summaryrefslogtreecommitdiff
path: root/arch/i386/boot
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/boot')
-rw-r--r--arch/i386/boot/boot.s18
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/i386/boot/boot.s b/arch/i386/boot/boot.s
index 2d17f6a..e443b08 100644
--- a/arch/i386/boot/boot.s
+++ b/arch/i386/boot/boot.s
@@ -19,14 +19,14 @@ stack_top:
.align 4096
boot_page_directory:
.skip 4096
-boot_page_table0:
- .skip 4096
+boot_page_tables:
+ .skip 20480
.section .multiboot.text, "a"
.global _start
.type _start, @function
_start:
- movl $(boot_page_table0 - 0xC0000000), %edi
+ movl $(boot_page_tables - 0xC0000000), %edi
movl $0, %esi
movl $1023, %ecx
@@ -43,12 +43,16 @@ _start:
addl $4, %edi
loop 1b
-3: movl $(0x000B8000 | 0x003), boot_page_table0 - 0xC0000000 + 1023 * 4
+3: movl $0xB8003, boot_page_tables - 0xC0000000 + 1023 * 4
- movl $(boot_page_table0 - 0xC0000000 + 0x003), boot_page_directory - 0xC0000000
- movl $(boot_page_table0 - 0xC0000000 + 0x003), boot_page_directory - 0xC0000000 + 768 * 4
+ movl $boot_page_tables, %ecx
+ subl $0xC0000000, %ecx
+ orl $0x003, %ecx
+ movl %ecx, boot_page_directory - 0xC0000000
+ movl %ecx, boot_page_directory - 0xC0000000 + 4 * 768
- movl $(boot_page_directory - 0xC0000000), %ecx
+ movl $boot_page_directory, %ecx
+ subl $0xC0000000, %ecx
movl %ecx, %cr3
movl %cr0, %ecx