From bb20921d00c770cb30bb85a300423d9062a94d91 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sun, 8 Nov 2026 07:49:23 +0800 Subject: [mubios] Multi-sector INT 13h AH=42h Signed-off-by: Richard Qin --- mubios/drivers/ata.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'mubios/drivers') diff --git a/mubios/drivers/ata.c b/mubios/drivers/ata.c index a0cd12a..928a7d1 100644 --- a/mubios/drivers/ata.c +++ b/mubios/drivers/ata.c @@ -60,8 +60,8 @@ ata_delay_400ns (void) io_in8 (ATA_STATUS); } -u8 -ata_read_sector28 (u32 lba, u16 *buffer) +static u8 +ata_read_one_sector28 (u32 lba, u16 *buffer) { u8 status; u16 index; @@ -91,3 +91,23 @@ ata_read_sector28 (u32 lba, u16 *buffer) return 0; } + +u8 +ata_read_sectors28 (u32 lba, u16 *buffer, u16 count) +{ + u16 sector; + + if (count == 0u) + return 1; + + for (sector = 0; sector < count; ++sector) + { + if (ata_read_one_sector28 (lba, buffer) != 0) + return 1; + + lba++; + buffer += 256; + } + + return 0; +} -- cgit v1.2.3