* Booting from USB floppy?
@ 2001-08-12 3:12 Chris Hanson
2001-08-12 5:19 ` H. Peter Anvin
2001-08-12 5:29 ` Matthew Dharm
0 siblings, 2 replies; 5+ messages in thread
From: Chris Hanson @ 2001-08-12 3:12 UTC (permalink / raw)
To: linux-kernel
I have been trying to build Debian 2.2 boot/root floppies for the HP
OmniBook 500 laptop, which (in some configurations) has only a USB
floppy drive. I've been unable to get the kernel to load the root
floppy. These tests were done using Linux 2.4.6.
At this point, I think this isn't possible without some real work in
the kernel. I'd like to get some feedback about whether this is a
correct deduction. To that end, here is my analysis.
1. The function mount_root() in "fs/super.c" specially detects floppy
devices and handles them differently than other devices that might
be specified by the "root=" parameter, such as "root=/dev/sda" in
this case. So handling a floppy drive that appears to be a SCSI
floppy looks like it can't be done without patching that code.
2. If that is worked around, there is a further problem: the USB
storage driver sets up the SCSI translator asynchronously. Prior
to this, the device "/dev/sda" doesn't exist, which means there's a
race condition between the USB-SCSI initialization and the boot
process accessing the root device. I discovered this by specifying
"root=/dev/sda", and seeing that the kernel didn't initialize the
USB floppy device before it tried to open "/dev/sda", and failed
with a "no such device" error. So fixing this would also requiring
synchronizing the race -- but it's not clear how you'd figure out
that synchronization would even be needed here.
Does this seem like a reasonably correct analysis of the situation?
Is it easier than I think? Is anyone else working on booting from USB
floppies?
Please CC me to any replies, since I don't read this list.
TIA,
Chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Booting from USB floppy?
2001-08-12 3:12 Booting from USB floppy? Chris Hanson
@ 2001-08-12 5:19 ` H. Peter Anvin
2001-08-12 5:29 ` Matthew Dharm
1 sibling, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2001-08-12 5:19 UTC (permalink / raw)
To: linux-kernel
Followup to: <E15VlgK-0005GO-00@trixia.ai.mit.edu>
By author: Chris Hanson <cph@zurich.ai.mit.edu>
In newsgroup: linux.dev.kernel
>
> I have been trying to build Debian 2.2 boot/root floppies for the HP
> OmniBook 500 laptop, which (in some configurations) has only a USB
> floppy drive. I've been unable to get the kernel to load the root
> floppy. These tests were done using Linux 2.4.6.
>
> At this point, I think this isn't possible without some real work in
> the kernel. I'd like to get some feedback about whether this is a
> correct deduction. To that end, here is my analysis.
>
Basically, this is yet another reason why THE FLOPPY DRIVE MAGIC
STUFF IN THE KERNEL IS OBSOLETE AND BROKEN. There is absolutely no
sane reason to keep that crap around; the only sane way is to have an
initrd or similar thing (like viro's initramfs) set up a ramfs
initialized from whatever; the floppy stuff in the kernel should just
be nuked.
-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt <amsp@zytor.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Booting from USB floppy?
2001-08-12 3:12 Booting from USB floppy? Chris Hanson
2001-08-12 5:19 ` H. Peter Anvin
@ 2001-08-12 5:29 ` Matthew Dharm
2001-08-17 3:30 ` Chris Hanson
1 sibling, 1 reply; 5+ messages in thread
From: Matthew Dharm @ 2001-08-12 5:29 UTC (permalink / raw)
To: Chris Hanson; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2576 bytes --]
Some people have reported limited success by placing a multi-second delay
just before the root fs is mounted, to give the USB system time to identify
and properly attach the scsi devices.
Matt
On Sat, Aug 11, 2001 at 11:12:52PM -0400, Chris Hanson wrote:
> I have been trying to build Debian 2.2 boot/root floppies for the HP
> OmniBook 500 laptop, which (in some configurations) has only a USB
> floppy drive. I've been unable to get the kernel to load the root
> floppy. These tests were done using Linux 2.4.6.
>
> At this point, I think this isn't possible without some real work in
> the kernel. I'd like to get some feedback about whether this is a
> correct deduction. To that end, here is my analysis.
>
> 1. The function mount_root() in "fs/super.c" specially detects floppy
> devices and handles them differently than other devices that might
> be specified by the "root=" parameter, such as "root=/dev/sda" in
> this case. So handling a floppy drive that appears to be a SCSI
> floppy looks like it can't be done without patching that code.
>
> 2. If that is worked around, there is a further problem: the USB
> storage driver sets up the SCSI translator asynchronously. Prior
> to this, the device "/dev/sda" doesn't exist, which means there's a
> race condition between the USB-SCSI initialization and the boot
> process accessing the root device. I discovered this by specifying
> "root=/dev/sda", and seeing that the kernel didn't initialize the
> USB floppy device before it tried to open "/dev/sda", and failed
> with a "no such device" error. So fixing this would also requiring
> synchronizing the race -- but it's not clear how you'd figure out
> that synchronization would even be needed here.
>
> Does this seem like a reasonably correct analysis of the situation?
> Is it easier than I think? Is anyone else working on booting from USB
> floppies?
>
> Please CC me to any replies, since I don't read this list.
>
> TIA,
> Chris
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver
It's not that hard. No matter what the problem is, tell the customer
to reinstall Windows.
-- Nurse
User Friendly, 3/22/1998
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Booting from USB floppy?
@ 2001-08-15 2:50 John Sheahan
0 siblings, 0 replies; 5+ messages in thread
From: John Sheahan @ 2001-08-15 2:50 UTC (permalink / raw)
To: linux-kernel
> I have been trying to build Debian 2.2 boot/root floppies for the HP
> OmniBook 500 laptop, which (in some configurations) has only a USB
> floppy drive. I've been unable to get the kernel to load the root
> floppy. These tests were done using Linux 2.4.6.
its possible to do a redhat install with roswell on a USB floppy
bootdisk then via ftp using a usb NIC on a sony vaio pcg c1vg.
http://www.reptechnic.com.au/kickstart.html
john
^ permalink raw reply [flat|nested] 5+ messages in thread
* Booting from USB floppy?
2001-08-12 5:29 ` Matthew Dharm
@ 2001-08-17 3:30 ` Chris Hanson
0 siblings, 0 replies; 5+ messages in thread
From: Chris Hanson @ 2001-08-17 3:30 UTC (permalink / raw)
To: mdharm-kernel; +Cc: linux-kernel
Date: Sat, 11 Aug 2001 22:29:36 -0700
From: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
Some people have reported limited success by placing a multi-second delay
just before the root fs is mounted, to give the USB system time to identify
and properly attach the scsi devices.
Thanks for the information.
I've made some small changes that seem to work OK. I've attached them
to this message, not to be submitted for inclusion in the kernel, but
just to have a public record of something that works, should someone
else be interested in this problem.
Chris
----------------------------------------------------------------------
diff -ruN linux-2.4.8-orig/drivers/block/rd.c linux-2.4.8/drivers/block/rd.c
--- linux-2.4.8-orig/drivers/block/rd.c Sun Jul 15 19:15:44 2001
+++ linux-2.4.8/drivers/block/rd.c Wed Aug 15 13:34:53 2001
@@ -704,11 +704,29 @@
int swim3_fd_eject(int devnum);
#endif
+#ifdef CONFIG_USB_STORAGE
+static void __init wait_for_usb_root_floppy(void)
+{
+ extern int blkdev_ops_exist(unsigned int);
+ long t;
+
+ while (!blkdev_ops_exist(MAJOR(ROOT_DEV)))
+ schedule_timeout(HZ);
+ /* Extra timeout for remaining messages. */
+ t = 5*HZ;
+ while (t > 0)
+ t = schedule_timeout(t);
+}
+#endif
+
static void __init rd_load_disk(int n)
{
#ifdef CONFIG_BLK_DEV_INITRD
extern kdev_t real_root_dev;
#endif
+#ifdef CONFIG_USB_STORAGE
+ extern int usb_root_floppy_p;
+#endif
if (rd_doload == 0)
return;
@@ -717,6 +735,9 @@
#ifdef CONFIG_BLK_DEV_INITRD
&& MAJOR(real_root_dev) != FLOPPY_MAJOR
#endif
+#ifdef CONFIG_USB_STORAGE
+ && !usb_root_floppy_p
+#endif
)
return;
@@ -729,6 +750,10 @@
swim3_fd_eject(MINOR(ROOT_DEV));
else if(MAJOR(real_root_dev) == FLOPPY_MAJOR)
swim3_fd_eject(MINOR(real_root_dev));
+#endif
+#ifdef CONFIG_USB_STORAGE
+ if (usb_root_floppy_p)
+ wait_for_usb_root_floppy();
#endif
printk(KERN_NOTICE
"VFS: Insert root floppy disk to be loaded into RAM disk and press ENTER\n");
diff -ruN linux-2.4.8-orig/fs/block_dev.c linux-2.4.8/fs/block_dev.c
--- linux-2.4.8-orig/fs/block_dev.c Thu Aug 9 19:41:36 2001
+++ linux-2.4.8/fs/block_dev.c Sun Aug 12 23:05:13 2001
@@ -517,6 +517,14 @@
return ret;
}
+int blkdev_ops_exist(unsigned int major)
+{
+ /* major 0 is used for non-device mounts */
+ if (major && major < MAX_BLKDEV)
+ return (blkdevs[major].bdops != 0);
+ return 0;
+}
+
int register_blkdev(unsigned int major, const char * name, struct block_device_operations *bdops)
{
if (major == 0) {
diff -ruN linux-2.4.8-orig/init/main.c linux-2.4.8/init/main.c
--- linux-2.4.8-orig/init/main.c Thu Jul 5 14:31:58 2001
+++ linux-2.4.8/init/main.c Sun Aug 12 23:05:13 2001
@@ -124,6 +124,10 @@
kdev_t real_root_dev;
#endif
+#ifdef CONFIG_USB_STORAGE
+int usb_root_floppy_p = 0;
+#endif
+
int root_mountflags = MS_RDONLY;
char *execute_command;
char root_device_name[64];
@@ -303,6 +307,20 @@
}
__setup("root=", root_dev_setup);
+
+#ifdef CONFIG_USB_STORAGE
+
+static int __init usb_root_floppy_setup(char *line)
+{
+ extern int usb_root_floppy_p;
+ root_dev_setup (line);
+ usb_root_floppy_p = 1;
+ return 1;
+}
+
+__setup("usb_root_floppy=", usb_root_floppy_setup);
+
+#endif
static int __init checksetup(char *line)
{
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-08-17 3:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-12 3:12 Booting from USB floppy? Chris Hanson
2001-08-12 5:19 ` H. Peter Anvin
2001-08-12 5:29 ` Matthew Dharm
2001-08-17 3:30 ` Chris Hanson
-- strict thread matches above, loose matches on Subject: below --
2001-08-15 2:50 John Sheahan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.