LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Some technical points about booting from CDs and USB sticks (https://www.linuxquestions.org/questions/linux-hardware-18/some-technical-points-about-booting-from-cds-and-usb-sticks-814136/)

Completely Clueless 06-14-2010 04:16 PM

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.

michaelk 06-14-2010 05:39 PM

Here is a starting point for bootable CDs.
http://en.wikipedia.org/wiki/El_Tori...-ROM_standard))

jefro 06-14-2010 07:51 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.

business_kid 06-15-2010 09:38 AM

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

Completely Clueless 06-15-2010 01:06 PM

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...

CC.

jefro 06-15-2010 03:14 PM

The design of the cd standard does have to have data on an exact area of the cd, the iso standard does replicate that.


All times are GMT -5. The time now is 08:59 AM.