263 comments

[ 1.8 ms ] story [ 279 ms ] thread
(comment deleted)
Love his videos. Helped me get back into coding and c++.
i was surprised about the c++ choice, considering all i've read on the subject about its supposed issues related to memory management ( i think related to destructor ?) or complex features that made it unfit for OS development.

i've reed a bit of the faq and it seems Andreas originally thought about using C and then realized it wasn't a good idea.

Any opinion or more infos on that point ?

>I chose the name SerenityOS because I wanted to always remember the Serenity Prayer.

Whats with operating systems and religion

> Whats with operating systems and religion

Confirmation bias; religion is everywhere, no reason to expect it to be exceptionally absent from computing/programming/operating systems etc.

Have you never been in a debate about vim vs. emacs?
There is no debate.
I think Vim won by virtue of already being installed.
Ehhh. Vi is already installed, and it is often not Vim.

Nano, on the other hand...

He opened with the explanation of doing this after coming out of rehab for drug addiction - I wouldn’t say it is related to “religion”, rather a nod/reminder for himself in why he’s doing it. Nothing beyond that it seems.
You need to be pretty smart to write an OS, and only dumb people and smart people are religious. Atheism is the belief for mediocre minds. ;)
Care to expand on those bold assertions?
I'm not sure what you consider bold about the assertions so it's difficult to expand. I am certainly not the sharpest tool in the shed, and I'm religious, so that provides at least circumstantial evidence for my initial statement.

Do you think I should consider that atheists could be dumb too? Most of the ones I've spoken to seem fairly convinced that they're reasonably smart.

Alright it's clear you're only here to rile people up. Not sure why you think that's appropriate here.
It's appropriate because it will improve your thinking to consider that I might just be right.

Edit: I happened to see your response since deleted. Don't worry, I'm not offended. I will say that HN at its best invites intellectual exploration. Take all your comments in this thread and look at them. What thoughts did you provoke? What did you add?

(comment deleted)
I'm sorry, do you think you're being "intellectually explorative" with unsubstantiated statements like "atheism is for the mediocre mind"?.
My apologies for upsetting you. Please see upthread for my apology to yourself and Dan.
Please don't take HN threads further into flamewar, let alone religious flamewar god help us.

https://news.ycombinator.com/newsguidelines.html

Fair enough Dan. I do have a tendency to walk the line but I like to think I'm reasonable enough to know when to backpedal. Apologies to yourself and Jagger. I'll try and be nicer.
Proper software development is indistinguishable from mysticism.
I suspect you have 1 other example. How many can you come up with that have nothing to do with religion?
The one other example is obviously either FreeBSD, whose mascot is a demon, or OSX, which itself is a religion. ;)
Also, for better or worse, TempleOS.
This is what I was referencing. Though I think the other poster may know and was making a joke.
> Whats with operating systems and religion

Many daemons lurk in OSes. Sometimes religion provides the comfort and safety you need to face the horrors hiding in operating systems.

I'm a relatively vocal atheist, but Serenity Prayer is a pretty useful/accepted creed to live by if you can get over the very first word, so I can't say it bothers me much; and while I realize there's one other OS that's much more explicitly religion-oriented, I'm not sure it's quite a significant pattern yet...

  "(God), give me grace
  to accept with serenity
  the things that cannot be changed,
  Courage to change the things
  which should be changed,
  and the Wisdom to distinguish
  the one from the other."
This is the version I'm familiar with:

    God, grant me the Serenity
    To accept the things I cannot change...
    Courage to change the things I can,
    And Wisdom to know the difference.
It's basically "should I use sudo or not" as a prayer.
Don't go hating on my boy Terry (pbuh):

"The got rid of CD/DVD. they are coming for our guns."

"You know the secret? The difference between heaven and hell? It's, like, doing your work. You feel really shitty if you don't do your work. If you do your work, it's fucking awesome."
The majority of the human population is religious. Software is generally created by humans so it doesn’t seem unlikely that some of that influence would rub off on their work (same as any other work of art really).
(comment deleted)
Please don't post flamebait and/or unsubstantive comments here.

https://news.ycombinator.com/newsguidelines.html

