PeterX wrote:Isn't that normal? I mean, look at multiboot specification: You have to setup your own GDT there, too.
Exactly my point. UEFI using long mode has no advantage whatsoever, you'll have to set up everything yourself at the end of the day.
PeterX wrote:Of course you could reboot on real hardware. I bet that takes more than 4 seconds.
Actually no. All my testbeds boots up in less than a sec. The funkiest of all is the RaspberryPi3, because it's using and old monitor with a HDMI-VGA converter. By the time the monitor turns on and adjusts to the screen resolution, the OS is already loaded
PeterX wrote:Generally speaking I see where UEFI sucks. But in other aspects it's quite cool. It's usable in C. It's 64bit.
These are true for all other firmware as well. For example, xv6 boot sector is written in C (it only needs a very minimal Asm to enable A20 and set up stack). You can also use SmallerC to write code for BIOS loaders (check out if you haven't already, it's truly a great project). By default, coreboot payloads are implemented in C. I've implemented my RaspberryPi loader in C. Etc. etc. etc. Using Assembly is not a must (except for a very minimal initialization code), however I find it simpler to be used with a boot loader (but that's just me).
PeterX wrote:It's portable.
Now this part I never understand. Nobody needs a portable firmware. A firmware should initialize a given motherboard with all of its components, that's all. If you move it to another platform, that's going to have completely different devices anyway... I think coreboot's philosophy is better: it is not portable at all, but you can compile it for many different platforms with many different drivers! It has a
directory full of compile configurations, each for a particular motherboard. Simple. I like simple
PeterX wrote:I can handle large disks. It has GPT with much more partitions than MBR.
Okay, large disks is a plus. But you can use GPT with BIOS and coreboot as well. I even use GPT for my RaspberryPi loader without probs. As long as a firmware provides a sector load function, you can have any partitioning table you want (GPT included).
PeterX wrote:But I have an even harder time with GNU-EFI.
Why? It's plain simple. Works out of the box. I guess I should write a GNU-efi tutorial on the wiki?
nexos wrote:I don't no if BOOTBOOT does it differently, but for GRUB and UEFI, it is the same deal. Honestly, UEFI is easier then GRUB because now it sets up those temporary paging tables!
I don't follow. Neither GRUB nor UEFI sets up paging tables for higher-half kernel. BOOTBOOT has to do it no matter what firmware it's running on.
nexos wrote:While I am getting on board with UEFI, I will no get on board with Secure Boot. Period.
That I can absolutely understand and relate with!
nexos wrote:I see what your saying, but for me entering PMode or long mode is just a matter of setting registers.
But how can you be sure that the paging table that the long mode UEFI allocated for you is below 4G? You see, if it's above 4G, then your prot-mode trampoline code will set up an invalid CR3 before it jumps to the long mode segment (PML4 address truncated to 32 bit)... And if you don't use the UEFI provided paging tables, but create one for the APs yourself, then UEFI did not helped you at all!
nexos wrote:True, you do have to write basic library functions like strlen, memcpy, memset, etc
That's why I also link with GNU-efi. It provides all those for you! It's just in the braindead UEFI parlance they have different names! For example memcmp is called CompareMem, memcpy is called CopyMem, strlen is called strlena (because StrLen is for wchar_t) etc. I haven't checked memset, because I only use it to zero out memory and there's ZeroMem for that. The libefi.a also provides uefi_call_wrapper, so that I don't have to care about the actual ABI.
PeterX wrote:But I prefer modern hardware and OSs.
So do I. I'm not saying that do not implement UEFI loaders. Not at all! I've implemented BOOTBOOT for UEFI, because it is important and some machines require it. All I'm saying is, just because you've implemented an UEFI loader, doesn't mean you have to use it in your VM all the time, especially if you also have a much-much faster loader implementation
Cheers,
bzt