loader.asm 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ; Copyright (C) 2021 Rain
  2. ; This file is part of XNIX.
  3. ; XNIX is free software: you can redistribute it and/or modify
  4. ; it under the terms of the GNU General Public License as published by
  5. ; the Free Software Foundation, either version 3 of the License, or
  6. ; (at your option) and later version.
  7. ; XNIX is distributed in the hope that it will be useful,
  8. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ; GNU General Public License for more details.
  11. ; You should have received a copy of the GNU General Public License
  12. ; along with XNIX. If not, see <https://www.gnu.org/licenses/>.
  13. org 0x7e00
  14. _start:
  15. xor ax, ax
  16. mov ds, ax
  17. mov es, ax
  18. mov ss, ax
  19. mov sp, 0x7c00
  20. ; display message 'Starting Loader...'
  21. mov si, message
  22. call print
  23. .die:
  24. hlt
  25. jmp .die
  26. print:
  27. cld
  28. lodsb
  29. test al,al
  30. jz .ret
  31. mov ah, 0x0e
  32. mov bx, 0x0f
  33. int 0x10
  34. jmp print
  35. .ret:
  36. ret
  37. message: db "Starting Loader", 0x0d, 0x0a, 0x00
  38. times 510 - ($ - $$) db 0x00
  39. db 0x55, 0xaa