mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-08 20:10:04 -04:00
Finalize the C++ 16->64 bit transition
This commit is contained in:
parent
0263dceb1f
commit
9873c153ef
@ -71,7 +71,7 @@ second_step:
|
||||
|
||||
;Run the kernel
|
||||
|
||||
jmp dword KERNEL_BASE:0x0
|
||||
jmp dword 0x500:0x0
|
||||
|
||||
.continue:
|
||||
mov cl, [sector]
|
||||
|
@ -118,7 +118,7 @@ constexpr uint16_t code_32_selector(){
|
||||
constexpr uint16_t code_64_selector(){
|
||||
return
|
||||
SEG_DESCTYPE(1) | SEG_PRES(1) | SEG_SAVL(0) |
|
||||
SEG_LONG(1) | SEG_SIZE(1) | SEG_GRAN(1) |
|
||||
SEG_LONG(1) | SEG_SIZE(0) | SEG_GRAN(1) |
|
||||
SEG_PRIV(0) | SEG_CODE_EXRD;
|
||||
}
|
||||
|
||||
@ -136,10 +136,6 @@ void setup_gdt(){
|
||||
gdt_entry(0, 0xFFFFF, code_32_selector()),
|
||||
gdt_entry(0, 0xFFFFF, data_selector()),
|
||||
gdt_entry(0, 0xFFFFF, code_64_selector())
|
||||
|
||||
//GDT_ENTRY(B_10011010, B_11001111), //32-bit Code Selector (ring 0)
|
||||
//GDT_ENTRY(, ), //Data Selector (ring 0)
|
||||
//GDT_ENTRY(, ) //64-bit Code Selector (ring 0)
|
||||
};
|
||||
|
||||
static gdt_ptr gdtr;
|
||||
|
@ -96,7 +96,10 @@ void enable_paging(){
|
||||
}
|
||||
|
||||
void __attribute__((noreturn)) lm_jump(){
|
||||
asm volatile(".byte 0x66, 0xea; .long kernel_main; .word 0x18;");
|
||||
|
||||
asm volatile("jmp 0x18:fake_label; fake_label:");
|
||||
|
||||
kernel_main();
|
||||
|
||||
__builtin_unreachable();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user