From 4259f8453d6069d5d3c7651b7cf9aae0f4c148ea Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sun, 8 Nov 2026 07:00:43 +0800 Subject: [mubios] Implement INT 13h AH=41h Signed-off-by: Richard Qin --- mubios/arch/interrupt.S | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'mubios/arch/interrupt.S') 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 -- cgit v1.2.3