Subject: Re: EADFS and Linux, a temporary solution...

From: Sergio Monesi <[email-masked]>
Date: Mon, 08 Dec 1997 19:46:43 +0100

In message <Pine.SGI.3.91.971208100111.18166B-100000@hebe>
          Phil Norman <[email-masked]> wrote:

> > I am now trying to set up a DOS partition in order to swap files easily
> > between Linux and RISC OS. How do I configure the Linux partition table?
> > There is no 'fdisk' in my installation (admittely I haven't installed all
> > the RPMs nor I have the very latest versions) but the version supplied
> > with the RedHat installer disc doesn't seem to be able to write to the
> > disc. !PartMan can only create Linux native/swap partitions AFAIK.
> You don't need a DOS partition to swap files between linux and RiscOS.  
> Linux can mount (read-only) ADFS partitions, and ExeterFS (available from 
> my web site, URL in the sig) is a RiscOS program which can read linux 
> ext2fs partitions.  Unfortunately, this currently means that you have to 
> boot into the OS you want to copy things into, but it means you don't 
> have to resort to smelly DOS ;-)

I have ExeterFS but I never actually tried it. My main concern is that I
cannot generally access the Linux partition because while I am working with
RISC OS I am using the EADFS bootblock while from Linux I cannot access all
the ADFS partitions (for the same reason). Instead, the DOS partition is
shared between the two OSes so I can transfer the files easily (eg. using a
parallel port Zip file that I can only access from Linux) or simply store
them there avoiding to waste twice the space.

> > I'm ready to hack the partition table manually but I don't know the
> > 'magic number' that marks a DOS partition (Linux swap seems to be
> > 0xDEAFAB1E and Linux native 0xDEAFA1DE), can anybody help me? Is there a
> > checksum in the partition table?
> Yep, those magic numbers are correct.  AFAICR, the partition table is 
> stored as an array of 3-word-long entries, each with the following format:
> +0	partition magic number (as you mentioned above)
> +4	offset from first sector of partition table to first sector of partition
> +8	length, in sectors, of partition
> ....and if the 'magic number' is zero, that means there are no more 
> partitions.  

Yes, a quick look at the ExeterFS sources has been very useful for me to
understand that :-)

Now, even if I still don't know the magic number of a DOS partition, I fixed
my problem: I created another Linux Native partition (using PartMan) that
points to the DOS partition (not at the beginning of it, though, because it
seems to contain a DOS partition table or something like that), then Linux
recognises it during the boot and I can mount it using 'mount -t msdos
/dev/hda7 /dosswap' (or writing a line in /etc/fstab).

> Linux can tell the difference between partition tables  created by PartMan
> and those created by DOS (if it sees a partition  table, when it prints the
> info on each drive it can see it prints a [DOS]  or [Linux] depending on
> which partition type it is).  

It also seems to print [RISCiX] if it finds a *RiscBSD* partition table (on
my other disc)! Unfortunately it doesn't seem to recognise it, I could share
the swap space between the two OSes...

> Actually, here I  have a few questions of my own.
> 1: Is the [Linux] partition table one which is generic to all versions of 
> Linux, or is it one invented by RK?

I tried to use the Linux 'fdisk' on a PC (any idea about why it is missing
from the ARMLinux distribution?) in order to understand the DOS magic number
but it seemed to be completely different from the ARMLinux one... probably
because it was actually a DOS partition table, though...

Cheers,
Sergio

-- 
Sergio Monesi...         \ . . . \  Cracking RC5-64 with a StrongARM RiscPC
mailto:[email-masked]     \ . . . \  http://rc5.distributed.net/
http://bounce.to/sergio/   \ . . . \  Join the Wild Wereboar Team (#1308)!

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: <[email-masked]>
Date: Tue, 9 Dec 1997 20:53:25 +0000 (GMT)

> Linux, or is it one invented by RK?

No, it is a special for native standard internal Filecore disks.  Each drive
manufacturer has a totally different scheme of how to handle partitions on
their system, and as such, ARM Linux tries to use the same method that the
manufacturer uses, hence the partition table is totally different on each
manufacturers device.  Believe it! :(

It means that you can't take (for instance) and ICS IDEFS formatted IDE drive
and put it on the RapIDE interface, nor can you take a PowerTec formatted
SCSI drive and connect it to a Cumana SCSI card - if you do, only the first
partition will be available.  At least Linux will identify the partitioning
scheme used on the drive, rather than associate it with the interface! ;)

> 2: What's the format of the [DOS] partition table?

It is a standard DOS partition table.  I'll have to say, read the source,
Luke. ;)
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King        [email-masked]        --- ---
  | | | |    http://www.arm.uk.linux.org/~rmk/home.html      /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |