mboot
partp = ((struct dos_partition *) &mboot.parts) + part - 1;
partp = ((struct dos_partition *) &mboot.parts);
partp = ((struct dos_partition *) &mboot.parts) + i;
if ((mboot.bootinst = malloc(MAX_SEC_SIZE)) == NULL)
if (read_disk(0, mboot.bootinst) == -1) {
free(mboot.bootinst);
free(mboot.bootinst);
mboot.bootinst = NULL;
partp = ((struct dos_partition *) &mboot.parts) + i;
partp = (struct dos_partition *) (&mboot.parts[0]);
part = ((struct dos_partition *) &mboot.parts) + i;
partp = ((struct dos_partition *) &mboot.parts) + i - 1;
mboot.bootinst_size = sb.st_size;
if (mboot.bootinst_size % secsize != 0) {
free(mboot.bootinst);
if ((mboot.bootinst = malloc(mboot.bootinst_size)) == NULL) {
n = read(boot_fd, mboot.bootinst, mboot.bootinst_size);
if (n != mboot.bootinst_size)
partp = (struct dos_partition *)(&mboot.parts[3]);
partp = ((struct dos_partition *) &mboot.parts) + i - 1;
struct dos_partition *partp = &mboot.parts[0];
static struct mboot mboot;
partp = ((struct dos_partition *) &mboot.parts) + i;
mboot.bootinst_size = secsize;
if (mboot.bootinst != NULL)
free(mboot.bootinst);
if ((mboot.bootinst = malloc(mboot.bootinst_size)) == NULL) {
if (read_disk(0, mboot.bootinst) == -1) {
if (*(uint16_t *)&mboot.bootinst[DOSMAGICOFF] != DOSMAGIC) {
memcpy(mboot.parts, &mboot.bootinst[DOSPARTOFF], sizeof(mboot.parts));
memcpy(&mboot.bootinst[DOSPARTOFF], mboot.parts, sizeof(mboot.parts));
for(sector = 0; sector < mboot.bootinst_size / secsize; sector++)
&mboot.bootinst[sector * secsize]) == -1) {