Booting from USB Drives?
GilesP asks: "With so many USB flash drives around (like the pendrive, Targus Go-Anywhere, and others), and with the demise of the floppy disk, I began to wonder if it would be possible to boot from a USB drive? So your BIOS is going to need to support booting from a USB device, but what else would be involved? I'm primarily thinking about Linux here, but other OSes would be interesting too. These devices come in a range of sizes from 8Mb up to 1Gb, so there is plenty of room to hold a Linux installation. Has anybody done anything like this?"
Ehrm, no.
OK, here is the real answer.
Some pc BIOS can boot off of an ATAPI device hooked to USB, such as an Iomega Zip drive or a compact flash card or somesuch; however, the implementations vary WILDLY on how this is accomplished. Booting from said devices involves much fakery in what is usually presented to a bootloader as either a virtual floppy drive or a virtual hard disk. The fakery involved in booting from USB is even more complicated than booting from a CD-ROM, for which there is (at least) a standard that most bioses somewhat support.
Your bootloader (lilo, grub, etc.) can indeed bootstrap the kernel from a USB connected boot media; however, you will have to configure it differently based on which kind of device (floppy or HDD) your bios simulates for a USB boot. IE if your bios simulates a floppy drive, you'll have to tell lilo/grub/etc to load the kernel from the bios's floppy drive (here, bios calls to the floppy drive are rerouted to the usb device). Incedentally, this is the way CD-ROM booting works, but CD-ROM booting is MUCH simpler since an image file in a special area of the CD-ROM sits in for the virtual drive.
Anyway, most USB booting bioses are going to be simulating hard drives anyway due to the size of most usb media, so all you have to do is set up lilo to boot from the first bios hdd (ie 0x80) and you're set there.
Now on the subject of actually bringing the OS up - well that is the fun part. You can not (as the parent post said) just have "usb support compiled in" to make linux boot. USB doesnt exactly work that way in Linux. You can indeed have your usb controller driver, the usb mass storage driver, etc. all compiled statically with the kernel (not modules), but you're still going to have to start the hotplug daemon to get the setup functional to where you can use the connected device, and that's not going to happen without a root filesystem.
So, you need an initrd. No problem provided you can get lilo or grub or whateverelse to find and load it. All your initrd needs to do is to load up your USB modules, mount your root fs off of usb mass storage (/dev/sda1 or whatever weird devfs name you use) and then pivot_root over to it. This is mostly equivalent to an initrd setup for something like a network booting system that uses NFS root or fibre channel or something like that. Any initrd HOWTO will cover setting up an initrd that loads modules and performs configuration to mount the root device that the kernel cannot do on its own.
Sorry for the long ramble. Booting linux from USB is possible; however, it is not for the faint of heart. If you get it to work, it will probably not work for every motherboard that claims to allow usb booting. Any modern version of Windows will most not boot this way. (Well, technically you could load windows 3.11 or earlier in real mode like this, and maybe even windows 95/98 in safe mode)
FYI, a good place to start looking is the HOWTO's that involve installing linux onto subnotebooks without internal CDROM or Floppy. A lot of these sites provide floppy images that can boostrap an installation system (ie linux) from a USB connected floppy or cdrom drive. The USB booting on these laptops is probably quite a bit more solid than the equivalent on any desktop motherboard.
~GoRK
I just bought a new Amptron MOBO and the BIOS supports this.
The BIOS also has some network features built in, but I haven't checked them out yet.
Go try one out, they're pretty cheap.
A mac maybe?
It can boot from Firewire and USB and even the net with standards, no s**ty pxe, just bootp/dhcp and tftp and nfs (or afp or any other network file system).
I think Sun also have this capitable.
On macs with os X, the OF reads from the devices and then the os sends messages to the of to read particular blocks from the device to get the driver and then loads the drive and lets the driver take over. In fact this is how they do scsi and ide. The OF(BIOS) contains generic drivers to load the kernel and also to read from the device.
OpenFirmware
It's sort of the Mac equivilent of a BIOS if you like
Listening for the sound of the coming rain...
Open Firmware.
Basicly it's a forth interpreter that initialises the processor, initialises various chips on the mother board and initialises PCI cards. It's avaiables on MacIntosh since the PPC switch and on sun Hardware.
Booting from a USB drive on a mac would not be difficult you'de just specify the path of the system blessed folder, be it a linux, Open, Net, Darwin or Mac OS X system.
none Yet.
Actually its available ever since the switch to PCI from Nubus, which happened slightly after the PPC switch. 61xx, 71xx, and 81xx (and possibly others?) are Nubus based and do not have Open Firmware. Not intending to be nitpicky :)
nwp