From 29db27925fe4fa63ac167a0357b6a939db159703 Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Sun, 13 Oct 2024 16:37:52 -0400 Subject: [PATCH] initial work on a macro to call read_disk_raw --- include/BIOS/func/ext_read.nasm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/BIOS/func/ext_read.nasm b/include/BIOS/func/ext_read.nasm index 42d1cdc..826729a 100644 --- a/include/BIOS/func/ext_read.nasm +++ b/include/BIOS/func/ext_read.nasm @@ -36,6 +36,29 @@ struc LBAPkt_t .lower_lba resd 1 .upper_lba resd 1 endstruc +; call_read_disk_raw +%macro call_read_disk_raw 5 + movzx ax, %5 + push ax ; drive_num + + movzx ax, %4 + push ax ; count + + movzx dword eax, %3 + push dword eax ; lba + + movzx ax, %2 + push ax ; offset + + movzx ax, %1 + push ax ; segment = 0 + + ; uint8_t read_stage2_raw(uint16_t buf_segment, uint16_t buf_offset, + ; uint32_t lba, + ; uint16_t count, uint16_t drive_num) + call read_disk_raw + add sp, 0xC +%endmacro ; Wrapper for AH=0x42 INT13h (Extended Read) ;