Readit News logoReadit News
tosti commented on Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program   serversfor.dev/linux-insi... · Posted by u/birdculture
charcircuit · a day ago
You are missing the point. The kernel is still abstracting over those GPIO timings so programs don't need to know the timings themselves. This is the benefit of using a platform. These low level things get abstracted away from what you have to do.
tosti · a day ago
Oh, I see. You're piecing together the layers much like a cake.

The way I see it, everything is tied together as some kind of flow chart where different elements have different jobs. Linux is quite a small part of the system when compared to Google Chrome. Even if you were to invert the cake, as a whole it still wouldn't make sense to me to see it that way.

Hardware tends to have more distinct layering than the lalala-land of software where pretty much anything goes.

tosti commented on Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program   serversfor.dev/linux-insi... · Posted by u/birdculture
charcircuit · 2 days ago
The kernel talks to the device using an API it exposes. Similarly Chrome will talk to the OS using an API it exposes. OS APIs can also behave in weird and unexpected ways, be hard to debug and fail. Chrome protects the content it hosts from this complexity. Interacting with the layer underneath you is part of your job of hosting things on top of you.
tosti · 2 days ago
Those are just drivers to stuff that runs its own cpu and interfaces over some kind of serial port. Printers are a well known example of this. Also intel wireless nics with their firmware blobs.

Not are drivers are like that. For instance, drivers/input/serio/ps2-gpio.c is all about timing the right signals.

tosti commented on Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program   serversfor.dev/linux-insi... · Posted by u/birdculture
zsoltkacsandi · 3 days ago
> More importantly, a kernel is a platform.

Completely agree with this framing. We will get there by the end of the series.

tosti · 2 days ago
Yeah no. An operating system kernel doesn't just act as a host for userland processes, it interacts with hardware. Hardware behaves in weird and unexpected ways, can be quite hard to debug, can fail, etc.

This is why Linux is excellent. Users of other operating systems often remind people to update their device drivers. A non-technical Linux responds asking what the heck device drivers are. To the casual user, device drivers become invisible because they work exactly as intended.

tosti commented on Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program   serversfor.dev/linux-insi... · Posted by u/birdculture
seanw444 · 3 days ago
I've used Linux for quite some time, and had always kinda wondered what purpose initramfs served, since I have to rebuild it so often. Thanks.
tosti · 2 days ago
Linux includes a cpio utility and documentation for building your own initramfs.
tosti commented on Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program   serversfor.dev/linux-insi... · Posted by u/birdculture
checker659 · 3 days ago
Pass init=/bin/sh or what have you in GRUB cmdline
tosti · 3 days ago
Traditionally,

    init=/etc/rc
And have that be a shell script which starts whatever you need. You'll probably want fsck in there, mount -a, some syslogd, perhaps dbus, some dhcp client, whatever else you need, and finally the getty which is probably a good idea to respawn after it exits. That's usually the job of init so you could well end your rc with exec /sbin/init

tosti commented on Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program   serversfor.dev/linux-insi... · Posted by u/birdculture
ronsor · 3 days ago
You can actually disable most features of the Linux kernel, including multi-user support (everything will run as root). The end result is a stripped down kernel fit for only running your single desired application.
tosti · 3 days ago

    gmake tinyconfig all
The result of that probably won't boot your friendly neighbourhood desktop distro.

tosti commented on Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program   serversfor.dev/linux-insi... · Posted by u/birdculture
teraflop · 3 days ago
Nice article! One point of clarification:

> When the kernel starts it does not have all of the parts loaded that are needed to access the disks in the computer, so it needs a filesystem loaded into the memory called initramfs (Initial RAM filesystem).

The kernel might not have all the parts needed to mount the filesystem, especially on a modern Linux distro that supports a wide variety of hardware.

Initramfs exists so that parts of the boot logic can be handled in userspace. Part of this includes deciding which device drivers to load as kernel modules, using something like udev.

Another part is deciding which root filesystem to mount. The root FS might be on an LVM volume that needs to be configured with device-mapper, or unlocked with decrypt. Or it might be mounted over a network, which in turn requires IP configuration and authentication. You don't want the kernel to have those mechanisms hard-coded, so initramfs allows handling them in userspace.

But strictly speaking, you don't need any of that for a minimal system. You can boot without initramfs at all, as long as no special userspace setup is required. i.e., the root FS is a plain old disk partition specified on the kernel command line, and the correct drivers (e.g. for a SCSI/SATA hard drive) are already linked into the kernel.

tosti · 3 days ago
This. Only CPU microcode can't be loaded without an initramfs unless you enable late loading, but that's labeled dangerous because it may cause instability. If needed, you could let the built-in motherboard uefi do the microcode updates instead.
tosti commented on HTML as an Accessible Format for Papers (2023)   info.arxiv.org/about/acce... · Posted by u/el3ctron
fooofw · 7 days ago
It's kind of fun to compare this formulation with the seemingly contradictory official arXiv argument for submitting the TeX source [1]:

> 1. TeX has many advantages that make it ideal as a format for the archives: It is plain text, it is compact, it is freely available for all platforms, it produces extremely high-quality output, and it retains contextual information.

> 2. It is thus more likely to be a good source from which to generate newer formats, e.g., HTML, MathML, various ePub formats, etc. [...]

Not that I disagree with the effort and it surely is a unique challenge to, at scale, convert the Turing complete macro language TeX to something other than PDF. And, at the same time, the task would be monumentally more difficult if only the generated PDFs were available. So both are right at the same time.

[1] https://info.arxiv.org/help/faq/whytex.html#contextual

tosti · 7 days ago
Working with both at the same time makes their strengths and pitfalls shine. It's like that dual-boot computer where you're constantly in the wrong OS.

HTML has better separation of concerns than latex. Latex does typesetting a lot better than html. HTML layout can differ wildly in the same document. Latex documents are easier to layout in the first place.

...etc...

tosti commented on How I discovered a hidden microphone on a Chinese NanoKVM   telefoncek.si/2025/02/202... · Posted by u/ementally
15155 · 7 days ago
A DAC and amplifier circuit is electrically incapable of processing input (on its own.)

Physically unplugging and moving a speaker to a mic input works, sure, but very few devices can do this switching electronically.

tosti · 7 days ago
I think most intel HDA compatible chips can do this. You can specify which pins are connected to what.
tosti commented on Netflix to Acquire Warner Bros   about.netflix.com/en/news... · Posted by u/meetpateltech
throw0101d · 8 days ago
How does ZFS need to be liberated?
tosti · 8 days ago
They took the entire Solaris code back to proprietary source and kept improving ZFS themselves. For instance, they added encryption.

u/tosti

KarmaCake day7November 24, 2025View Original