Octocontrabass wrote:
Krash wrote:
I feel that the ultimate knowledge of making a bios and boot loader is where you can replace the one that you are currently running. I obviously , don't want to try this in a hard machine.
I'm not sure if I agree with that statement.
I am absolutely sure I don't.
Why not? First, both the BIOS and the bootloader are pretty much
irrelevant to the operating system itself. These are details you want to suppress, not expose - they don't help, and are quite likely to confuse you or encourage you to tie things too closely to the hardware in question.
Regarding the BIOS, for the majority of systems, the really crucial aspects of the BIOS are the parts that abstract the motherboard's
specific hardware and chipset - something that would be
completely useless unless you had the details of both the hardware and the chipset.
Details, I might add, which for most systems are at least partly proprietary. And which most
definitely wouldn't be present in the 'generic' BIOS in question.
Why? Because the hypervisor traps all the BIOS calls and reroutes them to the underlying ones, or more likely, just emulates them in the host OS's userland. I am not sure if the generic BIOS would actually work on an non-virtualized hardware, meaning that it is at best going to be misleading.
Also, while older BIOSes were usually written in assembly, it is my understanding that modern ones (including the generic one, most likely) are usually done partly in C - all the functions need to be written specifically for the hardware it is targeting rather than use standard libraries, and the compiler is probably either a non-standard one and/or one configured to avoid emitting certain code that wouldn't be appropriate (think of the
--ffreestanding option for GCC, but with wider consequences), but still in C. Disassembling compiled code, especially compiled code that is probably very highly optimized, is likely to be an exercise in frustration.
(I feel like there was something else I wanted to mention, but hopefully I'll get back to it later.)
This does brings up another question related to my earlier ones: what are the hardware platforms you are working with? This is less likely to be a factor here, but it is worth knowing.