Live data from Hacker News

Interview with Andreas Kling of Serenity OS (2022)

corecursive.com

11–20 of 181 posts

Re: Interview with Andreas Kling of Serenity OS (2022)

#11
post #6
post #2

I'm increasingly tempted to try my hand at making a toy OS - or at least a kernel. There's a few things I desperately want an operating system to do: 1. Have either database-like transactions or (at a minimum) write barriers for file operations. The current filesystem semantics are terrible for databases and other applications which need to not corrupt their data after a crash. fsync() is too heavy, because you can't…

Do it. Ignore whoever says it's too complicated. You probably won't supplant Linux with your toy OS for your own research, but for a software engineer, writing a OS is the closest thing we have to the exhilarating feeling of seeing your code affect real hardware. You haven't lived until a bug of your own causes a triple-fault exception that causes a literal system shutdown. I started this career writing my own tiny O…

> Just don't make it another UNIX, please. We have enough of those already ;)

Hah thanks for the encouragement! Don't worry, there's no danger on that front. I'm pretty thoroughly bored of the "everything is a file" motif.

I do like unix's idea of making large programs out of small programs that can be composed together. But unix's raw byte streams make a terrible messaging bus.

Re: Interview with Andreas Kling of Serenity OS (2022)

#12
post #11
post #6

Earlier quoted context omitted.

Do it. Ignore whoever says it's too complicated. You probably won't supplant Linux with your toy OS for your own research, but for a software engineer, writing a OS is the closest thing we have to the exhilarating feeling of seeing your code affect real hardware. You haven't lived until a bug of your own causes a triple-fault exception that causes a literal system shutdown. I started this career writing my own tiny O…

> Just don't make it another UNIX, please. We have enough of those already ;) Hah thanks for the encouragement! Don't worry, there's no danger on that front. I'm pretty thoroughly bored of the "everything is a file" motif. I do like unix's idea of making large programs out of small programs that can be composed together. But unix's raw byte streams make a terrible messaging bus.

You're on the right path! My area of interest is actually making messaging (a-la-Smalltalk/Erlang) the root idea everything is built upon, rather than the file stream. The file metaphor made sense in the 1960, not in an ultra-networked world of heterogeneous CPUs. IMO, communication should be the basis of computing.

Which also means inventing a language to build this novel paradigm. As Dan Ingalls said, an operating system is everything that doesn't fit in a language.

I am looking forward to finding the time for this long and quixotic quest :-)

Re: Interview with Andreas Kling of Serenity OS (2022)

#13

Earlier quoted context omitted.

Some of the issues can be improved "hackily" by for instance giving a database software exclusive access to two discrete disks - one for the db file, one for the journal.

Why is this "hacky"? I've long wondered why databases need to be on filesystems, other than simply convenience. If you think about it, a filesystem is, itself, basically a database (not a relational one of course). So it seems like you could improve performance a lot by eliminating the filesystem layer and going straight to direct disk access. Also, how this would be done would probably change depending on whether yo…

Lots - maybe most - applications need to essentially run their own mini database to store user data. I obviously don't want a partition per application, or per word document.

Abstracting away your hard disk is literally the job of your filesystem.

Re: Interview with Andreas Kling of Serenity OS (2022)

#14

Earlier quoted context omitted.

Some of the issues can be improved "hackily" by for instance giving a database software exclusive access to two discrete disks - one for the db file, one for the journal.

Why is this "hacky"? I've long wondered why databases need to be on filesystems, other than simply convenience. If you think about it, a filesystem is, itself, basically a database (not a relational one of course). So it seems like you could improve performance a lot by eliminating the filesystem layer and going straight to direct disk access. Also, how this would be done would probably change depending on whether yo…

>I've long wondered why databases need to be on filesystems, other than simply convenience. [...]So it seems like you could improve performance a lot by eliminating the filesystem layer and going straight to direct disk access.

