Hacker News
points by tremon 1 day ago | 0 comments
Is it real bare-metal if you're using UEFI, though?
[–] RetroTechie 1 day ago
> Is it real bare-metal if you're using UEFI, though?

If I'm not mistaken, the "bare metal" part refers to how directly you can touch it once control passes to your code. So definitely qualifies imho.

Not whether a 'glorified bootloader' burned some CPU cycles before that.

The "bare metal" qualifier goes away if underlying OS prevents your code from touching the hardware directly.

[–] tremon 13 hours ago
Well, articles about touching said hardware directly is exactly I'm missing here. As far as I can see, the only article about actual code is article 5, and that one is about "using EFI’s Simple File Protocol to read and write files". That doesn't qualify as bare-metal programming to me. Perhaps the goal is for those articles to appear later, but for now this is "prerequisites for doing bare-metal programming" more than "first steps".

Of course, I'm aware that doing actual hardware access on a complex platform such as x86 is massively complicated, which is why most bare-metal targets tend to use simpler platforms in the first place.

[–] jasomill 10 hours ago
UEFI also provides block device and SCSI passthrough interfaces, and you're free to write your own drivers and poke storage controllers directly if you prefer, or for that matter, call ExitBootServices and then do anything the hardware itself allows.
[–] jasomill 10 hours ago
It's as close to the metal as you're likely to get on a modern UEFI system short of a firmware hack.