section boot.text progbits alloc exec nowrite align=16
MB_PAGE_ALIGN equ 1<<0 ; Add multiboot header
MB_MEM_FIELDS equ 1<<1 ; to boot.text section
%macro multiboot_header 1 ; This file should be linked first
align 4
dd 0x1BADB002
dd %1
dd -(0x1BADB002 + (%1))
%endmacro
multiboot_header MB_PAGE_ALIGN | MB_MEM_FIELDS
db 'kryptOS version 0.02.01',0,'http://kr4z.com/',0
global entry
entry: ; Boot loader jumps to here
mov ecx, 0x4FFFFF ; Set up stack under the
mov esp, ecx ; main kernel code at 0x500000
push ebx ; Push arguments to start()
push eax ; eax = 0x2BADB002, ebx = pointer to
; multiboot structure
extern start
call start ; Call start()
hang: ; We shouldn't return from start()
jmp hang ; but if we do, hang (if this area of
; memory hasn't been written over yet...)