Skip to contentSkip to conversation

2.7 block ramblings (was Re: DMA for ide-scsi?)

DISCUSSION James Bottomley 9 participants 18 messages Sep 13, 2003 – Sep 21, 2003

lore
Share & tools
lore
#0 lore raw

Oh, and I'm pondering the best way to deliver out-of-bang ATA taskfiles and SCSI cdbs to a device. (for the uninitiated, this is lower level than block devices / cdrom devices / etc.)

... AF_BLOCK is not out of the question ;-)

Well, I think the main issue to doing this is one of layering. What SAM-3 did for SCSI was essentially give us a 3 layer stack which the kernel represents as the upper, the mid and the lower layers (Note, these layers are subdividable too).

For SCSI commands, queuecommand() is a natural handoff point from the mid to lower layer representing a pure scsi command with no transport dependent details.

For ATA, a task file does contain transport dependent knowledge, thus it should enter the stack at a slightly lower level (and a level which the current SCSI model doesn't even represent).

Thus, the two ways of approaching this would seem to be either to derive somehow a way of removing the transport dependence from the taskfile (a sort of Task CDB for ATA), or redo the driver model stack to subdivide the current low level drivers correctly. I think the latter will probably be more productive, particularly if the subdivision is made optional (and thus wouldn't affect most of the drivers currently in the tree). Even in SCSI, there are certain register based SCSI Parallel cards that would benefit from being driven at the same level as a task file.

James

#1 lore raw
Quoted 13 lines · James Bottomley

Oh, and I'm pondering the best way to deliver out-of-bang ATA taskfiles and SCSI cdbs to a device. (for the uninitiated, this is lower level than block devices / cdrom devices / etc.)

... AF_BLOCK is not out of the question ;-)

Well, I think the main issue to doing this is one of layering. What SAM-3 did for SCSI was essentially give us a 3 layer stack which the kernel represents as the upper, the mid and the lower layers (Note, these layers are subdividable too).

Quoted 7 lines

For SCSI commands, queuecommand() is a natural handoff point from the mid to lower layer representing a pure scsi command with no transport dependent details.

For ATA, a task file does contain transport dependent knowledge, thus it should enter the stack at a slightly lower level (and a level which the current SCSI model doesn't even represent).

This is a good point, and I admit I don't have a good response.

On one hand, the current kernel interface presented to userland is the same for ATA and SCSI: "an ioctl, which sends packet to device" So from the standpoint of the userland ABI, that rebuts layering to a certain extent. We even have ioctls in today's ATA layer to send SCSI CDBs to ATA devices! ;-)

So from that angle, it all looks like a packet to me.
Or struct request, shall I say. or skb. after a while they are all the same to me...

Quoted 9 lines

Thus, the two ways of approaching this would seem to be either to derive somehow a way of removing the transport dependence from the taskfile (a sort of Task CDB for ATA), or redo the driver model stack to subdivide the current low level drivers correctly. I think the latter will probably be more productive, particularly if the subdivision is made optional (and thus wouldn't affect most of the drivers currently in the tree). Even in SCSI, there are certain register based SCSI Parallel cards that would benefit from being driven at the same level as a task file.

"the latter" is what I'm shooting for, with /dev/disk. Or maybe a better moniker is storage API. I think that parallels a theme I am pursuing in 2.7:

Make the low-level driver interface for ATA devices, RAID devices like cciss, etc. look strikingly similar to the SCSI low-level driver interface. At that point we call it the "storage LLD interface". This would IMO encompass the low-level driver subdivision you describe.

Ideally an ata/scsi/raid driver shouldn't be doing much more than h/w queue processing, and some hooks for unusual events like power management or h/w-specific device enumeration.

Overall I'd like to get "low level drivers" at pretty much the same level. ATA and SCSI drivers would be fairly small, with a lot of their functionality handled by helper functions. RAID drivers would be largers.

Another thorny tangent to throw out there:

IMO, we need to move users from a [probe-]order-based device and bus enumeration to some system based on unique ids. I'm of the opinion that _both_ block devices and filesystems need some sort of GUID. Luckily, a lot of blkdevs/fs's are already there.

If you look at current usage out there, order isn't _terribly_ important given today's tools (such as LABEL=). More important IMO is figuring out which spindle is your boot disk, and which is your root disk. Red Hat handles root disks by doing LABEL= from initrd. But discovering the boot disk is still largely an unsolved problem AFAIK...

Jeff

#2 lore raw
Quoted 10 lines · Jeff Garzik

IMO, we need to move users from a [probe-]order-based device and bus enumeration to some system based on unique ids. I'm of the opinion that _both_ block devices and filesystems need some sort of GUID. Luckily, a lot of blkdevs/fs's are already there.

If you look at current usage out there, order isn't _terribly_ important given today's tools (such as LABEL=). More important IMO is figuring out which spindle is your boot disk, and which is your root disk. Red Hat handles root disks by doing LABEL= from initrd. But discovering the boot disk is still largely an unsolved problem AFAIK...

LABEL= is so broken that I immediately remove it from all my redhat systems. It is not unique at all. As soon as you plug another system disk into your system at boot time all hell breaks loose. At least it could have a random number in it or something.

If you need to know your bootdisk (why?) why not just get the bootloader to tell you?

Justin

#3 lore raw
Quoted 4 lines · Justin Cormack

LABEL= is so broken that I immediately remove it from all my redhat systems. It is not unique at all. As soon as you plug another system disk into your system at boot time all hell breaks loose. At least it could have a random number in it or something.

You can use UUID's for labels too if you prefer. I normally write a host string into my labels. What I actually want is mount by label to develop an rpc service so I can mount by label and if the disk is in another box NFS it 8)

Quoted 2 lines

If you need to know your bootdisk (why?) why not just get the bootloader to tell you?

The bootloader doesn't know. It has a bios concept of the boot device which is really hard if at all possible to translate without things like EDD.

#4 lore raw
Quoted 3 lines · Alan Cox

You can use UUID's for labels too if you prefer. I normally write a host string into my labels. What I actually want is mount by label to develop an rpc service so I can mount by label and if the disk is in
another box NFS it 8)

Sounds yummy! When can we start testing it? <G>

#5 lore raw
In reply to Justin Cormack
Quoted 4 lines · Justin Cormack

LABEL= is so broken that I immediately remove it from all my redhat systems. It is not unique at all. As soon as you plug another system disk into your system at boot time all hell breaks loose. At least it could have a random number in it or something.

I do not understand your complaint.
It is you who assigns the label. You can choose whatever label you fancy. Include any random strings you like.

Quoted 2 lines

If you need to know your bootdisk (why?) why not just get the bootloader to tell you?

I am not quite sure why anybody would like to know what the bootdisk was. The rootdisk, yes, that we need. But the bootdisk?
Finding it is nontrivial in general. Letting the bootloader tell us is also nontrivial.

#6 lore raw
Quoted 8 lines · Andries Brouwer
Quoted 2 lines · Justin Cormack

If you need to know your bootdisk (why?) why not just get the bootloader to tell you?

I am not quite sure why anybody would like to know what the bootdisk was. The rootdisk, yes, that we need. But the bootdisk?
Finding it is nontrivial in general. Letting the bootloader tell us is also nontrivial.

The bootloader or mkinitrd typically tells the kernel what the root disk is, so that's not a big deal. The boot disk, OTOH, is tough. Right now, we just assume the sysadmin knows what's he's doing, when he installs lilo or grub on a disk. You care about the boot disk when installing lilo... maybe there are similar situations too which I do not recall. As Alan said, besides EDD (only on newer boxes) there's really nothing.

Jeff

#7 lore raw
In reply to Andries Brouwer
Quoted 1 line · Andries Brouwer

I do not understand your complaint.

I sort of do - several vendor installers use fixed labels so two installs on the same box get very confused. I've seen novices tie themselves in knots with it before. That isn't a problem with LABEL=, its an implementation issue with the vendors install tools, and Red Hat certainly is one of the parties that made this mistake.

Alan

#8 lore raw
Quoted 9 lines · Alan Cox
Quoted 1 line · Andries Brouwer

I do not understand your complaint.

I sort of do - several vendor installers use fixed labels so two installs on the same box get very confused. I've seen novices tie themselves in knots with it before. That isn't a problem with LABEL=, its an implementation issue with the vendors install tools, and Red Hat certainly is one of the parties that made this mistake.

LABEL= is the wrong solution to the right problem, IMHO. It only seems to make sense if you are a distributor trying to make a one size mostly fits all. If you tinker with your system it only seems to get in the way.

It seems to me that if you are in the position of tinkering, and installing an OS you ought to have an understanding of root and boot disks, and what is in your system. If you don't understand things well enough to specify the proper boot disk and root disk you shouldn't be tinkering and it won't matter how each is specified.

#9 lore raw
Quoted 5 lines · Thomas Molina

It seems to me that if you are in the position of tinkering, and installing an OS you ought to have an understanding of root and boot disks, and what is in your system. If you don't understand things well enough to specify the proper boot disk and root disk you shouldn't be tinkering and it won't matter how each is specified.

Your root disk can change for all sorts of non Linux reasons ranging from windows config changes to hotplug devices. For example if your root is /dev/sdc and /dev/sdb fails you'll want LABEL=.

#10 lore raw
In reply to Justin Cormack
Quoted 3 lines · Justin Cormack

LABEL= is so broken that I immediately remove it from all my redhat systems. It is not unique at all. As soon as you plug another system disk into your system at boot time all hell breaks loose.

That's your fault as a sysadmin ;-)

Quoted 2 lines

At least it
could have a random number in it or something.

You can use UUIDs today! :)

Quoted 2 lines

If you need to know your bootdisk (why?) why not just get the bootloader to tell you?

The only time one cares what the boot disk is, is when _installing_ the boot loader...

Jeff

#11 lore raw
In reply to Jeff Garzik
Quoted 10 lines · Jeff Garzik

IMO, we need to move users from a [probe-]order-based device and bus enumeration to some system based on unique ids. I'm of the opinion that _both_ block devices and filesystems need some sort of GUID. Luckily, a lot of blkdevs/fs's are already there.

If you look at current usage out there, order isn't _terribly_ important given today's tools (such as LABEL=). More important IMO is figuring out which spindle is your boot disk, and which is your root disk. Red Hat handles root disks by doing LABEL= from initrd. But discovering the boot disk is still largely an unsolved problem AFAIK...

Such things are infinitely difficult.
Moreover, great care is needed - one has to define precisely what it is this GUID is supposed to be an ID of.

(Is it the ZIP drive? Or is it the ZIP disk?
The 2.4 USB code is broken because it remembers a GUID and thinks that identical GUID implies identical disk.)

I have a handful of CF/SM cardreaders.
Some of them have no form of ID. Others have an ID.

Then one can insert a CF or SM card into the reader. Some of these cards have an ID. Some have not.

On the card one usually finds a FAT filesystem.
There may be a label. Or there may not be.

This describes a 3-level situation.
I have also 4-level situations, where the reader is filled with one of four auxiliary adapters (each with an own ID) and the adapter then get a CF/SM/SD/... card.

So, yes, we love IDs. And we can always provide them ourselves as label or UUID or so in the filesystem.

But finding an unformatted unlabeled disk is difficult.

Andries

#12 lore raw
Quoted 3 lines · Andries Brouwer

Such things are infinitely difficult.
Moreover, great care is needed - one has to define precisely what it is this GUID is supposed to be an ID of.

Absolutely agreed.

Quoted 10 lines

(Is it the ZIP drive? Or is it the ZIP disk?
The 2.4 USB code is broken because it remembers a GUID and thinks that identical GUID implies identical disk.)

I have a handful of CF/SM cardreaders.
Some of them have no form of ID. Others have an ID.

Then one can insert a CF or SM card into the reader. Some of these cards have an ID. Some have not.

Quoted 7 lines

On the card one usually finds a FAT filesystem.
There may be a label. Or there may not be.

This describes a 3-level situation.
I have also 4-level situations, where the reader is filled with one of four auxiliary adapters (each with an own ID) and the adapter then get a CF/SM/SD/... card.

Using an adapter's ID would be a mistake. You want to use the media's unique ID, assuming it has one.

Quoted 2 lines

So, yes, we love IDs. And we can always provide them ourselves as label or UUID or so in the filesystem.

Not all filesystems have them :)

