diff options
author | dzwdz | 2022-07-16 22:50:34 +0200 |
---|---|---|
committer | dzwdz | 2022-07-16 22:50:34 +0200 |
commit | a251c14f1a745f3388ce73a5a45ebc73cd1782b5 (patch) | |
tree | 2eab140ce2bcc729d8836e97a61bd0d731bb44d6 /src/kernel/arch/amd64/32 | |
parent | c8ed6aa7476b7f506366d9fe56ed6f2e7a12b40d (diff) |
amd64: back at the shell!
Diffstat (limited to 'src/kernel/arch/amd64/32')
-rw-r--r-- | src/kernel/arch/amd64/32/boot.s | 1 | ||||
-rw-r--r-- | src/kernel/arch/amd64/32/gdt.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/kernel/arch/amd64/32/boot.s b/src/kernel/arch/amd64/32/boot.s index 06de66e..af32007 100644 --- a/src/kernel/arch/amd64/32/boot.s +++ b/src/kernel/arch/amd64/32/boot.s @@ -80,6 +80,7 @@ cpu_halt: .global cpu_pause .type cpu_pause, @function cpu_pause: + xchgw %bx, %bx sti hlt cli diff --git a/src/kernel/arch/amd64/32/gdt.c b/src/kernel/arch/amd64/32/gdt.c index 2229330..d3d4aed 100644 --- a/src/kernel/arch/amd64/32/gdt.c +++ b/src/kernel/arch/amd64/32/gdt.c @@ -87,15 +87,15 @@ void gdt_init(void) { gdt_fillout(&GDT[SEG_r3data], 3, false); lgdt_arg.limit = sizeof(GDT) - 1; - lgdt_arg.base = (uint64_t) &GDT; + lgdt_arg.base = (uint64_t)(int)&GDT; memset32(&TSS, 0, sizeof(TSS)); for (int i = 0; i < 3; i++) - TSS.rsp[i] = (uint64_t) &_isr_mini_stack; - TSS.ist[1] = (uint64_t) &_isr_mini_stack; + TSS.rsp[i] = (uint64_t)(int)&_isr_mini_stack; + TSS.ist[1] = (uint64_t)(int)&_isr_mini_stack; - uint64_t tss_addr = (uint64_t) &TSS; + uint64_t tss_addr = (uint64_t)(int)&TSS; GDT[SEG_TSS] = (struct gdt_entry) { .limit_low = sizeof(TSS), .limit_high = sizeof(TSS) >> 16, |