Пример #1
0
  /** @see org.jnode.driver.Driver#startDevice() */
  protected void startDevice() throws DriverException {
    final Device ideDev = getDevice();

    // Register my api's
    ideDev.registerAPI(SCSIHostControllerAPI.class, this);

    // Create the ATAPI bus
    this.atapiBus = new ATAPIBus(ideDev);

    // Create the generic SCSI device, attached to the ATAPI bus
    scsiDevice = new ATAPISCSIDevice(atapiBus, "_sg");

    // 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);
    }
  }
 /** @see org.jnode.driver.Driver#startDevice() */
 protected void startDevice() throws DriverException {
   final Device device = getDevice();
   try {
     final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
     dm.rename(device, getDevicePrefix() + "-" + device.getId(), false);
   } catch (DeviceAlreadyRegisteredException ex) {
     log.error("Cannot rename device", ex);
   } catch (NameNotFoundException ex) {
     throw new DriverException("Cannot find DeviceManager", ex);
   }
   device.registerAPI(FrameBufferAPI.class, this);
 }
Пример #3
0
 protected void startDevice() throws DriverException {
   final Device device = getDevice();
   final DeviceManager dm;
   try {
     dm = InitialNaming.lookup(DeviceManager.NAME);
     dm.rename(device, getDevicePrefix(), true);
   } catch (DeviceAlreadyRegisteredException ex) {
     log.error("Cannot rename device", ex);
     throw new DriverException("Cannot rename device", ex);
   } catch (NameNotFoundException ex) {
     throw new DriverException("Cannot find DeviceManager", ex);
   }
   int busId = 0; // fix to handle multiple firewire controllers
   bus = new FireWireBus(this, busId);
 }