Further, some sites may prefer block-level GUIDs to fs-level ones. Sites using raw partitions instead of filesystems, for one.

We must leave this up to the sysadmin -- within the bounds of technology of course. The sysadmin is out of luck if they purchase a media that does not support some sort of labelling or UUID.

Quoted 1 line

But finding an unformatted unlabeled disk is difficult.

You sound like you're agreeing with me ;-)

Jeff

#13 lore raw
Quoted 2 lines

Further, some sites may prefer block-level GUIDs to fs-level ones. Sites using raw partitions instead of filesystems, for one.

The EFI GUID Partition scheme (aka GPT aka CONFIG_EFI_PARTITION) stores a GUID in the disk label to define the whole disk, plus another per-partition GUID and per-partition label. So even if the file system doesn't have one, if you're using GPT, one *could* use those. I haven't hacked up mount to search for those though. If there's enough interest, I'll do so. Recall GPT is currently only used on ia64, though the code works fine on other arches including x86, and it's been decided (on l-k at least) that GPT will be the default disk label format for systems running 2.6.x kernels with disks >2TB, as the msdos label can't hold it.

Quoted 5 lines

The boot disk, OTOH, is tough. Right now, we just assume the sysadmin knows what's he's doing, when he installs lilo or grub on a disk. You care about the boot disk when installing lilo... maybe there are similar situations too which I do not recall. As Alan said, besides EDD (only on newer boxes) there's really nothing.

