summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-08-13 23:19:36 +0000
committerJoursoir <chat@joursoir.net>2021-08-13 23:24:30 +0000
commitb51923e1fa3ab6c3cdeb7c1ff139083082511d33 (patch)
treed212fe984b1577b65dbb15f698a689281ab2f6dd
parent4432d2242c1474ec0195c4952897a629b212c996 (diff)
downloadmfsos-b51923e1fa3ab6c3cdeb7c1ff139083082511d33.tar.gz
mfsos-b51923e1fa3ab6c3cdeb7c1ff139083082511d33.tar.bz2
mfsos-b51923e1fa3ab6c3cdeb7c1ff139083082511d33.zip
x86/boot: add macros for BIOS print interrupts
-rw-r--r--arch/x86/boot/bios.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/boot/bios.inc b/arch/x86/boot/bios.inc
new file mode 100644
index 0000000..d01b27c
--- /dev/null
+++ b/arch/x86/boot/bios.inc
@@ -0,0 +1,19 @@
+.macro BIOS_PRINT string
+ mov $0x0e, %ah # Set writing char in TTY mode routine
+ mov \string, %si # Set in Source Index reg the beginning
+ # address of a string
+print_loop\@:
+ lodsb # Increase SI by 1 byte => get next char
+ or %al, %al # Check for a '\0'
+ jz print_done\@
+
+ int $0x10 # Print a char in al register
+ jmp print_loop\@
+print_done\@:
+.endm
+
+.macro PUTCHAR char
+ mov $0x0e, %ah # Set writing char in TTY mode routine
+ mov \char, %al
+ int $0x10 # Print a char in al register
+.endm