1
0

32bit-main.asm 748 B

123456789101112131415161718192021222324252627
  1. [org 0x7c00] ; bootloader offset
  2. mov bp, 0x9000 ; set the stack
  3. mov sp, bp
  4. mov bx, MSG_REAL_MODE
  5. call print ; This will be written after the BIOS messages
  6. call switch_to_pm
  7. jmp $ ; this will actually never be executed
  8. %include "../05-bootsector-functions-strings/boot_sect_print.asm"
  9. %include "../09-32bit-gdt/32bit-gdt.asm"
  10. %include "../08-32bit-print/32bit-print.asm"
  11. %include "32bit-switch.asm"
  12. [bits 32]
  13. BEGIN_PM: ; after the switch we will get here
  14. mov ebx, MSG_PROT_MODE
  15. call print_string_pm ; Note that this will be written at the top left corner
  16. jmp $
  17. MSG_REAL_MODE db "Started in 16-bit real mode", 0
  18. MSG_PROT_MODE db "Loaded 32-bit protected mode", 0
  19. ; bootsector
  20. times 510-($-$$) db 0
  21. dw 0xaa55