Lines Matching defs:sector
70 #define MAX_SEC_SIZE 65536 /* maximum sector size that is supported */
71 #define MIN_SEC_SIZE 512 /* the sector size to start sensing at */
72 static int secsize = 0; /* the sensed sector size */
249 static ssize_t read_disk(off_t sector, void *buf);
250 static int write_disk(off_t sector, void *buf);
336 /* (abu)use mboot.bootinst to probe for the sector size */
338 err(1, "cannot allocate buffer to determine disk sector size");
340 errx(1, "could not detect sector size");
423 printf("Media sector size is %d\n", secsize);
424 printf("Warning: BIOS sector numbering starts with sector 1\n");
503 printf("\tbeg: cyl %d/ head %d/ sector %d;\n\tend: cyl %d/ head %d/ sector %d\n"
527 errx(1, "%s: length must be a multiple of sector size", fname);
595 Decimal("beginning sector", tsec, tmp, NO_TRACK_SECTORS);
605 Decimal("ending sector", tsec, tmp, NO_TRACK_SECTORS);
750 read_disk(off_t sector, void *buf)
753 lseek(fd, (sector * 512), 0);
794 write_disk(off_t sector, void *buf)
803 wr = pwrite(fd, buf, secsize, (sector * 512));
810 warnx("Failed to write sector zero");
884 int sector, i;
894 for(sector = 0; sector < mboot.bootinst_size / secsize; sector++)
895 if (write_disk(sector,
896 &mboot.bootinst[sector * secsize]) == -1) {