Live data from Hacker News

Interview with Andreas Kling of Serenity OS (2022)

corecursive.com

61–70 of 181 posts

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

#61
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'm increasingly tempted to try my hand at making a toy OS - or at least a kernel.

I strongly encourage you to do this!

I think writing your own OS is one of the things every dev should do at least once, just for the educational value. The others are writing a game and writing a compiler and linker.

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

#62
If I were so motivated, I would start with the principles outlined in https://en.wikipedia.org/wiki/THE_multiprogramming_system.

Using Windows NT or Window 95 as an inspiration would make the task much harder. NT is an absolutely massive, full features, in some sense, and extension of Vax VMS, which itself is extremely feature rich.

I would take the challenge to build something that is the simplest thing that could possibly work.

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

#63

> But at least in my case, whenever I tell people about some idea, I kind of tend to lose interest in the idea. So I just went to work on it instead. I think that's great advice.

I read somewhere long ago that there's some chemical released when you talk about your plans, similar to the chemical that gets released when you complete your plan. So when you talk about your ideas, you feel like you've already accomplished them. Ever since I heard this, I've been protective of what I talk about and it seems to have helped me ship more things than before.

On the other hand sometimes it can make you commit something to someone. It really depends.

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

#64

> But at least in my case, whenever I tell people about some idea, I kind of tend to lose interest in the idea. So I just went to work on it instead. I think that's great advice.

I read somewhere long ago that there's some chemical released when you talk about your plans, similar to the chemical that gets released when you complete your plan. So when you talk about your ideas, you feel like you've already accomplished them. Ever since I heard this, I've been protective of what I talk about and it seems to have helped me ship more things than before.

I also noticed people don't get impressed when I talk about my ideas, but they are impressed when I show screenshots

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

#65
Considering the use-cases, multi-tasking operating systems are not necessarily going to escape the trend toward information appliances.

In my opinion, if the workstation does survive, than a posix style OS similar to the abandoned HeliOS will become necessary again at some point... as Moore's law is effectively dead, and a 15% context-switching overhead on existing threading and mailbox models is silly.

Would I want to write one from scratch?

https://www.youtube.com/watch?v=lITBGjNEp08

Have a great day, and remember to have fun =)

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

#66
post #50

Figured I would write this here, but I would scratch the concept of a file system and replace it with a database.

True, because you could always ...

    CREATE TABLE filesystem(inode AS BIGINT UNIQUE NOT NULL PRIMARY KEY, is_dir AS BIT(1) NOT NULL, name AS VARCHAR(4096) UNIQUE NOT NULL, in_this_dir_inode AS INT NOT NULL, bloblist_ptr AS INT NOT NULL, metadata_ptr AS BIGINT),

    CREATE TABLE bloblist(blob_id AS INT UNIQUE NOT NULL, onwer_inode_ptr AS INT, thisblob AS LONGBLOB, prev_blob_ptr AS INT NOT NULL, next_blob_ptr AS INT NOT NULL)

   CREATE TABLE file_metadata(metadata_record_id AS BIGINT UNIQUE NOT NULL, created_at AS DATETIME NOT NULL, last_accessed at AS DATETIME, last_modified_at AS DATETIME, owner_uid AS INT NOT NULL, owner_gid AS INT NOT NULL, mode AS BIT(4) NOT NULL)
or similar.

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

#67
post #41

Earlier quoted context omitted.

I feel like it should be possible to say "I want to reserve access to this resource when something important happens on it". Or just "I want to reserve access to this resource". Hopefully eliminates TOCTOU races. I guess then there have to be different modes to balance scalability/flexibility.

You can definitely do that, it just means that userspace can now stall access to things unless you're very careful :) Like, one model (often used by EDR, which is why everyone hates them) is that every operation must be "authorized" so it doesn't go through until some evaluation happens. But this means the kernel has to ask a program for every operation, which is slow.

What's EDR? But yeah, I recognize that there need to be limits. I haven't really thought it through yet, heh.

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

#68
post #40

Earlier quoted context omitted.

I'd like to go the other way, and have a filesystem that leverages a proper database for its metadata. I can search millions of records in a split second in SQL. But searching records on my hard disk takes enormously more time. The solutions out there for speeding it up (like Windows Indexing service) rely on asynchronous indexing that's patched on top of the filesystem instead of integrated realtime within it, and a…

>I'd like to go the other way, and have a filesystem that leverages a proper database for its metadata. Microsoft made an attempt back in 2003 at creating a "smarter" file system with rich metadata based on a real database engine (MS SQL Server) ... but eventually abandoned the project: https://en.wikipedia.org/wiki/WinFS WinFS wasn't necessarily going to completely replace NTFS but Microsoft did have ambitious plans…

Yeah they totally missed the mark with WinFS, in my opinion. It was too exotic/foreign with no clear adoption path.

All I want is dumb files with something like SQLite replacing or augmenting the allocation table. Then sprinkle on some new capabilities incrementally.

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

#69
I would not. I would use Linux and its ecosystem as a base. Use a very hackable window manager that allows me to customize the window management and overall experience to my liking. Write a collection of scripts and programs that allow me to do things faster. Maybe release a distro with all of this together ready to use.
Post reply on HN