bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: amiga partitioning support for parted


From: Sven Luther
Subject: Re: amiga partitioning support for parted
Date: Mon, 21 Jul 2003 21:04:23 +0200
User-agent: Mutt/1.5.4i

On Mon, Jul 21, 2003 at 09:24:51AM +1000, Andrew Clausen wrote:
> Hi Sven,
> 
> Sorry for the delay... I had a conference all last week.

Ok, so did i ...

> On Wed, Jul 16, 2003 at 01:50:14PM +0200, Sven Luther wrote:
> > I am currently at Debconf 3 in Oslo, working at adding support for amiga
> > partitioning scheme to libparted. I hope to have this finished before
> > the end of Debcamp.
> 
> Cool!

Indeed.

That said, i did not finish it, having lost a whole day trying to find
why free segfaulted, and finally noticing that i was stupidly allocating
a 256 byte block (size of the amiga partition table blocks) and later
reading whole 512 bytes, which naturally broke all manner of things.

BTW, as i understand it, parted is mostly 512 bytes only, while it is
possible to use blocks of any size on amiga partitions. Possibly there
are some people around using 1024 sized blocks.

> > BTW, current 1.6.5 debian parted package does not build with gcc 3.3, i
> > have a fixed patch which i will apply to the debian package, but i guess
> > you already have fixed this in CVS or something such. If not, i would
> > gladly send you this patch.
> 
> I suggest you grab 1.6.6-pre2.

Ok, i will do, altough i will also send the patch to the debian package
maintainer, until 1.6.6 is released that is.

> > Ok, and now my questions :
> > 
> > The amiga partitioning can be set at any place in the first 16 (512) blocks.
> > When creating a new part table, usuallyblock 0 is used, altough you
> > could use block 2 or later, and have both a PC partition table and a
> > amiga partition table on the same disk. Now, when i clobber the disk, I
> > should just remove the first found amiga partition id, and not remove it
> > on all 16 blocks ?
> 
> I think you should remove the ID from any block containing it.
> 
> After clobber() is called, no partition table should be detected
> by any program.

Ok.

> > Also, is there a way to telling the higher levels
> > that we are looking at a partition on block n, and not have to search
> > for it each time ?
> 
> Do you mean ped_disk_get_partition_by_sector() ?
> I don't really understand your question.
> 

The amiga partition table can be found on any of the 16 first sectors of
the disk. So, when doing a probe, i have to look at all the 16 first
blocks, and search for an amiga partition table. The ped_probe function
returns the partition type, but could also return the blcok number where
the partition was found, so i have not to search it again when doing a
read. But then, maybe it is cheap partition access, and not really all
that important to worry about.

> > If i understood right, alloc, free and duplicate only handle virtual
> > partition tables on the disk, and read/write read/write them to the
> > disk. Same goes for partition entries.
> 
> alloc/free/duplicate act on data structures.

Since i had no answers, i took the disk.c file as documentation, and
have managed to understand most of it now.

> ped_disk_commit_to_dev() is the only API entry-point that writes
> to disk (for partition table stuff).

Yep, and it calls amiga_write.

I was a bit confused at first, since the amiga_read/write not only
reads the partitions table, but also the entries for each partitions.
That said, it makes sense for the other partitioning schemes, but the
amiga partition is a block containing info on the disk, and 4 linked
lists of blocks containing partitions, bad block descriptors, and two
other lists needed for amigaos to embed the filesystem on the harddisk.

> alloc creates a data structure representing an empty partition table.
> free frees a PedDisk data structure.
> duplicate clones a data structure representing a partition table.
> (This is useful for implementing undo)

Yep.

Maybe if i will have time i will try to write all such stuff i
discovered in a nice howto or something.

BTW, parted is a GNU project, right, so i do have to assign the
copyright of my fixes to the FSF or something such ? And also do some
paper work with my employer (on whose time i write the stuff) ?

Friendly,

Sven Luther




reply via email to

[Prev in Thread] Current Thread [Next in Thread]