Lines Matching refs:geometry
238 * Figure out the "geometry" of the disk in question
240 struct geometry {
242 uint32_t c, h, s; /* C/H/S geometry */
315 static const struct geometry *get_disk_image_geometry(uint32_t where,
318 static struct geometry hd_geometry;
401 /* For HDD emulation, we figure out the geometry later. Otherwise: */
442 enough like one, use geometry from that. This takes care of
470 /* No FAT filesystem found to steal geometry from... */
478 /* Assume it's a floppy drive, guess a geometry */
522 /* No valid floppy geometry, fake it by simulating broken
768 const struct geometry *geometry;
805 geometry = get_disk_image_geometry(ramdisk_image, ramdisk_size);
815 do_edd = (geometry->driveno & 0x80) ? 1 : 0;
824 if (geometry->sector_shift == 11) {
856 pptr->driveno = geometry->driveno;
857 pptr->drivetype = geometry->type;
858 pptr->cylinders = geometry->c; /* Possible precision loss */
859 pptr->heads = geometry->h;
860 pptr->sectors = geometry->s;
861 pptr->mdi.disksize = geometry->sectors;
862 pptr->mdi.diskbuf = ramdisk_image + geometry->offset;
863 pptr->mdi.sector_shift = geometry->sector_shift;
864 pptr->statusptr = (geometry->driveno & 0x80) ? 0x474 : 0x441;
891 (geometry->driveno & 0x80) ? "hd" : "fd",
892 geometry->driveno & 0x7f,
893 geometry->sectors >> 1,
894 (geometry->sectors & 1) ? ".5" : "",
895 geometry->c, geometry->h, geometry->s,
896 geometry->hsrc, geometry->ssrc,
921 if (geometry->driveno & 0x80) {
923 pptr->dpt.hd.max_cyl = geometry->c - 1;
924 pptr->dpt.hd.max_head = geometry->h - 1;
925 pptr->dpt.hd.ctrl = (geometry->h > 8) ? 0x08 : 0;
932 pptr->dpt.fd.sectors = geometry->s;
940 pptr->dpt.fd.maxtrack = geometry->c - 1;
941 pptr->dpt.fd.cmos = geometry->type > 5 ? 5 : geometry->type;
948 pptr->edd_dpt.sectors = geometry->sectors;
951 if (geometry->c <= 1024 && geometry->h <= 255 && geometry->s <= 63) {
952 pptr->edd_dpt.c = geometry->c;
953 pptr->edd_dpt.h = geometry->h;
954 pptr->edd_dpt.s = geometry->s;
955 /* EDD-4 states that invalid geometry should be returned
959 if (geometry->sector_shift != 11)
960 pptr->edd_dpt.flags |= 0x0002; /* Geometry valid */
962 if (!(geometry->driveno & 0x80)) {
977 pptr->cd_pkt.driveno = geometry->driveno;
1070 regs.edx.b[0] = geometry->driveno & 0x80;
1087 if (geometry->driveno & 0x80) {
1109 if (pptr->drivecnt <= (geometry->driveno & 0x7f))
1110 pptr->drivecnt = (geometry->driveno & 0x7f) + 1;
1113 pptr->driveshiftlimit = probe_drive_range(geometry->driveno) + 1;
1114 if ((pptr->driveshiftlimit & 0x80) != (geometry->driveno & 0x80))
1147 if (geometry->driveno & 0x80) {
1221 (char *)pptr->mdi.diskbuf + geometry->boot_lba * 512,
1235 shdr->edx = geometry->driveno;