// format disk track static void disk_1305(struct bregs *regs, struct drive_s *drive_g) { debug_stub(regs); u16 nlc, nlh, nlspt; fillLCHS(drive_g, &nlc, &nlh, &nlspt); u8 num_sectors = regs->al; u8 head = regs->dh; if (head >= nlh || num_sectors == 0 || num_sectors > nlspt) { disk_ret(regs, DISK_RET_EPARAM); return; } struct disk_op_s dop; dop.drive_g = drive_g; dop.command = CMD_FORMAT; dop.lba = head; dop.count = num_sectors; dop.buf_fl = MAKE_FLATPTR(regs->es, regs->bx); int status = send_disk_op(&dop); disk_ret(regs, status); }
// format disk track static void noinline disk_1305(struct bregs *regs, struct drive_s *drive_gf) { debug_stub(regs); struct chs_s chs = getLCHS(drive_gf); u16 nlc=chs.cylinder, nlh=chs.head, nls=chs.sector; u8 count = regs->al; u8 cylinder = regs->ch; u8 head = regs->dh; if (cylinder >= nlc || head >= nlh || count == 0 || count > nls) { disk_ret(regs, DISK_RET_EPARAM); return; } struct disk_op_s dop; dop.drive_gf = drive_gf; dop.command = CMD_FORMAT; dop.lba = (((u32)cylinder * (u32)nlh) + (u32)head) * (u32)nls; dop.count = count; dop.buf_fl = MAKE_FLATPTR(regs->es, regs->bx); int status = send_disk_op(&dop); disk_ret(regs, status); }
static void vbe_104fXX(struct bregs *regs) { debug_stub(regs); regs->ax = 0x0100; }