Package org.jnode.driver.bus.ide.command

Examples of org.jnode.driver.bus.ide.command.IDERWSectorsCommand


        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) {
                throw new InterruptedIOException("IDE timeout: " + ex.getMessage());
            }
            if (cmd.hasError()) {
                throw new IOException("IDE " + errorSource + " error:" + cmd.getError());
            }

            length -= partLength;
            devOffset += partLength;
        }
View Full Code Here

TOP

Related Classes of org.jnode.driver.bus.ide.command.IDERWSectorsCommand

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.