Edit: unfortunately it looks like that's basically all you've been posting to HN. We ban such accounts, so I've banned this one. If you don't want to be banned, you're welcome to email hn@ycombinator.com and give us reason to believe that you'll follow the rules in the future.

I'm curious, how can someone implement device drivers (without knowing hardware details.) for a self-made OS like this?
It seems to only target very commonly ported and generally understood hardware, and not many things. 32bit Intel, no arm. Bochs VBE and Intel graphics, e1000 and rtl8192 nics. They're very sensible targets as they'll let you run with event performance on most virtual machine platforms as they're commonly emulated and mature.
It would be cool to have something similar but specifically targeting Raspberry Pi these days. There you don't have a lot of variability either, and it might even turn out useful relative to its "bigger" (or "bloated"?) competitors.
Sadly Pi has some significant IP blocks that don't have open manuals or permissive drivers to work from, so targeting it for a home brewed OS is extremely hard work.
Usually hobby OS developers only write drivers for well documented hardware like the e2k
Here's an example with the NE2000 network card (PCI only). I've tested it both on QEMU and with a real RTL8029AS card. Probably the most important thing is quality, RTL-level reference documentation. When you hit a dead-end, having a battle-tested Linux or BSD driver to peek at helps a lot, because hardware has quirks and the documentation might not tell the whole story.

SerenityOS currently doesn't have a lot of tooling to help debugging drivers aside from kprintf() and kubsan. Other operating systems may offer more advanced capabilities, such as NetBSD's rump kernel where you can run drivers in userland for example.

https://github.com/SerenityOS/serenity/pull/5191

General tips:

1. Start with a QEMU emulated device. QEMU is more forgiving than real hardware and you can study, understand, and debug the "hardware impersonation side" of the QEMU code to see what happens when you set a bit in some register.

2. Pick a simple device. Don't start with the USB stack or Ethernet. Maybe try to reimplement the UART driver first.

3. Don't freak out about "device driver architecture" stuff like whether you need lock-free queues or allocation-free algorithms or ring buffers or... whatever. Just get it working.

4. Write a userspace program that uses the driver you'd like to see working. That'll motivate you to finish it.

5. Repeat. Until eventually you know how to write device drivers. :)

> 2. Pick a simple device. Don't start with the USB stack or Ethernet. Maybe try to reimplement the UART driver first.

