summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setup.S9
1 files changed, 6 insertions, 3 deletions
diff --git a/setup.S b/setup.S
index 93d34e1..9ae578f 100644
--- a/setup.S
+++ b/setup.S
@@ -22,8 +22,11 @@ start:
outb %al, $0x70
# The system will move itself to its rightful place.
- push %cs
- pop %ds
+ xorl %eax, %eax
+ movw %cs, %ax
+ movw %ax, %ds
+ shll $4, %eax
+ addl %eax, gdt_48 - start + 2
lidt idt_48 - start # load idt with 0,0
lgdt gdt_48 - start # load gdt with whatever appropriate
@@ -134,7 +137,7 @@ idt_48:
gdt_48:
.word 0x800 # gdt limit=2048, 256 GDT entries
- .word 512+gdt - start,0x9 # gdt base = 0X9xxxx
+ .long gdt - start # gdt base
msg1:
.asciz "Setup.S\r\n"