// INT 13h Fixed Disk Services Entry Point void VISIBLE16 handle_13(struct bregs *regs) { debug_enter(regs, DEBUG_HDL_13); u8 extdrive = regs->dl; if (CONFIG_CDROM_EMU) { if (regs->ah == 0x4b) { cdemu_134b(regs); return; } u16 ebda_seg = get_ebda_seg(); if (GET_EBDA2(ebda_seg, cdemu.active)) { u8 emudrive = GET_EBDA2(ebda_seg, cdemu.emulated_extdrive); if (extdrive == emudrive) { // Access to an emulated drive. struct drive_s *cdemu = GET_GLOBAL(cdemu_drive); if (regs->ah > 0x16) { // Only old-style commands supported. disk_13XX(regs, cdemu); return; } disk_13(regs, cdemu); return; } if (extdrive < EXTSTART_CD && ((emudrive ^ extdrive) & 0x80) == 0) // Adjust id to make room for emulated drive. extdrive--; } } handle_legacy_disk(regs, extdrive); }
static void floppy_13(struct bregs *regs, struct drive_s *drive_gf) { // Only limited commands are supported on floppies. switch (regs->ah) { case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x08: case 0x15: case 0x16: disk_13(regs, drive_gf); break; default: disk_13XX(regs, drive_gf); break; } }
static void disk_13(struct bregs *regs, struct drive_s *drive_gf) { //debug_stub(regs); // clear completion flag SET_BDA(disk_interrupt_flag, 0); switch (regs->ah) { case 0x00: disk_1300(regs, drive_gf); break; case 0x01: disk_1301(regs, drive_gf); break; case 0x02: disk_1302(regs, drive_gf); break; case 0x03: disk_1303(regs, drive_gf); break; case 0x04: disk_1304(regs, drive_gf); break; case 0x05: disk_1305(regs, drive_gf); break; case 0x08: disk_1308(regs, drive_gf); break; case 0x09: disk_1309(regs, drive_gf); break; case 0x0c: disk_130c(regs, drive_gf); break; case 0x0d: disk_130d(regs, drive_gf); break; case 0x10: disk_1310(regs, drive_gf); break; case 0x11: disk_1311(regs, drive_gf); break; case 0x14: disk_1314(regs, drive_gf); break; case 0x15: disk_1315(regs, drive_gf); break; case 0x16: disk_1316(regs, drive_gf); break; case 0x41: disk_1341(regs, drive_gf); break; case 0x42: disk_1342(regs, drive_gf); break; case 0x43: disk_1343(regs, drive_gf); break; case 0x44: disk_1344(regs, drive_gf); break; case 0x45: disk_1345(regs, drive_gf); break; case 0x46: disk_1346(regs, drive_gf); break; case 0x47: disk_1347(regs, drive_gf); break; case 0x48: disk_1348(regs, drive_gf); break; case 0x49: disk_1349(regs, drive_gf); break; case 0x4e: disk_134e(regs, drive_gf); break; default: disk_13XX(regs, drive_gf); break; } }