LOG.debug("buildDescriptor: adding 1 more sector to fit size");
sizeInSectors++;
}
// build DiskDatabase
DiskDatabase ddb = new DiskDatabase();
ddb.setAdapterType(AdapterType.ide);
ddb.setSectors(64);
ddb.setHeads(32);
int cylinderCapacity = ddb.getSectors() * ddb.getHeads();
int cylinders = (int) (sizeInSectors / cylinderCapacity);
if ((sizeInSectors % cylinderCapacity) != 0) {
LOG.debug("buildDescriptor: adding 1 more cylinder to fit size");
cylinders++;
}
ddb.setCylinders(cylinders);
int nbSectors = ddb.getCylinders() * ddb.getHeads() * ddb.getSectors();
LOG.info("buildDescriptor: allocated size=" + (nbSectors * IDEConstants.SECTOR_SIZE));
// build Header
Header header = new Header();
header.setVersion("1");