aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mubios/arch/interrupt.S36
-rw-r--r--mubios/core/bda.c2
2 files changed, 38 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
diff --git a/mubios/core/bda.c b/mubios/core/bda.c
index 494c093..d7be60c 100644
--- a/mubios/core/bda.c
+++ b/mubios/core/bda.c
@@ -58,6 +58,7 @@ extern void irq1_entry (void);
extern void int1a_entry (void);
extern void int10_entry (void);
+extern void int13_entry (void);
static void
install_ivt_entry (u8 vector, void (*handler) (void))
@@ -81,4 +82,5 @@ ivt_init (void)
install_ivt_entry (0x09u, irq1_entry);
install_ivt_entry (0x1Au, int1a_entry);
install_ivt_entry (0x10u, int10_entry);
+ install_ivt_entry (0x13u, int13_entry);
}