7 ms·
Serenity OS: Interview
- adamgordonbell 5y agoHost here. Serenity is amazing. But also big props to Andreas for speaking so candidly about the back story of Serenity. I feel like there are certain things we don't talk about in tech and that can change. I love the idea that programming, esp side projects, can be a therapeutic thing.
- akling 5y agoGuest here. Thanks for having me on your show, Adam! I'm definitely a fan of talking more about things that we've been hiding from each other. On that topic, one of the most common questions I get personally is "which drugs did you use in the past?" and I recently made a video[1] answering that question. It was a difficult thing to get through, but the overwhelmingly supportive response has been amazing. For anyone who's struggling and is afraid to open up about it, know that there's a community of millions around the world who will welcome you with open arms. [1] https://www.youtube.com/watch?v=fZuWxvbK4_4 https://www.youtube.com/watch?v=fZuWxvbK4_4
- fishtacos 5y agoJust... thanks! Your candidness is uplifting for those who don't have the same capability, or voice, to discuss difficult personal topics.
- pjmlp 5y agoIt was quite interesting interview to follow, all the best in you endevours.
- menaerus 5y agoI wanted to watch this video for a minute or so (very shallow of me) but ended up being stuck in it for the whole 29 minutes. Very interesting and hard story to tell but also extremely inspiring to see what hell have you been through and was able to mature to the point to where you became an inspiration for many others. Well done. Now more technical questions ... for my own sake of understanding and learning. What would you say that were most important aspects of re-implementing (subset of?) C++ runtime that must be appropriate for in-kernel usage? Where would I look in the source code to learn about SerenityOS paging algorithms, and virtual memory management in general?
- akling 5y ago> What would you say that were most important aspects of re-implementing (subset of?) C++ runtime that must be appropriate for in-kernel usage? Something that I messed up originally and we're now correcting incrementally is the handling of allocation failures. There are many places in a kernel where errors don't have a natural propagation path (IRQ handling for example), so operations that may fail (like allocation) must be avoided. In general, heavy use of C++ features like templates and RAII has been very helpful for making kernel development productive. > Where would I look in the source code to learn about SerenityOS paging algorithms, and virtual memory management in general? You'll find the kernel memory management code in https://github.com/SerenityOS/serenity/tree/master/Kernel/Memory https://github.com/SerenityOS/serenity/tree/master/Kernel/Me... Quick breakdown: - Every Process has an AddressSpace. - An AddressSpace has a number of Region objects, each with a virtual base address, size, permission bits, etc. - Every Region has an underlying VMObject. - VMObject is virtual and can be AnonymousVMObject (MAP_ANONYMOUS) or InodeVMObject (MAP_FILE). - Cross-process memory sharing occurs when two or more Regions in separate AddressSpaces use the same underlying VMObject. - MemoryManager handles physical page allocation, fault handling, page tables, etc.
- menaerus 5y agoThanks. > Something that I messed up originally and we're now correcting incrementally is the handling of allocation failures. What in particular? Can you use exceptions reliably in the kernel land? I presume not unless you pre-allocate some hard-to-exhaust space for them. Have you maybe thought of using LSBs to encode an allocation failure within the pointer itself? It's an entertaining idea I had for some time now. In 64-bit byte-addressable architectures one can take advantage of suitable alignments and have 3 least significant bits used to encode 8 different states. In a similar vein one could also take advantage of MSBs given the virtual address memory space limit of nowadays CPUs.
- akling 5y agoWe don't use C++ exceptions anywhere in SerenityOS. Instead we use an ErrorOr<T>[1] return type for functions that may fail. These are then automatically propagated by use of a TRY() macro[2]. I haven't thought about encoding allocation failure as a low pointer value. I suppose you could, but it'd only work for pointers with sufficient alignment. Character/byte pointers often start at unaligned offsets when not coming directly from an allocator. Either way, I'm not sure compressing this information would solve any real problem we're having. [1] https://github.com/SerenityOS/serenity/blob/master/AK/Error.h https://github.com/SerenityOS/serenity/blob/master/AK/Error.... [2] https://github.com/SerenityOS/serenity/blob/master/AK/Try.h https://github.com/SerenityOS/serenity/blob/master/AK/Try.h
- adamrt 5y agoHey Adam, just wanted to say I’m a huge fan of both your and Andreas’ work. Really glad you guys got together for this.
- adamgordonbell 5y agoThanks for listening! It was a great episode to make I'm always looking for devs with interesting backstories to share so if have any ideas shoot me a message.
- sworley 5y agoProbably my favorite episode yet
- hypertele-Xii 5y agoThis is a podcast featuring a guest who built an OS from scratch (apparently).
- olliej 5y agoYup - serenityos.org And it is /completely/ from scratch - its own libc and libc++, own kernel, ui framework, browser (and I mean from scratch not Yet Another WebKit/Chromium wrapper), etc There are now a few regular core contributors now so it's not just one man vs the world
- fart32 5y agohttps://open.spotify.com/episode/29432cTYAROIvvxgtMamgQ?si=0cc2c45e0ef34824 https://open.spotify.com/episode/29432cTYAROIvvxgtMamgQ?si=0...
- willhinsa 5y agoBuilt by Andreas Kling[0], who regularly streams his development process for Serenity OS on his YouTube channel[1]. [0] https://awesomekling.github.io/about/ https://awesomekling.github.io/about/ [1] https://www.youtube.com/andreaskling https://www.youtube.com/andreaskling
- matheusmoreira 5y agoHe also used to post about it on 4chan's technology board, especially on the daily programming thread. Plenty of pictures and videos showing off progress as well as discussion of implementation details. https://warosu.org/g/?task=search2&search_text=awesomekling&search_ord=old https://warosu.org/g/?task=search2&search_text=awesomekling&... Definitely among the coolest things I've ever seen on 4chan.
- awesomekling 5y agoStarted by Andreas Kling, now built by the rapidly growing SerenityOS community with 600+ contributors! <3 https://github.com/SerenityOS/serenity/graphs/contributors https://github.com/SerenityOS/serenity/graphs/contributors
- LeFantome 5y agoWhile I agree with you, that is an impressively humble attitude. Having watched some of the early history, you can take at least partial credit for building some of those contributors as well. It was a different time, but Linux did not come so far so fast. Damn Scandinavians!
- nix23 5y ago>Damn Scandinavians! Yeah it's a state of mind, you do something for and with a community and not exclusively for your personal gains. In the US that was often compared to communism (just listen to the questions from reporters in the early day of Linux)
- 5y ago
- mythz 5y agoIt's been inspiring watching SerenityOS come to life with every update. One of the things I look forward to at the start of every month is SerenityOS's monthly update, this was the latest January 2022 update where they've done a port of Half Life and their continual improvements to their libGL implementation: https://www.youtube.com/watch?v=DL-RCV5a-C4 https://www.youtube.com/watch?v=DL-RCV5a-C4 Due to the sheer gravity of the task it may not ever become a mainstream OS but because its entire source code is built from scratch and all maintained within the same repo, it's easily able to prototype new OS features you're unlikely to see anywhere else. In that regard it's possibly the easiest codebase to prototype new OS features given you can make changes to any part of the OS & view changes immediately.
- ncmncm 5y agoThis is a very important role for alternative OSes. What makes Serenity OS and others like it useful for this purpose is that they have much less unnecessary complication, so that much more of the effort can go into actually experimenting with the feature, as opposed to trying to slot it in compatibly with all the historical baggage. Another useful quality is how they can demonstrate that a language some insist is unsuitable for kernels is, in fact, much better suited. You cannot write a whole competitive desktop OS almost single-handed without some decisive advantages. Serenity OS is coded in modern C++, and leans hard on its strong support for writing cleaner code. An OS kernel, besides providing a platform, is a big program. Any big program makes heavy demands on programmer and language, independent of its purpose.
- native_samples 5y agoThere's nothing controversial about writing kernels in C++ though. Windows, Apple, BeOS, etc - basically every commercial OS has used C++ or a subset in the kernel for decades. Linux is an outlier.
- KronisLV 5y ago> Due to the sheer gravity of the task it may not ever become a mainstream OS but because its entire source code is built from scratch and all maintained within the same repo, it's easily able to prototype new OS features you're unlikely to see anywhere else. In that regard it's possibly the easiest codebase to prototype new OS features given you can make changes to any part of the OS & view changes immediately. Isn't this a bit like what FreeBSD and other similar OSes do? To have a tightly integrated/tested base system with a set of software that it has, while maybe optionally supporting third party ports. Now, in practice you almost always end up with binary distribution of packages rather than building everything from source due to time/resource constraints, but there is definitely an argument to be made about less fragmentation, like much of the GNU/Linux software has.
- dang 5y agoPast related threads: SerenityOS demo at Handmade Seattle 2021 [video] - https://news.ycombinator.com/item?id=29270776 https://news.ycombinator.com/item?id=29270776 - Nov 2021 (180 comments) SerenityOS: Year 3 in Review - https://news.ycombinator.com/item?id=28817599 https://news.ycombinator.com/item?id=28817599 - Oct 2021 (46 comments) Not-a-Linux distro review: SerenityOS is a Unix-y love letter to the ‘90s - https://news.ycombinator.com/item?id=28219800 https://news.ycombinator.com/item?id=28219800 - Aug 2021 (113 comments) SerenityOS: Graphical Unix-like operating system with classic 90s UI - https://news.ycombinator.com/item?id=28206840 https://news.ycombinator.com/item?id=28206840 - Aug 2021 (129 comments) I quit my job to focus on SerenityOS full time - https://news.ycombinator.com/item?id=27317655 https://news.ycombinator.com/item?id=27317655 - May 2021 (249 comments) SerenityOS: Writing a Full Chain Exploit - https://news.ycombinator.com/item?id=26115141 https://news.ycombinator.com/item?id=26115141 - Feb 2021 (9 comments) SerenityOS: A love letter to '90s user interfaces with a Unix-like core - https://news.ycombinator.com/item?id=23911180 https://news.ycombinator.com/item?id=23911180 - July 2020 (1 comment) SerenityOS Update (April 2020) - https://news.ycombinator.com/item?id=23037581 https://news.ycombinator.com/item?id=23037581 - April 2020 (1 comment) Introduction to SerenityOS Programming - https://news.ycombinator.com/item?id=22479132 https://news.ycombinator.com/item?id=22479132 - March 2020 (43 comments) Pledge() and Unveil() in SerenityOS - https://news.ycombinator.com/item?id=22116914 https://news.ycombinator.com/item?id=22116914 - Jan 2020 (28 comments) CTF writeup: First published SerenityOS kernel exploit - https://news.ycombinator.com/item?id=21918351 https://news.ycombinator.com/item?id=21918351 - Dec 2019 (2 comments) SerenityOS: From Zero to HTML in a Year - https://news.ycombinator.com/item?id=21212294 https://news.ycombinator.com/item?id=21212294 - Oct 2019 (52 comments) Serenity OS update (August 2019) [video] - https://news.ycombinator.com/item?id=20851356 https://news.ycombinator.com/item?id=20851356 - Sept 2019 (2 comments) SerenityOS – a graphical Unix-like OS for x86, with 90s aesthetics - https://news.ycombinator.com/item?id=19986126 https://news.ycombinator.com/item?id=19986126 - May 2019 (179 comments) Serenity OS Demo (April 2019) - https://news.ycombinator.com/item?id=19813417 https://news.ycombinator.com/item?id=19813417 - May 2019 (1 comment) Serenity: x86 Unix-like operating system for IBM PC-compatibles - https://news.ycombinator.com/item?id=19537807 https://news.ycombinator.com/item?id=19537807 - March 2019 (83 comments)
- SerCe 5y agoThis was a very powerful episode. The strongest part for me was the description of Apple's developer workflow or philosophy, where you can look through the stack all the way through. When I first joined the JVM on Linux camp after mostly being in the .NET world on Win, seeing the system all the way through was a revelation, incredibly empowering. Andreas with Serenity not only sees the system through but can modify any part of the layer to make the abstraction of each layer just right.
- chris37879 5y agoIt's something that really doesn't get talked about enough. So much of modern tech is just abstraction on top of abstraction, being able to get in there and play around in those same spaces as your tools is important, though. I've been doing this with Flutter recently. Turns out it is both a toolkit and a package/platform. If you take out all the 'flutter' code, you're left with something that looks like sdl or glfw, just written in Dart. And it 100% has made me a better Flutter dev to do so. I now get a lot more of _how_ Flutter's drawing loop works, and how the framework beneath reduces all of app startup to one `runApp` call. Not being able to inspect the insides of a tool easily is a major turn off to me on anything.
- NeutralForest 5y agoBoth interesting and touching
- tartoran 5y agoVery inspiring and refreshing story built on honesty. I congratulate Andreas on reinventing himself and a new OS along with it.
- pfeilbr 5y agoAndreas ability to interweave deep tech with life and [vulnerable] humanity is truly a gift. It is rarely that the two come together this way. Thank you for all the time you put into Serenity[OS|HumanityOS :)].
- jiriro 5y agohttps://podcasts.apple.com/cz/podcast/serenity-os/id1330329512?i=1000549764383 https://podcasts.apple.com/cz/podcast/serenity-os/id13303295...
- dengolius 5y agowhat for this os? it can't be used for iot, for desktop or server so i can't understand the main idea why i need to use it or became a sponsor for this project...
- elcapitan 5y agoGreat podcast, thanks so much for this! What's the best way to look at the beginnings of the project? There's a first git commit saying "Import all this stuff into a single repo called Serenity." but maybe there's earlier version or earlier descriptions?
- avl999 5y agoAndreas is such a good dude. I highly recommend his youtube channel, not just for the tech content but even more importantly for the important musings about life, overcoming your demons and overcoming that voice in your head always trying to pull you down https://www.youtube.com/c/AndreasKling/videos https://www.youtube.com/c/AndreasKling/videos.
- stkdump 5y agoI wonder what it would take to bring Linux to this state, where while running a program, you can decide to look at the source code, check in the debugger what is going on, apply a change and run the program as if you used the precompiled version of it with very little effort. So you could make changes to programs with similar manual effort as if you changed a config file. And when updating the programs, the package manager would check for your manual changes, if they can be applied without merge conflicts. Upstreaming the changes would also be a simple standardized command. But you wouldn't have to, just to be able to run the changed software without friction.
- YEwSdObPQT 5y agoI've not played with the OS myself but I occasionally watch a live stream and ask him questions. He talks through stuff off the cuff and you know he is a genuine dude.
- nanreh 5y agoGreat interview, you earned yourself a new listener!