Package org.jnode.driver

Examples of org.jnode.driver.DriverException


        // Execute INQUIRY
        try {
            scsiDevice.inquiry();
        } catch (SCSIException ex) {
            throw new DriverException("Cannot INQUIRY device due to SCSIException", ex);
        } catch (TimeoutException ex) {
            throw new DriverException("Cannot INQUIRY device due to TimeoutException", ex);
        } catch (InterruptedException ex) {
            throw new DriverException("Interrupted while INQUIRY device", ex);
        }

        // Register the generic SCSI device.
        try {
            final DeviceManager dm = ideDev.getManager();
            synchronized (dm) {
                dm.rename(scsiDevice, "sg", true);
                dm.register(scsiDevice);
                dm.rename(ideDev, SCSIHostControllerAPI.DEVICE_PREFIX, true);
            }
        } catch (DeviceAlreadyRegisteredException ex) {
            throw new DriverException(ex);
        }
    }
View Full Code Here


                }
            });
        } catch (ResourceNotFreeException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new DriverException("Unknown exception", ex);
        }
    }
View Full Code Here

        int count = 0;
        IDEDeviceFactory factory;
        try {
            factory = IDEDriverUtils.getIDEDeviceFactory();
        } catch (NamingException ex) {
            throw new DriverException(ex);
        }
        for (int i = 0; i < devs.length; i++) {
            final IDEDriveDescriptor descr = devs[i];
            if (descr != null) {
                final String name = "hd" + ((char) ('a' + i));
View Full Code Here

        dev.registerAPI(IDEControllerAPI.class, this);
        IDEDeviceFactory factory;
        try {
            factory = IDEDriverUtils.getIDEDeviceFactory();
        } catch (NamingException ex) {
            throw new DriverException(ex);
        }
        this.ideProcessors[0] = factory.createIDEBus(dev, true);
        this.ideProcessors[1] = factory.createIDEBus(dev, false);
    }
View Full Code Here

                        log.error("Error starting IDE devices", ex);
                    }
                }
            });
        } catch (ResourceNotFreeException ex) {
            throw new DriverException(ex);
        } catch (DeviceAlreadyRegisteredException ex) {
            throw new DriverException(ex);
        }
    }
View Full Code Here

        this.primary = primary;
        IDEDeviceFactory factory;
        try {
            factory = IDEDriverUtils.getIDEDeviceFactory();
        } catch (NamingException ex) {
            throw new DriverException(ex);
        }
        this.io = factory.createIDEIO(parent, primary);

        // Register the irq handler
        final ResourceManager rm;
View Full Code Here

        boolean primary = true;
        IDEBus ideBus;
        try {
            ideBus = IDEDriverUtils.getIDEDeviceFactory().createIDEBus(parentDev, primary);
        } catch (NamingException ex) {
            throw new DriverException(ex);
        }

        // must have length 256 (see IDEDriveDescriptor)
        int[] data = new int[256];
        Boolean atapi = Boolean.valueOf(true);
View Full Code Here

            final DeviceManager dm = dev.getManager();
            synchronized (dm) {
                dm.rename(dev, "sg", true);
            }
        } catch (DeviceAlreadyRegisteredException ex) {
            throw new DriverException(ex);
        }

        this.locked = false;
        this.changed = true;
        this.capacity = null;
View Full Code Here

    @Override
    protected void stopDevice() throws DriverException {
        try {
            unlock();
        } catch (IOException ex) {
            throw new DriverException(ex);
        } finally {
            final SCSIDevice dev = (SCSIDevice) getDevice();
            dev.unregisterAPI(RemovableDeviceAPI.class);
            dev.unregisterAPI(FSBlockDeviceAPI.class);
            dev.unregisterAPI(SCSIDeviceAPI.class);
View Full Code Here

            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;
            for (IBMPartitionTableEntry pte : pt) {
                log.debug("Processing partition " + i);
                if (pte == null) {
                    BootLogInstance.get().warn("PartitionTableEntry #" + i + " is null");
                } else if (pte.isValid()) {
                    log.debug("Partition " + i + " is valid");
                    registerPartition(devMan, dev, pte, partIndex);
                }
                partIndex++;
                i++;
            }
            if (!pt.getExtendedPartitions().isEmpty()) {
                // Create partition devices for the extended partition
                log.debug("Extended");
                partIndex = registerExtendedPartition(devMan, dev, partIndex);
            }
        } catch (DeviceAlreadyRegisteredException ex) {
            log.error("Partition device is already known");
            throw new DriverException("Partition device is already known???? Probably a bug", ex);
        } catch (IOException ex) {
            log.error("Cannot read partition table", ex);
            throw new DriverException("Cannot read partition table", ex);
        } catch (NameNotFoundException ex) {
            log.error("Cannot find DeviceManager", ex);
            throw new DriverException("Cannot find DeviceManager", ex);
        } catch (Throwable ex) {
            log.error("Unknown error", ex);
            throw new DriverException("Unknown error", ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.driver.DriverException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.