Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; xandu - a unix like kernel
- ; written by Aaron "Dark_Aaron" Blakely, Michael "OoO" Raines, and Daniel "Yay" Heinrichs
- ;
- ; glue assembly - for
- global loader ; make entry point visable to linker
- extern kernel_start ; defined in kernel.c
- ; setup Multiboot headers for GRUB
- MODULEALGIN equ 1<<0 ; align loaded modules on page boundaries
- MEMINFO equ 1<<1 ; provide memory map
- FLAGS equ MODULEALIGN | MEMINFO ; this is the Multiboot 'flag' field
- MAGIC equ 0x1BADB002 ; 'magic number' lets bootloader find the header
- CHECKSUM equ -(MAGIC + FLAGS) ; checksum
- section .text
- align 4
- MultiBootHeader:
- dd MAGIC
- dd FLAGS
- dd CHECKSUM
- ; reserver inital kernel stack space
- STACKSIZE equ 0x4000 ; 16k
- loader:
- mov esp, stack+STACKSIZE ; setup the stack
- push eax ; pass Multiboot magic number
- push ebx ; pass Multiboot info structure
- call kernel_start ; call the kernel_start function
- cli
- hang:
- hlt ; hault the machine, if the kernel returns
- jmp hang
- section .bss
- align 4
- stack:
- resb STACKSTIZE ; reserve the kernel stack memory
Add Comment
Please, Sign In to add comment