Package org.jnode.driver.block.ramdisk

Examples of org.jnode.driver.block.ramdisk.RamDiskDevice


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

        BlockDeviceAPITestConfig cfg = (BlockDeviceAPITestConfig) config;
        String name = "RamDiskDevice-Tests";
        final RamDiskDevice device =
            new RamDiskDevice(StubDeviceManager.INSTANCE.getSystemBus(), name, cfg.getDeviceSize());
        final RamDiskDriver driver = new RamDiskDriver(name);
        init(null, driver, device);
    }
View Full Code Here


        return true;
    }

    public static RamDiskDevice createRamDisk(int size) {
        RamDiskDevice dev = null;
        try {
            final DeviceManager dm = InitialNaming
                .lookup(DeviceManager.NAME);
            dev = new RamDiskDevice(null, "dummy", size);
            dev.setDriver(new RamDiskDriver(null));
            dm.register(dev);
        } catch (NameNotFoundException e) {
            log.error(e);
        } catch (DeviceAlreadyRegisteredException e) {
            log.error(e);
View Full Code Here

    protected void startPlugin() throws PluginException {
        try {
            log.info("Create initrd ramdisk on /jnode");
            final DeviceManager dm = DeviceUtils.getDeviceManager();
            int size = getPreferences().getInt("size", (int) NumberUtils.getSize("100K"));
            final RamDiskDevice dev = new RamDiskDevice(null, "dummy", size);
            dev.setDriver(new RamDiskDriver("jnode"));
            dm.register(dev);

            log.info("Format initrd ramdisk");

            final FatFileSystemFormatter formatter = new FatFileSystemFormatter(FatType.FAT16);
View Full Code Here

        throws NameNotFoundException, DriverException, DeviceAlreadyRegisteredException {
        final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
        if (FLAG_CREATE.isSet()) {
            // Create
            final int size = ARG_SIZE.isSet() ? ARG_SIZE.getValue() : 4 * 4096;
            RamDiskDevice dev = new RamDiskDevice(null, "dummy", size);
            dev.setDriver(new RamDiskDriver(null));
            dm.register(dev);
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.driver.block.ramdisk.RamDiskDevice

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.