Lines Matching +full:0 +full:x4300
52 #define BIOS_NUMDRIVES 0x475
56 #define DT_ATAPI 0x10 /* disk type for ATAPI floppies */
57 #define WDMAJOR 0 /* major numbers for devices we frontend for */
67 #define CMD_RESET 0x0000
68 #define CMD_READ_CHS 0x0200
69 #define CMD_WRITE_CHS 0x0300
70 #define CMD_READ_PARAM 0x0800
71 #define CMD_DRIVE_TYPE 0x1500
72 #define CMD_CHECK_EDD 0x4100
73 #define CMD_READ_LBA 0x4200
74 #define CMD_WRITE_LBA 0x4300
75 #define CMD_EXT_PARAM 0x4800
76 #define CMD_CD_GET_STATUS 0x4b01
78 #define DISK_BIOS 0x13
83 #define DPRINTF(fmt, args...) ((void)0)
113 #define BD_MODEINT13 0x0000
114 #define BD_MODEEDD1 0x0001
115 #define BD_MODEEDD3 0x0002
117 #define BD_MODEMASK 0x0003
118 #define BD_FLOPPY 0x0004
119 #define BD_CDROM 0x0008
120 #define BD_NO_MEDIA 0x0010
128 #define BD_RD 0
218 unit = 0; in bd_get_bdinfo()
237 DPRINTF("looking for bios device 0x%x", biosdev); in bd_bios2unit()
238 for (i = 0; bdi[i] != NULL; i++) { in bd_bios2unit()
239 unit = 0; in bd_bios2unit()
242 DPRINTF("bd unit %d is BIOS device 0x%x", unit, in bd_bios2unit()
263 unit = 0; in bd_unit2bios()
280 for (drive = 0; drive < MAXBDDEV; drive++) { in fd_count()
292 if ((v86.eax & 0x300) == 0) in fd_count()
309 for (unit = 0; unit < numfd; unit++) { in fd_init()
318 if (bd_get_diskinfo_std(bd) != 0) { in fd_init()
322 if (bd->bd_sectors == 0) in fd_init()
332 return (0); in fd_init()
343 base = 0x80; in bd_init()
344 for (unit = 0; unit < *(unsigned char *)PTOV(BIOS_NUMDRIVES); unit++) { in bd_init()
363 return (0); in bd_init()
375 return (0); in cd_init()
387 (void) memset(&bc_sp, 0, sizeof (bc_sp)); in bd_get_diskinfo_cd()
399 if ((v86.eax & 0xff00) == 0 && in bd_get_diskinfo_cd()
401 bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + in bd_get_diskinfo_cd()
402 ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; in bd_get_diskinfo_cd()
403 bd->bd_sec = bc_sp.sp_cylsec & 0x3f; in bd_get_diskinfo_cd()
407 if (bc_sp.sp_bootmedia & 0x0F) { in bd_get_diskinfo_cd()
414 ret = 0; in bd_get_diskinfo_cd()
421 if (ret != 0 && bd->bd_unit >= 0x88) { in bd_get_diskinfo_cd()
422 bd->bd_cyl = 0; in bd_get_diskinfo_cd()
427 bd->bd_sectors = 0; in bd_get_diskinfo_cd()
428 ret = 0; in bd_get_diskinfo_cd()
440 if (bd->bd_sectors == 0) in bd_get_diskinfo_cd()
450 int nbcinfo = 0; in bc_add()
459 if (bd_get_diskinfo_cd(bd) < 0) { in bc_add()
468 return(0); in bc_add()
472 * Return EDD version or 0 if EDD is not supported on this drive.
478 if (unit < 0x80) in bd_check_extensions()
479 return (0); in bd_check_extensions()
490 (v86.ebx & 0xffff) != EDD_INSTALLED) /* signature */ in bd_check_extensions()
491 return (0); in bd_check_extensions()
494 if ((v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) in bd_check_extensions()
495 return (0); in bd_check_extensions()
497 return ((v86.eax >> 8) & 0xff); in bd_check_extensions()
512 * Read CHS info. Return 0 on success, error otherwise.
524 if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) in bd_get_diskinfo_std()
525 return ((v86.eax & 0xff00) >> 8); in bd_get_diskinfo_std()
528 if ((v86.ecx & 0x3f) == 0) in bd_get_diskinfo_std()
529 return (0x60); in bd_get_diskinfo_std()
531 bd->bd_cyl = ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> 8) + 1; in bd_get_diskinfo_std()
533 bd->bd_hds = ((v86.edx & 0xff00) >> 8) + 1; in bd_get_diskinfo_std()
534 bd->bd_sec = v86.ecx & 0x3f; in bd_get_diskinfo_std()
538 return (0); in bd_get_diskinfo_std()
542 * Read EDD info. Return 0 on success, error otherwise.
571 if (V86_CY(v86.efl) && ((v86.eax & 0xff00) != 0)) in bd_get_diskinfo_ext()
572 return ((v86.eax & 0xff00) >> 8); in bd_get_diskinfo_ext()
582 (params->sector_size % BIOSDISK_SECSIZE) == 0) in bd_get_diskinfo_ext()
589 if (params->sectors != 0) { in bd_get_diskinfo_ext()
597 return (0); in bd_get_diskinfo_ext()
610 if ((bd->bd_flags & BD_CDROM) != 0) { in bd_int13probe()
611 return (bd_get_diskinfo_cd(bd) == 0); in bd_int13probe()
615 if (edd == 0) in bd_int13probe()
617 else if (edd < 0x30) in bd_int13probe()
623 if (bd->bd_sectorsize == 0) in bd_int13probe()
630 if (bd->bd_unit < 0x80) { in bd_int13probe()
640 if (V86_CY(v86.efl) || (v86.eax & 0x300) == 0) in bd_int13probe()
645 if (edd != 0) in bd_int13probe()
647 if (ret != 0 || bd->bd_sectors == 0) in bd_int13probe()
650 if (ret != 0 && bd->bd_unit < 0x80) { in bd_int13probe()
658 ret = 0; in bd_int13probe()
661 if (ret != 0) { in bd_int13probe()
662 if (bd->bd_sectors != 0 && edd != 0) { in bd_int13probe()
671 if ((bd->bd_flags & BD_FLOPPY) != 0) in bd_int13probe()
682 if (bd->bd_sec == 0) in bd_int13probe()
684 if (bd->bd_hds == 0) in bd_int13probe()
687 if (bd->bd_sectors == 0) in bd_int13probe()
690 DPRINTF("unit 0x%x geometry %d/%d/%d\n", bd->bd_unit, bd->bd_cyl, in bd_int13probe()
702 i = 0; in bd_count()
717 int i, ret = 0; in bd_print_common()
721 return (0); in bd_print_common()
724 if ((ret = pager_output("\n")) != 0) in bd_print_common()
750 if ((ret = pager_output(line)) != 0) in bd_print_common()
765 bd->bd_sectorsize) == 0) { in bd_print_common()
770 if (ret != 0) in bd_print_common()
811 return (0); in bd_disk_get_sectors()
817 disk.d_offset = 0; in bd_disk_get_sectors()
820 if (disk_open(&disk, size, bd->bd_sectorsize) == 0) { in bd_disk_get_sectors()
864 if (bd->bd_open == 0) in bd_open()
868 rc = 0; in bd_open()
872 if (rc != 0) { in bd_open()
874 if (bd->bd_open == 0) { in bd_open()
889 int rc = 0; in bd_close()
897 if (bd->bd_open == 0) { in bd_close()
934 return (0); in bd_ioctl()
955 offset = 0; in bd_strategy()
986 if (size == 0 || (size % BIOSDISK_SECSIZE) != 0) { in bd_realstrategy()
1010 if (blks == 0 || (size % bd->bd_sectorsize) != 0) in bd_realstrategy()
1017 *rsize = 0; in bd_realstrategy()
1023 d_offset = 0; in bd_realstrategy()
1024 disk_blocks = 0; in bd_realstrategy()
1026 if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { in bd_realstrategy()
1032 if (disk_blocks == 0) in bd_realstrategy()
1058 if (bio_size / bd->bd_sectorsize == 0) in bd_realstrategy()
1065 rc = 0; in bd_realstrategy()
1066 while (blks > 0) { in bd_realstrategy()
1076 if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD)) != 0) { in bd_realstrategy()
1085 if (blkoff != 0) { in bd_realstrategy()
1111 if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_WR)) != 0) { in bd_realstrategy()
1123 blkoff = 0; in bd_realstrategy()
1154 v86.eax = CMD_WRITE_LBA; /* maybe Write with verify 0x4302? */ in bd_edd_io()
1165 return (0); in bd_edd_io()
1197 v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; in bd_chs_io()
1205 return (0); in bd_chs_io()
1213 bd_edd_io(bd, 0xffffffff, 1, (caddr_t)buf, BD_RD); in bd_io_workaround()
1225 if (blks < 0) in bd_io()
1239 if (dowrite == BD_RD && dblk >= 0x100000000) in bd_io()
1241 for (retry = 0; retry < 3; retry++) { in bd_io()
1247 if (result == 0) { in bd_io()
1262 if (result == 0x20 || result == 0x31 || result == 0x80) { in bd_io()
1268 if (result != 0 && (bd->bd_flags & BD_NO_MEDIA) == 0) { in bd_io()
1270 printf("%s%d: Write %d sector(s) from %p (0x%x) " in bd_io()
1271 "to %lld: 0x%x\n", dev->dd.d_dev->dv_name, in bd_io()
1276 "(0x%x): 0x%x\n", dev->dd.d_dev->dv_name, in bd_io()
1305 slice = 0; in bd_getdev()
1306 partition = 0; in bd_getdev()
1320 bd->bd_sectorsize) != 0) /* oops, not a viable device */ in bd_getdev()
1328 if (biosdev < 0x80) { in bd_getdev()
1342 unit = biosdev & 0x7f; in bd_getdev()
1355 unit = 0; /* XXX */ in bd_getdev()
1360 i = strtol(nip, &cp, 0); in bd_getdev()
1362 if ((cp != nip) && (*cp == 0)) in bd_getdev()
1367 DPRINTF("dev is 0x%x\n", rootdev); in bd_getdev()