Package org.jnode.partitions.ibm

Examples of org.jnode.partitions.ibm.IBMPartitionTableEntry


            if ((size % IDEConstants.SECTOR_SIZE) > 0) {
                nbSectors++;
            }
        }

        IBMPartitionTableEntry entry = bs.getPartition(id);
        entry.setBootIndicator(bootIndicator);
        entry.setSystemIndicator(fs);
        entry.setStartLba(start);
        entry.setNrSectors(nbSectors);
    }
View Full Code Here


        /* Format the MBR & partitiontable */
        GrubBootSector mbr = (GrubBootSector) (createFormatter()
            .getBootSector());

        IBMPartitionTableEntry pte = mbr.initPartitions(geom, IBMPartitionTypes.PARTTYPE_DOS_FAT16_LT32M);

        /*
         * System.out.println("partition table:"); for (int i = 0; i < 4; i++) {
         * System.out.println("" + i + " " + mbr.getPartition(i)); }
         */

        /* 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 {
            mbr.write(device.getAPI(BlockDeviceAPI.class));
        } catch (ApiNotFoundException ex) {
            final IOException ioe = new IOException("BlockDeviceAPI not found on device");
            ioe.initCause(ex);
View Full Code Here

            devPartitions.add(new Partition(0L, devSize, false));

            // add used partitions
            device = new Device(dev.getId(), devSize, dev, devPartitions);
            for (IBMPartitionTableEntry e : partitions) {
                IBMPartitionTableEntry pte = (IBMPartitionTableEntry) e;

                long start = pte.getStartLba();
                long size = pte.getNrSectors() * IDEConstants.SECTOR_SIZE;
                device.addPartition(start, size); // add a non-empty partition
            }
        }

        LOG.debug("createDevice: return device=" + device);
View Full Code Here

                        // non IBM partition tables are not handled for now
                        supportedPartitions = false;
                        break;
                    }

                    IBMPartitionTableEntry entry = (IBMPartitionTableEntry) e;
                    if (entry.isValid() && !entry.isEmpty()) {
                        partitions.add(entry);
                    }
                }

                supported = supportedPartitions;
View Full Code Here

TOP

Related Classes of org.jnode.partitions.ibm.IBMPartitionTableEntry

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.