Live data from Hacker News

Get PC BIOS back on UEFI only system

github.com

31–40 of 65 posts

Re: Get PC BIOS back on UEFI only system

#31

Earlier quoted context omitted.

... uhh, not really. :)

The little bit I perused is very readable code.. like enjoyable to read. There are a lot of stylistic decisions that always felt "right" to me (general spacing, commenting style, horizontal alignment of equals signs, etc) -- but FWIW the first codebase I ever read (and probably imprinted on me indelibly) was DikuMUD, which is kind of in the same ballpark. Anyways, very cool to see.

I... wouldn't confess to having perused illegally leaked Windows source, as it could taint you and make you ineligible to contribute to certain projects, like Wine.

Re: Get PC BIOS back on UEFI only system

#32
post #29

Earlier quoted context omitted.

DOSBox doesn't give access to real hardware. DOSemu doesn't run well on 64-bit machines. If you need unfettered hardware access, FreeDOS on the bare machine is the best option.

What about using PCem? It does well emulating real hardware.

That does one no good if you need something connected to a parallel port.

Re: Get PC BIOS back on UEFI only system

#33

Earlier quoted context omitted.

... uhh, not really. :)

Microsoft owns GitHub, and GitHub is crawling with Windows source code leaks… and I’m wondering it anyone at Microsoft really cares? Is it possible they’ve even made an intentional decision just to ignore it? If it were an Oracle source code leak, I expect they’d have a crack team of lawyers suing people 24x7 until it was all gone… maybe that’s why there haven’t (to my knowledge) been any Oracle source code leaks (I…

MS offers (or offered back in the day of Win2000 and XP) access to source code for governments, system integrators and academic institutions as part of its Shared Source Initiative:

- https://en.wikipedia.org/wiki/Shared_Source_Initiative#Overv...

- https://news.microsoft.com/source/2002/02/21/microsoft-annou...

Re: Get PC BIOS back on UEFI only system

#34
post #30
post #7

Very cool hack. But, as okanat says, if the goal is to run legacy operating systems, then modern hardware is going to be challenging in other ways too. IME the biggest thing I want PC BIOS back for is the ability to use non-GPT disk layouts, which this doesn't accomplish as, as to use it you put it on the EFI partition on your GPT disk.

Too late to edit: non-GPT, non-MBR For instance, whole-disk btrfs. Or old BSD partition schemes.

That is a very niche use case, and also won't really work on most real BIOS machines as they actually check for a proper MBR and/or BPB (and no GPT), which is also why GPT on BIOS support is very spotty, since a lot of BIOSes will detect the GPT and refuse to boot, or refuse to boot in legacy (CSM) mode.

In any case that is far beyond the original scope of booting old PC OSes, which MBR support alone serves really well (99.9% of the way there, really), which is why I assumed by default you were thinking of MBR, not some other weird scheme.

Re: Get PC BIOS back on UEFI only system

#35
post #30
post #7

Very cool hack. But, as okanat says, if the goal is to run legacy operating systems, then modern hardware is going to be challenging in other ways too. IME the biggest thing I want PC BIOS back for is the ability to use non-GPT disk layouts, which this doesn't accomplish as, as to use it you put it on the EFI partition on your GPT disk.

Too late to edit: non-GPT, non-MBR For instance, whole-disk btrfs. Or old BSD partition schemes.

you probably can with uefi modules

Re: Get PC BIOS back on UEFI only system

#36
post #31

Earlier quoted context omitted.

The little bit I perused is very readable code.. like enjoyable to read. There are a lot of stylistic decisions that always felt "right" to me (general spacing, commenting style, horizontal alignment of equals signs, etc) -- but FWIW the first codebase I ever read (and probably imprinted on me indelibly) was DikuMUD, which is kind of in the same ballpark. Anyways, very cool to see.

I... wouldn't confess to having perused illegally leaked Windows source, as it could taint you and make you ineligible to contribute to certain projects, like Wine.

That's Wine's problem, not mine.

Re: Get PC BIOS back on UEFI only system

#37
post #30
post #7

Very cool hack. But, as okanat says, if the goal is to run legacy operating systems, then modern hardware is going to be challenging in other ways too. IME the biggest thing I want PC BIOS back for is the ability to use non-GPT disk layouts, which this doesn't accomplish as, as to use it you put it on the EFI partition on your GPT disk.

Too late to edit: non-GPT, non-MBR For instance, whole-disk btrfs. Or old BSD partition schemes.

How much benefit would there be in whole-disk btrfs? The space taken up by GPT and the FAT32 EFI partition is a rounding error compared to the sizes of modern disks.

Re: Get PC BIOS back on UEFI only system

#38
post #7

Very cool hack. But, as okanat says, if the goal is to run legacy operating systems, then modern hardware is going to be challenging in other ways too. IME the biggest thing I want PC BIOS back for is the ability to use non-GPT disk layouts, which this doesn't accomplish as, as to use it you put it on the EFI partition on your GPT disk.

MBR and GPT can coexist on the same disk - MBR goes in sector 0, GPT starts in sector 1. Normally the MBR in sector 0 is “protective” (it just marks the whole disk as in use), but in theory you can create a “hybrid” disk in which the MBR and GPT both describe the same partitions. I suppose you could even reserve most of the disk as one big GPT partition and then split that up into multiple MBR partitions. You’d have…

In practice, whether or not this actually works can be very hit-or-miss. We've found several UEFI implementations will not consider a disk bootable if the pMBR doesn't exactly match the spec, which specifies that the 'protective' partition shouldn't be marked as bootable in the MBR partition table.

Meanwhile, other implementations will not consider the disk bootable in BIOS mode if the partition in the pMBR is not marked bootable.

Re: Get PC BIOS back on UEFI only system

#39
post #4

Earlier quoted context omitted.

You get better DOS emulation with DOSBox, rather than trying to make the modern peripherals work on a CSM / BIOS system.

DOSBox doesn't give access to real hardware. DOSemu doesn't run well on 64-bit machines. If you need unfettered hardware access, FreeDOS on the bare machine is the best option.

Actually it does give some. I'm using old ham radio software like CT9 under Windows 64-bits using DOSBox-X, with the parallel port configured in pass-through mode. DOSBox-X supplies a specific driver for this kind of direct hardware access. Of course not everything will work that way.

Re: Get PC BIOS back on UEFI only system

#40
post #38

Earlier quoted context omitted.

MBR and GPT can coexist on the same disk - MBR goes in sector 0, GPT starts in sector 1. Normally the MBR in sector 0 is “protective” (it just marks the whole disk as in use), but in theory you can create a “hybrid” disk in which the MBR and GPT both describe the same partitions. I suppose you could even reserve most of the disk as one big GPT partition and then split that up into multiple MBR partitions. You’d have…

In practice, whether or not this actually works can be very hit-or-miss. We've found several UEFI implementations will not consider a disk bootable if the pMBR doesn't exactly match the spec, which specifies that the 'protective' partition shouldn't be marked as bootable in the MBR partition table. Meanwhile, other implementations will not consider the disk bootable in BIOS mode if the partition in the pMBR is not ma…

Indeed! Which is why the only portable solution is to not do this.

For stuff that needs to be bootable by both BIOS and UEFI the only portable solution is to use MBR, not GPT. That means all legacy BIOS systems will boot it, and so will all UEFI systems since UEFI must support MBR.

For ISOs that need to additionally be booted off of optical media (aka ISOHYBRIDs) the story gets more complicated, but ultimately what you need to take away from that is the same: avoid GPT at all cost.

Post reply on HN