X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Farch%2Fx86%2Fstart.asm;h=18b9f5f82271dd20d921f59b96854578d6f277ab;hb=86f855a3e417d93976af42dde36f457e89524902;hp=b6026de6b936ccbe97ba75dd6d8c53066b83ba91;hpb=48743e39650eb1ef988380e9d95f27fd40d3a9ce;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/arch/x86/start.asm b/KernelLand/Kernel/arch/x86/start.asm index b6026de6..18b9f5f8 100644 --- a/KernelLand/Kernel/arch/x86/start.asm +++ b/KernelLand/Kernel/arch/x86/start.asm @@ -14,15 +14,26 @@ mboot: ; Multiboot macros to make a few lines later more readable MULTIBOOT_PAGE_ALIGN equ 1<<0 MULTIBOOT_MEMORY_INFO equ 1<<1 + MULTIBOOT_REQVIDMODE equ 1<<2 MULTIBOOT_HEADER_MAGIC equ 0x1BADB002 - MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO + MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_REQVIDMODE MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) ; This is the GRUB Multiboot header. A boot signature dd MULTIBOOT_HEADER_MAGIC dd MULTIBOOT_HEADER_FLAGS dd MULTIBOOT_CHECKSUM + dd mboot; - KERNEL_BASE ;Location of Multiboot Header + dd 0 ; load_addr + dd 0 ; load_end_addr + dd 0 ; bss_end_addr + dd 0 ; entry_addr + + dd 0 ; Mode type (0: LFB) + dd 0 ; Width (no preference) + dd 0 ; Height (no preference) + dd 32 ; Depth (32-bit preferred) ; Multiboot 2 Header ;mboot2: @@ -55,8 +66,9 @@ mboot: ; dd 8 ;mboot2_end: -[section .text] +[section .inittext] [extern kmain] +[extern Desctab_Install] [global start] start: ; Just show we're here @@ -87,11 +99,15 @@ start: .higher_half: mov WORD [0xB8006], 0x0773 ; 's' + + push ebx ; Multiboot Info + push eax ; Multiboot Magic Value + ; NOTE: These are actually for kmain + + call Desctab_Install mov WORD [0xB8008], 0x0773 ; 's' ; Call the kernel - push ebx ; Multiboot Info - push eax ; Multiboot Magic Value mov WORD [0xB800A], 0x0732 ; '2' call kmain @@ -132,13 +148,13 @@ APStartup: ; Load initial GDT mov ax, 0xFFFF mov ds, ax - lgdt [DWORD ds:lGDTPtr-KERNEL_BASE-0xFFFF0] + lgdt [DWORD ds:lGDTPtr-0xFFFF0] ; Enable PMode in CR0 mov eax, cr0 or al, 1 mov cr0, eax ; Jump into PMode - jmp 08h:DWORD .ProtectedMode-KERNEL_BASE + jmp 08h:DWORD .ProtectedMode [bits 32] .ProtectedMode: ; Load segment registers @@ -213,6 +229,10 @@ APStartup: jmp .hlt %endif +; +; +; +[section .text] [global GetEIP] GetEIP: mov eax, [esp]