Package org.jnode.driver

Examples of org.jnode.driver.Device


    /**
     * @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


            public AbstractInstaller.Step collect() {
                try {
                    String deviceID =
                        inContext.getStringInput("Enter the installation disk device name (example: hda0) : ");

                    Device disk = DeviceUtils.getDevice(deviceID);
                    JGrub jgrub = new JGrub(new PrintWriter(new OutputStreamWriter(System.out)), disk);

                    inContext.setStringValue(ActionConstants.INSTALL_ROOT_DIR, jgrub.getMountPoint());
                    return AbstractInstaller.Step.forth;
                } catch (Exception e) {
View Full Code Here

        final FileDevice newFd = new FileDevice(destFile, "rw");
        try {
            newFd.setLength(getDeviceLength());
            formatDevice(newFd);
            final Device sysDev = getSystemDevice(newFd);
            final BlockDeviceAPI sysDevApi = sysDev
                .getAPI(BlockDeviceAPI.class);
            copySystemFiles(sysDev);
            sysDevApi.flush();
        } catch (ApiNotFoundException ex) {
            final IOException ioe = new IOException("BlockDeviceAPI not found on device");
View Full Code Here

    public static void main(String[] args) throws Exception {
        new WLanCtlCommand().execute(args);
    }
   
    public void execute() throws ApiNotFoundException, NetworkException {
        final Device dev = argDevice.getValue();
        final WirelessNetDeviceAPI api;
        api = dev.getAPI(WirelessNetDeviceAPI.class);

        // Perform the selected operation
        if (argSetEssid.isSet()) {
            final String essid = argValue.getValue();
            getOutput().getPrintWriter().format(fmt_set, dev.getId(), essid);
            api.setESSID(essid);
        }
    }
View Full Code Here

    public void execute() throws NoSuchProtocolException, NetworkException, NameNotFoundException {
        final IPv4NetworkLayer ipNL =
                (IPv4NetworkLayer) NetUtils.getNLM().getNetworkLayer(ETH_P_IP);
        final IPv4Address target = argTarget.getValue();
        final IPv4Address gateway = argGateway.getValue();
        final Device device = argDevice.getValue();
        final IPv4ConfigurationService cfg = InitialNaming.lookup(IPv4ConfigurationService.NAME);

        if (argAdd.isSet()) {
            cfg.addRoute(target, gateway, device, true);
        } else if (argDel.isSet()) {
View Full Code Here

            kernel = new NVidiaCore(this, architecture, model, (PCIDevice) getDevice());
        } catch (ResourceNotFreeException ex) {
            throw new DriverException(ex);
        }
        super.startDevice();
        final Device dev = getDevice();
        dev.registerAPI(DisplayDataChannelAPI.class, kernel);
        dev.registerAPI(HardwareCursorAPI.class, kernel.getHardwareCursor());
    }
View Full Code Here

        }
        if (kernel != null) {
            kernel.release();
            kernel = null;
        }
        final Device dev = getDevice();
        dev.unregisterAPI(DisplayDataChannelAPI.class);
        dev.unregisterAPI(HardwareCursorAPI.class);
        super.stopDevice();
    }
View Full Code Here

            throw new NetworkException("The destination address must have been set");
        }
        stat.opackets.inc();

        // The device we will use to transmit the packet
        final Device dev;
        final NetDeviceAPI api;
        // The hardware address we will be sending to
        final HardwareAddress hwDstAddr;

        // Has the destination device been given?
        if (skbuf.getDevice() == null) {
            // The device has not been send, figure out the route ourselves.

            // First lets try to find a route
            final IPv4Route route;
            route = findRoute(hdr, skbuf);
            route.incUseCount();

            // Get the device
            dev = route.getDevice();
            api = route.getDeviceAPI();

            // Get my source address if not already set
            if (hdr.getSource() == null) {
                hdr.setSource(getSourceAddress(route, hdr, skbuf));
            }

            // Get the hardware address for this device
            hwDstAddr = findDstHWAddress(route, hdr, skbuf);
        } else {
            // The device has been given, use it
            dev = skbuf.getDevice();
            try {
                api = dev.getAPI(NetDeviceAPI.class);
            } catch (ApiNotFoundException ex) {
                throw new NetworkException("Device is not a network device", ex);
            }
            // The source address must have been set, check it
            if (hdr.getSource() == null) {
View Full Code Here

            driver = new CirrusCore(this, architecture, model, (PCIDevice) getDevice());
        } catch (ResourceNotFreeException ex) {
            throw new DriverException(ex);
        }
        super.startDevice();
        @SuppressWarnings("unused")
        final Device dev = getDevice();
        //dev.registerAPI(DisplayDataChannelAPI.class, driver);
        //       <-- should we register this one? We do read edid our own..
        //dev.registerAPI(HardwareCursorAPI.class, driver.getHardwareCursor());
    }
View Full Code Here

        }
        if (driver != null) {
            driver.release();
            driver = null;
        }
        final Device dev = getDevice();
        dev.unregisterAPI(DisplayDataChannelAPI.class);
        dev.unregisterAPI(HardwareCursorAPI.class);
        super.stopDevice();
    }
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.