Re: UEFI Wiki updates
Posted: Tue Sep 22, 2020 3:06 pm
What graphics parameters you set for qemu for getting such a set of resolutions?
I'm not setting anything special. I am using QEMU for Windows "out of the box" and using the EDK2 firmware "out of the box". Here is the batch file I use to invoke it:zaval wrote:What graphics parameters you set for qemu for getting such a set of resolutions?
Code: Select all
qemu-system-x86_64.exe -m 256 ^
-drive file=fysos64.img,format=raw,if=ide,media=disk,index=0 ^
-drive if=pflash,format=raw,unit=0,readonly,file=OVMF-pure-efi.fd ^
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS-pure-efi.fd ^
-parallel file:paraefi.txt -serial file:serial.txt ^
-vga std -net none -monitor stdio -machine q35
That's still rather strange. I don't have that problem. May I ask what your CPU speed is? Mine is 2.2GHz I think.bzt wrote:As I've said, I have an old slow machine, it could be that it just can't emulate that bloated UEFI monstrocity any faster...
I've already wrote that, 1GHz, running at about 3000 bogomips, no VT-x extensions.PeterX wrote:That's still rather strange. I don't have that problem. May I ask what your CPU speed is? Mine is 2.2GHz I think.bzt wrote:As I've said, I have an old slow machine, it could be that it just can't emulate that bloated UEFI monstrocity any faster...
Greetings
Peter
OK! I wonder why it is so slow on your PC. I think it should be roughly half as fast as on my computer. But it isn't. *puzzled*bzt wrote:I've already wrote that, 1GHz, running at about 3000 bogomips, no VT-x extensions.PeterX wrote:That's still rather strange. I don't have that problem. May I ask what your CPU speed is? Mine is 2.2GHz I think.bzt wrote:As I've said, I have an old slow machine, it could be that it just can't emulate that bloated UEFI monstrocity any faster...
Greetings
Peter
Cheers,
bzt
Well, unlike UEFI, emulating BIOS and coreboot is fast, so the only explanation left is: "What Andy giveth, Bill taketh away"PeterX wrote:OK! I wonder why it is so slow on your PC.
So I think it is because of the missing VT/KVM on bzt's PC.nexos wrote:It takes 4 seconds on my machine. My machine has 7 CPUs at 1.65 GHz and VTx and 8GB of RAM. With KVM, it takes 4 seconds.
bzt, try to create a Load Option for your loader and put it the first. Interestingly, OVMF images come preconfigured to have a Load Option for the UEFI shell, and since, as I've already pointed out, \efi\boot\bootXXXX.efi is optional for non-removable storages, it might well be not tried at all esp. given a Load Option is set. That delay, you describe might be some stupid waiting because you didn't provide Load Options, because for me, after Tianocore logo disappears, the UEFI shell does appear instantly or my Loader, - what is set first.Then that TianoCore logo disappears, and only then the real boot starts. I've already lost many precious seconds (sometimes ~10) before FS0:\EFI\BOOT\BOOTX64.EFI even gets loaded.
Thanks for the tip, but \efi\boot\bootXXXX.efi is configured by default all right.zaval wrote:bzt, try to create a Load Option for your loader and put it the first. Interestingly, OVMF images come preconfigured to have a Load Option for the UEFI shell, and since, as I've already pointed out, \efi\boot\bootXXXX.efi is optional for non-removable storages, it might well be not tried at all esp. given a Load Option is set.
As I've said, I have no problem after the TianoCore logo disappears. My loader is pretty fast. The long delay happens before that (most of it before the TianoCore logo shown).zaval wrote:That delay, you describe might be some stupid waiting because you didn't provide Load Options, because for me, after Tianocore logo disappears, the UEFI shell does appear instantly or my Loader, - what is set first.
Oh yes, it is. One of the worst "standards" ever. From the overall concept to the simple things. For example what "Number of partitions" mean in GPT? It is not well-defined: some interpret it as the number of active partitions, while for others it is the number of maximum usable partitions... Sadly the UEFI spec suggests both.zaval wrote:UEFI isn't monstrosity per se, EDK2 may be, but the standard itself is not.
No, it isn't. OVMF.fd is at least a Megabyte (!!!) and in run-time requires several Megabytes of RAM, I wouldn't call that "slim". BIOS, on the other hand, with it's 128K size and minimal (ca. 64k) run-time RAM requirement, now that's what slim is!zaval wrote:PI really has a lot of overdesigned stuff, but UEFI is slim. and extensible.
The core alone is completely useless. There's nothing minimalistic and clear about the must-have bytecode interpreter for example. There's no standard interface to load a disk sector by default, and there's no standard interface to switch video modes for example. Both are defined as "optional", and need LocateProtocol, which might fail (even though the video driver is clearly a requirement for ConOut, and you cannot load anything (not even the loader) without a disk driver). I really would like to see a bootloader that's capable of booting an OS using only the UEFI core (without any LocateProtocol or OpenProtocol calls)...zaval wrote:You don't have to implement all the protocols, and oppositely - you can devise your own. The core is minimalistic and clear.
That's extremely slow all things considered. If I were you, I'd implement the UEFI loader, but I would keep using the BIOS loader during compile - test development cycles.nexos wrote:It takes 4 seconds on my machine. My machine has 7 CPUs at 1.65 GHz and VTx and 8GB of RAM. With KVM, it takes 4 seconds.
I do have kvm, just no VT. At least according to /proc/cpuinfo there are no VT extensions, but lsmod lists the kvm kernel module. If I add "-enable-kvm" to the command line, it considerably speeds up almost everything, but not UEFI boot (still takes 6-8 secs, most of the time spent before loaders are loaded). I actually use this command for testing my OS with UEFI, and this one for testing with BIOS. (Note these commands are for running OS/Z, and not for the BOOTBOOT loader tests.)PeterX wrote:So I think it is because of the missing VT/KVM on bzt's PC.
Code: Select all
char *s = "Shutdown";
while (*s) __asm__ __volatile__("movw $0x8900, %%dx; outb %0, %%dx" : : "a"(*s++));
I know you don't like UEFI @bzt, but I am starting to grow more fond of UEFI. My BIOS loader's ELF64 loader is all out kludgy in how it switches to long mode. UEFI seems to be a blessing in disguise, as it handles switching to long mode and makes my code much cleaner. My EFI loader took me a week to make, and my BIOS took me two . To be fair, I reused some code, but still the UEFI one was shorter. As for startup speed, it fluctuates. 4 seconds is about average. I am fine with it, and have gotten used to it. So I will get rid of my BIOS loader soon.bzt wrote:If I were you, I'd implement the UEFI loader, but I would keep using the BIOS loader during compile - test development cycles.
It's not a question of whether I like it or not. An EFI app is like a ticking bomb. It will work for months, or even years perhaps, but you'll never know when will it blow in your face. And that's because firmware manufacturers and UEFI driver writers can start to interpret the UEFI spec differently any time. (Just take a look at MP Services. It was working for more than a year, with TianoCore, VB EFI, and on all real hardware, all laptops, all desktops, up until the point when one user tried it on a certain AMD tower, where without any meaningful error message ExitBootServices just froze. Good luck debugging such issues!)nexos wrote:I know you don't like UEFI @bzt, but I am starting to grow more fond of UEFI.
Once you're in long mode, it shouldn't matter to your kernel how you got there. And just for the records, UEFI using long mode is more of a problem than a blessing, you'll see for yourself later. You don't know what GDT it has set up, and at the end of the day you'll have to use your own no matter what. Likewise, you can't use its paging tables, so you'll have to use your own. When you got to the point to finally implement user space and user mode, you'll realize that you had to rewrite everything that UEFI has given to you, so it was a total waste of resources on UEFI's part... Just wait and you'll see!nexos wrote:My BIOS loader's ELF64 loader is all out kludgy in how it switches to long mode. UEFI seems to be a blessing in disguise, as it handles switching to long mode and makes my code much cleaner.
Which is irrelevant A software is written once, and executed many many times.nexos wrote:My EFI loader took me a week to make, and my BIOS took me two
And how big your loader binaries are? I bet that your EFI loader is considerably bigger than the BIOS version. Here is one of my boot records. It reads the kernel over serial line, then it sets up long mode. All of that in 512 bytes! Now implement a similar loader in UEFI, I seriously doubt you can do that in 512 bytes...nexos wrote:To be fair, I reused some code, but still the UEFI one was shorter.
You must be still young to have time to waste My time is lot more precious than wasting it on waiting for VMs to boot. When I actively do development, I test my OS very often, and those seconds accumulate. They build up to minutes and even hours pretty quickly. But do as you please!nexos wrote:As for startup speed, it fluctuates. 4 seconds is about average. I am fine with it, and have gotten used to it. So I will get rid of my BIOS loader soon.