From 63cc5c2b33eb36f5cc7e8ba063b36b68e87c837a Mon Sep 17 00:00:00 2001 From: fslongjin Date: Mon, 21 Feb 2022 23:24:51 +0800 Subject: [PATCH] =?UTF-8?q?:wrench:=20=E5=90=AF=E7=94=A8SSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/common/printk.c | 3 ++- kernel/head.S | 10 +++++++++- run.sh | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/kernel/common/printk.c b/kernel/common/printk.c index 5a65da30..5ce2e5cf 100644 --- a/kernel/common/printk.c +++ b/kernel/common/printk.c @@ -51,10 +51,11 @@ int init_printk(const int char_size_x, const int char_size_y) // @todo:将来需要将帧缓冲区物理地址填写到这个地址的页表项中 pos.FB_address = 0xa00000; - pos.FB_length = info.framebuffer_pitch - info.framebuffer_addr; + pos.FB_length = pos.width*pos.height*4; pos.x = 0; pos.y = 0; + return 0; } diff --git a/kernel/head.S b/kernel/head.S index 65fe9d8a..8bdc8fca 100644 --- a/kernel/head.S +++ b/kernel/head.S @@ -453,7 +453,15 @@ SetUp_TSS64: // 装载任务状态段寄存器(已改为在main.c中使用load_TR宏进行装载) // mov $0x50, %ax // 设置起始地址为80 // ltr %ax - + + //now enable SSE and the like + movq %cr0, %rax + and $0xFFFB, %ax //clear coprocessor emulation CR0.EM + or $0x2, %ax //set coprocessor monitoring CR0.MP + movq %rax, %cr0 + movq %cr4, %rax + or $(3 << 9), %ax //set CR4.OSFXSR and CR4.OSXMMEXCPT at the same time + movq %rax, %cr4 call Start_Kernel diff --git a/run.sh b/run.sh index 9b54c6fb..5a82d3d6 100644 --- a/run.sh +++ b/run.sh @@ -93,7 +93,7 @@ if [ $flag_can_run -eq 1 ]; then bochs -q -f ${bochsrc} -rc ./tools/bochsinit else qemu-system-x86_64 -cdrom ${iso} -m 128M \ - -monitor telnet::2333,server,nowait -serial stdio + -monitor telnet::2333,server,nowait -serial stdio -s fi else echo "不满足运行条件"