Package org.jnode.driver

Examples of org.jnode.driver.Device


            // Show all devices.
            listAvailableDevices(dm, out);
            return;
        }

        Device dev = ARG_DEVICE.getValue();
        // FIXME PartitionHelper assumes that the device is an IDE device !?!
        if (!(dev instanceof IDEDevice)) {
            err.println(dev.getId() + " is not an IDE device");
            exit(1);
        }
        final PartitionHelper helper = new PartitionHelper(dev.getId(), out);
        try {
            helper.checkMBR();
        } catch (IOException ioex) {
            out.println(ioex.getMessage());
            out.println("Create a new MBR with a valid partition table.");
View Full Code Here


        // create stub resource manager
        MockObjectFactory.createResourceManager(testCase);

        // create stub IDE device
        Device parent = MockObjectFactory.createParentDevice();
        BlockDeviceAPITestConfig cfg = (BlockDeviceAPITestConfig) config;
        IDEDevice device = MockObjectFactory.createIDEDevice(parent, testCase, true, cfg.getDeviceSize());

        init(null, driver, device);
    }
View Full Code Here

    }

    public void init(TestConfig config, MockObjectTestCase testCase) throws Exception {
        super.init(config, testCase);

        Device parent = MockObjectFactory.createParentDevice();
        BlockDeviceAPITestConfig cfg = (BlockDeviceAPITestConfig) config;
        MappedBlockDeviceSupport api = new MappedBlockDeviceSupport(parent, 0L, cfg.getDeviceSize());
        init(null, api, null);
    }
View Full Code Here

    /**
     * @see org.jnode.driver.Driver#stopDevice()
     */
    protected void stopDevice() throws DriverException {
        final Device ideDev = getDevice();

        // Unregister the SCSI device
        try {
            ideDev.getManager().unregister(scsiDevice);
        } finally {
            scsiDevice = null;
            atapiBus = null;
        }

        // Unregister my api's
        ideDev.unregisterAPI(SCSIHostControllerAPI.class);
    }
View Full Code Here

        Assert.assertTrue("Must contains one directory", root.iterator().hasNext());
    }

    private Device createTestDisk(boolean formatted) throws IOException {
        File file = TestUtils.makeTempFile("hfsDevice", "10M");
        Device device = new FileDevice(file, "rw");
        return device;

    }
View Full Code Here

     * Register a mounted filesystem
     *
     * @param fs
     */
    public void registerFileSystem(FileSystem<?> fs) {
        final Device device = fs.getDevice();
        filesystems.put(device, fs);
    }
View Full Code Here

    public SCSITest(String[] args) throws ApiNotFoundException,
        NameNotFoundException, DeviceNotFoundException {
        processArgs(args);
        final DeviceManager dm = InitialNaming
            .lookup(DeviceManager.NAME);
        final Device dev = dm.getDevice(name);
        api = dev.getAPI(SCSIDeviceAPI.class);
    }
View Full Code Here

    public static void main(String[] args) {

        try {
            final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
            final Device fd0 = dm.getDevice("fd0");
            final BlockDeviceAPI api = fd0.getAPI(BlockDeviceAPI.class);
            try {

                final ByteBuffer buf = ByteBuffer.allocate(512);
                api.read(0, buf);
            } catch (IOException ex) {
View Full Code Here

    /**
     * Create and start the structures required by this driver.
     */
    private void startDriver() throws ResourceNotFreeException, DriverException {
        final Device dev = getDevice();
        dev.registerAPI(IDEControllerAPI.class, this);
        IDEDeviceFactory factory;
        try {
            factory = IDEDriverUtils.getIDEDeviceFactory();
        } catch (NamingException ex) {
            throw new DriverException(ex);
View Full Code Here

    /**
     * Stop and release the structures required by this driver.
     */
    private void stopDriver() {
        final Device dev = getDevice();
        final int max = ideProcessors.length;
        for (int i = 0; i < max; i++) {
            ideProcessors[i].stop();
            ideProcessors[i] = null;
        }
        dev.unregisterAPI(IDEControllerAPI.class);
    }
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.