git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Misc changes
[tpg/acess2.git]
/
Kernel
/
arch
/
x86_64
/
start64.asm
diff --git
a/Kernel/arch/x86_64/start64.asm
b/Kernel/arch/x86_64/start64.asm
index
699c793
..
d0cc503
100644
(file)
--- a/
Kernel/arch/x86_64/start64.asm
+++ b/
Kernel/arch/x86_64/start64.asm
@@
-2,6
+2,13
@@
; Acess2 x86_64 Port
;
[bits 64]
; Acess2 x86_64 Port
;
[bits 64]
+;KERNEL_BASE equ 0xFFFF800000000000
+KERNEL_BASE equ 0xFFFFFFFF80000000
+
+[extern kmain]
+
+[extern gMultibootPtr]
+[extern gMultibootMagic]
[section .text]
[global start64]
[section .text]
[global start64]
@@
-18,6
+25,9
@@
start64:
jmp rax
.himem:
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
; Clear the screen
mov rax, 0x1F201F201F201F20 ; Set the screen to White on blue, space (4 characters)
mov edi, 0xB8000
@@
-28,6
+38,10
@@
start64:
mov rsp, gInitialKernelStack
; Call main
mov rsp, gInitialKernelStack
; Call main
+ mov edi, [gMultibootMagic - KERNEL_BASE]
+ mov esi, [gMultibootPtr - KERNEL_BASE]
+ call kmain
+
cli
.hlt:
hlt
cli
.hlt:
hlt
@@
-40,10
+54,10
@@
GetRIP:
[global GetCPUNum]
GetCPUNum:
[global GetCPUNum]
GetCPUNum:
- str ax
- mov gs, ax
xor rax, rax
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
ret
KSTACK_USERSTATE_SIZE equ (16+1+5)*8 ; GPRegs, CPU, IRET
@@
-117,6
+131,6
@@
User_Syscall_Exit:
[section .bss]
[global gInitialKernelStack]
[section .bss]
[global gInitialKernelStack]
- resd 1024*
1 ; 1 Page
+ resd 1024*
4 ; 4 Pages
gInitialKernelStack:
gInitialKernelStack:
UCC
git Repository :: git.ucc.asn.au