Package org.jnode.partitions.ibm

Examples of org.jnode.partitions.ibm.IBMPartitionTableEntry


        getPartition(0).clear();
        getPartition(1).clear();
        getPartition(2).clear();
        getPartition(3).clear();

        IBMPartitionTableEntry entry = getPartition(0);
        entry.setBootIndicator(true);
        entry.setStartLba(1);
        entry.setNrSectors(geom.getTotalSectors() - 1);
        entry.setSystemIndicator(firstPartitionType);
        entry.setStartCHS(geom.getCHS(entry.getStartLba()));
        entry.setEndCHS(geom.getCHS(entry.getStartLba() + entry.getNrSectors() - 1));

        return entry;
    }
View Full Code Here


        return entry;
    }

    public synchronized IBMPartitionTableEntry getPartition(int partNr) {
        if (partitions[partNr] == null) {
            partitions[partNr] = new IBMPartitionTableEntry(null, data, partNr);
        }
        return partitions[partNr];
    }
View Full Code Here

        public Object invoke(Invocation invocation) throws Throwable {
            int index = ((Integer) invocation.parameterValues.get(0))
                .intValue();
            Partition part = partitions[index];
            IBMPartitionTableEntry entry = createEntry(index,
                part.isExtended(), part.getStartLba(), part.getNbSectors());
            return entry;
        }
View Full Code Here

    @Test
    public void testhasChildPartitionTable() {
        byte[] bootSector = getBootSector();
        LittleEndian.setInt8(bootSector, 450, 0x85);
        IBMPartitionTableEntry pte = new IBMPartitionTableEntry(null, bootSector, 0);
        assertTrue(pte.hasChildPartitionTable());
    }
View Full Code Here

    @Test
    public void testhasNoChildPartitionTable() {
        byte[] bootSector = getBootSector();
        LittleEndian.setInt8(bootSector, 450, 0x84);
        IBMPartitionTableEntry pte = new IBMPartitionTableEntry(null, bootSector, 0);
        assertFalse(pte.hasChildPartitionTable());
    }
View Full Code Here

    @Test
    public void testIsValid() {
        byte[] bootSector = getBootSector();
        LittleEndian.setInt8(bootSector, 450, 0x85);
        IBMPartitionTableEntry pte = new IBMPartitionTableEntry(null, bootSector, 0);
        assertTrue(pte.isValid());
    }
View Full Code Here

        assertTrue(pte.isValid());
    }

    @Test
    public void testIsNotValidEmptyBootSector() {
        IBMPartitionTableEntry pte = new IBMPartitionTableEntry(null, getBootSector(), 0);
        assertFalse(pte.isValid());
    }
View Full Code Here

        assertFalse(pte.isValid());
    }

    @Test
    public void testIsEmpty() {
        IBMPartitionTableEntry pte = new IBMPartitionTableEntry(null, getBootSector(), 0);
        assertTrue(pte.isEmpty());
    }
View Full Code Here

        //now we should have an filled vector in the pt
        final List<IBMPartitionTableEntry> extendedPartitions = pt.getExtendedPartitions();
        log.info("Have " + extendedPartitions.size() + " Extended partitions found");

        for (int iPart = 0; iPart < extendedPartitions.size(); iPart++) {
            IBMPartitionTableEntry pteExt = extendedPartitions.get(iPart);
            registerPartition(devMan, dev, pteExt, partIndex);

            if (iPart < (extendedPartitions.size() - 1)) {
                partIndex++;
            }
View Full Code Here

        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);
            bs.getPartition(1).setSystemIndicator(IBMPartitionTypes.PARTTYPE_EMPTY);
            bs.getPartition(2).setSystemIndicator(IBMPartitionTypes.PARTTYPE_EMPTY);
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.