; Acess2 x86_64 Port
;
[bits 64]
-KERNEL_BASE equ 0xFFFF800000000000
+;KERNEL_BASE equ 0xFFFF800000000000
+KERNEL_BASE equ 0xFFFFFFFF80000000
[extern kmain]
jmp rax
.himem:
+ xor rax, rax
+ mov dr0, rax ; Set CPU0
+
; Clear the screen
mov rax, 0x1F201F201F201F20 ; Set the screen to White on blue, space (4 characters)
mov edi, 0xB8000
[global GetCPUNum]
GetCPUNum:
- str ax
- mov gs, ax
xor rax, rax
- mov al, [gs:104] ; End of TSS
+ str ax
+ sub ax, 0x38 ; TSS Base
+ shr ax, 4 ; One 16-byte TSS per CPU
ret
KSTACK_USERSTATE_SIZE equ (16+1+5)*8 ; GPRegs, CPU, IRET