A UART driver is great; then if you want to do Ethernet, virtio-net is a good start, and then carefully pick your physical ethernet card; something descriptor based will let you reuse the descriptor concepts you already learned. Realtek cards get a lot of shade, but aren't too bad to interface with and they're very popular; if you've got a bunch of computers, you've probably got at least a few realtek nics. Ethernet is cool, because then you can start communicating with the world (although there's a lot of stuff to get tcp going)

From 3 months rehab to build an os and more. That is just outright incredible. Maybe the boring day job before lead to the addiction. Anyway an insane comeback.
Can't wait for your live-streams from the back of your car before you leap in front of a train.
Following this for almost 3 years now, it really is an amazing achievement. His YouTube streams are very helpful in learning a lot about Systems, Unix and good programming methodologies. Cheers to him for taking the leap of faith!
Hey Andreas (assuming you're still reading these threads) I'm so happy to see you reach this point with Serenity. I remember seeing your project pop up here (early 2019 I think?) and just being absolutely blown away by the undertaking. What I love most about the project after following it since though is you've really shown it's absolutely doable, not only by you or superstar programmers but by folks willing to put the time in, and along the way made so many others realize this whether they contribute to Serenity or not. Your YouTube videos are absolutely great and there is just something about it all (probably the "under one roof" philosophy) that makes showing the "adding/fixing this little piece" so much more consumable. In short, thank you for doing all of this for not only yourself but everyone else now involved with the project.

Anyways I always told myself I should chip in for all of the great content over the years and so now I've joined your Patreon - here's to hoping more are able to as well and you can continue living the dream!

Hi Andreas, I'd love to interview you sometime about addiction. Sounds like you have a strong perspective and are comfortable sharing your story. I'm still rebuilding things so I won't be launching my media production company for another year or so but I'll probably reach out on Twitter someday ;)
Andreas is the best part about this project. He's just _nice_. He's a good person. It makes me want to contribute and work with him because I feel like I'll learn from him.

Too many elite programmers are total jerks!

Kindness goes a long way. One kind thing someone does stays with you for a very long time.
OMG. That reminds me of the Xen dude, of a potential hire at a startup who demanded "make it a big number" salary, and countless people who know some about one domain assuming their ex-food doesn't emanate odor.

Also, there's the sociological fallacy of assuming the biggest jerk must be the most talented, when it may well be a façade to impress people. There are some talented jerks, but all the talent in the world doesn't matter if no one will work with you.

PS: Shout-out to Steve Kablink for being awesome.

(comment deleted)
<3
He lives! And hasn't yet been struck by any outdoor natural fireworks or rapid, falling condensation in ATX. :D
Hehe there's a flash flood warning for the next two hours, fingers crossed...
you cannot be more correct. too many elite programmers are not only jerks, but also selfish egoistic masochists who deny any right to others to be wrong now and then, while still fit for work. yet - same jerks often complain having difficulties finding help (typically overseeing the quite obvious reason for it).

no, this is not a hate comment, but a sad one, as rarely people ask why so many opensource projects are led by single person, and very rarely by more than 3 active developers. maybe it has to do with the fact that arrogant top-notch jerks also like to showoff as they expose narcissistic traits and opensource is a good venue to do so.

perhaps also because is difficult to argue with total jerk (have you tried). or convince him/her/they/them that your not-so-up-to-the-standard code is still worth, and that in reality most of the code running the world is a total mess (for various reasons) but still runs (for various reasons).

the gift to be able to work with nice people that also develop nice code is close to blessing.

I think you're onto something about showing off. You just won't hear as much relative to their importance about the projects led by entirely uncontroversial people who don't care about attention.

Another aspect is that in a lot of disciplines, a certain level of maniacal persistence increases your chance of success. To take the "mythical" 10k hours to mastery, it's a lot easier to get to 10k hours if you're not spending time getting in 10k hours of socialisation.

I say this as someone who myself would much rather code than spend time socialising most days - it's certainly not meant to imply that everyone introvert or who spends most of their time coding are assholes (that'd implicate myself...), but that there's a level of correlation between being good and spending lots of time practising and not spending as much time thinking about social niceties, and not everyone manages to strike the right balance.

what i also tried to say, but maybe could not do so well... is that opensource is not about being open to people or acting democratic. surely there are many nice ppl behind opensource projects, but that does not make these projects inclusive.

also there is great number of great people that are very great at coding and not so great at communicating with other people.

so what is emphasized here in my comment is that the kind of opensource project that is inclusive and led by s.o. who knows how to express empathy and has time to also be involved with other people is more valuable as a community effort.

not going into discussion whether openssl is better of with one single dev or not, whether sqlite3 is more important than a serenityos etc.

Brilliant, hopefully Rust can come to SerenityOS quicker than we thought.

Huzzah!

Wow, that must be a really big milestone for SerenityOS. Not many hobby OSs end up making enough money for the developer to sustain himself.
Not many hobby projects of any kind for that matter. IMO he gets this kind of support not just because of the value added by SerenityOS itself, but because of the value he adds by making YouTube streams and other content. People feel like they can learn a lot about programming from him.
It doesn't. He says it brings in $2000/month and that this is not enough to sustain his family, but he hopes to increase it.

It's nice that he's able to indulge in this kind of hobby programming, but he must have an incredibly generous and understanding family. Clearly he can hold down programming jobs at major tech firms and could therefore give his family a much higher quality of life than $2k/month will bring, but chooses not to. Well, OK. I'd like to write an OS too, but my family has slightly higher expectations ...

I’ve been following Andreas and SerenityOS since the very beginning and this is absolutely very cool news. I am so psyched to see where SerenityOS will go!!
>SerenityOS [1]

Graphical Unix-like operating system for x86 computers.

SerenityOS is a love letter to '90s user interfaces with a custom Unix-like core. It flatters with sincerity by stealing beautiful ideas from various other systems.

Roughly speaking, the goal is a marriage between the aesthetic of late-1990s productivity software and the power-user accessibility of late-2000s *nix. This is a system by us, for us, based on the things we like.

[1] https://github.com/SerenityOS/serenity