EDD BIOSs are coming, slowly... 2 work today correctly, several more are "close but no cigar", it's all the rest that worry me.

There's one more trick that's being used successfully, which I would like to add to the EDD code. That's "let BIOS help you out before installing". i.e. you boot into a FreeDOS environment, write a system-unique disk signature to the boot disk (int13 device 80h) "BOOT" or something - we've got 4 bytes available in the msdos label for it, then reboot and let Linux go grab the signature, store it, and like edd.o does, export it to userspace. Now from userspace one can see what Linux-named-disk has the signature you're looking for, and voila, you now solved it w/o needing EDD BIOSs. But it requires a non-Linux boot step somewhere in the install process.

Thanks,
Matt

Signature · 4 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
#14 lore raw
Quoted 3 lines · Matt Domsch

system-unique disk signature to the boot disk (int13 device 80h) "BOOT" or something - we've got 4 bytes available in the msdos label for it

int 13 is still available during the 16bit boot up phase of the kernel. It does strike me as playing with fire, but an alternative approach might work. Read the first 4K off the boot disk, stuff it somewhere temporary and then in 32bit compare it with the disk starts..

#15 lore raw
Quoted 9 lines · Alan Cox
Quoted 3 lines · Matt Domsch

system-unique disk signature to the boot disk (int13 device 80h) "BOOT" or something - we've got 4 bytes available in the msdos label for it

