1 // 16bit code to access hard drives.
3 // Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
4 // Copyright (C) 2002 MandrakeSoft S.A.
6 // This file may be distributed under the terms of the GNU LGPLv3 license.
8 #include "disk.h" // floppy_13
9 #include "biosvar.h" // SET_BDA
10 #include "config.h" // CONFIG_*
11 #include "util.h" // debug_enter
12 #include "pic.h" // eoi_pic2
13 #include "bregs.h" // struct bregs
14 #include "pci.h" // pci_bdf_to_bus
15 #include "ata.h" // ATA_CB_DC
18 /****************************************************************
20 ****************************************************************/
23 __disk_ret(struct bregs *regs, u32 linecode, const char *fname)
26 if (regs->dl < EXTSTART_HD)
27 SET_BDA(floppy_last_status, code);
29 SET_BDA(disk_last_status, code);
31 __set_code_fail(regs, linecode, fname);
33 set_code_success(regs);
37 __disk_stub(struct bregs *regs, int lineno, const char *fname)
39 __debug_stub(regs, lineno, fname);
40 __disk_ret(regs, DISK_RET_SUCCESS | (lineno << 8), fname);
43 #define DISK_STUB(regs) \
44 __disk_stub((regs), __LINE__, __func__)
47 fillLCHS(struct drive_s *drive_g, u16 *nlc, u16 *nlh, u16 *nlspt)
49 if (CONFIG_CDROM_EMU && drive_g == GET_GLOBAL(cdemu_drive)) {
50 // Emulated drive - get info from ebda. (It's not possible to
51 // populate the geometry directly in the driveid because the
52 // geometry is only known after the bios segment is made
54 u16 ebda_seg = get_ebda_seg();
55 *nlc = GET_EBDA2(ebda_seg, cdemu.lchs.cylinders);
56 *nlh = GET_EBDA2(ebda_seg, cdemu.lchs.heads);
57 *nlspt = GET_EBDA2(ebda_seg, cdemu.lchs.spt);
60 *nlc = GET_GLOBAL(drive_g->lchs.cylinders);
61 *nlh = GET_GLOBAL(drive_g->lchs.heads);
62 *nlspt = GET_GLOBAL(drive_g->lchs.spt);
65 // Perform read/write/verify using old-style chs accesses
67 basic_access(struct bregs *regs, struct drive_s *drive_g, u16 command)
70 dop.drive_g = drive_g;
71 dop.command = command;
74 u16 cylinder = regs->ch | ((((u16)regs->cl) << 2) & 0x300);
75 u16 sector = regs->cl & 0x3f;
78 if (count > 128 || count == 0 || sector == 0) {
79 dprintf(1, "int13_harddisk: function %02x, parameter out of range!\n"
81 disk_ret(regs, DISK_RET_EPARAM);
87 fillLCHS(drive_g, &nlc, &nlh, &nlspt);
89 // sanity check on cyl heads, sec
90 if (cylinder >= nlc || head >= nlh || sector > nlspt) {
91 dprintf(1, "int13_harddisk: function %02x, parameters out of"
92 " range %04x/%04x/%04x!\n"
93 , regs->ah, cylinder, head, sector);
94 disk_ret(regs, DISK_RET_EPARAM);
98 // translate lchs to lba
99 dop.lba = (((((u32)cylinder * (u32)nlh) + (u32)head) * (u32)nlspt)
102 dop.buf_fl = MAKE_FLATPTR(regs->es, regs->bx);
104 int status = send_disk_op(&dop);
106 regs->al = dop.count;
108 disk_ret(regs, status);
111 // Perform read/write/verify using new-style "int13ext" accesses.
113 extended_access(struct bregs *regs, struct drive_s *drive_g, u16 command)
115 struct disk_op_s dop;
116 // Get lba and check.
117 dop.lba = GET_INT13EXT(regs, lba);
118 dop.command = command;
119 dop.drive_g = drive_g;
120 if (dop.lba >= GET_GLOBAL(drive_g->sectors)) {
121 dprintf(1, "int13_harddisk: function %02x. LBA out of range\n"
123 disk_ret(regs, DISK_RET_EPARAM);
127 dop.buf_fl = SEGOFF_TO_FLATPTR(GET_INT13EXT(regs, data));
128 dop.count = GET_INT13EXT(regs, count);
130 int status = send_disk_op(&dop);
132 SET_INT13EXT(regs, count, dop.count);
134 disk_ret(regs, status);
138 /****************************************************************
139 * Hard Drive functions
140 ****************************************************************/
142 // disk controller reset
144 disk_1300(struct bregs *regs, struct drive_s *drive_g)
146 struct disk_op_s dop;
147 dop.drive_g = drive_g;
148 dop.command = CMD_RESET;
149 int status = send_disk_op(&dop);
150 disk_ret(regs, status);
155 disk_1301(struct bregs *regs, struct drive_s *drive_g)
158 if (regs->dl < EXTSTART_HD)
160 v = GET_BDA(floppy_last_status);
162 v = GET_BDA(disk_last_status);
165 // XXX - clear disk_last_status?
170 disk_1302(struct bregs *regs, struct drive_s *drive_g)
172 basic_access(regs, drive_g, CMD_READ);
175 // write disk sectors
177 disk_1303(struct bregs *regs, struct drive_s *drive_g)
179 basic_access(regs, drive_g, CMD_WRITE);
182 // verify disk sectors
184 disk_1304(struct bregs *regs, struct drive_s *drive_g)
186 basic_access(regs, drive_g, CMD_VERIFY);
191 disk_1305(struct bregs *regs, struct drive_s *drive_g)
196 fillLCHS(drive_g, &nlc, &nlh, &nlspt);
198 u8 num_sectors = regs->al;
201 if (head >= nlh || num_sectors == 0 || num_sectors > nlspt) {
202 disk_ret(regs, DISK_RET_EPARAM);
206 struct disk_op_s dop;
207 dop.drive_g = drive_g;
208 dop.command = CMD_FORMAT;
210 dop.count = num_sectors;
211 dop.buf_fl = MAKE_FLATPTR(regs->es, regs->bx);
212 int status = send_disk_op(&dop);
213 disk_ret(regs, status);
216 // read disk drive parameters
218 disk_1308(struct bregs *regs, struct drive_s *drive_g)
220 u16 ebda_seg = get_ebda_seg();
221 // Get logical geometry from table
223 fillLCHS(drive_g, &nlc, &nlh, &nlspt);
227 if (regs->dl < EXTSTART_HD) {
229 count = GET_GLOBAL(Drives.floppycount);
231 if (CONFIG_CDROM_EMU && drive_g == GET_GLOBAL(cdemu_drive))
232 regs->bx = GET_EBDA2(ebda_seg, cdemu.media) * 2;
234 regs->bx = GET_GLOBAL(drive_g->floppy_type);
236 // set es & di to point to 11 byte diskette param table in ROM
238 regs->di = (u32)&diskette_param_table2;
239 } else if (regs->dl < EXTSTART_CD) {
241 count = GET_BDA(hdcount);
242 nlc--; // last sector reserved
244 // Not supported on CDROM
245 disk_ret(regs, DISK_RET_EPARAM);
249 if (CONFIG_CDROM_EMU && GET_EBDA2(ebda_seg, cdemu.active)) {
250 u8 emudrive = GET_EBDA2(ebda_seg, cdemu.emulated_extdrive);
251 if (((emudrive ^ regs->dl) & 0x80) == 0)
252 // Note extra drive due to emulation.
254 if (regs->dl < EXTSTART_HD && count > 2)
255 // Max of two floppy drives.
260 regs->ch = nlc & 0xff;
261 regs->cl = ((nlc >> 2) & 0xc0) | (nlspt & 0x3f);
264 disk_ret(regs, DISK_RET_SUCCESS);
268 // initialize drive parameters
270 disk_1309(struct bregs *regs, struct drive_s *drive_g)
275 // seek to specified cylinder
277 disk_130c(struct bregs *regs, struct drive_s *drive_g)
282 // alternate disk reset
284 disk_130d(struct bregs *regs, struct drive_s *drive_g)
291 disk_1310(struct bregs *regs, struct drive_s *drive_g)
293 // should look at 40:8E also???
295 struct disk_op_s dop;
296 dop.drive_g = drive_g;
297 dop.command = CMD_ISREADY;
298 int status = send_disk_op(&dop);
299 disk_ret(regs, status);
304 disk_1311(struct bregs *regs, struct drive_s *drive_g)
309 // controller internal diagnostic
311 disk_1314(struct bregs *regs, struct drive_s *drive_g)
316 // read disk drive size
318 disk_1315(struct bregs *regs, struct drive_s *drive_g)
320 disk_ret(regs, DISK_RET_SUCCESS);
321 if (regs->dl < EXTSTART_HD || regs->dl >= EXTSTART_CD) {
328 // Get logical geometry from table
330 fillLCHS(drive_g, &nlc, &nlh, &nlspt);
332 // Compute sector count seen by int13
333 u32 lba = (u32)(nlc - 1) * (u32)nlh * (u32)nlspt;
334 regs->cx = lba >> 16;
335 regs->dx = lba & 0xffff;
336 regs->ah = 3; // hard disk accessible
340 disk_1316(struct bregs *regs, struct drive_s *drive_g)
342 if (regs->dl >= EXTSTART_HD) {
344 disk_ret(regs, DISK_RET_EPARAM);
347 disk_ret(regs, DISK_RET_ECHANGED);
350 // IBM/MS installation check
352 disk_1341(struct bregs *regs, struct drive_s *drive_g)
354 regs->bx = 0xaa55; // install check
355 regs->cx = 0x0007; // ext disk access and edd, removable supported
356 disk_ret(regs, DISK_RET_SUCCESS);
357 regs->ah = 0x30; // EDD 3.0
360 // IBM/MS extended read
362 disk_1342(struct bregs *regs, struct drive_s *drive_g)
364 extended_access(regs, drive_g, CMD_READ);
367 // IBM/MS extended write
369 disk_1343(struct bregs *regs, struct drive_s *drive_g)
371 extended_access(regs, drive_g, CMD_WRITE);
376 disk_1344(struct bregs *regs, struct drive_s *drive_g)
378 extended_access(regs, drive_g, CMD_VERIFY);
383 disk_134500(struct bregs *regs, struct drive_s *drive_g)
385 u16 ebda_seg = get_ebda_seg();
386 int cdid = regs->dl - EXTSTART_CD;
387 u8 locks = GET_EBDA2(ebda_seg, cdrom_locks[cdid]);
390 disk_ret(regs, DISK_RET_ETOOMANYLOCKS);
393 SET_EBDA2(ebda_seg, cdrom_locks[cdid], locks + 1);
395 disk_ret(regs, DISK_RET_SUCCESS);
400 disk_134501(struct bregs *regs, struct drive_s *drive_g)
402 u16 ebda_seg = get_ebda_seg();
403 int cdid = regs->dl - EXTSTART_CD;
404 u8 locks = GET_EBDA2(ebda_seg, cdrom_locks[cdid]);
407 disk_ret(regs, DISK_RET_ENOTLOCKED);
411 SET_EBDA2(ebda_seg, cdrom_locks[cdid], locks);
412 regs->al = (locks ? 1 : 0);
413 disk_ret(regs, DISK_RET_SUCCESS);
418 disk_134502(struct bregs *regs, struct drive_s *drive_g)
420 int cdid = regs->dl - EXTSTART_CD;
421 u8 locks = GET_EBDA(cdrom_locks[cdid]);
422 regs->al = (locks ? 1 : 0);
423 disk_ret(regs, DISK_RET_SUCCESS);
427 disk_1345XX(struct bregs *regs, struct drive_s *drive_g)
429 disk_ret(regs, DISK_RET_EPARAM);
432 // IBM/MS lock/unlock drive
434 disk_1345(struct bregs *regs, struct drive_s *drive_g)
436 if (regs->dl < EXTSTART_CD) {
437 // Always success for HD
438 disk_ret(regs, DISK_RET_SUCCESS);
443 case 0x00: disk_134500(regs, drive_g); break;
444 case 0x01: disk_134501(regs, drive_g); break;
445 case 0x02: disk_134502(regs, drive_g); break;
446 default: disk_1345XX(regs, drive_g); break;
450 // IBM/MS eject media
452 disk_1346(struct bregs *regs, struct drive_s *drive_g)
454 if (regs->dl < EXTSTART_CD) {
455 // Volume Not Removable
456 disk_ret(regs, DISK_RET_ENOTREMOVABLE);
460 int cdid = regs->dl - EXTSTART_CD;
461 u8 locks = GET_EBDA(cdrom_locks[cdid]);
463 disk_ret(regs, DISK_RET_ELOCKED);
467 // FIXME should handle 0x31 no media in device
468 // FIXME should handle 0xb5 valid request failed
470 // Call removable media eject
472 memset(&br, 0, sizeof(br));
474 call16_int(0x15, &br);
476 if (br.ah || br.flags & F_CF) {
477 disk_ret(regs, DISK_RET_ELOCKED);
480 disk_ret(regs, DISK_RET_SUCCESS);
483 // IBM/MS extended seek
485 disk_1347(struct bregs *regs, struct drive_s *drive_g)
487 extended_access(regs, drive_g, CMD_SEEK);
490 // IBM/MS get drive parameters
492 disk_1348(struct bregs *regs, struct drive_s *drive_g)
494 u16 size = GET_INT13DPT(regs, size);
496 // Buffer is too small
498 disk_ret(regs, DISK_RET_EPARAM);
504 u8 type = GET_GLOBAL(drive_g->type);
505 u16 npc = GET_GLOBAL(drive_g->pchs.cylinders);
506 u16 nph = GET_GLOBAL(drive_g->pchs.heads);
507 u16 npspt = GET_GLOBAL(drive_g->pchs.spt);
508 u64 lba = GET_GLOBAL(drive_g->sectors);
509 u16 blksize = GET_GLOBAL(drive_g->blksize);
511 dprintf(DEBUG_HDL_13, "disk_1348 size=%d t=%d chs=%d,%d,%d lba=%d bs=%d\n"
512 , size, type, npc, nph, npspt, (u32)lba, blksize);
514 SET_INT13DPT(regs, size, 26);
515 if (type == DTYPE_ATAPI) {
516 // 0x74 = removable, media change, lockable, max values
517 SET_INT13DPT(regs, infos, 0x74);
518 SET_INT13DPT(regs, cylinders, 0xffffffff);
519 SET_INT13DPT(regs, heads, 0xffffffff);
520 SET_INT13DPT(regs, spt, 0xffffffff);
521 SET_INT13DPT(regs, sector_count, (u64)-1);
523 if (lba > (u64)npspt*nph*0x3fff) {
524 SET_INT13DPT(regs, infos, 0x00); // geometry is invalid
525 SET_INT13DPT(regs, cylinders, 0x3fff);
527 SET_INT13DPT(regs, infos, 0x02); // geometry is valid
528 SET_INT13DPT(regs, cylinders, (u32)npc);
530 SET_INT13DPT(regs, heads, (u32)nph);
531 SET_INT13DPT(regs, spt, (u32)npspt);
532 SET_INT13DPT(regs, sector_count, lba);
534 SET_INT13DPT(regs, blksize, blksize);
536 if (size < 30 || (type != DTYPE_ATA && type != DTYPE_ATAPI)) {
537 disk_ret(regs, DISK_RET_SUCCESS);
543 u16 ebda_seg = get_ebda_seg();
544 SET_INT13DPT(regs, size, 30);
546 SET_INT13DPT(regs, dpte_segment, ebda_seg);
547 SET_INT13DPT(regs, dpte_offset
548 , offsetof(struct extended_bios_data_area_s, dpte));
551 u8 ataid = GET_GLOBAL(drive_g->cntl_id);
552 u8 channel = ataid / 2;
553 u8 slave = ataid % 2;
554 u16 iobase1 = GET_GLOBAL(ATA_channels[channel].iobase1);
555 u16 iobase2 = GET_GLOBAL(ATA_channels[channel].iobase2);
556 u8 irq = GET_GLOBAL(ATA_channels[channel].irq);
559 if (type == DTYPE_ATA) {
560 u8 translation = GET_GLOBAL(drive_g->translation);
561 if (translation != TRANSLATION_NONE) {
562 options |= 1<<3; // CHS translation
563 if (translation == TRANSLATION_LBA)
565 if (translation == TRANSLATION_RECHS)
570 options |= 1<<5; // removable device
571 options |= 1<<6; // atapi device
573 options |= 1<<4; // lba translation
574 if (CONFIG_ATA_PIO32)
577 SET_EBDA2(ebda_seg, dpte.iobase1, iobase1);
578 SET_EBDA2(ebda_seg, dpte.iobase2, iobase2 + ATA_CB_DC);
579 SET_EBDA2(ebda_seg, dpte.prefix, ((slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0)
581 SET_EBDA2(ebda_seg, dpte.unused, 0xcb);
582 SET_EBDA2(ebda_seg, dpte.irq, irq);
583 SET_EBDA2(ebda_seg, dpte.blkcount, 1);
584 SET_EBDA2(ebda_seg, dpte.dma, 0);
585 SET_EBDA2(ebda_seg, dpte.pio, 0);
586 SET_EBDA2(ebda_seg, dpte.options, options);
587 SET_EBDA2(ebda_seg, dpte.reserved, 0);
588 SET_EBDA2(ebda_seg, dpte.revision, 0x11);
590 u8 sum = checksum_far(
591 ebda_seg, (void*)offsetof(struct extended_bios_data_area_s, dpte), 15);
592 SET_EBDA2(ebda_seg, dpte.checksum, -sum);
595 disk_ret(regs, DISK_RET_SUCCESS);
600 SET_INT13DPT(regs, key, 0xbedd);
601 SET_INT13DPT(regs, dpi_length, 36);
602 SET_INT13DPT(regs, reserved1, 0);
603 SET_INT13DPT(regs, reserved2, 0);
605 SET_INT13DPT(regs, host_bus[0], 'P');
606 SET_INT13DPT(regs, host_bus[1], 'C');
607 SET_INT13DPT(regs, host_bus[2], 'I');
608 SET_INT13DPT(regs, host_bus[3], 0);
610 u32 bdf = GET_GLOBAL(ATA_channels[channel].pci_bdf);
611 u32 path = (pci_bdf_to_bus(bdf) | (pci_bdf_to_dev(bdf) << 8)
612 | (pci_bdf_to_fn(bdf) << 16));
613 SET_INT13DPT(regs, iface_path, path);
615 SET_INT13DPT(regs, iface_type[0], 'A');
616 SET_INT13DPT(regs, iface_type[1], 'T');
617 SET_INT13DPT(regs, iface_type[2], 'A');
618 SET_INT13DPT(regs, iface_type[3], 0);
619 SET_INT13DPT(regs, iface_type[4], 0);
620 SET_INT13DPT(regs, iface_type[5], 0);
621 SET_INT13DPT(regs, iface_type[6], 0);
622 SET_INT13DPT(regs, iface_type[7], 0);
624 SET_INT13DPT(regs, device_path, slave);
626 SET_INT13DPT(regs, checksum
627 , -checksum_far(regs->ds, (void*)(regs->si+30), 35));
629 disk_ret(regs, DISK_RET_SUCCESS);
632 // IBM/MS extended media change
634 disk_1349(struct bregs *regs, struct drive_s *drive_g)
636 if (regs->dl < EXTSTART_CD) {
637 // Always success for HD
638 disk_ret(regs, DISK_RET_SUCCESS);
642 // always send changed ??
643 regs->ah = DISK_RET_ECHANGED;
647 disk_134e01(struct bregs *regs, struct drive_s *drive_g)
649 disk_ret(regs, DISK_RET_SUCCESS);
653 disk_134e03(struct bregs *regs, struct drive_s *drive_g)
655 disk_ret(regs, DISK_RET_SUCCESS);
659 disk_134e04(struct bregs *regs, struct drive_s *drive_g)
661 disk_ret(regs, DISK_RET_SUCCESS);
665 disk_134e06(struct bregs *regs, struct drive_s *drive_g)
667 disk_ret(regs, DISK_RET_SUCCESS);
671 disk_134eXX(struct bregs *regs, struct drive_s *drive_g)
673 disk_ret(regs, DISK_RET_EPARAM);
676 // IBM/MS set hardware configuration
678 disk_134e(struct bregs *regs, struct drive_s *drive_g)
681 case 0x01: disk_134e01(regs, drive_g); break;
682 case 0x03: disk_134e03(regs, drive_g); break;
683 case 0x04: disk_134e04(regs, drive_g); break;
684 case 0x06: disk_134e06(regs, drive_g); break;
685 default: disk_134eXX(regs, drive_g); break;
690 disk_13XX(struct bregs *regs, struct drive_s *drive_g)
692 disk_ret(regs, DISK_RET_EPARAM);
696 disk_13(struct bregs *regs, struct drive_s *drive_g)
700 // clear completion flag
701 SET_BDA(disk_interrupt_flag, 0);
704 case 0x00: disk_1300(regs, drive_g); break;
705 case 0x01: disk_1301(regs, drive_g); break;
706 case 0x02: disk_1302(regs, drive_g); break;
707 case 0x03: disk_1303(regs, drive_g); break;
708 case 0x04: disk_1304(regs, drive_g); break;
709 case 0x05: disk_1305(regs, drive_g); break;
710 case 0x08: disk_1308(regs, drive_g); break;
711 case 0x09: disk_1309(regs, drive_g); break;
712 case 0x0c: disk_130c(regs, drive_g); break;
713 case 0x0d: disk_130d(regs, drive_g); break;
714 case 0x10: disk_1310(regs, drive_g); break;
715 case 0x11: disk_1311(regs, drive_g); break;
716 case 0x14: disk_1314(regs, drive_g); break;
717 case 0x15: disk_1315(regs, drive_g); break;
718 case 0x16: disk_1316(regs, drive_g); break;
719 case 0x41: disk_1341(regs, drive_g); break;
720 case 0x42: disk_1342(regs, drive_g); break;
721 case 0x43: disk_1343(regs, drive_g); break;
722 case 0x44: disk_1344(regs, drive_g); break;
723 case 0x45: disk_1345(regs, drive_g); break;
724 case 0x46: disk_1346(regs, drive_g); break;
725 case 0x47: disk_1347(regs, drive_g); break;
726 case 0x48: disk_1348(regs, drive_g); break;
727 case 0x49: disk_1349(regs, drive_g); break;
728 case 0x4e: disk_134e(regs, drive_g); break;
729 default: disk_13XX(regs, drive_g); break;
734 floppy_13(struct bregs *regs, struct drive_s *drive_g)
736 // Only limited commands are supported on floppies.
747 disk_13(regs, drive_g);
749 default: disk_13XX(regs, drive_g); break;
754 /****************************************************************
756 ****************************************************************/
759 handle_legacy_disk(struct bregs *regs, u8 extdrive)
761 if (! CONFIG_DRIVES) {
762 // XXX - support handle_1301 anyway?
763 disk_ret(regs, DISK_RET_EPARAM);
767 if (extdrive < EXTSTART_HD) {
768 struct drive_s *drive_g = getDrive(EXTTYPE_FLOPPY, extdrive);
771 floppy_13(regs, drive_g);
775 struct drive_s *drive_g;
776 if (extdrive >= EXTSTART_CD)
777 drive_g = getDrive(EXTTYPE_CD, extdrive - EXTSTART_CD);
779 drive_g = getDrive(EXTTYPE_HD, extdrive - EXTSTART_HD);
782 disk_13(regs, drive_g);
786 // XXX - support 1301/1308/1315 anyway?
787 disk_ret(regs, DISK_RET_EPARAM);
791 handle_40(struct bregs *regs)
793 debug_enter(regs, DEBUG_HDL_40);
794 handle_legacy_disk(regs, regs->dl);
797 // INT 13h Fixed Disk Services Entry Point
799 handle_13(struct bregs *regs)
801 debug_enter(regs, DEBUG_HDL_13);
802 u8 extdrive = regs->dl;
804 if (CONFIG_CDROM_EMU) {
805 if (regs->ah == 0x4b) {
809 u16 ebda_seg = get_ebda_seg();
810 if (GET_EBDA2(ebda_seg, cdemu.active)) {
811 u8 emudrive = GET_EBDA2(ebda_seg, cdemu.emulated_extdrive);
812 if (extdrive == emudrive) {
813 // Access to an emulated drive.
814 struct drive_s *cdemu = GET_GLOBAL(cdemu_drive);
815 if (regs->ah > 0x16) {
816 // Only old-style commands supported.
817 disk_13XX(regs, cdemu);
820 disk_13(regs, cdemu);
823 if (extdrive < EXTSTART_CD && ((emudrive ^ extdrive) & 0x80) == 0)
824 // Adjust id to make room for emulated drive.
828 handle_legacy_disk(regs, extdrive);
831 // record completion in BIOS task complete flag
835 debug_isr(DEBUG_ISR_76);
836 SET_BDA(disk_interrupt_flag, 0xff);
840 // Old Fixed Disk Parameter Table (newer tables are in the ebda).
841 struct fdpt_s OldFDPT VAR16FIXED(0xe401);