1
0

header.inc 867 B

12345678910111213141516171819202122232425262728293031323334353637
  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 128*1024 ; 0x20000
  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. ; xor esp, esp
  22. mov esp, stack_top
  23. xor ebp, ebp
  24. xor esi, esi
  25. xor edi, edi
  26. ; make space for memory operations
  27. %rep 8
  28. push 0
  29. %endrep
  30. push 0
  31. popf