SmD wrote:First off, I did not see anything about a requirement for a BIOS to be included for support of older software.
That may be in part because EFI is designed for use on many platforms - if it's on a machine with an ARM processor there's no point in insisting that it include BIOS functions. It does however leave the door open to the BIOS disappearing altogether, but so long as equivalent services are provided, that can't really be a bad thing - it just needs a few little modifications to our OSes. All most of us want is memory information, the ability to change screen mode and services for loading and saving to USB devices (so that it isn't impossibly hard to get your foot in the door). If that can be done while staying in 32-bit mode (or 64), then that's a real gain, and a massive one if you don't have to stop every other processor in the machine while EFI code is running - I assume that's a large part of the intention.
SmD wrote:Here is my problem with BIOS: I do not feel I can trust it. I mean, what if there were a bug, or some discrepancy from that which you expect? Then what?
If there's a significant problem with any BIOS code, someone here will find it pretty quickly and warn everyone, but it doesn't happen very often. If you're just using the BIOS in standard ways, you aren't likely to hit any problem caused by anything other than your own bugs, but if you are lucky enough to find a bug in a BIOS, it will demonstrate that you are a fine entomologist.
My approach to BIOS is: Use it as little as possible, and kill it as soon as possible. (I totally agree with a quotation I have read of Linus Torvalds.)
And if you treat EFI the same way, you aren't going to have a lot to worry about. When it becomes necessary for everyone to use EFI, someone here will put together a tutorial showing you how to boot your OS and get what you need from EFI. The worst case scenario is that you might have to copy a few little bits of code to interface with EFI, and there's no reason why those shouldn't be provided in assembly language form.
I do not trust it to not overwrite my memory, to not trash registers when returning from my calls to it...
The former would be dead easy to identify, and the latter is expected - why would anyone care what it does to the registers? You have to trash a lot more than just registers when you go back into real mode to speak to the BIOS. And if you're only writing an OS to run in real mode, you're wasting most of the capability of the machine.
Heck, I do not even trust that it has the processor in real-address mode when it transfers control to me.
Has anyone ever found a BIOS that doesn't hand back control in real mode after you've called a BIOS service in real mode? Any machine with a BIOS that strange isn't going to matter - just don't support it.
The only positive I can see with EFI is that it loads all of your code at once. No having to deal with getting a drive's parameters, reading sectors, possibly having to reset the drive, et cetera. Basically, just get a memory map, then disable it as much as possible.
The positive is that it does what it needs to do, just as the BIOS does, and it might allow you to use its services without having to undo most of the changes you've made to the setup of your machine every time you use EFI for something - that could be a huge positive. The only real negative is that you will have to write a few unexciting parts of your OS in order to get going, but the important stuff isn't going to change at all, and that's the bulk of your OS (unless you've made the mistake of writing it all in 16-bit mode).
I had hoped that maybe I had overlooked something. Unfortunately, it seems that I had not. Rather than continuing to go to absurd lengths to maintain at least somewhat decent backwards compatibility with older software... Now, that older software is like nothing more than a broken electronics component. Do not repair. Just throw it away, and buy a more recent one. What a sad mindset.
Are you now complaining that they're not continuing to go to absurd lengths to maintain backwards compatibility? Looks like they can't win either way! The reality is that all the old stuff can be still run in an emulator, and it'll still run faster than it did in the machines it was originally designed to run on. EFI might lead to real mode and 16-bit protected mode disappearing from the processor altogether, but that won't be a bad thing if it speeds it up a fraction and reduces its power comsumption. 16-bit mode is horribly restricted for programming in anyway and I doubt any low-level programmer will miss it.
SmD wrote:I am definitely paranoid when it comes to code that is not my own.
My mindset is to avoid all assumptions. The more that is assumed, the more that can be different from that assumed.
If you restrict your OS to code that is entirely your own, how advanced will it ever get? You're going to have to include code written by someone (or something) that isn't you at some stage, and BIOS or EFI code is much better tested than most code.
EFI sounds very inflexible and demanding. It has to have LBA 1 through whatever, it has to have duplicates of those sectors at the end of the disk... From what I can tell, there is no documentation for low-level programmers like myself.
I have no idea how many duplicate sectors are required, but a few wasted sectors aren't going to be missed. Low-level documentation will be created by someone when it's needed. In the mean time, just continue to develop your OS while keeping in mind the things that may need to be changed later on so that you don't paint yourself into a corner.
EFI's successor will have to be much more adaptive. Or, better yet, as another poster suggested, maybe EFI shall be the end of x86. Suddenly, I cannot help but take a curiosity in other architectures...
You might easily move to something else that suddenly takes a turn towards extinction. If legacy stuff can be dropped, x86 is actually more likely to survive - it needs to reduce its power consumption to compete with ARM, and getting rid of 16-bit modes would help.
I hate the idea of having to rewrite everything just because the industry has decided my code is too old to matter. (Or, as is actually the case, that it just tries to be supported on as old a hardware as possible, hoping that the future will retain compatibility.)
If your old code matters, it can run in an emulator. If it's OS code and can't run on the latest machines, it's past it anyway. What kind of code are you actually writing and what are you writing it for? Isn't most of it in 32-bit mode (or 64) already? That isn't going to go extinct for a good long while, and when it does you'll still be able to run it in an emulator - if it's OS code that's all it'll be fit for by then anyway.