Subject: Re: LABELSECTOR, LABELOFFSET:disklabel in different architectures
To: anand lalgondar <anandlalgondar@hotmail.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 11/07/2003 21:15:59
On Wed, Nov 05, 2003 at 11:03:54AM +0530, anand lalgondar wrote:
> Hello,
> 
> Why do different architectures have different LABELSECTOR and LABELOFFSET 
> values.
> For example in i386 the values are:
> --------------------------------------------------------------------------------------------------------------------
> #define	LABELSECTOR	1	/* sector containing label */
> #define	LABELOFFSET	0	/* offset of label in sector */
> #define	MAXPARTITIONS	16	/* number of partitions */
> #define	OLDMAXPARTITIONS 	8	/* number of partitions 
> before 1.6 */
> #define	RAW_PART	3	/* raw partition: XX?d (XXX) */
> --------------------------------------------------------------------------------------------------------------------
> 
> where as in evbmips the values are:
> --------------------------------------------------------------------------------------------------------------------
> #define	LABELSECTOR	0	/* sector containing label */
> #define	LABELOFFSET	64	/* offset of label in sector */
> #define	MAXPARTITIONS	16	/* number of partitions */
> #define	RAW_PART	2	/* raw partition: xx?c */
> --------------------------------------------------------------------------------------------------------------------
> 
> Is it because different arhitectures have a standard to store the partition 
> information at some standard location. Or is there any other reason.

Yes, this is the reason. Some architectures have fixed on-disk
layout (sun, or next68k for example, to talk about things I looked at
recently) read by firmware at boot time.

> [...]
> The same thing should also be provided to mbrlabel since it is used to 
> update the in-core disklabel.

Yes, we should have a userland tool knowing about the different disk
layout, similar to mbrlabel. Unfortunably we don't have anything like that yet.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 23 ans d'experience feront toujours la difference
--