It seems very interesting. Anyone has an idea whet the minimal system requirements are?
It's generally aimed at being run on QEMU. But it can be installed on bare metal at your own risk. This [1] mentions:

> Current hardware support is extremely limited. [...] x86 [...] Most successful hard disk installations have been on Pentium 4 era hardware [...] 2 GB parallel ATA or SATA IDE disk [...] no support for USB but some machines will emulate PS/2 keyboards and mice in the BIOS via USB [...] having real PS/2 input devices is recommended [...] A minimum of 128 MB RAM and a Pentium III class CPU [...] No GPU suport [...] VESA BIOS [...] No wifi [...] only three network card chipset [...] The sole sound card supported is the SoundBlaster 16 ISA

The HW compatibility list [2] is pretty short also.

[1] https://github.com/SerenityOS/serenity/blob/master/Documenta...

[2] https://github.com/SerenityOS/serenity/blob/master/Documenta...

(comment deleted)
I've netbooted it on my ASUS A7N8X Deluxe motherboard with an Athlon XP processor and 1 GiB of RAM (~2003 era). I haven't tried older museum pieces, but the unofficial CPU requirement is a Pentium III-class CPU or better.
It runs pretty well on a Pentium 4. I wrote the Starfield screensaver for Serenity (poorly) and it pegs the P4, for what it's worth. It's runs great in QEMU on any modern CPU.
Keep it up Andreas and don’t give up ever , your story is inspiring to many.
Wow, Andreas Kling is really inspiring.

I need to get my mental space together (from the ADHD mess that it currently is), and start working on some of software engineering projects/goals.

I really hope I can.

Hello. Something to consider is that for some people big, or even medium-sized, projects and goals aren't a great fit. Some people are wired to constantly be dabbling and exploring. If you're failing to meet the goals that you're setting for yourself and then beating yourself up about it then it's worth considering a different approach.

Of course this can be easier to do in your personal life than in your work life; often at work someone else is setting the goals...

On the other hand, maybe I'm reading way too much into a couple sentences from a stranger on the internet and this doesn't apply to you...