int 13 is still available during the 16bit boot up phase of the kernel. It does strike me as playing with fire, but an alternative approach might work. Read the first 4K off the boot disk, stuff it somewhere temporary and then in 32bit compare it with the disk starts..

This is essentially what we are proposing, only instead of reading 4K, read 1 sector and stash the 4-byte disk signature where we can get at it later, and export it via edd.o for comparison later. This much is easy, as the empty_zero_page has 512 bytes free for reading the sector in setup.S, and 4 bytes we can use to stash the signature until setup.c runs where we can copy it somewhere safe. Then export it via edd.o through /proc (2.4) or /sys (2.6).

The thing that writes the signature to disk can be anything that can issue int13 calls. Right now we do it in a FreeDOS app, but a special loadlin/syslinux/isolinux used for OS installation may be simpler and not require a FreeDOS environment be run ever.

-Matt

Signature · 4 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
#16 lore raw
In reply to Alan Cox
Quoted 9 lines · Alan Cox
Quoted 3 lines · Matt Domsch

system-unique disk signature to the boot disk (int13 device 80h) "BOOT" or something - we've got 4 bytes available in the msdos label for it

int 13 is still available during the 16bit boot up phase of the kernel. It does strike me as playing with fire, but an alternative approach might work. Read the first 4K off the boot disk, stuff it somewhere temporary and then in 32bit compare it with the disk starts..

