4 KERNEL_BASE equ 0xFFFF800000000000
8 MULTIBOOT_MAGIC equ 0x1BADB002
22 mov eax, gInitialPML4 - KERNEL_BASE
25 ; Enable long/compatability mode
37 lgdt [gGDTPtr - KERNEL_BASE]
45 jmp 0x08:start64 - KERNEL_BASE
51 dd 0x00000000, 0x00209800 ; 0x08: 64-bit Code
52 dd 0x00000000, 0x00009000 ; 0x10: 64-bit Data
53 dd 0x00000000, 0x00209800 ; 0x18: 64-bit User Code
54 dd 0x00000000, 0x00209000 ; 0x20: 64-bit User Data
55 dd 0x00000000, 0x00209800 ; 0x38: 32-bit User Code
56 dd 0x00000000, 0x00209000 ; 0x30: 32-bit User Data
57 times MAX_CPUS dd 0, 0, 0, 0 ; 0x38+16*n: TSS 0
65 gInitialPML4: ; Covers 256 TiB (Full 48-bit Virtual Address Space)
66 dd gInitialPDP - KERNEL_BASE + 3, 0 ; Identity Map Low 4Mb
68 dd gInitialPDP - KERNEL_BASE + 3, 0 ; Map Low 4Mb to kernel base
71 gInitialPDP: ; Covers 512 GiB
72 dd gInitialPD - KERNEL_BASE + 3, 0
75 gInitialPD: ; Covers 1 GiB
76 dd gInitialPT1 - KERNEL_BASE + 3, 0
77 dd gInitialPT2 - KERNEL_BASE + 3, 0
79 gInitialPT1: ; Covers 2 MiB