private boolean is48bit;
private IDEDiskBus diskBus;
private IBMPartitionTable pt;
protected void startDevice() throws DriverException {
final IDEDevice dev = (IDEDevice) getDevice();
diskBus = new IDEDiskBus(dev);
/* Register the IDEDevice API */
dev.registerAPI(IDEDeviceAPI.class,
new IDEDeviceBlockAlignmentSupport<IBMPartitionTableEntry>(this, SECTOR_SIZE));
/* Get basic configuration */
final IDEDriveDescriptor descr = dev.getDescriptor();
//lba = descr.supportsLBA();
//dma = descr.supportsDMA();
is48bit = descr.supports48bitAddressing();
maxSector = descr.getSectorsAddressable();
// Look for partitions
try {
// Find the devicemanager
DeviceManager devMan = InitialNaming.lookup(DeviceManager.NAME);
// Read the bootsector
final byte[] bs1 = new byte[SECTOR_SIZE];
read(0, ByteBuffer.wrap(bs1));
// Read the bootsector twice, since the first read seems to fail.
// todo: THIS IS A WORKAROUND
final byte[] bs = new byte[SECTOR_SIZE];
read(0, ByteBuffer.wrap(bs));
IDEDeviceFactory factory;
try {
factory = IDEDriverUtils.getIDEDeviceFactory();
} catch (NamingException ex) {
throw new DriverException(ex);
}
log.debug("Creating partition table object on " + dev.getId());
this.pt = factory.createIBMPartitionTable(bs, dev);
log.debug("Created partition table object");
int partIndex = 0;
int i = 0;