This is what I had in mind.
linux-2.4.23-pre4
+ http://domsch.com/linux/edd30/linux/linux-2.4.23-pre4-edd-20030914.patch.gz
+ patch below

 Documentation/i386/zero-page.txt |    4 +++-
 arch/i386/boot/setup.S           |   21 +++++++++++++++++++++
 arch/i386/kernel/edd.c           |   27 +++++++++++++++++++++++++--
 arch/i386/kernel/i386_ksyms.c    |    1 +
 arch/i386/kernel/setup.c         |    3 +++
 include/asm-i386/edd.h           |    7 ++++++-
 6 files changed, 59 insertions(+), 4 deletions(-)

This puts the 4-byte disk signature into
/proc/bios/edd/int13_dev80/mbr_signature

Thanks,
Matt

Signature · 197 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com


diff -Nru a/Documentation/i386/zero-page.txt b/Documentation/i386/zero-page.txt
--- a/Documentation/i386/zero-page.txt	Mon Sep 15 17:00:58 2003
+++ b/Documentation/i386/zero-page.txt	Mon Sep 15 17:00:58 2003
@@ -66,8 +66,10 @@
 0x21c	unsigned long	INITRD_SIZE, size in bytes of ramdisk image
 0x220	4 bytes		(setup.S)
 0x224	unsigned short	setup.S heap end pointer
+0x228	4 bytes		DISK80_SIG_BUFFER (setup.S)
 0x2d0 - 0x600		E820MAP
-0x600 - 0x7D4		EDDBUF (setup.S)
+0x600 - 0x800		EDDBUF (setup.S) for disk signature read sector
+0x600 - 0x7d4		EDDBUF (setup.S)
 
 0x800	string, 2K max	COMMAND_LINE, the kernel commandline as
 			copied using CL_OFFSET.
diff -Nru a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
--- a/arch/i386/boot/setup.S	Mon Sep 15 17:00:58 2003
+++ b/arch/i386/boot/setup.S	Mon Sep 15 17:00:58 2003
@@ -49,6 +49,8 @@
  * by Matt Domsch <[email protected]> October 2002
  * conformant to T13 Committee www.t13.org
  *   projects 1572D, 1484D, 1386D, 1226DT
+ * disk signature read by Matt Domsch <[email protected]>
+ *	and Andrew Wilks <[email protected]> September 2003
  */
 
 #include <linux/config.h>
@@ -549,6 +551,25 @@
 #endif
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
+# Read the first sector of device 80h and store the 4-byte signature
+	movl	$0xFFFFFFFF, %eax
+	movl	%eax, (DISK80_SIG_BUFFER)	# assume failure
+	movb	$READ_SECTORS, %ah
+	movb	$1, %al				# read 1 sector
+	movb	$0x80, %dl			# from device 80
+	movb	$0, %dh				# at head 0
+	movw	$1, %cx				# cylinder 0, sector 0
+	pushw	%es
+	pushw	%ds
+	popw	%es
+	movw	$EDDBUF, %bx
+	int	$0x13
+	jc	disk_sig_done
+	movl	(EDDBUF+MBR_SIG_OFFSET), %eax
+	movl	%eax, (DISK80_SIG_BUFFER)	# store success
+disk_sig_done:
+	popw	%es
+
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
 #    int 13h ah=41h "Check Extensions Present"
