Updated the build files to use $(xCP), allows use of mcopy to a mtools disk
[tpg/acess2.git] / Kernel / arch / x86 / start.asm
index e1cc70a..4135160 100644 (file)
@@ -21,30 +21,30 @@ mboot:
        dd mboot - KERNEL_BASE  ;Location of Multiboot Header\r
        \r
 [section .text]\r
-[extern _kmain]\r
+[extern kmain]\r
 [global start]\r
 start:\r
        ; Set up stack\r
-       mov esp, _Kernel_Stack_Top\r
+       mov esp, Kernel_Stack_Top\r
        \r
        ; Start Paging\r
-       mov ecx, _gaInitPageDir - KERNEL_BASE\r
+       mov ecx, gaInitPageDir - KERNEL_BASE\r
        mov cr3, ecx\r
        \r
        mov ecx, cr0\r
-       or      ecx, 0x80000000\r
+       or      ecx, 0x80010000 ; PG and WP\r
        mov cr0, ecx\r
        \r
        lea ecx, [.higherHalf]\r
        jmp ecx\r
 .higherHalf:\r
 \r
-       mov DWORD [_gaInitPageDir], 0\r
+       mov DWORD [gaInitPageDir], 0\r
 \r
        ; Call the kernel\r
        push ebx        ; Multiboot Info\r
        push eax        ; Multiboot Magic Value\r
-       call _kmain
+       call kmain
 
        ; Halt the Machine\r
        cli\r
@@ -52,20 +52,20 @@ start:
        hlt\r
        jmp .hlt\r
 \r
-[global _GetEIP]\r
-_GetEIP:\r
+[global GetEIP]\r
+GetEIP:\r
        mov eax, [esp]\r
        ret\r
 \r
-[extern _Proc_Clone]\r
-[extern _Proc_Exit]\r
-[global _SpawnTask]\r
-_SpawnTask:\r
+[extern Proc_Clone]\r
+[extern Threads_Exit]\r
+[global SpawnTask]\r
+SpawnTask:\r
        ; Call Proc_Clone with Flags=0\r
        xor eax, eax\r
        push eax
        push eax\r
-       call _Proc_Clone\r
+       call Proc_Clone\r
        add esp, 8      ; Remove arguments from stack\r
        \r
        test eax, eax\r
@@ -77,29 +77,29 @@ _SpawnTask:
        ; Child\r
        push edx        ; Argument\r
        call ebx        ; Function\r
-       call _Proc_Exit ; Kill Thread\r
+       call Threads_Exit       ; Kill Thread\r
        \r
 .parent:\r
        ret\r
 \r
 [section .initpd]\r
-[global _gaInitPageDir]\r
-[global _gaInitPageTable]\r
+[global gaInitPageDir]\r
+[global gaInitPageTable]\r
 align 0x1000\r
-_gaInitPageDir:\r
-       dd      _gaInitPageTable-KERNEL_BASE+3  ; 0x00\r
+gaInitPageDir:\r
+       dd      gaInitPageTable-KERNEL_BASE+3   ; 0x00\r
        times 1024-256-1        dd      0\r
-       dd      _gaInitPageTable-KERNEL_BASE+3  ; 0xC0\r
+       dd      gaInitPageTable-KERNEL_BASE+3   ; 0xC0\r
        times 256-1     dd      0\r
 align 0x1000\r
-_gaInitPageTable:\r
+gaInitPageTable:\r
        %assign i 0\r
        %rep 1024\r
        dd      i*0x1000+3\r
        %assign i i+1\r
        %endrep\r
-[global _Kernel_Stack_Top]\r
+[global Kernel_Stack_Top]\r
 ALIGN 0x1000\r
        times 1024      dd      0\r
-_Kernel_Stack_Top:\r
+Kernel_Stack_Top:\r
        

UCC git Repository :: git.ucc.asn.au