kzinti wrote:The linked page makes it clear that you are not allowed to change the colour of the logo. Changing it doesn't make it a different logo or allow you to use it.
If they have an issue with that, they should let me know, and then, but not before I'll change that picture. Seriously, an icon for the repo is the least important thing for an interface wrapper. Its not that that logo is included in the source in any way, it's just an avatar on the gitlab's preferences page. If you do a git clone, you won't get the logo
vvaltchev wrote:OK, but how I can select the partition or the physical drive? Is there any special URL-like syntax or POSIX-UEFI supports only paths inside the current partition?
Okay, one more time: POSIX-UEFI is a wrapper around UEFI calls. If UEFI itself can't access paths inside a partition, then POSIX-UEFI can't either.
vvaltchev wrote:Yep, and there are many cases like that. For example? How can I access a disk or a partition as a binary blob? I'll have to use UEFI.
What do you mean "many cases"? So far GOP is the only one that I couldn't wrap up in POSIX calls. Everything needed by a basic boot loader covered.
vvaltchev wrote:Or, how can I change the video mode, clear the screen, move the cursor etc. ? Still need to use UEFI directly.
What is your problem? By default you have to use that messed up UEFI interface for EVERYTHING or use those braindead library functions from EDK2 (which do not cover every UEFI protocol either btw). When you use POSIX-UEFI, you can spare yourself and use a much simpler interface in 99% of the time. And even for those 1% native UEFI calls POSIX-UEFI provides a simple implementation, a simple and fast build system (compared to EDK2's bloat). What is that you can't understand about this? If you are your own enemy, then go ahead and use that horrible EDK2. I've done that, I know exactly what I'm talking about. No sane people would ever think EDK2 is good or at least a bit usable.
Let me give you an example, under Linux, your application simply gets the command line arguments on the stack. Under UEFI, you need a helper function, ShellCommandLineParse which requires an additional library, ShellPkg, which in turn querying the EFI_SHELL_PARAMETERS_PROTOCOL and if that fails then the SHELL_INTERFACE_PROTOCOL... That is, if you're using the EDK2, because there's no ShellCommandLineParse in GNU-EFI, it calls that same function GetShellArgcArgv. And that's because EDK2
constantly renames libraries and functions breaking compatibility. They used to have
StdLib with LibC and PosixLib, and
now they don't. Should I continue how ugly UEFI actually is? Terrible ABI wrapped up in everchanging libraries... Yeah, what could go wrong?
GNU-EFI is much better, but it has its own pitfalls (the need of uefi_call_wrapper and doesn't compile with CLang).
vvaltchev wrote:At the moment, I believe that the POSIX model cannot map well UEFI, roughly because UEFI is not a UNIX-like kernel.
Think it again. Apart from the ABI their API is not so different. UEFI mimics Windoze calls, and you can convert those into libc (anybody who has written a multiplatform application knows that). The only real difference is, that UEFI needs a huge load of helper functions to hide the actual protocol interfaces, while a true POSIX kernel doesn't, just a single libc with well-defined interface to wrap up syscalls.
vvaltchev wrote:While some POSIX functions might be perfect for UEFI, in other cases you will inevitably end up with limitations.
For those rare cases you use the same interface that you'd have to use for EVERYTHING otherwise.
vvaltchev wrote:The need to access other partitions and disks is one of them. On a UNIX kernel, we can use the special device files in /dev plus the POSIX primitives, here we cannot do that.
Yes, we can! Here are the list of pseudo device files under POSIX-UEFI:
/dev/stdin - returns EFI_SIMPLE_TEXT_INPUT_PROTOCOL instance (ST->ConIn)
/dev/stdout - returns EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance (ST->ConOut)
/dev/stderr - returns EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance (ST->StdErr)
/dev/serial - returns EFI_SERIAL_IO_PROTOCOL instance
/dev/diskN - returns EFI_BLOCK_IO_PROTOCOL instance
...anything else - returns EFI_SIMPLE_FILE_SYSTEM_PROTOCOL instance
vvaltchev wrote:We'd need maybe a different mechanism to enumerate all the disks and partitions. The same applies for video modes, network devices and other fancy UEFI features.
No, we don't. You're mixing up interface with implementation. Two totally different implementations might have the same interface. A good example fprintf. That's the best thing in UNIX and POSIX, everything is a file.
vvaltchev wrote:I get that, just I wanted to offer some perspective about the other approaches and maybe make you at least consider the idea of not being strictly POSIX-compliant. You could offer in your library a set of functions designed for UEFI which are just inspired by POSIX, not strictly following it.
Never intended to by
strictly POSIX-compliant. That's not possible without a kernel. The point is, use interfaces that look like POSIX so that people don't have to learn and s*ck with that horrible GUID interface and learn nearly a hundred of helper functions from the supporting library (which is constantly changing btw). Instead programmers can use a few functions that they are already familiar with, so there's no need to learn everything from the gourd up.
One example, which is more obvious to you? Which one should an UEFI newbie choose?
a) find the system table, find boot services in it, and LocateProtocol method in it. Then use that method with some magic numbers to return a struct which in turn must be defined exactly the same way in your application as in the firmware, and which should contain a method called GetRNG() which has parameters that you have to learn
- or -
b) call the well-known rand() that you're already familiar with to do the same thing.
Cheers,
bzt