Hi,
Antti wrote:I have planned to experiment with a toy-OS installer. In this case, the OS is not the main target of interest. It does not have to be a general-purpose OS at all. The main thing is just the ability of installing software on HDD that is capable of booting and starting something up.
For El Torito, the firmware is meant to find a suitable "boot record". This means that the same CD can have boot loaders for 80x86 BIOS and 80x86 UEFI (and others for Itanium, PowerPC, etc) and the right boot loader will automatically be used. Of course the same applies for booting from network, or USB, or anything else (e.g. you can have BIOS and UEFI boot loaders on the same USB flash stick).
For my OS, there's several kernels and the boot code auto-detects some things (e.g. if the CPUs all support long mode or not) and determines which kernel is the most suitable kernel to use.
Most OSs have an "auto-update" feature where they'll ask a repository for newer versions. Because my OS is a micro-kernel, it should be possible to update most of the OS without rebooting.
Most OS's now have some sort of "live CD"; with an OS installer implemented as a normal utility that runs under the OS itself.
Combining these 4 things means that I can have a single CD (or USB flash stick, or "network boot server"), that supports BIOS and UEFI, and 32-bit and 64-bit 80x86; where the OS can update itself after boot, and can be used "live" or as an OS installer. It also means that you could boot, run the OS installer, remove the CD, then use the OS without rebooting at all.
Also note that during a typical OS installation a lot of time is spent copying files; which means reading data from one device (and optionally decompressing it) and writing data to a different device. Ideally you want to be reading, decompressing and writing all at the same time; and this requires native drivers (using the firmware means that you can only do one thing at a time, and it will take at least twice as long to install the OS). It'd be nice if the OS installer used "pretty graphics" too (e.g. a user-friendly GUI thing) - drop down "default language" selection, a graphical partition management, progress bar/s, etc. Of course the OS installer would also need networking support (for auto-updates, for using NTP to avoid asking the user if CMOS/RTC is set to local time or UTC, possible remote desktop, etc), user input devices (keyboard, mouse, touchpad, etc), file system support, partition management tools, etc.
Mostly what I'm suggesting here is that if you make a separate "OS installer" (that isn't built on top of your OS and does everything itself); then you'll end up writing most of your OS twice (once for the OS, and then again for the separate OS installer). Basically; it's probably a lot smarter to have an OS installer that relies on your OS's functionality to avoid duplicating everything.
Antti wrote:First of all, I have a question for you all. How many of you have created an OS that can install itself on HDD? For example, booting from CD and running an installer?
I never seem to get that far - I concentrate on getting the base (kernel, drivers, etc) "perfect" before worrying about building things on top of that base..
Cheers,
Brendan