- Sector offset was wrong so it didn't interoperate
- User mode fetched only half the sectors so execve broke on hd
- Tools replicated hd offset bug
With these fixed you can partition and run FUZIX on the hard disk device even
if set up directly or under another OS.
Swap still blows up but this doesn't appear to be an hd bug at this point
if (((uint16_t)udata.u_offset|udata.u_count) & BLKMASK)
goto bad2;
dptr = (uint16_t)udata.u_base;
- nblock = udata.u_count >> 9;
+ nblock = udata.u_count >> 8;
block = udata.u_offset >> 9;
hd_page = udata.u_page;
} else if (rawflag == 2) {
hd_seccnt = 1;
sector = block;
- sector = ((sector << 1) & 0x1E) | 0x01;
+ sector = (sector << 1) & 0x1E;
cyl = block >> 4;
We need 32K per process: hardwire it here - FIX if you change
the mapping model */
- swap_dev = (d << 4) + i + 1 + 0x100;
+ swap_dev = (d << 4) + i + 1;
if (cyls >= MAX_SWAPS)
cyls = MAX_SWAPS - 1;
}
hd_seccnt = 1;
hd_sdh = 0x80 | (dev << 3);
- hd_secnum = 2;
+ hd_secnum = 1;
hd_cyllo = 0;
hd_cylhi = 0;
hd_cmd = HDCMD_READ;
p.g.cyl = buf[28] | (buf[29] << 8);
p.g.head = buf[30];
printf("Disk is %d cylinders, %d heads\n", p.g.cyl, p.g.head);
- p.g.sec = 16;
+ p.g.sec = 32;
p.g.precomp = 0;
p.g.land = p.g.cyl + 1;
p.g.seek = 0;
/* FIXME: should fill in matching LBA bits */
- if (fseek(vol, 512 + 384L, SEEK_SET) < 0) {
+ if (fseek(vol, 256 + 384L, SEEK_SET) < 0) {
perror(argv[1]);
exit(1);
}