Bona Fide OS Development
http://forums.osdever.net/

booting from USB thumbdrive - info or snippets anyone?
http://forums.osdever.net/viewtopic.php?f=4&t=19
Page 1 of 1

Author:  DudeOfX [ Mon Aug 31, 2009 5:14 pm ]
Post subject:  booting from USB thumbdrive - info or snippets anyone?

I haven't googled or searched due to time... but I know I'm gonna need to at some point... I'm posting here so that maybe what I'm looking for will magically gather here and I'll have an easier time by he time I need this info... any help would help...

I am looking for info or example code on the intricacies in booting from a thumbdrive or from a SD card in case a PC has a slot for them...

A "hello world" bootloader from a USB thumbdrive... Reading and writing to and from a thumbdrive programmaticaly without support from the OS... A USB disk driver... BIOS support for USB harddrives and/or SD/MMC slots...

any stuff of the sort would help...

Author:  Kieran [ Mon Aug 31, 2009 6:08 pm ]
Post subject:  Re: booting from USB thumbdrive - info or snippets anyone?

I know GRUB will boot from a USB drive, I think you can use standard BIOS hard-disk interrupts as the USB drive becomes an emulated hard-disk. However I have never tried booting from an SD card or any other type of memory card, I do not know If BIOS's would emulate theese.

Author:  rene [ Wed Sep 02, 2009 3:15 pm ]
Post subject:  Re: booting from USB thumbdrive - info or snippets anyone?

I think so, since your BIOS detect the SD card (inserted into card reader) as a disk, of course... but the point is once you are in protected mode, there is no more BIOS interrupts, so you will need to have the driver to read/write on USB disks or SD cards... but, AFAK some SD card readers are implemented as PATA devices, so it should work as hard disks... look at http://wiki.osdev.org/ATA_PIO_Mode for more information on how to read/write in hard disk using the ATA PIO mode.

Author:  brenden [ Thu Sep 10, 2009 12:22 pm ]
Post subject:  Re: booting from USB thumbdrive - info or snippets anyone?

Also, read http://www.osdever.net/tutorials/lba.php for a simple example.

ATA is pretty well documented online, so it should be easy, though if you are using a USB card reader you will need to develop a USB hub interface. This also is well documented online.

Author:  Love4Boobies [ Wed Oct 14, 2009 12:36 pm ]
Post subject:  Re: booting from USB thumbdrive - info or snippets anyone?

You can't boot off SD cards. Not natively, anyway. You can however use tricks such as chain loading and create your own standard that is documented for your boot loader. In order to boot via USB you need a few things:

  • A BIOS that supports booting from USB.
  • The BIOS needs to be configured to allow that.
  • The device needs to allow that (i.e., a special chip that helps with booting - it is precisely this reason why you can't boot off a card reader... reminds you of the PnP Expansion Headers?).
  • Perhaps a special signature like the infamous 0x55AA.

The problem is that not all BIOSes treat USB booting the same and there's not even a de facto standard. Most of them use things like hard disk or floppy disk emulation and the usual El Torito for USB optical drives. I'd really hate to see someone trying to boot off some kind of USB Zip drive via a SCSI interface since that's probably the antonym of BAID :)

Author:  AndyEsser [ Sun Nov 08, 2009 6:25 am ]
Post subject:  Re: booting from USB thumbdrive - info or snippets anyone?

Do a search on google for HP USB Boot Key Utility, or alternatively PM me and I'll email it to you.

This program will format a USB key and ask for a bootable floppy image to copy onto the USB. So long as you write your bootloader and stuff and it works from a floppy disk, save out the image, stick it thru the HP Boot Key utility and voila, I think it formats it with FAT 12 or something so as long as your bootloader can read that then you get it to boot straight into a command line or something.

Author:  Guest [ Mon Nov 09, 2009 12:58 am ]
Post subject:  Re: booting from USB thumbdrive - info or snippets anyone?

All the conditions I have previously stated hold. The utility just writes sectors starting from offset 0, no magic whatsoever.

Author:  Love4Boobies [ Mon Nov 09, 2009 1:00 am ]
Post subject:  Re: booting from USB thumbdrive - info or snippets anyone?

That was me before. I didn't realize I could post without being logged on. Are you sure this is a good idea?

Cheers,
Bogdan

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/