There is a popular book that talks about accepting and embracing life as a dabbler and explorer called Refuse to Choose. (Personally I wouldn't buy it because then I would just feel bad about not reading it, but my wife told me about some ideas in it and it seems reasonable...)

What's more is that it also has a full web browser that is not based on webkit/blink/gecko but its own independent engine.
But I've been told by Hacker News multiple times that developing an independent browser is impossible without the means of a multi-million dollar corporation.
I mean, it kind of is. You can make a basic browser, sure, but you'll have a hard time implementing video playback, canvas, JavaScript and everything else, while also delivering good performance and rendering everything accurately. Yes, I know his browser has JS support, but the performance is likely at least an order of magnitude slower than V8 or Firefox... And then there's CSS, and the fact that HTML, JS and CSS keep growing and having more functionality added every month. That's not to minimize his accomplishments, browsers are just immensely complex pieces of software. Complex enough that Opera killed their own browser engine because they didn't have the manpower to maintain it anymore, and are now using WebKit.

All of that being said, it all depends on your expectations. You can totally make a browser that is capable of going to web forums and posting on Hacker News, browsing the SerenityOS website and maybe even Wikipedia for instance. If you want to build something that supports pre-2005 HTML/JS, that's probably quite feasible.

Just a nitpick, but I'm pretty sure Opera was gutted of engineers as well after their acquisition fiasco with that Chinese outfit. I don't think they had as much manpower as the good ol days AND not enough manpower to compete with the old engine.

I'm on mobile or I'd go find a source, but I'm fairly certain some key people left before all that went down.

Not that maintaining a web browser is easy, but they WERE doing it, to varying success.

It's not just Opera though. Microsoft Edge is using also Webkit. I'm legit worried that if Mozilla ever tanks, we could have a complete WebKit browser monoculture.
>I'm legit worried that if Mozilla ever tanks, we could have a complete WebKit browser monoculture.

Does that really matter much, if it's open source? A lot of software converges on one or a few standard libraries or applications.

It'd be quite a huge and significant step in the web becoming a single stack or implementation, rather than a set of open standards with various interoperable implementations.
Yes, it matters a lot. One of the reasons people want open source is to be able to "fork away" from a popular project, if the leadership team of that project takes a direction that people disagree with. Obviously this goal is impossible to meet, if the project is closed-source, or has an onerous license.

There is another cost that people don't talk about as much, and that is the cost to understand a large, alien codebase enough to be able to understand and change it. If the effort to contribute is too high, you can't get a second group of programmers to rally around the fork, and the new project will fizzle.

As an example, Google understands the economics of code very well. They know that there is little threat to market dominance for them to release Android or Chromium as open source.

Sure, I wasn't addressing that though. I just meant that it's a little inaccurate to say Opera couldn't do it because of the turmoil and turnover, and that's on top of the fact that browser engines are immensely technical projects.

I'm worried about that as well, but it's not really fair to attribute blame to most people at Opera, especially prior to the China thing. Things were okay there for a long time before that.

> Microsoft Edge is using also Webkit.

No, it's not.

> if Mozilla ever tanks, we could have a complete WebKit browser monoculture

Not a risk. Chrome dominates, and it uses Blink, not WebKit. (Yes, the distinction matters, and no, it is not a distinction that is minor/negligible/insubstantial.)

Like telecomm, wifi, and USB standards, web browsing protocol standards are deliberately overcomplicated as a way to legally fend off competition. Anytime a big corporation gets its hooks into a Standard, one can expect its complexity to grow forever unless an individual at said corporation prevents it.
IMO, it's more that the standards are overcomplicated as a result of (unhealthy) competition. This is maybe less true now, but my impression has been that until recently, Firefox and Chrome were both always racing to implement some new proprietary feature before the other browsers could design an equivalent. There were no standards. In fact, even before that, the way JavaScript was created is that Brendan Eich, at NetScape, implemented it in two weeks. The same was true of many other browser features, they were rushed into production in order to outdo other browsers and have this new feature first, and then everyone was kind of stuck having to support every half-baked feature because some websites made use of them.
It’s probably not so much deliberate complexification, as reluctant simplification. The system will become complex all by itself when there is little pressure to streamline it.
Truly, while the web also now being better than at the time of activex and flash etc. I’d wager the only rescue for a new free non-WebKit would be simple ways to use external programs - maybe yet a challenge for language design.
In the span of about 2 years, the Serenity browser has gone from nothing to where it is now. It already supports JavaScript and the canvas API.

Do you think you could build this in 2 years? The answer is yes, you could.

Sure, but like I said, having some JS support is one thing, building a fast JS engine is another. The same goes for canvas, I mean, you have to realize, there is WebGL support on the web now, but also the Web Audio API, WASM, etc. It never stops growing. There's even talk about adding machine learning features to WASM.

Again, this isn't to minimize the accomplishment, this is great, it's just to say, while building a hobbyist browser must be fun for sure, and I'm sure this browser can be useful to browse many websites out there, particularly if said websites intentionally restrict which HTML features they use. However, it's probably not realistic to think you could compete with the commercial browsers. They have dozens of people who have been working full-time on those projects for two decades and they are constantly adding new features.

I think if Andreas Kling was here, he would probably agree. I'm sure his goal was never to replace Chrome/Firefox or compete with them, but rather to learn, educate, and have fun. I congratulate him on his success and for reaching the milestone of being able to sustain himself from his passion project.

I think this is where the ninety-ninety rule is typically invoked.
Eh, it kinda is. The Serenity browser has seen a huge amount of grassroots development work that most projects couldn't dream of and it's still quite a way off usable for what most people consider every-day browsing tasks.
Every time I hear V8 mentioned, people talk about it like it's some sort of sacred tablet given to us mortals by Lord Google. It's good, but its just another interpreter/compiler.
Just because you don't like cult around it, doesn't mean you have downplay V8. No, it's not just another interpreter/compiler. V8 is an incredible feat of engineering.
Even if you somehow manage to fully implement all of JS with decent performance, you will finally hit the wall with video DRM - your users will never be able to watch Netflix, for example.
Widevine is the first DRM to be really open to be ported. They suck the least of all DRM systems. This is the DRM used in the Chrome browser and Firefox. I think it would be possible (not easy, or logical, but possible) that Serenity Browser gets Widevine at some point.
Don't the content companies need to trust your project with some secret key at some point for this to work?
That's the 80/20, for day to day it probably does not work. So indeed creating an independent browser is pretty much impossible.
Depends on what is meant by "browser". Browsing HTML is not too difficult.

There is no rule that says a "browser" must match Google's in-house Chrome or its outsourced Firefox (all salaries of Firefox developers are currently paid with money from a deal with Google).

Look at how many browsers exist already for Gemini. How many were funded by advertising. Probably zero. The multi-million dollar corporations have a vested interest in keeping the notion of "browser" so complex that independent authors cannot even contemplate it.

Unless anyone can name a counter example it's probably the most advanced open source browser engine except for the WebKit family, the Gecko family, and NetSurf. Never mind the whole OS - that alone is worthy of Andreas being able to work full time on the project!
Don't know about SerenityOS' but Dillo (predating even NetSurf) is pretty nice minimal browser with independent layout engine and there's Abaco (for Plan 9) which supports most of HTML4. That said from your list you miss KHTML (WebKit's parent; have diverged significantly since), Trident, EdgeHTML, Presto, and of course, Servo. All without doubt advanced engines. It's disappointing that both Microsoft and Opera didn't open sourced their own after retiring them.

