1 ; AcessOS Microkernel Version
\r
6 KERNEL_BASE equ 0xC0000000
\r
10 ; Multiboot macros to make a few lines later more readable
\r
11 MULTIBOOT_PAGE_ALIGN equ 1<<0
\r
12 MULTIBOOT_MEMORY_INFO equ 1<<1
\r
13 MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
\r
14 MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO
\r
15 MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
\r
17 ; This is the GRUB Multiboot header. A boot signature
\r
18 dd MULTIBOOT_HEADER_MAGIC
\r
19 dd MULTIBOOT_HEADER_FLAGS
\r
20 dd MULTIBOOT_CHECKSUM
\r
21 dd mboot - KERNEL_BASE ;Location of Multiboot Header
\r
28 mov esp, _Kernel_Stack_Top
\r
31 mov ecx, _gaInitPageDir - KERNEL_BASE
\r
38 lea ecx, [.higherHalf]
\r
42 mov DWORD [_gaInitPageDir], 0
\r
45 push ebx ; Multiboot Info
\r
46 push eax ; Multiboot Magic Value
\r
60 [extern _Proc_Clone]
\r
61 [extern _Threads_Exit]
\r
64 ; Call Proc_Clone with Flags=0
\r
69 add esp, 8 ; Remove arguments from stack
\r
74 ; In child, so now set up stack frame
\r
75 mov ebx, [esp+4] ; Child Function
\r
76 mov edx, [esp+8] ; Argument
\r
80 call _Threads_Exit ; Kill Thread
\r
86 [global _gaInitPageDir]
\r
87 [global _gaInitPageTable]
\r
90 dd _gaInitPageTable-KERNEL_BASE+3 ; 0x00
\r
91 times 1024-256-1 dd 0
\r
92 dd _gaInitPageTable-KERNEL_BASE+3 ; 0xC0
\r
101 [global _Kernel_Stack_Top]
\r