Advertisement
Guest User

Untitled

a guest
Jun 8th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; This is the first stage of the boot loader. This file's compiled binary is
  2. ; meant to be burned to the first sector of the boot disk. Do not do ANYTHING
  3. ; else to it, or otherwise, you will completely break the system.
  4. JMP WORD BEGIN
  5. NOP
  6.  
  7. ; BIOS Parameter Block
  8. BPBOEM      DB "MY-OS   "
  9. BPBBPS      DW 512
  10. BPBSPC      DB 1
  11. BPBRSE      DW 1
  12. BPBFATS     DB 2
  13. BPBNIRS     DW 224
  14. BPBTLS      DW 2000
  15. BPBMDT      DB 240
  16. BPBSPFAT    DW 9
  17. BPBSPT      DW 18
  18. BPBHOS      DW 2
  19. BPBHS       DD 0
  20. BPBLASOM    DD 0
  21. ; Extended BIOS Parameter Block
  22. EXBPBDN     DB 0
  23. EXBPBFLAGS  DB 0
  24. EXBPBSIGN   DB 29h
  25. EXBPBVOLID  DD 0
  26. EXBPBVOL    DB "MY-OS      "
  27. EXBPBFILESYS    DB "FAT12   "
  28.  
  29. BEGIN:
  30.     MOV AX, 31744
  31.     CLI
  32.     MOV SS, AX
  33.     MOV SP, 2048
  34.     STI
  35.     MOV DS, AX
  36.     MOV ES, AX
  37.     MOV FS, AX
  38.     MOV GS, AX
  39.    
  40.    
  41.     HLT
  42.     JMP $
  43.  
  44. ; Set emptry bytes to null
  45. TIMES 01FEh - ($ - $$) DB 00h
  46. ; Boot sector 'signature'
  47. DB 85
  48. DB 170
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement