6 ms·
I think I've ranted about this in HN before, but UEFI is so pointlessly complex. Modern OSes don't rely on the BIOS for basically anything. When choosing the su
by paol 2y ago
I think I've ranted about this in HN before, but UEFI is so pointlessly complex. Modern OSes don't rely on the BIOS for basically anything. When choosing the successor to the old PC BIOS we could have made something extremely minimal.
Instead UEFI goes hard in the opposite direction. It's basically a full blown operating system with all the attendant complexity and, unsurprisingly, vulnerability surface.
- harshreality 2y agoHow do you build a BIOS successor that's not complicated, when it has to be able to reflash bios from a file on a fat32 partition on a usb stick, because all the other historical ways of reflashing bios were difficult and more fragile? How do you build a BIOS successor that's not complicated when it needs to allow an OS to alter boot settings for the next boot? Granted, most of what goes on in a BIOS is displaying and changing variables involved in getting the system running, and maintaining those values, which just requires some sort of minimal editing interface and nv storage, but then... users appear. They want to be able to use a mouse. They want an ability to configure their raid chipset prior to boot, or netboot, and HW makers want to implement that in a way that's not some arcane raw assembly dance between BIOS and additional chip FW. What then? I don't think the complaint is about complexity, but about code quality and architecture. This isn't the only case where an old, simpler but less capable and annoying, system has been replaced by a much more complex system that is much hated and [initially] buggy and less secure, but also more or less gets the job done better than the old way, and where average users of the new system find it easier and more productive. If there wasn't a case where a hardware manufacturer needed a capability prior to the OS taking over, or to modify their HW settings from the OS in a portable way, it wouldn't be in UEFI, right? Calling UEFI a full operating system seems needlessly inflammatory. It's not a linux or windows kernel. It has to do a fair amount of the basics, but so does any kernel running on a general purpose chip and interfacing with a bunch of other people's code. UEFI is terrible. Baseband firmwares are terrible. Security processor firmwares are terrible. AMT is terrible. Okay, but we still need them.
- blueflow 2y agoNo, we don't need them. Look at the OpenWRT ecosystem and the routers it runs on. Those cheap plastic routers come with pretty dumb bootloaders and it works. Its just the x86 platform that is shite.
- kokada 2y agoHowever each OpenWRT router also has its own custom bootloader AFAIK. This is why you need different images for different devices, and can't create a single image for everything. UEFI on the other hand you just build one image and it works everywhere.
- blueflow 2y ago> UEFI on the other hand you just build one image and it works everywhere. Thats the theory. Practice looks like that: https://lore.kernel.org/linux-efi/20200907170021.GA2284449@rani.riverdale.lan/ https://lore.kernel.org/linux-efi/20200907170021.GA2284449@r... If Vendors couldn't get the BIOS consistently right in the 80ies, why would they get UEFI consistently right now?
- kokada 2y agoYes, UEFI is messy, not saying you will never have issues. But on the other hand, in OpenWRT you literally need to build an image for each device, something that you (almost) never have to do with UEFI or BIOS. Or when was the last time you had to build a specific image for a x86_64 laptop? If this happened to you, I am curious, this would probably make a nice blog post. By the way, I am not saying that UEFI is not complicated, but there is probably a middle ground between "we need to build a specific image for this device because its bootloader is dumb" and "we have a f* operational system as a bootloader that works everywhere but is full of holes".
- blueflow 2y ago> Or when was the last time you had to build a specific image for a x86_64 laptop? iwlwifi firmware blobs..
- blueflow 2y agoMy favourite pet peeves that i love to complain about (repeatedly): - The GPT partition scheme inherited mixed-endianness UUID from Windows 3.1. Some people argue it does not qualify as mixed-endianness, but it is the struct from Windows 3.1 and its not evident from a printed UUID whether it is the Windows format or Big Endian as the standard says. - Default file system for EFI is FAT, which was originally made for floppies and 8.3 filenames. Everything above 32MB and 11-byte filenames is hacked on top. There were a ton of competing, incompatible implementations until the Microsoft Extensible Firmware Initiative standardized it. FAT should deserve a long list on its own. - EFI binaries are Windows PE executables, and PE executables are starting with the MS-DOS MZ header as introduced with MS-DOS 3 (or was it 2?). The "This program cannot be run in DOS mode" header. From an osdev perspective, EFI is hideous. Good luck implementing that stuff for your own OS. For secureboot: On one side i hope that Microsoft gets hacked and their EFI signing key leaked, on the other side i'm confident this has already happened.
- Antip0dean 2y ago> ...we could have made something extremely minimal. Instead UEFI goes hard in the opposite direction... My initial suspicion was that this was about preparing the ground for closed computing regardless of the surrounding hardware. That this hasn't happened suggests it's just my imagination gone wild, it's a missed opportunity for (say) Microsoft, or the folks behind it had good intentions. Occam's Razor, I guess?
- p_l 2y agoTL;DR UEFI builds an open platform even if the actual code is closed, while "simple" alternatives make closed platforms with open source code. Raw coreboot/uboot like approaches give you open source but closed platform - the simplicity means you need considerable resources to do something else than the original maker wanted to do with it. UEFI (and before it, Microsoft attempts at semi-standardizing PC low level interfaces, effort on ACPI, etc) are an effort to provide an open platform no matter the opennes of code, availability of deep dive docs of individual computer models, and handling the fact that computers arez in fact, complex. If you want a general purpose computer that explicitly targets the idea that it's owner can just plug in CD/USB/netboot a windows/Linux/BSD installer media, without waiting for new release just to have a bootable kernel on s new machine, there's s lot of inherent complexity. Especially if you want to be able to boot a version from before release of the board you're using without significant loss of functionality (something that devicetree cannot do without special explicit work from physical device vendor, but is handled by ACPI through bytecode and _OSI checks for supported capability levels from OS). Especially if you also want to make it extensible and reduce cost in integrating parts from different vendors (aka why UEFI with hardcoded CSM boot started taking over by 2005). It's much easier not just to integrate a third party driver for example for network chip when the driver will use well defined interfaces instead of hooking into "boot BASIC from ROM" interrupt, especially when the driver can then expose it's configuration in standard format that will work no matter if you have monitor and mouse connected or just serial port. Petitboot is not the answer - it's way worse when you have to custom rebuild system firmware to add drivers (possibly removing other drivers to make space) because you want to netboot from a network card from different vendor, or just because the hardware is still good but the NIC is younger. Much easier to just grab driver from OpRom or worst case drop it in standardised firmware-accessible partition. Did I mention how much easier handling booting with UEFI is compared to unholy mess of most other systems? Yes, even GRUB on x86, which by default doesn't write standard compliant boot code so if you dual boot and use certain software packages you end up with nonbootable system. Or how many Linux installers and guides make partitions that only boot because of bug-compatibility in many BIOSes. Not to mention messing with bootsectors Vs "if you drop a compatible filesystem with a file named this way* it will be used for booting". If I want to play around with booting a late 1960s design where you need to patch binaries if you change something in hardware, I can boot a PDP-10 emulator instead. I push for using UEFI properly because I have work to do and goals to achieve other than tinkering with booting, no matter how much I like tinkering in general
- i80and 2y agoIt sounds like what you want is Coreboot? Which it seems like AMD is interested in from the slides in [1] [1]: https://community.amd.com/t5/business/empowering-the-industry-with-open-system-firmware-amd-opensil/ba-p/599644 https://community.amd.com/t5/business/empowering-the-industr...
- pjmlp 2y agoFear not, Microsoft has an ongoing Rust implementation, and then everything will be sorted out. /s https://techcommunity.microsoft.com/t5/surface-it-pro-blog/rust-support-for-uefi-development-through-project-mu/ba-p/3970582 https://techcommunity.microsoft.com/t5/surface-it-pro-blog/r...
- TacticalCoder 2y ago> It's basically a full blown operating system with all the attendant complexity and, unsurprisingly, vulnerability surface. By design. The UEFI is a gigantic NSA backdoor. I've got a bridge to sell to anyone who believes the NSA doesn't own the Microsoft UEFI signing keys, for a start.
- p_l 2y agoIt not being a backdoor and NSA stealing UEFI keys from MS aren't exclusive. To the point that it's Microsoft who mandated a deviation from UEFI SecureBoot spec that enables owners to replace root of trust keys (Platform Key) in UEFI systems if the vendors wants that "designed for windows" sticker.
- sounds 2y agoMicrosoft only mandated that for the "designed for windows" sticker, while simultaneously mandating that their arm laptops went hard in the opposite direction. https://news.ycombinator.com/item?id=3458679 https://news.ycombinator.com/item?id=3458679
- p_l 2y agoThat was during MS early flirting with ARM based devices running normal windows kernel. The "setup your own PK without vendor or even Microsoft keys" is part of Microsoft's offering for some big dollar clients in Enterprise, which is why it's included in certification these days. And I mean using your own keys, not running without SecureBoot, which was the topic linked in the 2012 discussion.
- sounds 2y agoI think you're intentionally obscuring the difference between: (1) A system locked by Microsoft, who benevolently allows some users to achieve freedom by setting up new Platform Keys. If the big dollar clients demand standardization and openness, then it might curtail the typical Microsoft antitrust shenanigans. (2) A system that is owned by the purchaser, who may choose to deploy Microsoft or other security solutions, and then remove them, at will. We already have (2), so any attempt to subvert it is by definition untrustworthy. Item (1) is what is called "trustworthy computing," and Microsoft still openly celebrates it [1]. Item (2) is what is being obscured. [1] https://www.microsoft.com/en-us/security/blog/2022/01/21/celebrating-20-years-of-trustworthy-computing/ https://www.microsoft.com/en-us/security/blog/2022/01/21/cel...