Minimal Linux Bootloader (2018)

88 1vuio0pswjnm7 27 5/4/2025, 4:36:02 PM raw.githubusercontent.com ↗

Comments (27)

D4ckard · 58d ago
I love MBR hacking, it's so fun to see. Cf. sector lisp [1] and OSle [2].

[1]: https://github.com/jart/sectorlisp

[2]: https://news.ycombinator.com/item?id=43866585

1vuio0pswjnm7 · 57d ago
HN has added "(2018)" to the title but the source for this bootloader was originally uploaded to Google six years earlier in 2012. The version uploaded to Github in 2018 added comments.

https://web.archive.org/web/20130516162543if_/http://sebasti...

1vuio0pswjnm7 · 58d ago
secure · 58d ago
I use this bootloader in gokrazy and blogged about debugging a limitation in it a while ago: https://michael.stapelberg.ch/posts/2024-02-11-minimal-linux...
not_your_vase · 58d ago

  > Blog nicht gefunden.
Ahhh, after looking harder, I see the typo

https://sebastian-plotz.blogspot.com/

watermelon0 · 58d ago
.de redirects me to .com.

Maybe this is somehow geolocked in a weird way, to return not found error for you.

  > GET / HTTP/1.1
  > Host: sebastian-plotz.blogspot.de
  > User-Agent: curl/8.7.1
  > Accept: */*
  >
  * Request completely sent off
  < HTTP/1.1 302 Moved Temporarily
  < Location: http://sebastian-plotz.blogspot.com/
1vuio0pswjnm7 · 57d ago
"On Blogger since November 2020."

https://www.blogger.com/profile/10975102234345772797

Blog post is dated 2012.

https://sebastian-plotz.blogspot.com/2012/07/1.html

This is what happens when Google acquires potential competition.

https://en.wikipedia.org/wiki/Blogger_(service)

Unlikely that original Blogger service registered a "blogspot" domainname in myriad ccTLDs such as .de

Blogger was not a surveillance-based advertising company

not_your_vase · 57d ago
When I wrote the comment the top comment's link had a typo in it: https://sebastion-plotz.blogspot.de

Since then it was edited, and in a cash-money style there isn't any note about it.

No comments yet

6SixTy · 58d ago
Kind of cool, but being exclusively for BIOS/MBR kind of kills my excitement.
seba_dos1 · 58d ago
With EFI, you can just boot straight into Linux without any bootloader.
NewJazz · 58d ago
Technically there's a pe shim, no?
seba_dos1 · 58d ago
cyberax · 58d ago
You can just package Linux as a PE executable.
NewJazz · 57d ago
I guess my point was that the package was in a way a very minimal bootloader. Equivocal, easily.
nine_k · 58d ago
Yes. BIOS. Real mode. Not that I've been missing them these 30 years, and they are still in place. It gives a weird feeling.

I mean, if you target ancient baroque hardware like e.g. ZX Spectrum, you specifically target an ancient machine. But this is expected to work on any modern x86 hardware, while it feels like code for a 80286, and likely would run there. And this ancient stuff is still supported and actively used.

musicale · 58d ago
> this ancient stuff is still supported and actively used.

It sort of warms my heart that code for the IBM 360 (now IBM Z) and the IBM PC (now x86 PC) can still run on modern hardware decades later.

On one hand, we're stuck with the legacy of the past. But on the other hand, we can build on things and don't need to reinvent them unnecessarily.

msla · 58d ago
How much emulation is required to get System/360 code running on a modern IBM mainframe? Can the CPUs still run the original 32-bit code? Do CCWs and whatever other peripheral code still work?
zokier · 58d ago
Intels X86S proposal[1] gives perspective on this. Both in how there would be reasons to get rid of legacy, and how yet it still got shot down pretty quickly[2]. It's unfortunate that I don't think we ever got more explanation on it's termination, where did the opposition come from

[1] https://news.ycombinator.com/item?id=36013257

[2] https://news.ycombinator.com/item?id=42468664

msla · 58d ago
Did you reply to the wrong person?
musicale · 56d ago
Apparently user code can still run:

"z/Architecture retains backward compatibility with previous 32-bit-data/31-bit-addressing architecture ESA/390 and its predecessors back to the 32-bit-data/24-bit-addressing System/360."

https://en.wikipedia.org/wiki/Z/Architecture

raxxorraxor · 58d ago
> Yes. BIOS. Real mode.

  ; 0x20000 - 0x2fdff temporal space to load ; size: 63.5Kb is the max.
wasn't there an inofficial unreal mode that increased the adressable space? Otherwise there aren't too many options as to stay minimal in the first place.
micw · 58d ago
Do I see it right that I need to recompile and reinstall it on each new kernel?
paulannesley · 58d ago
Yeah it looks like it needs to be assembled and written any time the kernel file's position on disk changes (`current_lba`), or different kernel cmdline is required.

I seem to remember having to do something similar with lilo… not hand-editing assembly, but running a command to rewrite the boot sector when the kernel moves on disk.

M95D · 58d ago
I don't see how this is better than lilo.
6SixTy · 58d ago
It's not supposed to be better than lilo, just code golf. Limine is pretty much the only serious bootloader gunning for the spot lilo/elilo was going for.
WalterGR · 58d ago
It’s not meant to be full-featured. It shows how to write a bootloader that’s smaller than 512 bytes.
gitroom · 58d ago
yeah im always low key impressed this old boot stuff still works now - makes messing with it feel kinda worth it