TSS_END:
.set TSS_SIZE, TSS_END - TSS
.align 0x1000
+#TODO replace with actual RAM detection
+.globl test_ram
+test_ram: .quad 256
+ .quad 0
+ .skip 0x1000 * 256 - 16 # 1MiB RAM
+PDPT_low: .quad 0x83
+ .quad 0x83 + 1024 * 1024 * 1024
+ .skip 0x1000 - 16
PDPT_high: .skip 0x1000 - 16
.quad 0x83
.quad 0x83 + 1024 * 1024 * 1024
.section .bss
.align 0x1000
-PML4T: .skip 0x1000
-PDPT_low: .skip 0x1000
-PDT: .skip 0x1000
-PT: .skip 0x1000
+PML4T: .skip 0x1000
phys_mem_map: .skip 0x1000 * 128 - 8
.align 16
stack_bottom:
mov $PML4T - KERNEL_VMA, %eax
mov %eax, %cr3
mov $PDPT_low - KERNEL_VMA + 3, %eax
- mov %eax, PML4T - KERNEL_VMA + 0 * 8
+ mov %eax, PML4T - KERNEL_VMA + 0 * 8
mov $PDPT_high - KERNEL_VMA + 3, %eax
mov %eax, PML4T - KERNEL_VMA + 511 * 8
- mov $PDT - KERNEL_VMA + 3, %eax
- mov %eax, PDPT_low - KERNEL_VMA + 0 * 8
- mov $PT - KERNEL_VMA + 3, %eax
- mov %eax, PDT - KERNEL_VMA + 0 * 8
-
- mov $PT - KERNEL_VMA, %edi
- mov $0x0003, %ebx
- mov $512, %ecx
-1: mov %ebx, (%edi)
- add $0x1000, %ebx
- add $8, %edi
- loop 1b
# Enable PAE paging:
mov %cr4, %eax