ModeInfoBlock modeInfoBlock = null;
try {
Address vbeControlInfo = UnsafeX86.getVbeControlInfos();
VbeInfoBlock vbeInfoBlock = new VbeInfoBlock(vbeControlInfo);
if (vbeInfoBlock.isEmpty()) {
throw new DriverException(
"can't start device (vbeInfoBlock is empty): grub haven't switched to graphic mode");
}
Address vbeModeInfo = UnsafeX86.getVbeModeInfos();
modeInfoBlock = new ModeInfoBlock(vbeModeInfo);
if (modeInfoBlock.isEmpty()) {
throw new DriverException(
"can't start device (modeInfoBlock is empty): grub haven't switched to graphic mode");
}
kernel = new VESACore(this, vbeInfoBlock, modeInfoBlock, (PCIDevice) getDevice());
configs = kernel.getConfigs();
} catch (ResourceNotFreeException ex) {
throw new DriverException(ex);
} catch (Throwable t) {
throw new DriverException(t);
}
final Device dev = getDevice();
super.startDevice();
dev.registerAPI(HardwareCursorAPI.class, kernel);