Both Oracle RDBMS and older versions of Microsoft SQL Server had the option to use "raw disk devices" / "raw partitions" instead of the filesystem. It had some obvious justifications such as avoiding the "wasteful double buffering" of the file system cache being redundant to the database's cache and avoiding "unnecessary" extra i/o abstraction layers.

Microsoft later got rid of that option because it wasn't worth the tradeoff of a small performance gain while losing the easier management aspects of NTFS file system.

Re: Interview with Andreas Kling of Serenity OS (2022)

#15
post #13

Earlier quoted context omitted.

Why is this "hacky"? I've long wondered why databases need to be on filesystems, other than simply convenience. If you think about it, a filesystem is, itself, basically a database (not a relational one of course). So it seems like you could improve performance a lot by eliminating the filesystem layer and going straight to direct disk access. Also, how this would be done would probably change depending on whether yo…

Lots - maybe most - applications need to essentially run their own mini database to store user data. I obviously don't want a partition per application, or per word document. Abstracting away your hard disk is literally the job of your filesystem.

I don't mean that some little SQLite DB for your web browser's storage and settings needs its own partition; that's obviously going too far. I mean for really huge databases, where an entire server is dedicated to running that DB and it has high performance needs.

Re: Interview with Andreas Kling of Serenity OS (2022)

#17
post #2

I'm increasingly tempted to try my hand at making a toy OS - or at least a kernel. There's a few things I desperately want an operating system to do: 1. Have either database-like transactions or (at a minimum) write barriers for file operations. The current filesystem semantics are terrible for databases and other applications which need to not corrupt their data after a crash. fsync() is too heavy, because you can't…

I am very interested in this tutorial for building an OS for the Raspberry Pi in Rust: https://github.com/rust-embedded/rust-raspberrypi-OS-tutoria...

I'd love to try it out when (if ever) I have the time.

Re: Interview with Andreas Kling of Serenity OS (2022)

#18
post #12
post #11

Earlier quoted context omitted.

> Just don't make it another UNIX, please. We have enough of those already ;) Hah thanks for the encouragement! Don't worry, there's no danger on that front. I'm pretty thoroughly bored of the "everything is a file" motif. I do like unix's idea of making large programs out of small programs that can be composed together. But unix's raw byte streams make a terrible messaging bus.

You're on the right path! My area of interest is actually making messaging (a-la-Smalltalk/Erlang) the root idea everything is built upon, rather than the file stream. The file metaphor made sense in the 1960, not in an ultra-networked world of heterogeneous CPUs. IMO, communication should be the basis of computing. Which also means inventing a language to build this novel paradigm. As Dan Ingalls said, an operating…

You might enjoy http://synit.org/, perhaps. Heavily inspired by both Smalltalk and Erlang. (It's my own wee quixotic project btw)

Re: Interview with Andreas Kling of Serenity OS (2022)

#19
post #10
post #8

For those looking to try their hand at building an OS, there's Linux From Scratch. https://www.linuxfromscratch.org/ I failed tremendously, but I had a lot of incorrect ideas about what makes an operating system go. The learning experience was worth it, though.

That teaches how to compile Linux kernel and software, not to create an OS out of thin air. The go-to guide for anyone that wants to build their own operating system has always been the OSDev community wiki and forum: https://wiki.osdev.org/Main_Page

To be fair there is a lot you can do in userland. Graphics protocols, package management, isolation, security etc. And even more can be done by incrementally patching the kernel where needed.

It's just that Linux is kind of usable out of the box with just the kernel and /bin/sh. But for other OSes this isn't true, the kernel can expose a vastly different interface than the actual os which users interact with.

Re: Interview with Andreas Kling of Serenity OS (2022)

#20

I just wonder how much of the truly exceptional engineering in today's software was done by people on drugs (yes, 'ADHD' medication counts). I fully expect it to be a significant chunk, but I hope it's not the majority.

Core to Andreas' story is that he did his engineering as an escape from drugs, not the other way around as you allude to.
Post reply on HN