Examples of IDEDriveDescriptor


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

    }

    private void printPartitionTable(PartitionHelper helper, PrintWriter out)
        throws DeviceNotFoundException, ApiNotFoundException, IOException {
        IDEDevice ideDev = helper.getDevice();
        IDEDriveDescriptor descriptor = ideDev.getDescriptor();
        int sectorSize = IDEConstants.SECTOR_SIZE;
        if (ideDev != null) {
            out.println("IDE Disk : " + ideDev.getId() + ": " +
                descriptor.getSectorsAddressable() * 512 + " bytes");
        }
        out.println("Device Boot    Start       End    Blocks   System");
        IBMPartitionTable partitionTable = helper.getPartitionTable();
        int i = 0;
        for (IBMPartitionTableEntry entry : partitionTable) {
View Full Code Here

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

        final Collection<Device> allDevices = dm.getDevicesByAPI(BlockDeviceAPI.class);
        for (Device dev : allDevices) {
            //out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]");
            if (dev instanceof IDEDevice) {
                IDEDevice ideDevice = (IDEDevice) dev;
                IDEDriveDescriptor desc = ideDevice.getDescriptor();
                if (desc.isDisk()) {
                    out.println("IDE Disk: " + ideDevice.getId() + "('" + desc.getModel() + "' " +
                        desc.getSectorsAddressable() * IDEConstants.SECTOR_SIZE + " bytes)");
                }
            }
        }
    }
View Full Code Here

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

        0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};


    @Before
    public void setUp() {
        ideDescriptor = new IDEDriveDescriptor(ide, true);
        cdromIdeDescriptor = new IDEDriveDescriptor(cdrom, true);
    }
View Full Code Here

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

    }

    @Test(expected = IllegalArgumentException.class)
    public void testConstructorDataWrongLength() {
        int[] data = new int[125];
        IDEDriveDescriptor wrongIdeDescriptor = new IDEDriveDescriptor(data, true);
    }
View Full Code Here

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

            if ((state & ST_DATA_REQUEST) != 0) {
                // Data is ready to read
                for (int i = 0; i < 256; i++) {
                    data[i] = io.getDataReg();
                }
                result = new IDEDriveDescriptor(data, atapiID);
            } else {
                // Not busy, but still no data ready??? strange
                //log.debug("irq:!drq");
                result = null;
            }
View Full Code Here

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

            }
        };

        Class<?>[] clsArgs = {int[].class, boolean.class};
        Object[] args = {data, atapi};
        IDEDriveDescriptor desc = (IDEDriveDescriptor)
            MockUtils.createMockObject(IDEDriveDescriptor.class,
                initializer, clsArgs, args);

        DefaultIDEControllerDriver ctrlDriver = new DefaultIDEControllerDriver();
        IDEDevice device = new IDEDevice(ideBus, primary, master, "hdTest", desc, ctrlDriver);
View Full Code Here

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

        final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
        final String name = (args.length > 0) ? args[0] : "hda";

        IDEDevice dev = (IDEDevice) dm.getDevice(name);
        IDEDeviceAPI<?> api = dev.getAPI(IDEDeviceAPI.class);
        IDEDriveDescriptor descr = dev.getDescriptor();

        System.out.println("LBA support   : " + descr.supportsLBA());
        System.out.println("DMA support   : " + descr.supportsDMA());
        System.out.println("48-bit support: " + descr.supports48bitAddressing());
        System.out.println("Length        : " + api.getLength());

        final ByteBuffer data = ByteBuffer.allocate(1024);
        api.read(0, data);
View Full Code Here

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

        /* Register the IDEDevice API */
        dev.registerAPI(IDEDeviceAPI.class,
            new IDEDeviceBlockAlignmentSupport<IBMPartitionTableEntry>(this, SECTOR_SIZE));

        /* Get basic configuration */
        final IDEDriveDescriptor descr = dev.getDescriptor();
        //lba = descr.supportsLBA();
        //dma = descr.supportsDMA();
        is48bit = descr.supports48bitAddressing();
        maxSector = descr.getSectorsAddressable();

        // Look for partitions
        try {
            // Find the devicemanager
            DeviceManager devMan = InitialNaming.lookup(DeviceManager.NAME);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.