bios_disk_load.asm 496 B

12345678910111213141516171819202122232425262728293031323334353637
  1. use16
  2. org 0x7C00
  3. ; Load stage 2 to memory.
  4. mov ah, 0x02
  5. mov al, 1
  6. mov dl, 0x80
  7. mov ch, 0
  8. mov dh, 0
  9. mov cl, 2
  10. mov bx, stage2
  11. int 0x13
  12. jmp stage2
  13. times ((0x200 - 2) - ($ - $$)) db 0x00
  14. dw 0xAA55
  15. stage2:
  16. mov si, msg
  17. mov ah, 0x0E
  18. for_each_char:
  19. lodsb
  20. cmp al, 0x00
  21. je end_for_each_char
  22. int 0x10
  23. jmp for_each_char
  24. end_for_each_char:
  25. cli
  26. hlt
  27. msg: db 'second stage', 0
  28. times ((0x400) - ($ - $$)) db 0x00