Some technical points about booting from CDs and USB sticks
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Some technical points about booting from CDs and USB sticks
Hi guys,
I can't seem to find comprehensive and/or up-to-date answers to these questions from searches, so I'll try to explain as clearly as possible here and rephrase for utmost clarity.
When first a regular HDD boots up, the BIOS passes control over to the first 512 bytes of the disk, so long as the disk has the magic number (correct signature) at the end of this first sector. The BIOS doesn't 'care' what is in this first sector; it just passes control over to the code within it and hopefully boot-up is underway. Other boot instructions may commonly lay elsewhere on the disk, which is fine, since the boot sector code will point to them and the process goes on.
Now, what happens when you boot from a CD or a USB stick? Not quite the same thing happens, does it?
What I need to know is, when booting from alternative media, what is the BIOS 'looking for' and whereabouts on these new media does it expect to find the boot code? I've looked at the directory structures of CDs and sticks and there doesn't seem to be any common factor in the files and directories there that I can identify, unlike when I examine a regular HDD and its partitions with a hex editor.
Can someone please clue me up? What's the deal here?
THanks.
CC.
Last edited by Completely Clueless; 06-14-2010 at 04:17 PM.
The cd can only be a bootable device if we already have extended bios support. It was never part of the original x86 design. As above there are a few ways a cd can be made to be bootable within bios support. One is el-torito as above there is a lot of info on the wiki page. Another is http://syslinux.zytor.com/wiki/index.php/ISOLINUX All of them require extended bios support or some other bootable media that teaches the system how to use cd or usb.
USB is kind of similar but bios has the ability to "see" a usb (in some bios's) the usb device as a real hard drive. It can also see them as zip devices or even floppies.
What you need to know is how your bios works to extend it's original function from the original x86 design.
As has been mentioned, there;s a few ways to boot elsewhere than hd
1. grub entry - in which case the boot is the hd and the files are elsewhere
2. Floppy and El-Torito which look at boot sectors.
3. Various other devices, usually initiated by the bios, effectively a non standard boot order.
If they don't look at the boot sector of this other device(e.g. usb), and don't have a grub line, what do you think the bios is actually doing? You are better imho looking for the api which will be a boring document somewhere (perhaps even intel.com. CD booting came a long time (relatively speaking) before usb booting, so
OK guys,thanks, all noted. Before I delve into the resources y'all have been kind enough to post, just one final dumb question...
When I download an image file of a live CD distro, it is typically a single file of just under 700Mb.
If I simply copy this single file onto a blank CD, it can't boot, can it? But the checksums should be the same, yes?
Now say I burn the original, downloaded file to a blank CD as an .iso image instead. This time I get a CD which typically has a bootable, multi-level directory tree structure on it, yes?
Yet in both cases, the checksums of the burned CDs will match the checksum of the source file? Seems a bit odd...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.