Package org.jnode.driver.bus.ide

Examples of org.jnode.driver.bus.ide.IDEDevice


        final String errorSource = isWrite ? "write" : "read";
        if (lbaStart + sectors > this.maxSector) {
            throw new IOException(errorSource + " beyond device sectors");
        }

        final IDEDevice dev = (IDEDevice) getDevice();
        final IDEBus bus = (IDEBus) dev.getBus();
        final int maxSectorCount = is48bit ? MAX_SECTOR_COUNT_48 : MAX_SECTOR_COUNT_28;
        final boolean primary = dev.isPrimary();
        final boolean master = dev.isMaster();

        while (length > 0) {
            final long partLbaStart = devOffset / SECTOR_SIZE;
            final int partSectorCount = Math.min(length / SECTOR_SIZE, maxSectorCount);
            final int partLength = partSectorCount * SECTOR_SIZE;

            final IDERWSectorsCommand cmd = isWrite ?
                new IDEWriteSectorsCommand(primary, master, is48bit, partLbaStart, partSectorCount, buf) :
                new IDEReadSectorsCommand(primary, master, is48bit, partLbaStart, partSectorCount, buf);
            try {
                log.debug("bus.exAndWt" + (isWrite ? "W" : "R") + " dev=" + dev.getId() + " start=" + partLbaStart +
                    " sectors=" + partSectorCount + " len=" + partLength);
                bus.executeAndWait(cmd, IDE_DATA_XFER_TIMEOUT);
            } catch (InterruptedException ex) {
                throw new IOException("IDE " + errorSource + " interrupted", ex);
            } catch (TimeoutException ex) {
View Full Code Here


    /**
     * @see org.jnode.driver.DeviceToDriverMapper#findDriver(org.jnode.driver.Device)
     */
    public Driver findDriver(Device device) {
        if (device instanceof IDEDevice) {
            final IDEDevice ideDev = (IDEDevice) device;
            if (ideDev.getDescriptor().isDisk()) {
                return new IDEDiskDriver();
            }
        }
        return null;
    }
View Full Code Here

//            coreInitialized = true;
//        }       
    }

    public static IDEDevice createFakeDevice(ErrorReporter errorReporter) {
        IDEDevice device = null;
        try {
            String name = findUnusedName("fake");
            FakeIDEDevice fd = new FakeIDEDevice(name, true, true, DEFAULT_FILE_SIZE);
            if (addDevice(fd)) {
                device = fd;
View Full Code Here

        return device;
    }

    public static IDEDevice createVMWareDevice(ErrorReporter errorReporter) {
        IDEDevice device = null;

        try {
            AbstractIDEDevice fd = createVMWareDevice();
            if (addDevice(fd)) {
                device = fd;
View Full Code Here

        return device;
    }

    public static IDEDevice createFileDevice(ErrorReporter errorReporter) {
        IDEDevice device = null;

        try {
            AbstractIDEDevice fd = createFileDevice();
            if (addDevice(fd)) {
                device = fd;
View Full Code Here

            }
        };
        t.start();
*/
        // DeviceUtils.createFakeDevice(new ErrorReporter());
        IDEDevice dev = DeviceUtils.createFileDevice(errorReporter);
        @SuppressWarnings("unused")
        JGrub jgrub = new JGrub(new PrintWriter(new OutputStreamWriter(System.out)), dev);
       
//        jgrub.install();
       
View Full Code Here

TOP

Related Classes of org.jnode.driver.bus.ide.IDEDevice

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.