aboutsummaryrefslogtreecommitdiff
path: root/stand/i386/libi386/biosdisk.c
diff options
context:
space:
mode:
Diffstat (limited to 'stand/i386/libi386/biosdisk.c')
-rw-r--r--stand/i386/libi386/biosdisk.c43
1 files changed, 7 insertions, 36 deletions
diff --git a/stand/i386/libi386/biosdisk.c b/stand/i386/libi386/biosdisk.c
index 2c52617f255d..9ad9b67f5b57 100644
--- a/stand/i386/libi386/biosdisk.c
+++ b/stand/i386/libi386/biosdisk.c
@@ -25,9 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
/*
* BIOS disk device handling.
*
@@ -165,7 +162,7 @@ struct devsw biosfd = {
.dv_close = bd_close,
.dv_ioctl = bd_ioctl,
.dv_print = fd_print,
- .dv_cleanup = NULL
+ .dv_cleanup = nullsys,
};
struct devsw bioscd = {
@@ -177,7 +174,7 @@ struct devsw bioscd = {
.dv_close = bd_close,
.dv_ioctl = bd_ioctl,
.dv_print = cd_print,
- .dv_cleanup = NULL
+ .dv_cleanup = nullsys,
};
struct devsw bioshd = {
@@ -189,7 +186,9 @@ struct devsw bioshd = {
.dv_close = bd_close,
.dv_ioctl = bd_ioctl,
.dv_print = bd_print,
- .dv_cleanup = NULL
+ .dv_cleanup = nullsys,
+ .dv_fmtdev = disk_fmtdev,
+ .dv_parsedev = disk_parsedev,
};
static bdinfo_list_t *
@@ -1031,7 +1030,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
d_offset = dev->d_offset;
}
if (disk_blocks == 0)
- disk_blocks = bd->bd_sectors - d_offset;
+ disk_blocks = bd->bd_sectors * (bd->bd_sectorsize /
+ BIOSDISK_SECSIZE) - d_offset;
/* Validate source block address. */
if (dblk < d_offset || dblk >= d_offset + disk_blocks)
@@ -1285,35 +1285,6 @@ bd_io(struct disk_devdesc *dev, bdinfo_t *bd, daddr_t dblk, int blks,
}
/*
- * Return the BIOS geometry of a given "fixed drive" in a format
- * suitable for the legacy bootinfo structure. Since the kernel is
- * expecting raw int 0x13/0x8 values for N_BIOS_GEOM drives, we
- * prefer to get the information directly, rather than rely on being
- * able to put it together from information already maintained for
- * different purposes and for a probably different number of drives.
- *
- * For valid drives, the geometry is expected in the format (31..0)
- * "000000cc cccccccc hhhhhhhh 00ssssss"; and invalid drives are
- * indicated by returning the geometry of a "1.2M" PC-format floppy
- * disk. And, incidentally, what is returned is not the geometry as
- * such but the highest valid cylinder, head, and sector numbers.
- */
-uint32_t
-bd_getbigeom(int bunit)
-{
-
- v86.ctl = V86_FLAGS;
- v86.addr = DISK_BIOS;
- v86.eax = CMD_READ_PARAM;
- v86.edx = 0x80 + bunit;
- v86int();
- if (V86_CY(v86.efl))
- return (0x4f010f);
- return (((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) |
- (v86.edx & 0xff00) | (v86.ecx & 0x3f));
-}
-
-/*
* Return a suitable dev_t value for (dev).
*
* In the case where it looks like (dev) is a SCSI disk, we allow the number of