Package org.jnode.driver

Examples of org.jnode.driver.Device


    /**
     * Stop the keyboard device.
     */
    protected synchronized void stopDevice() throws DriverException {
        final Device dev = getDevice();
        dev.unregisterAPI(KeyboardAPI.class);
        dev.unregisterAPI(SystemTriggerAPI.class);
        if (System.in == kis) {
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    SystemInputStream.getInstance().releaseSystemIn();
                    return null;
View Full Code Here


    public CardBusDriver() {
    }

    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) {
View Full Code Here

     * @throws DeviceException
     * @see org.jnode.driver.DeviceFinder#findDevices(org.jnode.driver.DeviceManager, org.jnode.driver.Bus)
     */
    public void findDevices(DeviceManager devMan, Bus bus) throws DeviceException {
        try {
            final Device bios = new Device(bus, "bios");
            bios.setDriver(new BiosDriver());
            devMan.register(bios);
        } catch (DriverException ex) {
            throw new DeviceException(ex);
        }
    }
View Full Code Here

     * Start the device
     *
     * @throws DriverException
     */
    protected void startDevice() throws DriverException {
        final Device dev = getDevice();

        // Find the ACPI info
        try {
            final ResourceManager rm;
            rm = InitialNaming.lookup(ResourceManager.NAME);
            info = findAcpiRSDTPTR(rm);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find the resource manager");
        } catch (ResourceNotFreeException ex) {
            log.error("Cannot claim BIOS region", ex);
        }

        // Register out API
        dev.registerAPI(FirmwareAPI.class, this);

        // Start an ACPI device if we found the info for it.
        if (info != null) {
            log.info("Start ACPI device");
            acpiDevice = new AcpiDevice(dev.getBus(), "acpi", info);
            try {
                dev.getManager().register(acpiDevice);
            } catch (DeviceAlreadyRegisteredException ex) {
                log.error("Cannot register ACPI device", ex);
            }
        }
    }
View Full Code Here

     * Stop the device
     *
     * @throws DriverException
     */
    protected void stopDevice() throws DriverException {
        final Device dev = getDevice();
        if (acpiDevice != null) {
            dev.getManager().unregister(acpiDevice);
        }
        dev.unregisterAPI(FirmwareAPI.class);
    }
View Full Code Here

    // ********** Driver implementation **********//

    /** A routine that claims all the resources nessasary to run the PCSpeaker. * */
    public void startDevice() throws DriverException {
        try {
            final Device dev = getDevice();
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            speakIO = claimPorts(rm, dev, SPEAKER_PORT, 1);
            pitIO = claimPorts(rm, dev, CHANNEL2_PORT, 2);
            getDevice().registerAPI(SpeakerAPI.class, this);
            // do a test beep during startup
View Full Code Here

        String devId = (args.length > 0) ? args[0] : "eth0";

        try {
            final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
            final Device dev = dm.getDevice(devId);
            final NetDeviceAPI api = dev.getAPI(NetDeviceAPI.class);
            final EthernetAddress mac = (EthernetAddress) api.getAddress();

            SocketBuffer skbuf = new SocketBuffer();
            skbuf.insert(28);
            skbuf.set16(0, 0x0001); // Hardware type
View Full Code Here

        } 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);
    }
View Full Code Here

    /**
     * @see org.jnode.driver.Driver#stopDevice()
     */
    protected void stopDevice() throws DriverException {
        final Device dev = getDevice();
        dev.unregisterAPI(HardwareCursorAPI.class);
        if (currentConfig != null) {
            kernel.close();
        }
        if (kernel != null) {
            kernel.release();
View Full Code Here

            kernel = new VMWareCore(this, (PCIDevice) getDevice());
            configs = kernel.getConfigs();
        } catch (ResourceNotFreeException ex) {
            throw new DriverException(ex);
        }
        final Device dev = getDevice();
        super.startDevice();
        dev.registerAPI(HardwareCursorAPI.class, kernel);
        dev.registerAPI(DeviceInfoAPI.class, this);
    }
View Full Code Here

TOP

Related Classes of org.jnode.driver.Device

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.