Booting from USB drive

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ddexterdd
Posts: 1
Joined: Sat Aug 06, 2005 11:00 pm

Booting from USB drive

Post by ddexterdd »

I am trying to make a bootloader load off the USB drive. I can't find sample, lowlevel code anywhere that shows how to move data from or to the usb drive. Help!
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

Strictly speaking, you need to cntrol the USB controller (EHCI, OHCI or UHCI), use the USB Storage spec for accessing the device, speak SCSI over that bus and use that to retrieve & store data without crashing the device or using a command it doesn't know.

Your BIOS can emulate this for you.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Two things you have to do, both of which are reasonably easy.

Firstly, get the bootloader into the bootsector of the USB drive. This is easy with a program that can directly edit disk sectors and allow copying of the data in them. I use Hex Workshop, but you can use whatever you want.

Secondly, the BIOS has to support booting off a USB. New BIOSes (after about 2004-05) allow you to boot off a USB, so just go through the SETUP utility and look for a USB-boot option.

I hope this helps!
Post Reply