🔧 启用SSE

This commit is contained in:
fslongjin 2022-02-21 23:24:51 +08:00
parent d9d83335af
commit 63cc5c2b33
3 changed files with 12 additions and 3 deletions

View File

@ -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;
}

View File

@ -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

2
run.sh
View File

@ -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 "不满足运行条件"