Package org.jnode.fs.fat

Examples of org.jnode.fs.fat.BootSector


        try {
            final FileSystemService fSS = InitialNaming.lookup(FileSystemService.NAME);
            FatFileSystemType type = fSS.getFileSystemType(FatFileSystemType.ID);
            FatFileSystem fs = new FatFileSystem(fd, false, type);
            try {
                BootSector bs = fs.getBootSector();
                bs.read(fd);

                out.println("OEM name          " + bs.getOemName());
                out.println("bytes/sector      " + bs.getBytesPerSector());
                out.println("sectors/cluster   " + bs.getSectorsPerCluster());
                out.println("#reserved sectors " + bs.getNrReservedSectors());
                out.println("#fats             " + bs.getNrFats());
                out.println("#rootdir entries  " + bs.getNrRootDirEntries());
                out.println("#logical sectors  " + bs.getNrLogicalSectors());
                out.println("Medium descriptor 0x" + Integer.toHexString(bs.getMediumDescriptor()));
                out.println("sectors/fat       " + bs.getSectorsPerFat());
                out.println("sectors/track     " + bs.getSectorsPerTrack());
                out.println("#heads            " + bs.getNrHeads());
                out.println("#hidden sectors   " + bs.getNrHiddenSectors());

                fs.getFat().printTo(out);
                fs.getRootDir().printTo(out);

                try {
View Full Code Here


    }

    public void initMbr() throws DeviceNotFoundException, ApiNotFoundException, IOException {
        out.println("Initialize MBR ...");

        BootSector oldMBR = bs;
        bs = new GrubBootSector(PLAIN_MASTER_BOOT_SECTOR);

        if (MBR.containsPartitionTable()) {
            out
                    .println("This device already contains a partition table. Copy the already existing partitions.");

            for (int i = 0; i < 4; i++) {
                final IBMPartitionTableEntry oldEntry = oldMBR.getPartition(i);
                modifyPartition(i, oldEntry.getBootIndicator(), oldEntry.getStartLba(), oldEntry
                        .getNrSectors(), SECTORS, oldEntry.getSystemIndicator());
            }
        } else {
            bs.getPartition(0).setSystemIndicator(IBMPartitionTypes.PARTTYPE_EMPTY);
View Full Code Here

        }
    }

    private void reloadMBR() throws IOException {
        MBR.read(api);
        bs = new BootSector(MBR.array());
    }
View Full Code Here

TOP

Related Classes of org.jnode.fs.fat.BootSector

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.