Lines Matching refs:Drive
117 // - cdrom drive is hardcoded to ide 0 device 1 in several places. see "FIXME ElTorito Hardcoded"
1980 /* Floppy drive */
2106 if (type == 0 || type > 0x4) BX_PANIC("Bad drive type\n");
2127 if (type == 0 || type > 0x3) BX_PANIC("Bad drive type\n");
3588 // Returns ah: emulated drive, al: error code
3730 // return the boot drive + no error
5322 case 0x08: /* read disk drive parameters */
5342 case 0x10: /* check drive ready */
5356 case 0x15: /* read disk drive size */
5425 case 0x45: // IBM/MS lock/unlock drive
5435 case 0x48: // IBM/MS get drive parameters
5581 case 0x09: /* initialize drive parameters */
5653 case 0x09: /* initialize drive parameters */
5656 case 0x10: /* check drive ready */
5681 case 0x15: /* read disk drive size */
5737 case 0x45: // IBM/MS lock/unlock drive
5800 case 0x48: // IBM/MS get drive parameters
5938 case 0x08: /* read disk drive parameters */
6066 /* basic checks : emulation should be active, dl should equal the emulated drive */
6077 case 0x09: /* initialize drive parameters */
6080 case 0x10: /* check drive ready */ // FIXME ElTorito Various. should check if ready ?
6166 case 0x08: /* read disk drive parameters */
6196 case 0x15: /* read disk drive size */
6211 case 0x45: // IBM/MS lock/unlock drive
6214 case 0x48: // IBM/MS get drive parameters
6305 Bit8u drive, num_sectors, sector, head, status, mod;
6329 drive not present */
6370 drive = GET_ELDL();
6371 get_hd_geometry(drive, &hd_cylinders, &hd_heads, &hd_sectors);
6412 BX_PANIC("hard drive BIOS:(read/verify) head > 15\n");
6423 BX_PANIC("hard drive BIOS:(read/verify) BUSY bit set\n");
6429 outLBA(cylinder,hd_heads,head,hd_sectors,sector,drive);
6435 outb(0x01f6, 0xa0 | ((drive & 0x01)<<4) | (head & 0x0f));
6445 BX_PANIC("hard drive BIOS:(read/verify) read error\n");
6448 BX_PANIC("hard drive BIOS:(read/verify) expected DRQ=1\n");
6516 drive = GET_ELDL ();
6517 get_hd_geometry(drive, &hd_cylinders, &hd_heads, &hd_sectors);
6558 BX_PANIC("hard drive BIOS:(read) head > 15\n");
6562 BX_PANIC("hard drive BIOS:(read) BUSY bit set\n");
6564 // should check for Drive Ready Bit also in status reg
6588 BX_PANIC("hard drive BIOS:(write) data-request bit not set\n");
6663 case 0x08: /* read disk drive parameters */
6666 drive = GET_ELDL ();
6667 get_hd_geometry(drive, &hd_cylinders, &hd_heads, &hd_sectors);
6705 case 0x09: /* initialize drive parameters */
6738 case 0x10: /* check drive ready */
6751 CLEAR_CF(); // drive ready
6779 case 0x15: /* read disk drive size */
6780 drive = GET_ELDL();
6781 get_hd_geometry(drive, &hd_cylinders, &hd_heads, &hd_sectors);
6809 case 0x45: // IBM/MS lock/unlock drive
6829 get_hd_geometry(drive, hd_cylinders, hd_heads, hd_sectors)
6830 Bit8u drive;
6841 if (drive == 0x80) {
6893 void floppy_prepare_controller(drive)
6894 Bit16u drive;
6903 // turn on motor of selected drive, DMA & int enabled, normal operation
6905 if (drive)
6910 dor |= drive;
6916 // wait for drive readiness
6939 floppy_media_known(drive)
6940 Bit16u drive;
6946 if (drive)
6953 if (drive)
6966 floppy_media_sense(drive)
6967 Bit16u drive;
6973 if (floppy_drive_recal(drive) == 0) {
6977 // for now cheat and get drive type from CMOS,
6978 // assume media is same as drive type
6985 // 5-4 last diskette drive step rate selected
6991 // Bitfields for diskette drive media state:
6997 // 3 drive capable of supporting 4MB media
7009 if (drive == 0)
7014 // 360K 5.25" drive
7020 // 1.2 MB 5.25" drive
7026 // 720K 3.5" drive
7032 // 1.44 MB 3.5" drive
7038 // 2.88 MB 3.5" drive
7046 // 160k 5.25" drive
7052 // 180k 5.25" drive
7058 // 320k 5.25" drive
7071 if (drive == 0)
7082 floppy_drive_recal(drive)
7083 Bit16u drive;
7088 floppy_prepare_controller(drive);
7092 outb(0x03f5, drive); // 0=drive0, 1=drive1
7113 if (drive) {
7114 val8 |= 0x02; // Drive 1 calibrated
7117 val8 |= 0x01; // Drive 0 calibrated
7129 floppy_drive_exists(drive)
7130 Bit16u drive;
7134 // check CMOS to see if drive exists
7136 if (drive == 0)
7150 Bit8u drive, num_sectors, track, sector, head, status;
7164 drive = GET_ELDL();
7165 if (drive > 1) {
7173 if (drive == 0)
7178 SET_AH(0x80); // drive not responding
7186 set_diskette_current_cyl(drive, 0); // current cylinder
7205 drive = GET_ELDL();
7207 if ((drive > 1) || (head > 1) || (sector == 0) ||
7217 // see if drive exists
7218 if (floppy_drive_exists(drive) == 0) {
7226 // see if media in drive, and type is known
7227 if (floppy_media_known(drive) == 0) {
7228 if (floppy_media_sense(drive) == 0) {
7298 floppy_prepare_controller(drive);
7302 outb(0x03f5, (head << 2) | drive); // HD DR1 DR2
7321 SET_AH(0x80); // drive not ready (timeout)
7373 set_diskette_current_cyl(drive, track);
7432 floppy_prepare_controller(drive);
7436 outb(0x03f5, (head << 2) | drive); // HD DR1 DR2
7455 SET_AH(0x80); // drive not ready (timeout)
7512 set_diskette_current_cyl(drive, track);
7521 set_diskette_current_cyl(drive, track);
7535 drive = GET_ELDL();
7537 if ((drive > 1) || (head > 1) || (track > 79) ||
7544 // see if drive exists
7545 if (floppy_drive_exists(drive) == 0) {
7546 SET_AH(0x80); // drive not responding
7552 // see if media in drive, and type is known
7553 if (floppy_media_known(drive) == 0) {
7554 if (floppy_media_sense(drive) == 0) {
7599 floppy_prepare_controller(drive);
7603 outb(0x03f5, (head << 2) | drive); // HD DR1 DR2
7618 SET_AH(0x80); // drive not ready (timeout)
7673 set_diskette_current_cyl(drive, 0);
7678 case 0x08: // read diskette drive parameters
7680 drive = GET_ELDL();
7682 if (drive > 1) {
7701 if (drive == 0)
7776 case 0x15: // read diskette drive type
7778 drive = GET_ELDL();
7779 if (drive > 1) {
7787 if (drive == 0)
7793 SET_AH(0); // drive not present
7796 SET_AH(1); // drive present, does not support change line
7803 drive = GET_ELDL();
7804 if (drive > 1) {
7805 SET_AH(0x01); // invalid drive
7876 set_diskette_current_cyl(drive, cyl)
7877 Bit8u drive;
7880 if (drive > 1)
7881 BX_PANIC("set_diskette_current_cyl(): drive > 1\n");
7882 write_byte(0x0040, 0x0094+drive, cyl);
7886 determine_floppy_media(drive)
7887 Bit16u drive;
7893 if (drive==1)
7899 if (drive == 0) {
7900 DOR = 0x1c; // DOR: drive0 motor on, DMA&int enabled, normal op, drive select 0
7903 DOR = 0x2d; // DOR: drive1 motor on, DMA&int enabled, normal op, drive select 1
7908 // Drive not determined means no drive exists, done.
7922 // turn on drive motor
7993 // 0: system boot sequence, first drive C: then A:
7994 // 1: system boot sequence, first drive A: then C:
8043 * address, and bootdrv as the boot drive */
8143 ;; Set the magic number in ax and the boot drive in dl.
8503 ;; check if access to the emulated drive
8507 cmp al,dl ;; int13 on emulated drive
8539 dec dl ;; real drive is dl - 1
8684 ;- POST: Floppy Drive -
8691 mov 0x043e, al ;; drive 0 & 1 uncalibrated, no interrupt has occurred
8711 mov al, #0x10 ;; get CMOS diskette drive type
8717 shr al, #4 ;; look at top 4 bits for drive 0
8726 and al, #0x0f ;; look at bottom 4 bits for drive 1
8739 ;; drive type has not been determined,
8758 ;- POST: HARD DRIVE -
8830 mov (0x003d + 0x08), al ;; drive control byte
8974 mov (0x004d + 0x08), al ;; drive control byte
9160 ;; chosen so it could be divided by either 3 to drive the 5Mhz CPU
9161 ;; at the time, or 4 to drive the CGA video adapter. The div3
10633 ;; Hard Drive setup
10981 ;; Since no provisions are made for multiple drive types, most
11013 ;; Since no provisions are made for multiple drive types, most
11029 db 4 ;; drive type in cmos
11198 ;; time to turn off drive(s)?