bios_serial.S 445 B

123456789101112131415161718192021222324252627
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#serial-uart */
  2. #include "common.h"
  3. BEGIN
  4. /* Initialize the serial. */
  5. mov $0x00, %ah
  6. /* Initialization value. */
  7. mov $0xe3, %al
  8. /* Port number. */
  9. mov $0x00, %dx
  10. int $0x14
  11. mov $msg, %si
  12. loop:
  13. lodsb
  14. mov $0x01, %ah
  15. or %al, %al
  16. jz halt
  17. /* Send value in %al. */
  18. int $0x14
  19. jmp loop
  20. halt:
  21. hlt
  22. msg:
  23. .asciz "hello world\n"