summaryrefslogtreecommitdiff
path: root/kernel/x86/uart.S
diff options
context:
space:
mode:
authorNathan Lee <me@nwlee.tech>2026-09-20 21:12:49 -0500
committerNathan Lee <me@nwlee.tech>2026-09-20 21:12:49 -0500
commit50e526d72f1fd9cb895d743a1353b54505b48025 (patch)
tree3442b2bd7b3b6ba6db3d972f89cf575ce1201278 /kernel/x86/uart.S
parent09be8ace254a7f8bb69542d09a6b2013636123a2 (diff)
add x86 supportHEADmaster
Diffstat (limited to 'kernel/x86/uart.S')
-rw-r--r--kernel/x86/uart.S18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/x86/uart.S b/kernel/x86/uart.S
new file mode 100644
index 0000000..416fad2
--- /dev/null
+++ b/kernel/x86/uart.S
@@ -0,0 +1,18 @@
+.section .text
+
+.global outb
+.global inb
+
+# void outb(uint16_t port, uint8_t val)
+outb:
+ mov %dl, %al
+ mov %cx, %dx
+ outb %al, %dx
+ ret
+
+# uint8_t inb(uint16_t port)
+inb:
+ mov %cx, %dx
+ inb %dx, %al
+ ret
+