Package org.jnode.fs.fat

Examples of org.jnode.fs.fat.GrubFatFormatter.format()


    public static void createFloppy(File f) throws Exception {

        GrubFatFormatter ff = new GrubFatFormatter(0, null, null);
        FileDevice newFd = new FileDevice(f, "rw");
        newFd.setLength(1440 * 1024);
        ff.format(newFd);

        // newFd.start();
        final FileSystemService fSS = InitialNaming.lookup(FileSystemService.NAME);
        FatFileSystemType type = fSS.getFileSystemType(FatFileSystemType.ID);
        FatFileSystem fs = new FatFileSystem(newFd, false, type);
View Full Code Here


     * @throws IOException
     */
    protected void formatDevice(Device dev) throws IOException {
        GrubFatFormatter ff = createFormatter();
        try {
            ff.format(dev.getAPI(BlockDeviceAPI.class));
        } catch (ApiNotFoundException ex) {
            final IOException ioe = new IOException("BlockDeviceAPI not found on device");
            ioe.initCause(ex);
            throw ioe;
        }
View Full Code Here

        /* Format partition 0 */
        part0 = new MappedFSBlockDeviceSupport(device, pte.getStartLba()
            * bytesPerSector, pte.getNrSectors() * bytesPerSector);
        GrubFatFormatter ff = createFormatter();
        ff.setInstallPartition(0x0000FFFF);
        ff.format(part0);
        GrubBootSector part0bs = (GrubBootSector) ff.getBootSector();

        /* Fixup stage2 sector in MBR */
        mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector());
        try {
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.