aboutsummaryrefslogtreecommitdiff
path: root/mubios/arch
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-11-08 07:00:43 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-11-08 07:00:43 +0800
commit4259f8453d6069d5d3c7651b7cf9aae0f4c148ea (patch)
tree79eb6d10cff8558ee3ac7a836a7dfc6037ab068f /mubios/arch
parenta460aa2fd50ba86f39e7d23ff3019aedd2b8600e (diff)
downloadrcc-project-4259f8453d6069d5d3c7651b7cf9aae0f4c148ea.tar.gz
rcc-project-4259f8453d6069d5d3c7651b7cf9aae0f4c148ea.tar.xz
[mubios] Implement INT 13h AH=41h
Signed-off-by: Richard Qin <richard.qin.x@gmail.com>
Diffstat (limited to 'mubios/arch')
-rw-r--r--mubios/arch/interrupt.S36
1 files changed, 36 insertions, 0 deletions
diff --git a/mubios/arch/interrupt.S b/mubios/arch/interrupt.S
index 6dc05c8..ab068c1 100644
--- a/mubios/arch/interrupt.S
+++ b/mubios/arch/interrupt.S
@@ -140,3 +140,39 @@ int10_save_cursor:
int10_return:
iret
+
+ .global int13_entry
+ .type int13_entry, @function
+
+int13_entry:
+ int13_entry:
+ cmp ah, 0x41
+ jne int13_return
+
+ push bp
+ mov bp, sp
+
+ cmp bx, 0x55AA
+ jne int13_fail
+
+ mov bx, 0xAA55
+ mov cx, 0x0001
+ mov ax, 0x3000
+
+ # Clear CF in the FLAGS saved by INT.
+ and word ptr [bp + 6], 0xFFFE
+
+ pop bp
+ iret
+
+int13_fail:
+ mov ah, 0x01
+
+ # Set CF in the FLAGS saved by INT.
+ or word ptr [bp + 6], 0x0001
+
+ pop bp
+ iret
+
+int13_return:
+ iret