Edit: Oops, didn't see the "open source" clause. So Trident, EdgeHTML, and Presto don't count.

I daresay Serenity might have the edge on Abaco and perhaps even Dillo. Servo I totally forgot. I didn't realise KHTML was still a thing.
Webkit family actually should be called KHTML family.
KHTML is dead since 2016 though
Not to make it sound any less impressive (because it truly is an amazing effort) but it's basically first place there simply because the criteria excludes every other like engine better and there is no remaining option that's worse. Well technically (the now deprecated) KHTML is missing many of the things now supported but that spawned the "WebKit Family" so I don't think that counts (and it supports other things Serenity's doesn't). Well Lynx might actually be behind in compliance... but it's not exactly aiming for the same goalpost.
I see your point. I guess I was trying to make the point (that perhaps everyone on HN is already aware of) that there really is an incredibly limited number of active browser projects even marginally capable of being used for the modern web so any new one deserves huge support.
I just backed his Patreon just because of this!
What a great little project! Each bit adds to what came before.

Just don't be reluctant to delete code when its time has come, and it can continue improving indefinitely.

Bit by bit indeed! The birthday posts here give a nice overview of how much the system has evolved over its couple years of existence: https://www.serenityos.org/happy/

The monthly progress videos are also nice in that regard.

I'm unlikely to ever use this project, follow it closely or interact with the creator but it still makes me extremely happy to see someone working on a project like this, with the goals, motivations and context that Andreas discusses. Thank you for making the world a little bit better at a time when it feels so crazy.
The author seems to be against providing ISOs, which is a shame, I'd love to try this out.
Quite simple to compile yourself and run
He isn't against ISOs, the "there are no ISOs" is a Serenity-internal meme. The thing is that because SerenityOS moves so fast, it makes no sense to provide ISOs, they would be outdated within days. Also, Andreas and other top contributors have other things to worry about than keeping a nightly imaging system of some sort up and running. But if you (or me or anyone, even people inside the Serenity circle) were to make an ISO archive, nobody, including Andreas, would complain. It's just not a priority by any means.

Also, as mentioned previously, it's really not that hard to build it (even if you run Windows thanks to WSL 2). People are very willing to help you, and most of it is just waiting for the toolchain to compile (custom gcc and the likes).

SerenityOS looks impressive.

Programming in assembly is like playing with Legos. Last year I started creating my own pet OS in a Bochs virtual machine, compiling with nasm. Created the boot loader and UI, but then realized what I really wanted to implement wasn't the low level layer.

For that reason I placed the project aside and moved to the highest level, creating a distributed command-line console in Javascript that connects to Node.js based servers. If I ever complete my dreamed OS then I can either translate it into assembly, or build a JS interpreter.

At this point the console allows creating programs with UI controls, launch processes without blocking the console, and terminating them just clicking a button, as well as connecting to other servers to perform tasks.

Don't know if I am hacker minded enough to take a look. But he has a point though... no-nonsense and a straight forward GUI back on the menu would be great. I hate how I am held hostage by shitty designer ideas. I am a power user.