1
0

header.inc 840 B

123456789101112131415161718192021222324252627282930313233343536
  1. MBALIGN equ 1<<0 ; align loaded modules on page boundaries
  2. MEMINFO equ 1<<1 ; provide memory map
  3. FLAGS equ 0 ; this is the Multiboot 'flag' field
  4. MAGIC equ 0x1BADB002 ; 'magic number' lets bootloader find the header
  5. CHECKSUM equ -(MAGIC + FLAGS) ; checksum of above, to prove we are multiboot
  6. section .multiboot
  7. align 4
  8. dd MAGIC
  9. dd FLAGS
  10. dd CHECKSUM
  11. section .bss
  12. resb 2*4096 ; 0x2000
  13. stack_top:
  14. section .text
  15. _start:
  16. main:
  17. xor eax, eax
  18. xor ecx, ecx
  19. xor edx, edx
  20. xor ebx, ebx
  21. mov esp, stack_top
  22. xor ebp, ebp
  23. xor esi, esi
  24. xor edi, edi
  25. pxor xmm0, xmm0
  26. ; make space for memory operations
  27. sub esp, 32
  28. push 0
  29. popf