TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bored? How about trying a Linux speedrun? (2020)

212 pointsby mdwaltersalmost 2 years ago

28 comments

cyclotron3kalmost 2 years ago
It&#x27;s more like an escape room than a speed run.<p>First person to watch a specific youtube video, which contains the password, wins.<p>Or maybe you&#x27;re literally locked in a room, and you have to bootstrap the PC to the point where you can connect to the local network, then connect to the insecure Citrix server which is running the security software that controls the door locks. From there you can unlock the door to your cell and escape.<p>Only to find you&#x27;re standing alone on an abandoned oil rig in the north Atlantic.
评论 #36968247 未加载
评论 #36971142 未加载
评论 #36969222 未加载
nickstinematesalmost 2 years ago
I recommend anyone wanting to learn Linux to deploy a Gentoo machine. It gives you a crash course in all of the various components, allows you to hand roll&#x2F;customize your kernel, and provides incredible granularity in tuning <i>precisely</i> what is on your system. No bloat. No extra dependencies. Apps compiled with support for &quot;superfluous&quot; features disabled, etc.<p>I owe my love of chroot to Gentoo.<p>The guide[1] is incredibly straightforward and easy to follow.<p>1: <a href="https:&#x2F;&#x2F;wiki.gentoo.org&#x2F;wiki&#x2F;Handbook:AMD64" rel="nofollow noreferrer">https:&#x2F;&#x2F;wiki.gentoo.org&#x2F;wiki&#x2F;Handbook:AMD64</a>
评论 #36966564 未加载
评论 #36966960 未加载
评论 #36966738 未加载
评论 #36975848 未加载
评论 #36969214 未加载
yjftsjthsd-halmost 2 years ago
&gt; Then someone would decide it&#x27;s too easy if you have this thing or that thing, and they&#x27;d cut down the starting conditions.<p>Related: <a href="https:&#x2F;&#x2F;guix.gnu.org&#x2F;en&#x2F;blog&#x2F;2023&#x2F;the-full-source-bootstrap-building-from-source-all-the-way-down&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;guix.gnu.org&#x2F;en&#x2F;blog&#x2F;2023&#x2F;the-full-source-bootstrap-...</a> and <a href="https:&#x2F;&#x2F;guix.gnu.org&#x2F;manual&#x2F;en&#x2F;html_node&#x2F;Reduced-Binary-Seed-Bootstrap.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;guix.gnu.org&#x2F;manual&#x2F;en&#x2F;html_node&#x2F;Reduced-Binary-Seed...</a> - AIUI, the idea is that you can bootstrap from a tiny hex program (small enough to hand-enter) and then iterate compilers up to current gcc on normal GNU&#x2F;Linux.
mnw21camalmost 2 years ago
I&#x27;m astonished that this thread hasn&#x27;t yet mentioned <a href="https:&#x2F;&#x2F;www.ecb.torontomu.ca&#x2F;~elf&#x2F;hack&#x2F;recovery.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.ecb.torontomu.ca&#x2F;~elf&#x2F;hack&#x2F;recovery.html</a><p>Long story short, someone accidentally did rf -rf * in the wrong place as root, and they had to rebuild the system enough to restore from the backups, including writing an executable in machine code as hex and then converting it to binary to call the appropriate system call to effectively &quot;mkdir &#x2F;etc&quot;.<p>It wasn&#x27;t Linux, but close enough.
评论 #36977676 未加载
whartungalmost 2 years ago
There’s folklore, I don’t know where I heard it, or if I just made it up, so take it with a grain of salt.<p>But the story is the Chuck Moore, when he wrote ColorFORTH, essentially started with DOS, DEBUG, and a floppy drive.<p>And from this sprang forth (ahem) ColorFORTH. Essentially he hand keyed in the most minimal core necessary to start working with his own tools until he had a boot floppy. Then he tossed DOS and DEBUG and off he went.<p>Appreciate that the original FigForth is about 80 screens of code. And a 3.5” PC floppy can store over 1400 screens.<p>Chuck seems to be the kind of person that could type in a rough Forth in raw assembly and get it editable a feed on itself to get more powerful.<p>It’s an interesting thought experiment to be sure.
评论 #36967608 未加载
评论 #36969488 未加载
评论 #36967715 未加载
jesprenjalmost 2 years ago
Well bash has a built in TCP client which kind of ruins the fun. libc has a DNS library to query a resolver so no fun banging DNS over UDP required to download from gnu.org (:
评论 #36966001 未加载
评论 #36965946 未加载
评论 #36966196 未加载
RetroTechiealmost 2 years ago
Made me think of &quot;C compiler used as bootloader, that eats source code for Linux kernel <i>while booting</i>, and boots that&quot;.<p>Ah, still on the net:<p><a href="https:&#x2F;&#x2F;bellard.org&#x2F;tcc&#x2F;tccboot.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;bellard.org&#x2F;tcc&#x2F;tccboot.html</a><p>Uses TinyCC in place of a bootloader. Of course that would require other software like a shell &#x2F; BusyBox or similar besides the kernel. But after booting on-the-fly-compiled-Linux that seems like a minor issue.<p>Project is from 2004. Surely doing this with source code for current(ish) Linux kernels would be more involved? Especially those including Rust code. :-)<p>Would be fun to have a more up to date something of the above. Anyone?
Espionage724almost 2 years ago
I speed-run every install; how else would I improve anything about it? :p<p><a href="https:&#x2F;&#x2F;wiki.realmofespionage.xyz&#x2F;distros:fedora_workstation_gnome" rel="nofollow noreferrer">https:&#x2F;&#x2F;wiki.realmofespionage.xyz&#x2F;distros:fedora_workstation...</a><p>Fresh Fedora installs involve me opening Terminal, Firefox, going to that page, and copy&#x2F;pasting commands. I can reproduce my set-up in less than an hour.
评论 #36967623 未加载
l0b0almost 2 years ago
An end user variant of this might be counting total key strokes&#x2F;mouse clicks to install Linux on any machine, including all the disgusting BIOS&#x2F;UEFI fiddling to enable USB boot, disabling SecureBoot, and anything else necessary. Whoever wins has found the best end user hardware&#x2F;distro combo.
评论 #36965818 未加载
评论 #36966806 未加载
评论 #36969246 未加载
raggialmost 2 years ago
I worked on Fuchsia for about 5 years. Somewhere maybe around half way through, I think it was during a Christmas vacation, someone wrote in that they were still away from their desk, and they&#x27;d not bricked their test device, but nearly - they could no longer install new software via the regular path as they&#x27;d done something to one of the filesystem runtimes or the like and that broke some of the components. Along the way they&#x27;d also bricked the alternate boot path, so they couldn&#x27;t use the regular &quot;paving&quot; strategy (like a flash, but for regular disks and a bit faster&#x2F;higher level).<p>I&#x27;d been working on the system bootstrap and verified execution chain, and often had to cobble stuff together in our shell. The shell on Fuchsia is a bit weird though (also my doing, largely), we&#x27;d avoid installing most software, and instead most of the programs in the shell are little stubs containing e.g. `#!resolve fuchsia-pkg:&#x2F;&#x2F;fuchsia.com&#x2F;vim#bin&#x2F;vim`. If you have bricked your update system you can&#x27;t run those programs, as you can&#x27;t resolve an up to date and safe version of vim. What was there though, was always a very small number of utilities from sbase. If you were to pick between sbase, toybox, busybox and so on, I&#x27;m not necessarily sure you&#x27;d pick sbase, but for Fuchsia it was definitely one of the easier to port for a variety of reasons.<p>So you have basically a hexdump tool, cat, and a hacked up version of dash as a shell (a POSIX shell, essentially, on a system without fork, ttys, signals or sessions, so it worked a little differently). A similar set of constraints to this article.<p>I sent them an email which looked something like: run lsblk on target and capture the output. mount the efi device to &#x2F;mnt, assuming it&#x27;s good that&#x27;s fine. copy files using the pattern &quot;cat file | ssh target &#x27;cat - &gt; target-path&#x27;&quot;. Copy the following files in build-name:target-path form: zircon.bin:&#x2F;mnt&#x2F;zircon.bin bootx64.efi:&#x2F;mnt&#x2F;EFI&#x2F;BOOT&#x2F;bootx64.efi ramdisk.bin:&#x2F;mnt&#x2F;ramdisk.bin. umount &#x2F;mnt. On target do &#x27;for i in {1..4096}; do echo -n a &gt; &#x2F;dev&#x2F;{path-to-minfs}; done`, the system will crash and reboot shortly after, and should boot into your new ramdisk.<p>At the time there was a bug that&#x27;d trigger the final reboot when a mounted but broken partition had its magic header overwritten. A couple of months later I made this way harder to recover from, but we also added an A&#x2F;B&#x2F;R partition scheme so that there was essentially always a recovery strategy even if you send really broken software.<p>If you&#x27;re on a Linux system though, I think some of this gets in some ways easier. There&#x27;s some ABI junk to deal with, but you can get really far with disgusting behavior in a posix shell that has a tty and signals, as you can write a bunch of not very feature complete, but very functional programs quickly in shell. A quick editor - probably 20 lines or so, and each time you make it better it gets easier to be better. Already got some read&#x2F;write loop going on in that editor, great, plain text http isn&#x27;t far off.<p>This is all a bit of an interesting set of trivialities though, not to discount the idea. DNS is a good example as in the article, but if you have no DNS tools you are missing ip(1) and friends, and you need to go implement netlink first - otherwise having a DNS client doesn&#x27;t matter, you don&#x27;t have configured network interfaces! If you have ip(1) then you likely also have ss(1) and you can trick the latter into acting as a dns client. If you have to hand roll netlink without headers, a compiler and a linker though, that&#x27;s not really a from-memory job there, and the netlink part is far worse than the DNS part really. If you&#x27;re on a systemd system, and all you have is systemd a shell and ip tools, you&#x27;re basically completely set from the get-go, as you can jump straight to `machinectl pull-tar` and you&#x27;re off to the races.<p>Of course if you&#x27;re on an EFI system that hasn&#x27;t trimmed down much from the reference tianocore build, then you can probably reboot into an efi shell and get network configuration and pull an image from there, which is likely easier than escalating from a zero compiler zero network environment against the linux abi.<p>Fun idea, I&#x27;m just not totally sure how to put a good modern bound around &quot;minimal linux system&quot;.<p>It feels like a CTF, but kind of in reverse. Following that theme perhaps it should be &quot;escape the pot&quot;, modelling the stripped down system as a honeypot.
cturneralmost 2 years ago
Consider a minimal install of linux&#x2F;unix with no C compiler and no binutils.<p>Editing text. Construct an ed-like editor in shell - the first character&#x2F;token of each input line is a command. You could use awk or shell for this.<p>Creating binary files. If you have gnu coreutils, it has a powerful echo option to output bytes. If you have posix&#x2F;busybox&#x2F;toybox, use od(1), head and tail to extract a library of 1-byte files from existing binaries. Cat these together to create multibyte binaries.<p>Assembler and linker. You don&#x27;t need to use conventional notation. Create an assembly syntax around the same first-token-is-command approach used for the text editor. Implement an assembler that reads that notation and outputs binary. You would need to create elf headers. You would need to map system calls.
abnryalmost 2 years ago
Can someone please do this and stream it so I can learn?
评论 #36966424 未加载
ChrisArchitectalmost 2 years ago
(2020)<p>Previous discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22846250">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22846250</a>
accrualalmost 2 years ago
I did something like this with a 486 box recently. It only had DOS, ISA only, and no network card. By the end of the night I had Win 95 running, copying files over FTP, and SSH&#x27;d into my router from it. It was fun.
评论 #36967497 未加载
评论 #36966670 未加载
otikikalmost 2 years ago
Isn&#x27;t the fastest way to do this to download a linux bootable image and then reboot over that?
评论 #36968849 未加载
loser777almost 2 years ago
related: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=8utpbbdj0LQ">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=8utpbbdj0LQ</a>
评论 #36968181 未加载
johnklosalmost 2 years ago
One can learn all sorts of interesting skills when one starts to imagine all the possible ways simple tools can be used.<p>I&#x27;d like to see something like this, but with hardware included - something like Junkyard Wars, but with random computer hardware - which then people need to get going to be able to do specific functional things.
FranchuFranchualmost 2 years ago
I created a Linux image that allows for this about a year ago:<p>&gt; Linux &quot;distro&quot; that only includes a Lua interpreter and a Lua library to issue syscalls<p><a href="https:&#x2F;&#x2F;github.com&#x2F;FranchuFranchu&#x2F;lua-lfs-hard">https:&#x2F;&#x2F;github.com&#x2F;FranchuFranchu&#x2F;lua-lfs-hard</a>
executesorder66almost 2 years ago
&gt;I mean speedrunning the Linux situation itself. Start with a minimal system and get yourself to the point where you can do something meaningful (like reading cat pictures on Reddit).<p>So basically an Arch or Gentoo install speedrun. I&#x27;m pretty sure I&#x27;ve already seen those on Youtube.
z29LiTp5qUC30nalmost 2 years ago
Too easy.<p>Try you only have a single bootloader and a little bit of source code and building all the way up to a complete linux distro<p><a href="https:&#x2F;&#x2F;github.com&#x2F;fosslinux&#x2F;live-bootstrap">https:&#x2F;&#x2F;github.com&#x2F;fosslinux&#x2F;live-bootstrap</a><p>(checkout the builder-hex0&#x2F;fiwix work)
flobosgalmost 2 years ago
The “desert island machine” concept brings to my mind this incredible talk from David Beazley: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=RZ4Sn-Y7AP8">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=RZ4Sn-Y7AP8</a>
评论 #36970278 未加载
moominalmost 2 years ago
Here’s a version of the idea: bootstrap speedrun. Start with the source of everything but the binaries of nothing that isn’t the basics (cat&#x2F;chmod) &amp;c. Write a script that compiles gcc. Fastest benchmark time wins.
akshaybhalotiaalmost 2 years ago
Genuinely curious: how is this different from nand-to-tetris sort of challenges? (I haven&#x27;t tried those, just curious to know if people have heard of it.)
omgmajkalmost 2 years ago
Always wanted to get into speedruns, maybe this would be the perfect thing to do. Now all we need are set rules and a category on speedrun.com.
skrebbelalmost 2 years ago
Offtopic, but<p>&gt; I mean speedrunning the Linux situation itself.<p>I think “the Linux situation” is an amazing choice of words. It truly covers it all, doesn’t it?
victor22almost 2 years ago
That&#x27;s it, no more hacker news for me, I think this is the post that made me log off for good lol
riddleyalmost 2 years ago
Bored? How about learning about mobile-friendly CSS?
ksherlockalmost 2 years ago
related: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=TLbfqZBL8t8">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=TLbfqZBL8t8</a>