News for hackers. Stuff that matters.
Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @05:21AM (#31107415)
> UEFI is defined by a versioned standard that can be tested and certified against. By contrast, every legacy BIOS is unique.

The "standard" for BIOSes was at first the IBM PC ROS's Reference Manual, and later the PS/2 Reference. Naturally, many vendors failed to implement it correctly. But the problem with EFI is the same. Still hoping that someday, EFI netboot support will be something usable.

I once considered using EFI as a basis for booting some of my bare-metal works, but:

- it requires the GPT partitioning scheme, which in turn requires handling of UUIDs. Their endianess is not little, big - its mixed. mixed in the same value. This is a quirk inherited from Microsoft.

- EFI system partition is the FAT file system, which is an FS that is even older than the legacy BIOS. Many gory details. Legacy from Microsoft.

- EFI "executables" are actually windows executables, who still start with the 'MZ' header from MS-DOS. The real mode code for displaying "This program cannot be run in DOS mode" is, depending on the toolchain, sometimes still included. Also legacy from Microsoft.

I don't see why Linux users should be enthusiastic about adopting this.

Re:Fedora considers deprecating legacy BIOS by mjg59 on Thursday April 21, 2022 @06:00AM (#31107590)
- previously, x86 MBR-style partition tables (which were the only thing really supported in Linux) gave you no strong semantic information about what a partition was[1]. GPT may involve GUIDs, but in the grand scheme of things that's a small part of the cost of mounting stuff.

- FAT is old, and FAT is well-supported by basically anything, and what features do you want in the partition that contains your bootloader that FAT doesn't support?

- Yeah in an ideal universe we wouldn't have to deal with PE binaries and we wouldn't have to deal with the Windows 64-bit calling convention for jumping into the firmware and also we've solved all of this shit and it just isn't a big deal any more. We can look at any platform and complain about the implementation details, but at least this one is better documented than the BIOS interface ever was.

In summary: Linux has to boot on computers that exist, and most computers that exist have UEFI. The Linux community has had the opportunity to make meaningful improvements to the UEFI spec in a way that wasn't true with BIOS. UEFI isn't ideal, but it's better than what came before in this respect.

[1] Partitions could be identified as "Linux", but that gave you no information about what they were or where they should be mounted. Current systemd-driven development has allowed us to define the partition mount point as part of the GPT data, which means they can be automatically mounted in the correct place without static configuration about partition layout

Re:Fedora considers deprecating legacy BIOS by qwerty456127 on Thursday April 21, 2022 @06:46AM (#31107831)
> what features do you want in the partition that contains your bootloader that FAT doesn't support?

Well, I'd love to be able to drop a bunch of 8GB (notably FAT doesn't support files this big) LiveDVD disk images on a bare file system and see them in the computer's built-in boot-menu immediately. I already enjoy the fact I don't need a traditional boot loader (like GRUB) to handle multi-OS as I can have 2 independent EFI boot partitions (one for Windows and one for Linux) and use the computer's boot menu too choose which to boot from.

Ideally the whole OS should be just a read-only boot image and a traditional partition should only be used for config/data files IMHO.

Re:Fedora considers deprecating legacy BIOS by tremon on Thursday April 21, 2022 @09:17AM (#31108963)
I can have 2 independent EFI boot partitions and use the computer's boot menu too choose which to boot from.

You don't need 2 EFI boot partitions for this -- you can have multiple boot loaders in the same EFI partition, each with its own entry in the boot menu. In fact, this is how I boot: the default entry boots the linux kernel directly from the EFI partition (some UEFI implementations require the kernel to have a .efi extension, others don't), and I have separate fallback entries for refind and shellx64 in case I need to boot with different kernel parameters.

Re:Fedora considers deprecating legacy BIOS by Macha on Thursday April 21, 2022 @07:59AM (#31108329)
> Well, I'd love to be able to drop a bunch of 8GB (notably FAT doesn't support files this big) LiveDVD disk images on a bare file system and see them in the computer's built-in boot-menu immediately. I already enjoy the fact I don't need a traditional boot loader (like GRUB) to handle multi-OS as I can have 2 independent EFI boot partitions (one for Windows and one for Linux) and use the computer's boot menu too choose which to boot from.

Different systems have different constraints. For example, loading the firmware interface on my systems so it can present a boot menu is way, way slower than rEFInd or Grub. And presents an ugly menu in a non-native resolution for my monitors. And doesn't let me override kernel parameters adhocly at boot time if needed (thought it has been a number of years since I have, I'm reluctant to let go of the option).

Re:Fedora considers deprecating legacy BIOS by brobinson on Thursday April 21, 2022 @07:31AM (#31108110)
Ventoy can do this: small EFI partition with keys you can enroll in SecureBoot and a fat second partition you drop all your ISOs onto.
Re:Fedora considers deprecating legacy BIOS by Nextgrid on Thursday April 21, 2022 @10:36AM (#31109990)
GRUB can also do this. In fact, I'd be in favour of deprecating GRUB as the default for UEFI on Linux distros as it's a huge codebase (including lots of legacy things) which is overkill for booting a single OS (the Linux kernel itself can be a UEFI application, no bootloader needed) but for this use-case it's perfect as it's essentially its own mini-OS and can handle a wide array of filesystems including LUKS, Linux mdadm RAID, LVM, etc.
Re:Fedora considers deprecating legacy BIOS by horsawlarway on Thursday April 21, 2022 @01:33PM (#31112582)
To be fair - some distros are moving away from GRUB as the default.

Pop!Os uses systemd-boot (formerly gummi-boot) by default if you're on an UEFI system, and only falls back to GRUB for legacy bios.

Arch is also much easier to setup on systemd-boot.

The issue is that GRUB still has a very compelling support matrix - it'll work basically everywhere, and with most all configurations. So if you're already running a batteries included distro, where someone else is doing most of the configuration and the downstream systems are hugely variable (old consumer hardware) - then GRUB still makes the most sense.

Re:Fedora considers deprecating legacy BIOS by mjg59 on Thursday April 21, 2022 @07:01AM (#31107920)
That's a reasonable desire, but it's also not something that's supported by traditional BIOS - UEFI isn't any worse in this respect
Re:Fedora considers deprecating legacy BIOS by mmphosis on Thursday April 21, 2022 @02:28PM (#31113373)
The first and only instruction that runs is on the “read-only” boot image which can be the whole OS. The solid state image is read-only because the tab is physically in the read-only position. The is the entire specification for booting.
Re:Fedora considers deprecating legacy BIOS by zozbot234 on Thursday April 21, 2022 @06:54AM (#31107883)
> notably FAT doesn't support files this big

ExFAT can support those. You could also use the UDF file system.

Re:Fedora considers deprecating legacy BIOS by qwerty456127 on Thursday April 21, 2022 @07:04AM (#31107935)
But ExFAT lacks the FAT's virtues of being universally supported and royalty-free, yet still is a very dumb FS with no journal (which means unreliable) and no extended attributes (which means data-metadata separation impossible) so I don't see a reason for it to exist anywhere outside severely resource-limited embedded applications. I would rather use Ext4 everywhere for everything. Is the problem preventing wide adoption of Ext4 GPL?
Re:Fedora considers deprecating legacy BIOS by speeder on Thursday April 21, 2022 @09:27AM (#31109088)
Seemly ExFAT is specially unreliable... Nintendo Switch community first advice when you buy one is: If you buy a SD Card with ExFAT, reformat it to FAT, because ExFAT will eventually cause your files to be corrupted...
Re:Fedora considers deprecating legacy BIOS by babypuncher on Thursday April 21, 2022 @01:37PM (#31112638)
That may have more to do with Nintendo's implementation. The exFAT support that was added to the Linux kernel a few years ago has been fine.
Re:Fedora considers deprecating legacy BIOS by oynqr on Thursday April 21, 2022 @02:46PM (#31113622)
The Switch has a bad exfat driver.
Re:Fedora considers deprecating legacy BIOS by Beltalowda on Thursday April 21, 2022 @10:50AM (#31110160)
A EFI partition is mostly read-only, so I don't think that's a particularly large problem?

> I would rather use Ext4 everywhere for everything. Is the problem preventing wide adoption of Ext4 GPL?

The BSDs don't support ext{2,3,4} particularly well, and Linux doesn't support FFS/UFS particularly well. I mean, there's support for these things, but it's far from complete or perfect and it's taken a long time.

It's just a fair amount of effort to implement filesystems well, and there's very little tolerance for errors. Ext4 isn't spectacularly complicated, but it's not exactly a simple FS either. I think that has more to do with lack of support than anything else: lots of effort for not all that much practical benefit.

Re:Fedora considers deprecating legacy BIOS by Macha on Thursday April 21, 2022 @08:02AM (#31108343)
NTFS hasn't been widely adopted by firmware manufacturers either. I don't think firmware manufacturers want to spend time implementing support for even the NTFS/ext/APFS era of filesystems, never mind anything newer like ZFS or btrfs.
Re:Fedora considers deprecating legacy BIOS by vetinari on Thursday April 21, 2022 @09:36AM (#31109195)
NTFS was also undocumented, and whatever the ntfs-3g folks or others working on alternate implementation figured out, it was via reverse engineering.
Re:Fedora considers deprecating legacy BIOS by Macha on Thursday April 21, 2022 @01:19PM (#31112366)
Sure, but the manufacturers presumably play for licenses for the AMD AGESA, etc. so could pay for a NTFS license if they wanted to.

And ext has plenty of documentation and they haven't implemented that either.

So I think keeping down the software complexity is the more likely method. Down to

1. The limited software investment these companies make (often just buying and reskinning firmware from AMI)

2. The limited space available on the ROMs due to hardware cost savings (e.g. companies have had to drop GUIs or support for less popular APUs to add support for new generations of mainstream CPU in firmware updates)

Re:Fedora considers deprecating legacy BIOS by qwerty456127 on Thursday April 21, 2022 @02:18PM (#31113234)
> NTFS hasn't been widely adopted by firmware manufacturers either.

Although very complex and very undocumented, NTFS has actually been adopted very widely and quite reliably. Most of the pre-smart TVs and set-top-boxes can read FAT and NTFS USB drives which makes NTFS the only choice if you want movies exceeding 4 GiBs.

Re:Fedora considers deprecating legacy BIOS by AshamedCaptain on Thursday April 21, 2022 @02:24PM (#31113311)
In fact NTFS is available on most commercial UEFI implementations. You can use NTFS to format your Windows install pendrive...
Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @07:00AM (#31107914)
ExFAT is not supported by EFI.
Re:Fedora considers deprecating legacy BIOS by dinosaurdynasty on Thursday April 21, 2022 @09:44AM (#31109280)
> what features do you want in the partition that contains your bootloader that FAT doesn't support?

Atomic updates and not getting corrupted if the power is pulled/lost while the filesystem is being written to.

Re:Fedora considers deprecating legacy BIOS by StillBored on Thursday April 21, 2022 @01:24PM (#31112436)
I suspect your thinking about FAT as a general purpose filesystem rather than the uEFI System Partition (ESP). For the latter case, one simply serializes access to the FAT/directory and renames files into their final resting place. That is going to be as robust and uncorruptable as any of the more "advanced" file systems jouraling mechanisms. Sure you might have a lost FAT chain, or a FAT chain mismatch between FAT copies, but its not going to cause a boot problem and a FAT "fsck" operation done during boot is going to be the equivalent of throwing the incomplete journal entries away, and probably just as fast given most ESP's contain a less than a dozen files.

So, not a problem, with the huge advantage FAT can be implemented/validated/etc in a few dozen lines of code.

KISS

Re:Fedora considers deprecating legacy BIOS by zozbot234 on Thursday April 21, 2022 @06:49AM (#31107852)
> previously, x86 MBR-style partition tables (which were the only thing really supported in Linux) gave you no strong semantic information about what a partition was[1]

LVM appears to solve this issue as well as the related issue of only supporting a limited number of partitions in BIOS.

Re:Fedora considers deprecating legacy BIOS by chasil on Thursday April 21, 2022 @08:00AM (#31108331)
I believe that btrfs can be whole-disk and avoid partitions entirely, which would drastically simplify things.

The only snag is swap, which I don't believe can be on a subvolume.

vgchange is a struggle for me, from the first time I saw it in HP-UX.

Re:Fedora considers deprecating legacy BIOS by asveikau on Thursday April 21, 2022 @12:29PM (#31111583)
> The only snag is swap, which I don't believe can be on a subvolume.

Linux can make swap a regular file, even. It doesn't need to be a partition.

Google result shows: https://wiki.archlinux.org/title/swap#Swap_file

Re:Fedora considers deprecating legacy BIOS by StillBored on Thursday April 21, 2022 @01:54PM (#31112886)
And its something you want to do for security reasons anyway, since linux by default isn't encrypting swap partitions. Putting swap on an LUKs encrypted partition is a bit of a PITA but allows one to hibernate/resume without fear that ones private keys end up in plaintext stored on a disk.
Re:Fedora considers deprecating legacy BIOS by forty on Thursday April 21, 2022 @06:16PM (#31115850)
And relevant to OP, you cannot hibernate on Linux with secure boot enabled, I think precisely because Linux doesn't know how to sign/encrypt the RAM dump (no idea how it's actually called)
Re:Fedora considers deprecating legacy BIOS by StillBored on Thursday April 21, 2022 @10:14PM (#31117486)
Well, its an artificial limitation on secure boot in the Linux kernel pending some cleaups, and is fairly trivial to work around if your willing to comment out the line in question build your own kernel and sign it with a key of your own creation you have enrolled in the firmware.

The problem is less about linux being capable of encrypting/protecting the swap file and more around being able to assure that is true. So like many Linux kernel issues recently its less technical, more political.

So, as I mentioned previously its entirely possible with off the shelf distro's to enable encrypted swap, the average user just has to choose between hibernate, assuring the swap is secure, and secure boot. Its a bit irritating, but seems to be low priority as the focus seems to be on suspend or hibernate without secure boot.

Re:Fedora considers deprecating legacy BIOS by zhfliz on Thursday April 21, 2022 @02:49PM (#31113665)
until kernel 5.0 swap files were not supported on btrfs.

there's also some limitations, see https://btrfs.readthedocs.io/en/latest/btrfs-man5.html#swapf...

Re:Fedora considers deprecating legacy BIOS by asveikau on Thursday April 21, 2022 @04:39PM (#31114883)
I don't think these limitations are that major, and not everybody uses btrfs either.
Re:Fedora considers deprecating legacy BIOS by StillBored on Thursday April 21, 2022 @01:51PM (#31112851)
Most (all?) linux filesystems work just fine against raw devices. They are simply unaware of the difference. The larger problem is firmware trying to find partition tables/etc in the middle of a filesytem, but even then its mostly a non issue because random data doesn't tend to look like partition tables or MBRs.
Re:Fedora considers deprecating legacy BIOS by Dwedit on Thursday April 21, 2022 @05:10PM (#31115233)
FAT filesystems tend to get the cluster chains corrupted, then all your files are suddenly truncated to exactly 1 cluster long.

So I'd rather use EXT3 or NTFS because of Journaling, and not FAT.

[dead]
Re:Fedora considers deprecating legacy BIOS by dralley on Thursday April 21, 2022 @12:02PM (#31111243)
Matthew left Red Hat 10 years ago. If you're going to "full disclosure" people, you should probably do a better job with the details.
Re:Fedora considers deprecating legacy BIOS by homarp on Thursday April 21, 2022 @11:22AM (#31110648)
workED for Red Hat, per wikipedia: https://en.m.wikipedia.org/wiki/Matthew_Garrett

Right now at Aurora

Re:Fedora considers deprecating legacy BIOS by edgyquant on Thursday April 21, 2022 @10:57AM (#31110264)
I don’t think this is an important detail, if anything it may skew people against them as it seems they have corporate interests
[dead]
Re:Fedora considers deprecating legacy BIOS by mjg59 on Thursday April 21, 2022 @06:13AM (#31107667)
I'm responsible for a great deal of the UEFI support on x86 Linux systems. You're absolutely free to have concerns about a lot of the political and social positions I hold, but this is a topic where I am literally a domain expert. If you disagree with me on this subject, present technical arguments.
Re:Fedora considers deprecating legacy BIOS by mwcampbell on Thursday April 21, 2022 @09:16AM (#31108955)
As a newcomer to this thread, just wanted to say thanks for bringing your domain expertise to this discussion even though you're certainly not obligated to do so. And, though I presume you've been paid for at least some of the work you've done on Linux UEFI support, thanks for that as well. I'm thankful that someone is willing to go to the trouble to make Linux relatively easy to boot and install on modern PCs, though I imagine the desktop Linux space isn't very lucrative.
Re:Fedora considers deprecating legacy BIOS by scrollaway on Thursday April 21, 2022 @06:14AM (#31107675)
As an outsider to this debate, you’re the hostile party. You’re replying with name calling to someone who gave you a respectful and detailed answer.
Re:Fedora considers deprecating legacy BIOS by howinteresting on Thursday April 21, 2022 @12:53PM (#31111937)
blueflow's favorites list is remarkably revealing.
Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @06:01PM (#31115722)
i fixed it! thanks for reminding me.
Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @01:21PM (#31112397)
Check the screenshot i posted in your sister post and guess why the font colors are off.
Re:Fedora considers deprecating legacy BIOS by zahllos on Thursday April 21, 2022 @09:26AM (#31109079)
I am actually for keeping the legacy scheme around for a good while, mostly because there's plenty of hardware even now that relies on it.

But UEFI is more sane. Bios systems map the first 512 bytes which are both code and partition table into ram. Into that you need to cram enough code to locate stage 2, which I think tended to be located in the alignment space between the MBR and the next sector. Stage 2 once loaded needed enough logic to find and load your boot partition, and load your config from it, parse the kernel list and finally load one of those kernels. I seem to remember grub hard coding where the stage2 actually was, although I might be wrong about that. Either way it was a kinda fragile mess.

Sure, every boot process needs to get enough logic loaded to do the next thing, but with efi this is all taken care of during efis various internal loading phases, nicely located in code on onboard flash where it probably should be. By the time it comes to look for what you want to load, you are already in long mode and we aren't hiding stuff in places not covered by a partition definition. It is kinda annoying they didn't consider a boot filesystem with large enough file storage for big images (exfat, udfs, other reasonable choice, we have the filesystems) but we can cope with that.

The process for detecting bootable partitions and updating boot entries is a lot, lot saner than BIOS systems tend to be. Sure there are details of the design I don't like, and I kinda agree with your points there too, but substitute those for better choices and you still have a reasonable overall framework.

Re:Fedora considers deprecating legacy BIOS by im3w1l on Thursday April 21, 2022 @06:58PM (#31116204)
What I like about bios is how simple stupid it is. It reads a bunch of bytes in and boom and starts running them. Partition tables and multiple stages, yes that is the convention but you dont have to adhere to that if you dont want to. Having to change into long mode, yes that is an important wrinkle I give you that. But either way, the design is so simple that you could write a little hello world mbr-program with a hex editor. It's a handful of bytes.

Ok contrast that with UEFI. There are FAT boot partitions and PE executables and what not. That's a lot more complexity.

Re:Fedora considers deprecating legacy BIOS by Nextgrid on Thursday April 21, 2022 @10:40AM (#31110048)
The legacy BIOS boot system and MBR format has some real issues that could be improved but this just sounds like an ideological battle against things inspired by Microsoft rather than legitimate technical concerns. As far as I know, despite the things you list having Microsoft roots, they are well-documented and have free/libre implementations so Microsoft influences are not really a problem.

The main problem you have is that convincing manufacturers and proprietary OS makers (including Microsoft) to switch to a hypothetical UEFI replacement free of those issues is going to be an impossible task, while UEFI is already here and while not perfect appears to be better than the legacy BIOS boot system.

Re:Fedora considers deprecating legacy BIOS by jchw on Thursday April 21, 2022 @10:47AM (#31110113)
> - EFI "executables" are actually windows executables, who still start with the 'MZ' header from MS-DOS. The real mode code for displaying "This program cannot be run in DOS mode" is, depending on the toolchain, sometimes still included. Also legacy from Microsoft.

No. They are not Windows executables. They won’t run under Windows at all for multiple reasons. They are PE executables.

PE is the executable format developed for Windows, and yes, it is backwards compatible with MZ executables, so it has the now-confusing MZ header even though that doesn’t make sense under EFI. It also has some other weird details kind of hardcoded in, like some of the data directories, many of which don’t make that much sense under EFI. Worse, it’s a little weird to parse, with many things being deduced by using known structure sizes combined with offsets specified in fields.

However, PE as a format is totally fine. Good, even. In its purest form, it really doesn’t have that much baggage. It flat out has some advantages over ELF whose symbol table non-sense is notoriously complicated. Not so under PE: explicit table of exports, explicit table of imports. The imports go to specific modules. Symbols don’t conflict. It’s got cruft, but it’s very simple to write a parser or loader, and I’ve done so a number of times before. With PE the runtime linking is handled by whatever OS is running, be it EFI or Windows; none of the INTERP stuff is needed.

Frankly, I’d be OK with using PE on Linux too. When I was a kid, I toyed around with making a binfmt for PE. Of course I didn’t finish (most notably, I never figured out how to do linking, since the ELF binfmt didn’t really do that) but it’s quite straightforward to get the actual loader going.

As for the rest of the grievances… As far as I know, FAT and GPT are only required to be supported by EFI, not required to be used. Some EFI implementations support other filesystems for the ESP (like Apple with HFS+,) and I’ve not used one that won’t happily use an ESP on an MBR.

Re:Fedora considers deprecating legacy BIOS by zahllos on Thursday April 21, 2022 @11:44AM (#31110973)
> No. They are not Windows executables. They won’t run under Windows at all for multiple reasons. They are PE executables.

Starting with the fact they have a dedicated set of "subsystem" values: https://docs.microsoft.com/en-us/windows/win32/debug/pe-form... - the win32 loader won't load anything that isn't the CUI or the GUI Windows one, although the kernel also knows about the native one. You'll just get the "this is not a Windows application" messagebox.

With NASM, you can also override that linker stub. For example save this to a file:

    org 100h
    
    start:
        mov dx, msg
        mov ah, 9
        int 21h
        mov ah, 4Ch
        int 21h

        msg db 'Are you still running DOS in 2022? Wow! 640K enough for you!',13,10,'$'
nasm -fbin -o stub.com stub.asm

then if you are using Microsoft's tools you can use LINK.EXE <usual args> /STUB:stub.com and voila, if anyone _happens_ to (try to) your code under DOS, they'll get an amusing message.

If you want it to take up minimum space, use this one:

    org 100h
    
    start:
        mov ah,4Ch
        int 21h
which will just exit that program if run under dos.

Apparently the header is hardcoded in mingw, but you could easily binary patch it in the resulting executable.

I think I read somewhere you can also remove the stub completely, but I've never tried it.

Edit: for my last comment, yes, you can definitely drop it: https://stackoverflow.com/a/9659538.

Re:Fedora considers deprecating legacy BIOS by jaclaz on Thursday April 21, 2022 @05:51AM (#31107539)
Only for the record, I don't know in Linux, but on windows (at least up to 10) it is perfectly possible to use MBR partitioned media to boot in UEFI (i.e. even if generally speaking GPT is "tied" to UEFI, GPT partitioning is not a requisite unless a greater than 4TB mass storage with 512 bytes/sector is used, 4K disks are generally not bootable for a number of operating systems, but they are rare anyway as boot media).

Viceversa, it is possible with some loaders to boot BIOS from GPT (not easy-peasy or straightforward but it can be done).

As well, the FAT is only a requisite if there is not an EFI driver for the filesystem, as an example some motherboards and RUFUS provide a NTFS driver that allows booting from NTFS volumes under UEFI.

Still, while in theory GPT and UEFI have a few advantages, there is not in practice (yet) any meaningful reason to remove support to BIOS, though lately a number of notebooks have UEFI firmware only (no CSM aka BIOS), I cannot see how removing an option/choice from a distro can be a good thing.

Re:Fedora considers deprecating legacy BIOS by pja on Thursday April 21, 2022 @07:04AM (#31107939)
IIRC Windows 11 will no longer boot from MBR partitions & you have to convert them to GPT.
Re:Fedora considers deprecating legacy BIOS by little_panda on Thursday April 21, 2022 @04:14PM (#31114638)
It will; there are tweaks out there that explicitly allow for installing windows 11 on an mbr partition.

Hint: download the latest version of Rufus, point it to a windows 11 iso and select the "Extended installation" mode. The result will happily install itself onto an MBR partition.

I performed an upgrade (!) of a windows 10 installation to windows 11 in this manner; I'm writing from this SSD right now.

  PS C:\Users\alexa> $(get-disk | ? {$_.IsSystem}).PartitionStyle; [System.Environment]::OSVersion.Version 
  MBR
  
  Major  Minor  Build  Revision
  -----  -----  -----  --------
  10     0      22000  0
Re:Fedora considers deprecating legacy BIOS by quietbritishjim on Thursday April 21, 2022 @06:27AM (#31107733)
> UUIDs ... endianess is not little, big - its mixed. mixed in the same value

UUIDs do not have any endianness. They are just a sequence of individual bytes.

It's true that some ways of generating UUIDs work by using the bytes of longer numbers, which I can believe use mixed endianness (I don't know them well enough to remember myself). But no one should be relying on that when reading UUIDs back out, except maybe for debugging purposes.

Or does GPT require interpreting the parts of UUIDs? If so, that is the real problem.

Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @06:30AM (#31107749)
Its relevant for converting them from and to their string representation.

https://en.wikipedia.org/wiki/Universally_unique_identifier#...

Re:Fedora considers deprecating legacy BIOS by quietbritishjim on Thursday April 21, 2022 @08:54AM (#31108740)
Interesting link, thanks, I wasn't aware of that. The link seems to suggest that the odd mixed-endian string representation ("Variant 2") is now quite rare.

With the one that's more common ("Variant 1"), I'd say that I *slightly* disagree that representing the byte sequence 99,aa,bb,cc as 99aabbcc is "big endian". If you don't philosphically think of the latter as a number, then it's just the bytes written out compactly. But I do see that if you think of it as a number then it's big endian, especially if you're distinguishing from variant 2.

Re:Fedora considers deprecating legacy BIOS by GoblinSlayer on Thursday April 21, 2022 @10:04AM (#31109556)
Variant is a very abstract concept mostly for humans, programs pay no attention to it and serialize all kinds of UUID the same way.
Re:Fedora considers deprecating legacy BIOS by GoblinSlayer on Thursday April 21, 2022 @09:41AM (#31109248)
UUID is defined as a sequence of 6 integer fields of various sizes. Their conversion to text is fairly straightforward, but serialization to bytes may vary depending on how you do it. "Whatever ends up in memory" is microsoft little endian format.
Re:Fedora considers deprecating legacy BIOS by jordemort on Thursday April 21, 2022 @09:32AM (#31109153)
EFI doesn't actually mandate FAT for the system partition. The system partition can be any filesystem that the firmware supports.

Of course, pretty much all EFI implementations only support FAT, so it's a bit of a moot point; the only one I'm aware of that supports anything else is the one on Intel Macs, which also understands HFS+.

You can find a huge selection of EFI filesystem drivers at https://efi.akeo.ie/ but they're derived from GRUB and hence GPL, so don't expect the likes of American Megatrends to be bundling these any time soon.

Re:Fedora considers deprecating legacy BIOS by StillBored on Thursday April 21, 2022 @01:34PM (#31112589)
Well splitting hairs, it mandates that everyone support FAT, individual system+OS vendors can add their own filesystems, but then its vendor lock.

So, just do FAT and be done with it. Adding other filesystems is just a waste of time because the ESP only needs to store a half dozen files or so.

13.3.1.1: "The EFI firmware must support the FAT32, FAT16, and FAT12 variants of the EFI file system"

Re:Fedora considers deprecating legacy BIOS by babypuncher on Thursday April 21, 2022 @01:45PM (#31112753)
I think FAT is a fair baseline. It can be implemented in a few dozen lines of code. Support for it is ubiquitous. It is not encumbered by any active patents. All the alternatives I have seen proposed are both considerably more complex and not ubiquitously supported.
Re:Fedora considers deprecating legacy BIOS by faho on Thursday April 21, 2022 @05:34AM (#31107470)
EFI is here, non-specialty Linux distros don't really have the option of not adopting it.

So the choice is between adopting it and keeping BIOS indefinitely, or adopting it and at some point in the future dropping BIOS.

Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @05:37AM (#31107483)
False dichotomy: Not picking EFI does not mean keeping BIOS indefinitely.
Re:Fedora considers deprecating legacy BIOS by faho on Thursday April 21, 2022 @05:41AM (#31107494)
What replacement do you propose, then?

Especially what replacement do you propose that works with the kind of typical hardware that non-specialty linux distros like Fedora want to support?

Intel systems make up a large chunk of the hardware Fedora is used on, and as far as I can tell they're all-in on EFI.

So Fedora has to use EFI to be able to boot on Intel systems.

Re:Fedora considers deprecating legacy BIOS by tremon on Thursday April 21, 2022 @05:54AM (#31107557)
OpenFirmware: https://en.wikipedia.org/wiki/Open_Firmware

Many systems get by just fine with a minimal ELF or multiboot loader and a firmware-provided devicetree specification. Dynamic hardware enumeration is performed by every OS anyway, the only hardware that must be initialized is the bootloader/kernel storage.

For the x86 platform, this could be implemented via coreboot (libreboot always reads to me as lib-reboot) with a multiboot payload.

Re:Fedora considers deprecating legacy BIOS by faho on Thursday April 21, 2022 @06:01AM (#31107594)
Do you propose that Fedora not support EFI and tell its users to replace the firmare or only buy devices with that?

That would be a massive step backwards in hardware support.

Like I said: They don't really have the option of not supporting EFI.

Alternatively they can support EFI and OpenFirmware, but that increases the number of supported paths instead of decreasing them.

Re:Fedora considers deprecating legacy BIOS by adrian_b on Thursday April 21, 2022 @06:59AM (#31107908)
Actually I do not understand which is the problem of Fedora in this case.

The distribution needs to do almost nothing to support either EFI or the legacy BIOS or any other booting method.

That is the job of a bootloader package, not of the Linux distribution. For example I am using syslinux as the bootloader for all my computers, while grub is another example of a frequently used bootloader (but which seems to be excessively complex in comparison with syslinux).

I assume that by supporting only EFI Fedora means that they will remove all bootloaders from their installation image, so that the Linux kernel will be launched by its EFI stub.

I do not know about other bootloaders, but an installed syslinux package occupies only a few megabytes, maybe 10 megabytes at most, so deleting it cannot provide much space for anything else.

I cannot see how deleting a bootloader package may be claimed to be a significant simplification for the maintenance effort of the Fedora distribution.

Re:Fedora considers deprecating legacy BIOS by faho on Thursday April 21, 2022 @07:07AM (#31107965)
1. They no longer need to package bios bootloaders

2. They no longer need to support bios booting in the forums - no asking "how do you boot this? Bios, EFI? Have you tried the other?", no telling people "EFI is required for feature X"

3. They no longer need to maintain the bios boot documentation

4. They no longer need to maintain the bios path in the installer/boot media

5. They no longer need to test the bios paths (or hope they don't break and be ashamed if they don't)

6. This makes it easier to switch to a EFI-only default bootloader (instead of Grub 2, which can do both)

Is this massive? No, it's possible to keep maintaining BIOS support. But it's not just freeing space on the package mirrors either.

Re:Fedora considers deprecating legacy BIOS by adrian_b on Thursday April 21, 2022 @07:51AM (#31108273)
I agree that restricting the boot method to EFI would reduce the testing time.

Grub 2 is complex to configure, but there are other bootloaders that are much easier to configure, e.g. syslinux.

Restricting the boot method to EFI does not reduce the need for documentation in any way.

The user must still be instructed to enter the BIOS setup and verify whether their computer is not configured to boot in legacy mode, which would prevent booting. Also the user must be instructed to enter the BIOS setup even if the EFI mode is used, because the installation media might not boot anyway, because a wrong boot order is configured for EFI booting, and it must be changed.

The most complex part of the installation is not the booting, but identifying the device where Fedora should be installed, which might be needed to be reformatted and repartitioned.

So a lot of documentation is needed in any case, for novice users.

Removing the booting in legacy mode increases the chances that the installation media will not boot without the user having to modify the BIOS setup, so it increases the chances of the user having to search support in the forums.

Re:Fedora considers deprecating legacy BIOS by faho on Thursday April 21, 2022 @07:56AM (#31108309)
>Grub 2 is complex to configure, but there are other bootloaders that are much easier to configure, e.g. syslinux.

~~Yes but syslinux is bios-only. So if you have to support EFI too (and you do because there's EFI-only hardware), you now either need to support syslinux and an EFI bootloader, or a bootloader that supports both like Grub 2.~~

Edit: The article seems to suggest that syslinux can be removed if bios boot is no longer supported. I read that as it being bios-only, but it seems to support EFI?

>Restricting the boot method to EFI does not reduce the need for documentation in any way.

You still need documentation, yes. But you no longer need any documentation for booting with BIOS.

You no longer need to say "X is only supported in EFI, if you boot via BIOS you need to do Y" or anything like that, and keep those parts updated.

The part of the docs that says "To boot EFI, do X. To boot BIOS, do Y" can be cut down to "To boot Fedora, ensure X".

That is a reduction in the amount of documentation.

Re:Fedora considers deprecating legacy BIOS by usrn on Thursday April 21, 2022 @07:57AM (#31108316)
You arguably don't need a bootloader at all with EFI. You could just use the efistub.
Re:Fedora considers deprecating legacy BIOS by adrian_b on Thursday April 21, 2022 @08:59AM (#31108768)
Yes, it is easy to make a bootable device that can use either syslinux to boot when legacy BIOS is used or efistub to boot when EFI booting is used, eventually loading the same kernel.

No other bootloader is needed.

Re:Fedora considers deprecating legacy BIOS by imtringued on Thursday April 21, 2022 @01:21PM (#31112385)
Or systemd-boot. I will admit I am using Grub2 on my current Linux installation but I never liked grub. I think grub sucks.
Re:Fedora considers deprecating legacy BIOS by mattdm on Monday April 25, 2022 @09:46AM (#31154610)
> The distribution needs to do almost nothing to support either EFI or the legacy BIOS or any other booting method.

I think you're seriously underestimating the amount of effort the bootloader and hardware enablement teams who work on Fedora put in to making _systems boot Linux at all_.

Re:Fedora considers deprecating legacy BIOS by tremon on Thursday April 21, 2022 @10:26AM (#31109851)
No, I don't propose that Fedora not support EFI. I do propose that Red Hat use some of its parent company's clout to push hardware vendors in a more open direction.
Re:Fedora considers deprecating legacy BIOS by StillBored on Thursday April 21, 2022 @01:42PM (#31112700)
"Many systems get by just fine with a minimal ELF or multiboot loader and a firmware-provided devicetree specification"

Not really, none of those ecosystems has a fraction of the device variation that x86 has. When they do (arm) its a giant mess of incompatibility and non working hardware. Modern DT's are basically still tied to the linux kernel the same way that the old arm/platform descriptions tied firmware id's to individual kernel configurations. Which is why the answer to so many arm problems is "match your DT to the kernel revision", god help you if your trying to multiboot a *bsd/etc as well.

PS: Openfirmware is basically dead, that might have been a valid answer in 1998, but even IBM/etc provide alternative boot mechanisms for linux/PPC at this point. The only thing that comes close to a current replacement is UEFI.

Re:Fedora considers deprecating legacy BIOS by bitwize on Thursday April 21, 2022 @11:48AM (#31111031)
But OEMs didn't choose OpenFirmware. They chose UEFI. Therefore, Linux must support UEFI, and that's where developer effort will go.
Re:Fedora considers deprecating legacy BIOS by adrian_b on Thursday April 21, 2022 @06:45AM (#31107827)
I have encountered various embedded computers which no longer have the legacy BIOS boot option, so using EFI is indeed necessary.

However, the vast majority of server or desktop motherboards and of laptops still have the option for legacy BIOS booting, even if the option may be difficult to find in the BIOS menus.

I have about a dozen servers, desktops and laptops and I have configured all of them to use legacy BIOS booting, because EFI booting does not have any advantage, only disadvantages.

It would have been very easy to replace the ugly legacy BIOS booting method with a simple and clean method for booting, but unfortunately those who made the EFI specification have failed to achieve this goal.

Re:Fedora considers deprecating legacy BIOS by justsomehnguy on Thursday April 21, 2022 @02:33PM (#31113439)
>because EFI booting does not have any advantage, only disadvantage

For an already installed system it doesn't really matters, so the point is moot here.

But for the new systems setup I would always prefer a UEFI (with or without SecureBoot) because it allows to expose the HID management of the onboard/expansion board controllers, a proper way to return to the management/boot menu in the case of the failed boot.

Sure, it doesn't always work good, but neither BIOS/CMS.

Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @05:54AM (#31107554)
I don't. I'm waiting for something else, until then, we'll stick with BIOS. Supporting EFI means implementing more legacy cruft than we already have with BIOS.
Re:Fedora considers deprecating legacy BIOS by mjg59 on Thursday April 21, 2022 @06:24AM (#31107718)
This is literally not an option - systems have shipped without BIOS compatibility for a long time now, so refusing to support UEFI is just not an option.
Re:Fedora considers deprecating legacy BIOS by adrian_b on Thursday April 21, 2022 @07:35AM (#31108143)
Except for some embedded computers with Atom CPUs and some enterprise-oriented laptops, I have not seen any systems without legacy BIOS compatibility.

Nevertheless, the option to enable the legacy BIOS booting can be quite hard to find in the BIOS menus, which may deceive many into believing that a system does not support legacy BIOS booting, even when it actually does support it.

On work computers belonging to a company, the BIOS configuration may be locked, so it might not be possible for the users to enable legacy BIOS booting.

Re:Fedora considers deprecating legacy BIOS by eklitzke on Thursday April 21, 2022 @10:00AM (#31109517)
From the article:

> Intel stopped shipping the last vestiges of BIOS support in 2020 (as have other vendors, and Apple and Microsoft), so this is clearly the way things are heading - and therefore aligns with Fedora's "First" objective.

You may not have seen many computers yet without legacy BIOS compatibility but this is going to be the norm for new computers very soon.

Re:Fedora considers deprecating legacy BIOS by adrian_b on Thursday April 21, 2022 @10:35AM (#31109971)
The last new PC that I have seen, and which still had legacy BIOS booting support, was a Dell laptop purchased in Q2 2021.

However, it was a model launched in the second half of 2020. It is indeed possible that the models introduced since 2021 might omit the legacy BIOS booting support.

Re:Fedora considers deprecating legacy BIOS by doubled112 on Thursday April 21, 2022 @07:45AM (#31108221)
I have a couple of AMD ASUS Vivobooks that don’t have CSM/BIOS boot available

Never noticed until I wanted to boot memtest.

It’s possible that I missed it, but Google results didn’t look promising either.

[dead]
Re:Fedora considers deprecating legacy BIOS by mjg59 on Thursday April 21, 2022 @06:31AM (#31107759)
I don't think that's going to result in everyone shipping UEFI without BIOS compatibility suddenly changing their mind.
Re:Fedora considers deprecating legacy BIOS by StillBored on Thursday April 21, 2022 @02:02PM (#31112998)
Let me take a moment and point out, unless your using hardware from < 2005 or so, or one of the rare devices running a custom firmware you literally are using UEFI when you think your booting in BIOS mode.

Others have pointed out that the CSM is no longer being shipped. The CSM is the "Compatibility Support Module" and its a UEFI shim driver that adds the legacy bios INTx operations to a UEFI implementation.

So, most people booting in BIOS mode on hardware built in the past 15 years or so are actually running UEFI with an extra shim.

Re:Fedora considers deprecating legacy BIOS by chasil on Thursday April 21, 2022 @08:05AM (#31108367)
Intel ME is also here, and newer systems absolutely do not have the option to disable it, despite all it's flaws.

ME security vulnerabilities cannot be fixed in many cases, and it is an intolerable risk for some.

If you insist on a system that does not run ME at all, then the best you can run is a Core 2 Quad x9650 on BIOS.

Be mindful of what you are losing when you deprecate that machine.

Re:Fedora considers deprecating legacy BIOS by Schopenhauer01 on Thursday April 21, 2022 @05:32AM (#31107462)
Less legacy code for them to maintain. I see that as a win.
Re:Fedora considers deprecating legacy BIOS by adrian_b on Thursday April 21, 2022 @07:10AM (#31107990)
Fedora does not maintain any code related to legacy BIOS booting.

That is done by the maintainers of the bootloader packages.

What Fedora presumably intends is to remove all bootloader packages from the installation image.

In that case, the Linux kernel can be booted only by using its included EFI stub.

One less package in the installation image might be claimed to imply less maintenance work for Fedora, but in any case such maintenance work has nothing to do with the work done for maintaining legacy code.

Re:Fedora considers deprecating legacy BIOS by babypuncher on Thursday April 21, 2022 @01:27PM (#31112493)
Most of the issues you describe sound either trivial or non-issues entirely.

The mixed-endianness of GUIDs sounds annoying, but also easily worked around. It seems worth putting up with for the resiliency offered having the GPT duplicated at the beginning and and end of the disk.

I'm not sure the UEFI system partition has any practical need for anything newer or more complex than FAT. It is a very simple file system for which support is ubiquitous, and is far more capable than an MBR boot sector.

The EFI executable format being derived from Microsoft does not seem like an inherent problem, unless you can point out some meaning limitation it has compared to an alternative. However I do not know enough about binary executable formats to debate the merits of PE over ELF, so I could be missing something.

It seems to me the benefits of UEFI far outweigh the negatives here. And with UEFI now being ubiquitous in consumer and commercial hardware for about a decade now, I do not think a bleeding edge distro like Fedora dropping BIOS/MBR is a huge deal.

Re:Fedora considers deprecating legacy BIOS by saghm on Friday April 22, 2022 @12:19AM (#31118169)
> - EFI system partition is the FAT file system, which is an FS that is even older than the legacy BIOS. Many gory details. Legacy from Microsoft.

I've always wondered why it was required that my EFI partition be FAT. I've had systems where that partition has gotten messed up and required an fsck from a recovery boot, and it seemed like it should be possible to either do that automatically in some way, but being able to use a filesystem that self-corrects would be nice too (although maybe overkill for the 1 GB or whatever I give it). I guess maybe it would only be possible to perform the fsck if I booted from a different partition, which then could develop the same issue. This does make me wonder how silly it would be to have a duplicate boot partition on each of my machines that I only mount to sync over changes to the real one so I could avoid needing to grab my flash drive when stuff like this happens...

Re:Fedora considers deprecating legacy BIOS by op00to on Thursday April 21, 2022 @07:31AM (#31108109)
You don’t like it because Microsoft has a hand in developing the standard?
Re:Fedora considers deprecating legacy BIOS by emteycz on Thursday April 21, 2022 @05:23AM (#31107424)
I don't see why Linux users would care about this. It boots the system, nobody cares it uses some old MS tech.
Re:Fedora considers deprecating legacy BIOS by tremon on Thursday April 21, 2022 @05:58AM (#31107577)
It doesn't just "boot the system". The full EFI specification includes support for runtime services, i.e. proprietary code that keeps running even after your FLOSS operating system has booted. That's something Linux users should care about: it provides a backdoor for clinging to closed-source drivers on a pretend-open platform. There's already been proof-of-concept EFI viruses, it's only a matter of time until the first antivirus EFI service appears.
Re:Fedora considers deprecating legacy BIOS by mjg59 on Thursday April 21, 2022 @06:29AM (#31107738)
The UEFI runtime services provide functionality that is not generically exposed through any other OS environment. Linux could just refuse to provide those runtime features, and things would roughly work[1] - we'd still need to call some UEFI features in the boot stub, but the same is true of BIOS (look at what the 16-bit code does in terms of obtaining information that the kernel uses after init). If you want to drop all access to runtime services after kernel boot, you can by simply passing efi=noruntime to the kernel arguments.

[1] Some features would be broken, like recognising whether the system had booted successfully

Re:Fedora considers deprecating legacy BIOS by anthk on Thursday April 21, 2022 @07:28AM (#31108087)
Even back in the BIOS days Linux overrode lots of BIOS stuff such as partition size limits once it booted.
Re:Fedora considers deprecating legacy BIOS by tremon on Thursday April 21, 2022 @09:42AM (#31109262)
can efivarfs still be accessed after booting with efi=noruntime? If so, I might add that on my systems and see if anything breaks.
Re:Fedora considers deprecating legacy BIOS by mjg59 on Thursday April 21, 2022 @05:25PM (#31115391)
No, all runtime services are gone. You don't /strictly/ need them in order to boot - most Linux distributions will install a loader in the fallback path and the firmware will run it even if there are no boot entries.
Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @05:30AM (#31107453)
Because "removing legacy" was one of the key arguments of EFI enthusiasts, and its still plenus bovis stercus.
Re:Fedora considers deprecating legacy BIOS by prmoustache on Thursday April 21, 2022 @05:56AM (#31107568)
Your point is a bit moot because removing bios support will actually allow the maintainer to stop maintaining the bios parts regardless of the fact some other old things are kept.

While actually not removing bios support won't allow you to get rid of the aformentionned MS techs such as fat support.

Having said that I think this is a wee bit early.

Re:Fedora considers deprecating legacy BIOS by blueflow on Thursday April 21, 2022 @05:59AM (#31107582)
You made a factual mistake: MBR/BIOS based boot does not depend on a specific filesystem, nor does it depend on a specific executable file format except for the boot sector. You can safely remove FAT support from your kernel config, except when you need it for EFI.
Re:Fedora considers deprecating legacy BIOS by prmoustache on Thursday April 21, 2022 @06:28AM (#31107736)
> You made a factual mistake: MBR/BIOS based boot does not depend on a specific filesystem, nor does it depend on a specific executable file format except for the boot sector.

I never said that.

I said removing bios support allows you to remove anything that provides bios support and that choosing to not remove it won't allow you to get rid of the EFI dependencies so it is a moot point to talk about old techs used by EFI.

Re:Fedora considers deprecating legacy BIOS by froh on Thursday April 21, 2022 @05:36AM (#31107479)
"Full of faeces from cows" is and remains vulgar no matter how it's spelled.
Re:Fedora considers deprecating legacy BIOS by zozbot234 on Thursday April 21, 2022 @07:06AM (#31107951)
There's nothing "vulgar" whatsoever about cow dung. It is an eco-friendly, renewable material and commonly used for many sacred rituals in India.
Re:Fedora considers deprecating legacy BIOS by tpush on Thursday April 21, 2022 @07:47AM (#31108230)
The GP literally used it as a weird coded insult to UEFI (for whatever reason), India doesn't really enter this discussion.