
Bored? How about trying a Linux speed run? - lwhsiao
https://rachelbythebay.com/w/2020/04/11/pengrun/
======
dloss
Reminds me of David Beazley's talk about being locked in a hidden vault to
analyse 1.5 TBytes of C++ source code. No tools or internet connection, but a
Python interpreter. [https://pyvideo.org/pycon-us-2014/discovering-
python.html](https://pyvideo.org/pycon-us-2014/discovering-python.html)

~~~
mvdwoord
This remains one of my favorite talks of all time. Amazing story, well told.
Anyone who hasn't seen this yet... highly recommended.

~~~
kapilvt
DavidB is generally awesome, that said I just watched this its kinda of meh,
maybe 5-9m of good stuff, if haven't seen his other talks, I'd recommend them
first, unless you have particular interest in patent legal suits, and indexing
code for basic patterns via a library of functions (grep/glob/etc), ie its
basically using stdlib collections w/ files to build a vfs grep/stats lib, w/
py 2.3 while coding on a desert island so to speak. his other talks cover a
wide range of subjects, their probably all better imo.

------
carapace
Phase 1: Bit bang a Three-Instruction Forth: "A 3-INSTRUCTION FORTH FOR
EMBEDDED SYSTEMS WORK" by Frank Sergeant

> Illustrated on the Motorola MC68HC11 ... Copyright 1991

[http://pygmy.utoh.org/3ins4th.html](http://pygmy.utoh.org/3ins4th.html)

Phase 2: "A BNF PARSER IN FORTH" Bradford J. Rodriguez

> (This article first appeared in ACM SigFORTH Newsletter vol. 2 no. 2)

[https://www.bradrodriguez.com/papers/bnfparse.htm](https://www.bradrodriguez.com/papers/bnfparse.htm)

Phase 3: "Metal to the Desktop in 20,000 LoC"

Using principles from OMeta (
[https://en.wikipedia.org/wiki/OMeta](https://en.wikipedia.org/wiki/OMeta) )
recapitulate the VPRI STEPS project:

"STEPS Toward the Reinvention of Programming, 2012 Final Report"

> Submitted to the National ScienceFoundation (NSF) October 2012

> (In random order) Yoshiki Ohshima, Dan Amelang,Ted Kaehler, Bert
> Freudenberg, Aran Lunzer, Alan Kay,Ian Piumarta, Takashi Yamamiya, Alan
> Borning,Hesam Samimi, Bret Victor, Kim Rose

[http://www.vpri.org/pdf/tr2012001_steps.pdf](http://www.vpri.org/pdf/tr2012001_steps.pdf)

------
sdenton4
This is basically what early Gentoo releases were like... A hilariously
minimal tool chain and a txt guide to compiling and configuring every piece
between basically nothing and a functioning web browser. A typical speed run
took a day because compilation times were long. And if you realized late that
you'd made a fatal mistake, starting over took a loooong time.

#pepperidgefarmremembers

~~~
Legogris
I remember spending a lot of time with that as a teenager. A stage0 (or was it
stage1?) installation took about a weekend, I recall. I was a bit surprised
recently realizing that there's still a significant Gentoo community, with
influx of new users. Didn't really occur to me that the installation
experience is completely different these days, but that makes sense.

Might give it a try again.

~~~
chiefsucker
> Didn't really occur to me that the installation experience is completely
> different these days, but that makes sense.

I used Gentoo as my main OS for multiple years over a decade ago, installed it
a couple of times, and helped with the localization of several documents, but
I still remember the installation being basically the same as it is now.

I’m honestly wondering what is meant by this statement?

~~~
arantius
In the past you used to be able to choose from various stages, which went down
to _very low_ level. Now you must start from stage 3, which is already a
(slim, but) fully bootstrapped/running installation, which you customize from
there.

------
jml7c5
I think an important category has to be: no outside servers designed to help
with this speedrunning challenge. Without such a rule, one can get an outside
computer to do much of the work. One would merely write a small program that
connects to the known IP and pulls bootstrap code straight into memory.
(Granted, still a fair piece of work, but without such a rule the finish line
for the speedrun would become "establish a TCP connection").

EDIT: I wonder if including the Linux kernel + C library is just too much. How
minimal could one go with this challenge, yet have it still be fun/doable in a
reasonable duration? You start with just MS-DOS on the disk? Or a Forth
interpreter? Or maybe you start with a blank disk, but you get to twiddle bits
one at a time before you first use it, in the vein of the Altair 8800?

EDIT 2: An even more entertaining idea than some sort of 8800-style toggle
switch interface: you start with an actual Altair 8800, then get a few
"stepping stone" computers that have just enough hardware compatibility that
you can transfer data from one to the next. The final computer is a modern PC
with a network connection.

~~~
CM30
Generally, speedrunning communities (for games and other things) already bar
tricks and strats that require setup on an external file/system.

For instance, you can't carry hearts/stamina from one file to another in a
Breath of the Wild speedrun, or use wrong warping to instantly go to a
location saved on an alternate save file.

There are exceptions in certain scenes (in speedruns for Banjo-Kazooie, a
glitch is used on another save file to fix the RNG for a quiz section later in
the game), but generally, everything has to be done from an empty file/system
with no external resources already setup.

~~~
ProZsolt
You can "airgap" a gaming system so you can't use any external resources. It
is very clear what you can use and what you can't.

Here you have a network connection and you should use it. It's part of the
challenge. What counts as an external setup?

~~~
Legogris
Network, not necessarily internet.

------
INTPenis
This is how I used to live my life. Sort of. I mean early 2000s when I had
left home and moved to a far away city for a job in IT. All I had was a stolen
256M RAM laptop with FreeBSD. No internet and no TV at home because I lived in
a shitty apartment building.

At work I had all the bandwidth and resources I could use.

So I downloaded all I could during the weekdays and during evenings and
weekends I'd just browse manuals and try things on my laptop, in my own little
virtual LAN.

That's how you learn, kids.

~~~
tiborsaas
That's how I learned web development in the 2000s. I downloaded stuff at
school on floppy disks and took them home to inspect them. I had cool gifs,
midi files, html files and I had Home Site 4.0 which had a great documentation
about HTML and some basic JS.

~~~
IggleSniggle
Sadly, for me in the late 90s, it was learning the ins and outs of how to
modify Win95 UI. Turns out a whole lot of those skills were total dead-ends.
But I can help you make your Win95 look and feel however you like!

Need your cursor to be animated but change animations depending on what you're
doing? You got it! Find that editing .ini files lacks a certain flair? No
problem! Prefer a fuchsia screen of death, or a "fortune" style "safe to turn
off your computer" message? I got your back.

~~~
Legogris
I recall that custom animated bootup screen was something that had a different
variation of the quirky hack in different subversions through 95-98.

Also made a point of reskinning every last pixel. I still get a similar
feeling tweaking my Linux environment (albeit stronger focus on productivity
these days). Some inspiration in /r/unixporn, maybe you can relive that again
;)

~~~
IggleSniggle
I don't care to admit how much time I spent on fzf, autocompletions, and
zstyles today.

------
butz
I'd like to suggest "Linux From Scratch"
([http://www.linuxfromscratch.org/lfs/](http://www.linuxfromscratch.org/lfs/))
category. It might be easier for beginners, as it has definite start and
finish states and instructions. It would be interesting to do a blind run to
see how long it takes and later try a "real" speed run to optimize it as much
as possible.

------
jake_morrison
Embdded development is like this sometimes.

Start with some hardware. If you are lucky, you get a board support package
with a Linux kernel. Otherwise you need to write some drivers to talk to the
hardware. Progressively get it to the point that it will boot up and get on
the network. Then get the application running.

Microcontroller development is even worse. When you don't have any space, you
may actually end up writing everything in C from scratch.

~~~
fest
Or have some drinks with EEs and get them to value software development ease
of use: things like using top of the line, or at least midrange MCU with
enough flash for debug builds, populating debug connectors on EVT builds etc

~~~
jake_morrison
In one memorable project the hardware guys grudgingly agreed to waste money
and give the system enough resources to run Linux.

But they chose a cheaper ARM CPU without a MMU or hardware floating point.
That meant it would not run shared libraries, everything was statically
linked. We ran out of space in the Flash, and the project was in crisis. The
solution was using a lua interpreter.

These days, I like high level platforms like Nerves: [https://www.nerves-
project.org/](https://www.nerves-project.org/)

~~~
hak8or
Are you affiliated in any way to the nerves project? I skimmed the home page
and couldn't find out what it is exactly. Is it an elixer framework and
related bootstrap code targeting towards running on mmu-less arm cortex m
microcontrollers? Or on an embedded liux system? Or is this just a rest
endpoint somehow?

------
danieldk
If you have bash, you could retrieve wget or CURL and go from there.

    
    
        { echo -e "GET / HTTP/1.0\r\nHost: ftp.gnu.org\r\n\r" >&3; cat <&3 ; } 3<> /dev/tcp/ftp.gnu.org/80

~~~
rootlocus
> I realized a few years later that this was just an exercise in flexing the
> fact that I could probably bootstrap my way up from this with the C compiler
> to write a terrible editor, then write a terrible TCP client, find my way
> out to ftp.gnu.org, get wget, and keep going from there.

I assume by "a terrible TCP client" she means a TCP stack, so you don't have a
TCP stack yet, so `/dev/tcp` wouldn't exist. Otherwise just opening a socket
and sending the request would do the trick. Or maybe that's what she meant by
"TCP client"? But writing an editor for that would be overkill I think.

Nice try though :)

~~~
ilaksh
It is unclear to me whether the C libs include TCP.

If not then that seems like the main part of the work because once you have
that then you can download everything else.

Unless it was already in BIOS or some network hardware remote admin Intel
thing and there was a way to hack into that to use it. Then you would not have
to implement TCP IP.

To me the question is what is the minimal part of TCP /IP that you would need.
I guess also you need ethernet if that's not in the C libs.

To cheat maybe your computer has a modem and there is a BBS - simpler
protocol.

~~~
datenwolf
> It is unclear to me whether the C libs include TCP.

The exercise states that you have a Linux kernel and there is a network
connection. If the kernel does not have TCP, but only offers a raw socket,
well, then you have to write down a very simple TCP stack.

But if the kernel does have TCP, the exercise boils down to writing a very
simple HTTP client, a very simple DNS resolver and a bare bones XZ
decompressor and tar reader. From there I'd grab myself
[https://alpha.de.repo.voidlinux.org/static/xbps-static-
lates...](https://alpha.de.repo.voidlinux.org/static/xbps-static-
latest.x86_64-musl.tar.xz) then execute

./xbps-install -S
--repository=[https://alpha.de.repo.voidlinux.org/current](https://alpha.de.repo.voidlinux.org/current)
-r / base-system

and call it a day.

~~~
anthk
Or just get a static tar and xz static build, they must be somewhere.

Better: busybox build. It already has tar, xz and wget.

You just need to compile a simple HTTP client, or better:

find a gopher mirror. Bare netcat would work against that.

gopher://ftp.icm.edu.pl:70/1/vol/rzm6/busybox/binaries

With NetCat:

echo vol/rzm6/busybox/binaries/1.21.1/ | nc ftp.icm.edu.pl 70

echp vol/rzm6/busybox/binaries/1.21.1/busybox-i586 | nc ftp.icm.edu.pl 70 >
busybox

Then ln all the binaries. Or run busybox wget.

Accesign the rest of the files is the same, just redirect the nc command to a
file.

If tar is missing, you can just get for sure an static build and compile it.
Or try to find an sltar mirror to github ;).

But that busybox has ustar, so look how easy it was with just netcat and
Gopher, so writting an nc clone (openbsd's netcat portable version is really
easy, altough there are another ones many more times dumbed down) would be the
easiest win.

~~~
datenwolf
> Or just get a static tar and xz static build, they must be somewhere.

That is, that you can find them in an uncompressed form. If you fees
adventurous you can probably coax the compressed data somehow through the
bootloader decompressor, or the xz or deflate implementation found in the
Linux kernel. Unfortunately these days modules tend to be compressed as well,
but it should be possible to convice libdl to open a .ko file. If not you can
always mmap it PROT_READ|PROT_EXEC and follow the symbols entries through the
TLD yourself.

~~~
anthk
Busybox has these in binary form, in either HTTP/FTP/Gopher servers or who
knows which other protos. Pick your poison. Once you set a barebones
connection to a gopher server from stdin using a little of C socket
establishing code, you can just send the commands to fetch the binary,
redirect it to a file and chmod(2) +x it with ease.

------
brian_herman
I did it on mega. But I'll post youtube later I have to verify my account.
[https://mega.nz/file/ZY1BGLgC#VVIxq6HYB8UWXAF5d3S6aQBLKog89O...](https://mega.nz/file/ZY1BGLgC#VVIxq6HYB8UWXAF5d3S6aQBLKog89OPynqvFvVew9-M)
Youtube link:
[https://www.youtube.com/watch?v=8bSBBnLLhko](https://www.youtube.com/watch?v=8bSBBnLLhko)

------
anthk
Writting a shell is easy, but it's already done (do'h). You could be
restricted to a really basic one, with no cd having to reimplenent that
yourself. A simple "cd" command taking ARGV as the path would be around 10
lines in C.

Reimplementing echo would be the obvious second thing to do, and later, a
barebones cat a la plan9/OpenBSD. Finally the 3rd basic tool would be an ed(1)
clone without regex support.

ed(1) can work as a simple "more" like pager, too. Add add readonly flag to
argc/argv so it fopens the file with just read permissions and you have the
best setting to start. ed(1) is much easier to write than a visual editor.

Any TCP/IP stack related would be hard, but it the libc/kernel has a basic
implementation bundled, I'd write a gopher client and I'd declare the problem
solved, as I can fetch everything from here.

Gopher is much easier to implement than banging the FTP ports. Also you can do
a barebones IRC client with few lines. Nothing too complex, but usable enough.

Or better: write a netcat clone, [https://git.2f30.org/openbsd-
nc/](https://git.2f30.org/openbsd-nc/) connect to gopher, fetch the specs,
write a dumb gopher client, (or fetch sacc(1), you can compile it without
ncurses by editing the Makefile), connect to gpoherpedia/gutenberg Gopher
proxies to fetch all the documentation.

gopher://1436.ninja/1/Project_Gutenberg_in_Gopherspace

gopher://gopherpedia.com

But the netcat clone combined with the ed editor could serve as a basic IRC
client with FIFO files, also as a basic gopher client if you don't want to
fetch sacc(1). Once you get connected to an IRC channel in order to seek help,
among Gopher, you'll have tons of information.

Also it's the most Unix-y way to solve a problem, by far.

~~~
s3arch
I do not use IRC at all. But still curious, do people use it?

~~~
ccmcarey
Yes, some communities are still huge (Freenode).

~~~
Jenz
Freenode is actually _growing_ I’ve heard.

------
m463
A similar sort of exercise might be to just install Arch Linux to a working
desktop or some other use case.

Arch Linux puts responsibility for the install on your shoulders based on your
needs and decisions.

In the end, you get a VERY up-to-date installation of linux, without needless
bloat, and it stays that way due to rolling updates.

~~~
ColinWright
Sounds fabulous ... how do you do that? You say:

> _... just install Arch Linux to a working desktop ..._

How do you do that when you have:

> _... a box that has a couple of hard drives and a working network
> connection. HD #1 is blank. HD #2 has ... bootloader, kernel, C library and
> compiler, that sort of thing. There 's a network connection of some sort,
> and that's about it._

> _There are no editors and nothing more advanced than 'cat' to read files.
> You don't have jed, joe, emacs, pico, vi, or ed (eat flaming death). Don't
> even think about X. telnet, nc, ftp, ncftp, lftp, wget, curl, lynx, links?
> Luxury! Gone. Perl, Python and Ruby? Nope._

So, how do you install Arch Linux?

~~~
cercatrova
The parent mentions an alternative exercise, not one to be done with the
other.

~~~
ColinWright
That wasn't clear to me, but in the light of your comment, I see that it's
plausible. Thank you.

It always throws me when someone suggests an exercise, and someone, in reply,
says, "Or instead, do this other thing."

I'm oddly reminded of when we were recruiting and asked people to write some
code to solve a specific task and bring it to the interview for discussion.
Someone said "This spec is obvious nonsense" and proceeded to write a
completely _different_ spec, implement that, and get it horribly wrong.

~~~
cercatrova
That's hilarious. You would at least want to get right the spec you came up
with yourself, one would suspect.

~~~
quickthrower2
“Look my code is perfect, I’m not a BA so the spec might be off!”

------
fantispug
I've thought about a variant of this with Baking Pi [1]. That takes you
through assembly to the point of having a Raspberry Pi with a minimal terminal
(with just an external USB driver the author wrote).

I think it would be interesting to see how quickly you could get from there to
a useful system, say one where you could download the USB driver from github
and compile it. But I definitely don't know enough to do that.

[1]
[https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/](https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/)

------
lcall
This is a very cool idea. I have thought similarly, but for a "create current
civilization from scratch" game (edit: this is a real-life challenge, not on a
computer, and maybe not even as a competition): Start in an empty open area,
with nothing but nature and the low-tech clothing you wear and means of
communication with outside. The only things you can exchange with outside are:
any information at all (so, maybe use a smartphone but only to read/research,
or a "border" for q&a with anyone), and "traded" goods from similarly-managed
areas. Find and record the shortest (reasonable? by some definition?) path to
building a smartphone (or such) with its supporting infrastructure.

~~~
dylan604
[http://adarkroom.doublespeakgames.com/](http://adarkroom.doublespeakgames.com/)

sounds like the beginning of the game A Dark Room

~~~
lcall
Thanks. I edited my comment to clarify that I meant doing it in real life, out
in nature.

~~~
dylan604
still reminds me of the game. gather wood. start a fire. gather wood. build a
shelter. gather wood. build some tools. gather wood.

i'd suggest watching lots of YouTube videos before embarking on this in real
life though. my "i must be crazy" idea is living in a cabin in the mountains
during winter. given the fall to stock up on supplies.

~~~
lcall
Wholly agreed. I have no current ambition to actually do it in the foreseeable
future. But if someone does I would love to hear about it. And that they do it
safely & wisely, with honesty and the Golden Rule etc etc :) Maybe we could
learn some good things from it, and it seems almost as interesting to me as
space travel.

------
qznc
I more serious variation on the topic:
[http://bootstrappable.org/](http://bootstrappable.org/)

------
nonamenoslogan
I've spent many hours doing similar things to this--my most recent was
building Virtualbox VM's of the more interesting abandoned and ancient OSs
from WinWorldPC. So far I've got working versions of OpenSTEP, BeOS,
SyllableOS, Plan9, Solaris, ReactOS, Memphis/Neptune/Chicago, OS/2 Warp and
ECommStation, and another dozen or so. When I say working, I mean bootable
with a network connection of some type, though mine are usually a little
higher up the stack than raw UDP.

Thanks for a great read, love ideas like this if for nothing else but to keep
one's nerdiness and thirst for obscure trivia alive.

------
m3at
Close enough, there are distro install speedrun:
[https://www.reddit.com/r/linux/comments/7kg7i1/install_gento...](https://www.reddit.com/r/linux/comments/7kg7i1/install_gentoo_speedrun_l_i_v_e/)

Then of course, once you have the OS you can attempt the classical editor
speedrun:
[https://www.reddit.com/r/speedrun/comments/8rqkzz/vim_exit_s...](https://www.reddit.com/r/speedrun/comments/8rqkzz/vim_exit_speedrun_wr_25013/)

~~~
arendtio
:D Actually, I thought of Gentoo when reading the post. LFS is probably closer
to the task at hand, but the stage 1 Gentoo installations aren't that far
either.

------
eqvinox
The C library includes the stub resolver / getaddrinfo(), so you don't need to
memorize any IP addresses ;D

------
bschwindHN
Bored? Write a touchpad driver based on libinput which gives you identical
mouse acceleration between Macbook trackpads and linux trackpads.

~~~
jeroenhd
As someone who can't be bothered to pay the Apple tax, what does the Macbook
trackpad do that others don't? My experience with different mouse acceleration
configs (Windows, Synaptics, Linux) has only been negative.

~~~
willvarfar
I don’t have a clue about _why_, but I know from using macOS and Linux on mbp
that whereas the touchpad basically works in macOS, it totally doesn’t
function in Linux! :(

In Linux, wrists keep triggering touch events as you type. Screens start
scrolling, focus goes to random things, and everyone swears. You end up having
to hold your hands right over the keyboard in a very unnatural way to avoid
accidental mouse interaction.

I’ve had this problem on my current hp laptop that replaced my mbp too. It’s a
Linux concepts problem. Linux simply doesn’t cope with hands near the
touchpad.

Lots of coders I know use Linux on laptops. They swap recipes for how to
disable the touchpad completely.

<sobbing/>

~~~
aliceryhl
Which laptop are you using? This has never been an issue to me, and I've used
Linux exclusively for years. I'm on a Thinkpad T480s.

~~~
forty
I have exactly the same laptop and don't have any issue with the touchpad
either and never really understood what's wrong with non Mac touchpad. Maybe
it's just a cheap laptop vs expensive laptop thing than Mac vs Linux.

------
bawolff
I imagine at some point, some hardcore person would just end up doing echo -e
'bunch of machine code here' > file

------
bscphil
> Who knows how far down the stack this could go?

Seems to be like the obvious initial way to up the ante would be to get rid of
the compiler. How would you go about bootstrapping your way out if all you had
was the Linux kernel, glibc, and the Bourne shell?

~~~
danieldk
The stage0 bootstrap is seriously interesting:

[https://github.com/oriansj/stage0](https://github.com/oriansj/stage0)

It starts with a system without firmware and an OS, just a <=1KB hex monitor
that assembles special hex0 programs. In the next stage it bootstraps a more
comfortable assembler. Then it uses this assembler to bootstrap a small C
compiler written in assembly. And then it uses this C compiler to compile a C
compiler written in C. All the way up to gcc.

~~~
pabs3
This and the other projects by the Bootstrappable Builds project are really
interesting:

[https://bootstrappable.org/](https://bootstrappable.org/)

I wonder how many of the upper layers have cyclic build dependencies. I know
Scala and sbt do but what else?

------
joantune
Bored?! I'm sure that there are a gazillion more useful - and even fun -
things to do

~~~
yjftsjthsd-h
> I'm sure that there are a gazillion more useful

Sure, but that's always true.

> and even fun - things to do

Never:)

------
lwh
These sound like things that used to be regular part of install/setup on BSD
and Linux. It's so much nicer now not having to setup the network, GUI or
disks. Nevermind the week of downloading all the floppy images.

------
lilSebastian
What is "the Stevens book" mentioned here? TIA

~~~
zetaben
Probably "TCP/IP Illustrated"
[https://www.amazon.com/gp/aw/d/0321336313/ref=dbs_a_w_dp_032...](https://www.amazon.com/gp/aw/d/0321336313/ref=dbs_a_w_dp_0321336313)

But maybe also: "Advanced Programming in the UNIX Environnement"
[https://www.amazon.com/gp/aw/d/B00DB3G8KY/ref=dbs_a_w_dp_b00...](https://www.amazon.com/gp/aw/d/B00DB3G8KY/ref=dbs_a_w_dp_b00db3g8ky)

Which is really good

~~~
lilSebastian
Thanks very much

------
pnako
The last thing I would want to do is re-invent Unix once again.

I would probably try to hack myself some sort of Forth-like language and have
fun.

~~~
kbr2000
Yes, that would be a worthwhile choice! Shelter and fire first, probably :)

------
p410n3
I have done LEMP Speedruns in the past.

Start with an Debian USB stick and finish when you see the output of phpinfo()
in a browser

------
rmetzler
Why would you write a terrible editor in C and what would you use to type that
in?

Isn’t cat - > file.txt or echo enough?

AFAIK bash is able to set up tcp connections. Can’t you just download a static
compiled editor through this?

Maybe you don’t have bash. So what exactly is the starting point?

~~~
anthk
A basic shell with just forks and execs binaries from $PATH and nothing more.
Maybe, just maybe, file redirection. You won't have neither echo(1) or cat(1),
you must reimplement them. Echo(1) is damn easy.

~~~
pishpash
Better would be to have a scheduled execution of some bits on the disk, every
5 minutes or so, and you are only allowed to write to disk, not execute
anything on your own.

~~~
kchr
Sounds like a neat scenario for a CTF :-)

------
zitterbewegung
To avoid memorizing certain things to win speed running Linux could be broken
down into categories so that it can be a fair comparison. An example would be
no memorization or no networking . The current speeedrin community does this
already.

~~~
Kaze404
How do you stop someone from memorizing the run? Better yet, how do you stop
yourself from doing so?

~~~
NikolaeVarius
A large brick wrapped in a slice of lemon

~~~
bear8642
Also known as a Pan Galactic Gargle Blaster

~~~
donttrustme
Noted for its effect on certain carbon-based life forms. Also known as the
best drink in existence.

------
29athrowaway
You get all this functionality from the kernel for free.

[http://man7.org/linux/man-
pages/man2/syscalls.2.html](http://man7.org/linux/man-
pages/man2/syscalls.2.html)

~~~
jml7c5
Does the kernel provide a TCP stack? Either way, you still need to write an
editor with which to write programs that utilize those syscalls.

~~~
input_sh

        echo "line" >> file
    

I really don't get the need for an editor.

~~~
pests
This amuses me too. We had to bootstrap from nothing originally too. I think
many have never learned the history or started from first principals.

~~~
tom_mellior
> We had to bootstrap from nothing originally too.

I doubt that the original Unix was written without an editor, using only cat.
Of course some earlier interactive system at one point did have to come up
without an interactive editor... but still I'd think it's much more likely
that the editor was written off-line and fed into the system on punched cards
or tape rather than cat'ed from the terminal.

The original post only mentions the network and implicitly the keyboard as
possible inputs, but of course the challenge would be much easier if you
allowed a DVD, CD, or even floppy drive with drivers (which are part of the
kernel). I think pretty much any historical bootstrapping of an interactive OS
is much closer to this setting.

~~~
lwh
it had 'ed' the precursor to ex and vi editors. The terminal they used was
paper so not quite ready for a visually oriented editor!
([https://en.wikipedia.org/wiki/Teletype_Model_33](https://en.wikipedia.org/wiki/Teletype_Model_33))
If you're stuck on a basic system or rescue shell, cat and echo are
considerably more straightforward if you don't know how to use ed already.

~~~
tom_mellior
I doubt they wrote ed in cat.

~~~
lwh
sorry I was unclear. I assumed those who created ed knew how to use it - but
regular people not familiar with ed would tend to use cat and echo when stuck
in a broken / bare system.

~~~
tom_mellior
Of course they knew how to use it. But I don't think they wrote the first
lines of ed in ed-on-the-live-system. It is much much more likely that they
wrote them offline and imported the code from punched cards or via tape or
whatever from another system.

For whatever it's worth, Wikipedia
([https://en.wikipedia.org/wiki/History_of_Unix](https://en.wikipedia.org/wiki/History_of_Unix))
says: "In about a month's time, in August 1969, Thompson had implemented a
self-hosting operating system with an assembler, editor and shell, using a
GECOS machine for bootstrapping." I'm sure there are more details to be had
somewhere.

------
romes
It'd be very interesting to see an actual "starter kit" :I

The original idea could even be adapted to more than one degree of
difficulty... I love the idea, it's, at least, a fascinating concept

------
Aissen
That's basically gokrazy : [https://gokrazy.org/](https://gokrazy.org/)

Or is the game to do it only with the syscall interface and no library?

------
brian_herman
[https://www.youtube.com/watch?v=8bSBBnLLhko](https://www.youtube.com/watch?v=8bSBBnLLhko)

------
imprettycool
I know this is kind of a joke but this will never catch on the way videogame
speedruns do. Watching someone else write code is incredibly boring

------
eloisius
This would be a really fun competition in a maddening way. If somebody put up
a VM to start with, I'd bite. Or at least, if there was some kind of criteria
for a starting point, putting together a bare bones distro wouldn't be too
hard. I can see bootstrapping a basic editor using cat and working all the way
through a TCP stack, DNS, etc. but my mind blanks at implementing TLS. Seems
like it would be a requirement to do anything meaningful on the internet at
this point, but I wouldn't even know where to begin.

~~~
TimTheTinker
Computer Networks by Tanenbaum should be helpful, along with RFC 793 for
specific details (and any prerequisite RFCs).

------
exdsq
I'll bite and try this out myself, although I expect it will take a long time
to work everything out...

------
tyingq
I suppose TLS might be something of a barrier. Plain old ftp and http sites
are disappearing.

~~~
anthk
echp vol/rzm6/busybox/binaries/1.21.1/busybox-i586 | nc ftp.icm.edu.pl 70 >
busybox

:p

------
fizixer
The first thing you should do with the C compiler is create a scheme/lisp
interpreter.

------
radium3d
So, get Arch Linux running via UEFI (no grub) with gnome on boot? Always a fun
challenge!

------
6510
A dumb idea I had was to turn each and every occupation into a competitive
sports.

------
z3t4
Something similar is installing an unsupported OS or fresh OS via SSH.

------
hattori
First sentence: "I have a lot of dumb ideas."

One of us! One of us!

------
b0rsuk
Speedrunning with root. What can possibly go wrong...

------
adrianmonk
Ugh. As a former sysadmin, I've done more than plenty of permutations of this
game already. Playing it again wouldn't cure boredom for me.

------
DeathArrow
>" About 15 years ago, I mused about the idea of having a "desert island
machine". This is where I'd put someone in a room with a box that has a couple
of hard drives and a working network connection. HD #1 is blank. HD #2 has a
few scraps of a (Linux) OS on it: bootloader, kernel, C library and compiler,
that sort of thing. There's a network connection of some sort, and that's
about it.

There are no editors and nothing more advanced than 'cat' to read files. You
don't have jed, joe, emacs, pico, vi, or ed (eat flaming death). Don't even
think about X. telnet, nc, ftp, ncftp, lftp, wget, curl, lynx, links? Luxury!
Gone. Perl, Python and Ruby? Nope.

There's your situation. What do you do? "

I would swim, do some sunbathing, eat coconuts, do some fishing and generally
enjoy the situation. No work, no stress, nobody to bother. :)

~~~
badsectoracula
I grew up on a greek island, that stuff gets boring fast :-P

~~~
objektif
Linux also gets boring pretty fast :) Btw which Island? I love to visit there
at some point but dont know where to start.

~~~
badsectoracula
Samos. I haven't been there for about 12 years though so i don't know how it
is nowadays.

~~~
testmasterflex
It’s fantastic. I was there in 2016. Have visited Greece at least 15 times but
Samos is still my favourite. Make sure you rent a bike and drive around the
island.

------
zerm778
how about no

------
DeathArrow
>" So here's the pitch: Linux speedruns. By that, I don't mean "speedrunning a
game on a Linux box" (like emulation, or something). Nope.

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). "

I'd rather do something useful or at least pleasant. I don't have an infinite
amount of time and I don't like to waste it.

~~~
danpalmer
Looking at your comment history I fear this may not be the community for you.
Constructive criticism is valued, but negativity and sarcasm bordering on
racism are not. Please try to enhance the community rather than detract from
it.

~~~
DeathArrow
The fact that I don't consider building a Linux system from scratch neither
useful nor pleasant is somehow negative or sarcastic bordering on racism?

Should I explain why I don't consider it useful or pleasant?

~~~
saagarjha
> Looking at your comment history

