1 |
On 06/21/2012 04:08 AM, Duncan wrote: |
2 |
> Richard Yao posted on Wed, 20 Jun 2012 18:16:23 -0400 as excerpted: |
3 |
> |
4 |
>> 3. How does getting a x86 system to boot differ from getting a MIPS |
5 |
>> system or ARM system to boot? Does it only work because the vendors made |
6 |
>> it work or is x86 fundamentally harder? |
7 |
> |
8 |
> I can answer this one. x86 is harder at the bootloader stage, but in |
9 |
> turn easier, or perhaps simply different, at the kernel and kernel device |
10 |
> interface level. |
11 |
> |
12 |
> Consider, most MIPS and ARM systems ship with a specific set of basic |
13 |
> devices, configured to use specific IO addresses, IRQs, etc, and that's |
14 |
> it, at least to get up and running (USB devices, etc, may be able to be |
15 |
> plugged in, but they're not normally needed for boot). If you've been |
16 |
> keeping up with the kernel (say via LWN, etc), this has been one of the |
17 |
> big deals with the ARM tree recently, as until now each "board" had its |
18 |
> own hard-coded kernel config directly in the tree, and it was getting |
19 |
> unmanageable. They're switching to "device tree", etc, allowing the boot |
20 |
> loader to feed the kernel a file with this information at boot time, thus |
21 |
> allowing a whole bunch of different boards to boot off the same shipped |
22 |
> kernel, while at the same time getting the explosion of individual board |
23 |
> files out of the kernel tree. This is a BIG deal on ARM and similar |
24 |
> embedded archs, but doesn't affect x86 (either 32-bit or 64-bit) at all. |
25 |
> |
26 |
> Meanwhile, on x86, the system must be prepared for end-user switch-out of |
27 |
> pretty much everything. memory, storage (consider floppy, hard drive, |
28 |
> optical disk either direct or el-torito, USB stick, etc, all bootable and |
29 |
> all end-user changable!), even quantity and speed of CPUs, and the |
30 |
> firmware BIOS (or replacement) must cope with that and be able to boot |
31 |
> off it. Even back in the 386 era when everything was jumper-configured, |
32 |
> users could still change pretty much everything out, other than the mobo |
33 |
> itself. Now days, it's even MORE complex, as most of these devices can |
34 |
> be configured in dozens or hundreds of mode combinations via "plug-n- |
35 |
> pray", and they often don't /have/ a default -- they **MUST** be so |
36 |
> configured in ordered to be operable for the intended use. Sure, the |
37 |
> BIOS CAN leave some of it for the kernel to do, but other bits, not so |
38 |
> much, as otherwise, how does the kernel even get loaded -- the BIOS must |
39 |
> pick one of the many boot options, configure it (as well as the CPU and |
40 |
> the system between storage and the CPU, storage chipset, memory, etc) at |
41 |
> least well enough to read in the boot loader and/or kernel. None of |
42 |
> that's necessary on ARM, etc, because (pretty much) everything there's a |
43 |
> totally arbitrary-as-shipped config, nothing to dynamically negotiate and |
44 |
> get working before the kernel or secondary bootloader (after the BIOS) |
45 |
> can even work! |
46 |
> |
47 |
|
48 |
A firmware replacement for the BIOS does not need to worry about floppy |
49 |
drives, hard drives, optical drives, usb devices, isa devices, pci |
50 |
devices and pci express drives, etcetera, because those live on buses, |
51 |
which the kernel can detect. It would need a device tree to inform the |
52 |
kernel of what buses are available, but that would be specific to a |
53 |
given board, rather than what is attached to it. If the end user makes |
54 |
hardware changes, the kernel should be able to handle that, with the |
55 |
exception of changes involving RAM, which I believe go into the device tree. |
56 |
|
57 |
With that said, I am not convinced by your argument that x86 is |
58 |
fundamentally more complex. Many of the things you attributed to the |
59 |
BIOS are in fact handled by the kernel. There is plenty of duplication |
60 |
between the two, where the BIOS will configure things and then the |
61 |
kernel will configure them again. However, the BIOS does not accomplish |
62 |
anything useful in those cases. |