diff -Nru a/arch/i386/kernel/edd.c b/arch/i386/kernel/edd.c
--- a/arch/i386/kernel/edd.c	Mon Sep 15 17:00:58 2003
+++ b/arch/i386/kernel/edd.c	Mon Sep 15 17:00:58 2003
@@ -1,7 +1,8 @@
 /*
  * linux/arch/i386/kernel/edd.c
- *  Copyright (C) 2002 Dell Computer Corporation
+ *  Copyright (C) 2002, 2003 Dell, Inc.
  *  by Matt Domsch <[email protected]>
+ *  disk80 signature by Matt Domsch, Andrew Wilks, and Sandeep K. Shandilya
  *
  * BIOS Enhanced Disk Drive Services (EDD)
  * conformant to T13 Committee www.t13.org
@@ -27,7 +28,6 @@
 /*
  * TODO:
  * - move edd.[ch] to better locations if/when one is decided
- * - keep current with 2.5 EDD code changes
  */
 
 #include <linux/module.h>
@@ -333,6 +333,18 @@
 }
 
 static int
+edd_show_disk80_sig(char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+	char *p = page;
+	if ( !page || off) {
+		return proc_calc_metrics(page, start, off, count, eof, 0);
+	}
+
+	p += snprintf(p, left, "0x%08x\n", edd_disk80_sig);
+	return proc_calc_metrics(page, start, off, count, eof, (p - page));
+}
+
+static int
 edd_show_extensions(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	struct edd_info *info = data;
@@ -491,6 +503,15 @@
 	return 1;
 }
 
+static int
+edd_has_disk80_sig(struct edd_device *edev)
+{
+	struct edd_info *info = edd_dev_get_info(edev);
+	if (!edev || !info)
+		return 0;
+	return info->device == 0x80;
+}
+
 static EDD_DEVICE_ATTR(raw_data, edd_show_raw_data, NULL);
 static EDD_DEVICE_ATTR(version, edd_show_version, NULL);
 static EDD_DEVICE_ATTR(extensions, edd_show_extensions, NULL);
@@ -505,6 +526,7 @@
 		       edd_has_default_sectors_per_track);
 static EDD_DEVICE_ATTR(interface, edd_show_interface,edd_has_edd30);
 static EDD_DEVICE_ATTR(host_bus, edd_show_host_bus, edd_has_edd30);
+static EDD_DEVICE_ATTR(mbr_signature, edd_show_disk80_sig, edd_has_disk80_sig);
 
 static struct edd_attribute *def_attrs[] = {
 	&edd_attr_raw_data,
@@ -517,6 +539,7 @@
 	&edd_attr_default_sectors_per_track,
 	&edd_attr_interface,
 	&edd_attr_host_bus,
+	&edd_attr_mbr_signature,
 	NULL,
 };
 
diff -Nru a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
--- a/arch/i386/kernel/i386_ksyms.c	Mon Sep 15 17:00:58 2003
+++ b/arch/i386/kernel/i386_ksyms.c	Mon Sep 15 17:00:58 2003
@@ -185,4 +185,5 @@
 #ifdef CONFIG_EDD_MODULE
 EXPORT_SYMBOL(edd);
 EXPORT_SYMBOL(eddnr);
+EXPORT_SYMBOL(edd_disk80_sig);
 #endif
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c	Mon Sep 15 17:00:58 2003
+++ b/arch/i386/kernel/setup.c	Mon Sep 15 17:00:58 2003
@@ -212,6 +212,7 @@
 #define KERNEL_START (*(unsigned long *) (PARAM+0x214))
 #define INITRD_START (*(unsigned long *) (PARAM+0x218))
 #define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
+#define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER))
 #define EDD_NR     (*(unsigned char *) (PARAM+EDDNR))
 #define EDD_BUF     ((struct edd_info *) (PARAM+EDDBUF))
 #define COMMAND_LINE ((char *) (PARAM+2048))
