mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:37:35 +00:00
Kernel: Initialize the CPU to allow SSE on startup.
I still need to add support for SSE to the context switching code, but now at least one process can use it.
This commit is contained in:
parent
5808322556
commit
750d79dcaf
3 changed files with 16 additions and 0 deletions
|
@ -493,3 +493,16 @@ void __assertion_failed(const char* msg, const char* file, unsigned line, const
|
||||||
asm volatile("hlt");
|
asm volatile("hlt");
|
||||||
for (;;);
|
for (;;);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sse_init()
|
||||||
|
{
|
||||||
|
asm volatile(
|
||||||
|
"mov %cr0, %eax\n"
|
||||||
|
"andl $0xfffffffb, %eax\n"
|
||||||
|
"orl $0x2, %eax\n"
|
||||||
|
"mov %eax, %cr0\n"
|
||||||
|
"mov %cr4, %eax\n"
|
||||||
|
"orl $0x600, %eax\n"
|
||||||
|
"mov %eax, %cr4\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ class IRQHandler;
|
||||||
|
|
||||||
void gdt_init();
|
void gdt_init();
|
||||||
void idt_init();
|
void idt_init();
|
||||||
|
void sse_init();
|
||||||
void register_interrupt_handler(byte number, void (*f)());
|
void register_interrupt_handler(byte number, void (*f)());
|
||||||
void register_user_callable_interrupt_handler(byte number, void (*f)());
|
void register_user_callable_interrupt_handler(byte number, void (*f)());
|
||||||
void register_irq_handler(byte number, IRQHandler&);
|
void register_irq_handler(byte number, IRQHandler&);
|
||||||
|
|
|
@ -140,6 +140,8 @@ VFS* vfs;
|
||||||
{
|
{
|
||||||
cli();
|
cli();
|
||||||
|
|
||||||
|
sse_init();
|
||||||
|
|
||||||
kmalloc_init();
|
kmalloc_init();
|
||||||
init_ksyms();
|
init_ksyms();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue