Package org.jnode.driver.block

Examples of org.jnode.driver.block.FSBlockDeviceAPI


     * Mount the filesystem on the given device.
     */
    final void asyncDeviceStarted(Device device) {
        try {
            if (device.isStarted()) {
                final FSBlockDeviceAPI api = device.getAPI(FSBlockDeviceAPI.class);
                final boolean readOnly = false; // TODO: read from config
                if (device.implementsAPI(RemovableDeviceAPI.class)) {
                    tryToMount(device, api, true, readOnly);
                } else {
                    tryToMount(device, api, false, readOnly);
View Full Code Here


    public FatFileSystem format(Device device) throws FileSystemException {
        try {
            long numberOfSectors;
            long offset;

            FSBlockDeviceAPI api = (FSBlockDeviceAPI) device.getAPI(BlockDeviceAPI.class);
            int sectorSize = api.getSectorSize();

            PartitionTableEntry entry = api.getPartitionTableEntry();

            // if we can deduce partitiontable/fat dependencies do it otherwise
            // guess it.
            if (entry != null && entry instanceof IBMPartitionTableEntry) {
                numberOfSectors = ((IBMPartitionTableEntry) entry).getNrSectors();
                offset = ((IBMPartitionTableEntry) entry).getStartLba();
            } else {
                numberOfSectors = api.getLength() / sectorSize;
                offset = 0;
            }

            FatFormatter ff =
                    FatFormatter.HDFormatter(sectorSize, (int) numberOfSectors, SECTOR_PER_TRACK,
View Full Code Here

        try {
            long numberOfSectors;
            long offset;

            FSBlockDeviceAPI api = (FSBlockDeviceAPI) device.getAPI(BlockDeviceAPI.class);
            int sectorSize = api.getSectorSize();

            if (sectorSize != IDEConstants.SECTOR_SIZE) {
                log.error("This mkjfat1.0 support only the Hard Disk.Sector Size must " +
                        IDEConstants.SECTOR_SIZE + " bytes.\n");
            }

            PartitionTableEntry entry = api.getPartitionTableEntry();

            // if we can deduce partitiontable/fat dependencies do it otherwise
            // guess it.
            if (entry != null && entry instanceof IBMPartitionTableEntry) {
                numberOfSectors = ((IBMPartitionTableEntry) entry).getNrSectors();
                offset = ((IBMPartitionTableEntry) entry).getStartLba();
            } else {
                numberOfSectors = api.getLength() / sectorSize;
                offset = 0;
            }
           
            /*
             * Check the Disks Availability. low end limit - 65536 sectors I
View Full Code Here

TOP

Related Classes of org.jnode.driver.block.FSBlockDeviceAPI

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.