@@ -721,6 +722,7 @@
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
 unsigned char eddnr;
 struct edd_info edd[EDDMAXNR];
+unsigned int edd_disk80_sig;
 /**
  * copy_edd() - Copy the BIOS EDD information
  *              from empty_zero_page into a safe place.
@@ -730,6 +732,7 @@
 {
      eddnr = EDD_NR;
      memcpy(edd, EDD_BUF, sizeof(edd));
+     edd_disk80_sig = DISK80_SIGNATURE;
 }
 #else
 static inline void copy_edd(void) {}
diff -Nru a/include/asm-i386/edd.h b/include/asm-i386/edd.h
--- a/include/asm-i386/edd.h	Mon Sep 15 17:00:58 2003
+++ b/include/asm-i386/edd.h	Mon Sep 15 17:00:58 2003
@@ -1,6 +1,6 @@
 /*
  * linux/include/asm-i386/edd.h
- *  Copyright (C) 2002 Dell Computer Corporation
+ *  Copyright (C) 2002, 2003 Dell, Inc.
  *  by Matt Domsch <[email protected]>
  *
  * structures and definitions for the int 13h, ax={41,48}h
@@ -41,6 +41,10 @@
 #define EDDMAGIC1 0x55AA
 #define EDDMAGIC2 0xAA55
 
+#define READ_SECTORS 0x02
+#define MBR_SIG_OFFSET 0x1B8
+#define DISK80_SIG_BUFFER 0x228
+
 #ifndef __ASSEMBLY__
 
 #define EDD_EXT_FIXED_DISK_ACCESS           (1 << 0)
@@ -167,6 +171,7 @@
 
 extern struct edd_info edd[EDDMAXNR];
 extern unsigned char eddnr;
+extern unsigned int edd_disk80_sig;
 #endif				/*!__ASSEMBLY__ */
 
 #endif				/* _ASM_I386_EDD_H */
#17 lore raw
In reply to Matt Domsch

Matt:

This would require the generic mapping of disc labels away from the current hdX/sdX to hdN where 0 =< N < 5. This issue will be mapping EDDS which you are working on, and I tip my hat for what value it has left.

I will chat offline more in details to see where you are going and if I can offer help from the T13 side of life.

Cheers,

Andre Hedrick
LAD Storage Consulting Group

Quoted 48 lines · Matt Domsch
Quoted 2 lines

Further, some sites may prefer block-level GUIDs to fs-level ones. Sites using raw partitions instead of filesystems, for one.

The EFI GUID Partition scheme (aka GPT aka CONFIG_EFI_PARTITION) stores a GUID in the disk label to define the whole disk, plus another per-partition GUID and per-partition label. So even if the file system doesn't have one, if you're using GPT, one *could* use those. I haven't hacked up mount to search for those though. If there's enough interest, I'll do so. Recall GPT is currently only used on ia64, though the code works fine on other arches including x86, and it's been decided (on l-k at least) that GPT will be the default disk label format for systems running 2.6.x kernels with disks >2TB, as the msdos label can't hold it.

Quoted 5 lines

The boot disk, OTOH, is tough. Right now, we just assume the sysadmin knows what's he's doing, when he installs lilo or grub on a disk. You care about the boot disk when installing lilo... maybe there are similar situations too which I do not recall. As Alan said, besides EDD (only on newer boxes) there's really nothing.

EDD BIOSs are coming, slowly... 2 work today correctly, several more are "close but no cigar", it's all the rest that worry me.

There's one more trick that's being used successfully, which I would like to add to the EDD code. That's "let BIOS help you out before installing". i.e. you boot into a FreeDOS environment, write a system-unique disk signature to the boot disk (int13 device 80h) "BOOT" or something - we've got 4 bytes available in the msdos label for it, then reboot and let Linux go grab the signature, store it, and like edd.o does, export it to userspace. Now from userspace one can see what Linux-named-disk has the signature you're looking for, and voila, you now solved it w/o needing EDD BIOSs. But it requires a non-Linux boot step somewhere in the install process.

Thanks,
Matt

Signature · 9 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/