You can now set up a 10MB hd or similar with a mix of disk and swap, and it
also won't randomly pee on disks it doesn't own.
/* Labelling bits needed for a CHS drive */
struct minipart {
struct diskgeom g;
- uint16_t cyl[15];
- uint8_t type[15];
+ uint16_t cyl[16];
+ uint8_t type[16];
};
/* The full entry, including the LBA offsets added by the labeller
for use if in LBA mode. The LBAs must match the cyl pointers */
struct minipart_lba {
struct diskgeom g;
- uint16_t cyl[15];
- uint8_t type[15];
+ uint16_t cyl[16];
+ uint8_t type[16];
uint8_t gap;
- uint32_t lba[15];
+ uint32_t lba[16];
};
#endif
hd_xfer_in(addr);
else
hd_xfer_out(addr);
- /* Should beeturning READY, and maybe SEEKDONE */
+ /* Should be returning READY, and maybe SEEKDONE */
return hd_status;
}
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 + 0x100;
if (cyls >= MAX_SWAPS)
cyls = MAX_SWAPS - 1;
p.g.seek = 0;
p.g.secsize = 8;
- p.cyl[0] = p.g.cyl - 32;
+ p.cyl[0] = 0; /* Must be zero */
+ p.cyl[1] = p.g.cyl - 32;
p.type[0] = 0x55;
p.type[1] = 0x56;