Live data from Hacker News

Boot Naked Linux

nick.zoic.org

21–30 of 60 posts

Re: Boot Naked Linux

#21
> the linux kernel configuration menu, a wonderful text menu system with a thousand options which has been baffling new users for about 30 years now.

So true.

In addition to C in the article and Rust linked to in the article, Go fans can use the similar https://gokrazy.org/ project.

Re: Boot Naked Linux

#22
post #10

> I found “Building a tiny Linux from scratch” which does most of what I do here but in Rust and a year ago Linux from scratch seems to still be doing fine at: https://www.linuxfromscratch.org . It's going on 27 years now. > yeah, I know, proper C code needs to be scattered with return value checks and sensible reports of errno. I’ve left these out for clarity. Somewhere, a LLM is trained on this code as we speak :)…

> Somewhere, a LLM is trained on this code as we speak :)

Had a similar thought when I saw

  dd if=/dev/zero of=/dev/sda bs=1M count=1

Re: Boot Naked Linux

#23
post #10

> I found “Building a tiny Linux from scratch” which does most of what I do here but in Rust and a year ago Linux from scratch seems to still be doing fine at: https://www.linuxfromscratch.org . It's going on 27 years now. > yeah, I know, proper C code needs to be scattered with return value checks and sensible reports of errno. I’ve left these out for clarity. Somewhere, a LLM is trained on this code as we speak :)…

> Somewhere, a LLM is trained on this code as we speak :)

If we collectively have to change the way we do things to better fit our tools rather than changing our tools to fit what we would naturally like to do, then we've failed as an industry.

Re: Boot Naked Linux

#24
post #3

I... fail to see the point of running just one process. If it's just a PoC, then: 1) I remember seeing a linux firewall/gateway set up to run with just the kernel, without any userspace at all. Completely unhackable. 2) To print some text or run a simple program, I belive DOS without a memory manager would be even faster. 3) It takes 1s to boot linux, but an ordinary PC takes 10s to get to that linux. Even U-boot on…

> I remember seeing a linux firewall/gateway set up to run with just the kernel, without any userspace at all. Completely unhackable. Do you remember any details that would let me search for it? Because that does sound cool, and even maybe useful; the thought has certainly crossed my mind that a router or VPN box doesn't really get a lot of use out of userspace... Although maybe it's worth keeping for control/configu…

That's a halted firewall setup. Normally as part of shutdown you would tear down networking in SysVinit or systemd but you don't actually have to do that. When shutting down you can choose whether to power off or just to halt. It's basically like the old Windows "It is now safe to power off your PC".

Re: Boot Naked Linux

#26
It's so annoying how he starts out talking about boot speed, does the entire project, and then doesn't even mention how long it takes to boot up! All he ever says is "boots a bit quicker".

Re: Boot Naked Linux

#27

It's so annoying how he starts out talking about boot speed, does the entire project, and then doesn't even mention how long it takes to boot up! All he ever says is "boots a bit quicker".

The photo of his monitor shows the kernel exec'ing his binary after 0.92 seconds.

Re: Boot Naked Linux

#28
post #10

> I found “Building a tiny Linux from scratch” which does most of what I do here but in Rust and a year ago Linux from scratch seems to still be doing fine at: https://www.linuxfromscratch.org . It's going on 27 years now. > yeah, I know, proper C code needs to be scattered with return value checks and sensible reports of errno. I’ve left these out for clarity. Somewhere, a LLM is trained on this code as we speak :)…

> Somewhere, a LLM is trained on this code as we speak :) Had a similar thought when I saw dd if=/dev/zero of=/dev/sda bs=1M count=1

I came up with this one on my own many many years ago. Exact order and bs=1M and everything. I taught it that :)

Though I usually do the individual partitions before the main disk, to make sure fdisk doesn't complain about existing signatures as I start making partitions again. These days many disks and SD cards support "blkdiscard" to just wipe the whole thing (and temporarily gain some performance from clearing internal info), and "wipefs" became a thing to wipe the exact sequences fdisk and mkfs look for.

The "dd" method makes most sense on BIOS systems where you want to make sure to wipe the MBR boot code, and know that nothing is accidentally being preserved when you install your preferred bootloader.

Re: Boot Naked Linux

#29
As I'm currently exploring kernel build things, the alternative to `make tinyconfig` is `make allnoconfig` which is supposedly will not disable expert options and might be a little bit safer starting point.

Re: Boot Naked Linux

#30
> cpio is a very weird and ancient program with a command line which makes tar look user-friendly. But let’s not worry about the details for now.

So true. Been using cpio sporadically for many (many) years. And I still have to look it up. But at least I don't have to do `info cpio` anymore.

Post reply on HN