Serenity: x86 Unix-like operating system for IBM PC-compatibles
github.com
github.com
I actually made a little demo video about this system just yesterday if you'd like to see it running: https://www.youtube.com/watch?v=hE52D-zbX3g
I'd say congratulations but I'm not sure what to congratulate as there's numerous accomplishments here worth doing so for. Compositing windowing? Complete and functional network stack? Seriously, kudos.
Were there any ideas you wanted to prove with your implementation?
How did you gain the knowledge to implement all these subsystems? Did you use any specific resources?
Just building a kernel and networking would have been awesome, but a GUI and all the applications is just mind-blowing cool.
Submissions like this is why I read HN. There are something intriguing about projects like this, that are small enough for you to have a chance of understanding how every part works.
I spent many years with a PC emulator (my other GH repo) being my only main hobby project. It's a reasonably correct 80386 with various peripherals and a BIOS. This project allowed me to take 80% of the skills acquired from the emulator, turn them inside out, and build an operating system from them. Of course, Serenity eventually outgrew the limitations of my emulator (no networking, no FPU, no VESA LFB...) and I've stopped trying to catch up for now.
Other than that, the OSDev.org wiki has been immensely helpful at times, and the vast number of open source operating systems you can look at for help/inspiration when stuck. :)
At the moment you would need to add it to the base code before compiling. I've been working on porting GCC in increments. Last time I tried, GCC was able to build "Hello World" but somehow fell apart between assembly and linking for programs with more than a few functions. It's something I keep coming back to as it's quite draining to deal with the long build times of GNU tools for more than an evening.
>Would I be able to run it on bare metal someday (are any other drivers compatible?) or is this VM-only?
At the moment this is VM only. It could probably be made to run on bare metal relatively soon with a bit of hackery, but it's not something I've spent any time on since the VM environment is fantastic for rapid development.
- Ruby - Python3 or something else?
Does it support POSIX shell (yet?)?
- sh?
- Bash?
- zsh?
- You kept the end user in mind: You. The GUI looks like a mashup, in a good way: A Mac OS menu bar, Windows GUI feel and a NextSTEP launcher on top of a Unix like system. It shows that for every element, instead of simply recreating whatever system you decided to emulate, you took the parts you liked best from whatever system and simply recreated that. I haven't looked at the code too thoroughly, but I can probably find the same mindset there.
- You kept the scope tight. It's easy to lose sight of the bare minimum MVP, especially when working on a hobby project. The functionality showcased here tells me that whenever you started implementation of a feature, you built exactly what you needed, nothing less, nothing more.
- You also didn't get bogged down with premature optimizations. Yes, the PNG renderer is slow. But it does the bare minimum it's supposed to.
But most of all, this takes a crazy amount of time, skills and dedication. You've probably encountered quite some frustrating moments you had to chew through, but now you're here, presenting your work. And it's awesome!
If you looked at the code, you would indeed find a similar "take what you like and leave the rest" style mashup. I spent many years working on WebKit, so you find a lot of WebKit-style patterns, containers and templates. I also spent some years working on Qt, so there's a huge bit of that in the GUI library. :)
I didn't think of this when making the video, I simply typed "ping 127.0.0.1" out of some reflex. So basically, I need to make a loopback interface. Putting that on my TODO list, thanks for noticing this!
https://github.com/awesomekling/serenity/blob/master/Kernel/...
/* * Really really really Q&D malloc() and free() implementations * just to get going. Don't ever let anyone see this shit. :^) */
I keep postponing writing a better malloc because every time I run into trouble with this thing, I spend 5 minutes optimizing away whatever the current problem is and buy myself another month of not having to write a better malloc. Someday though.
These are the most inspiring HN posts. They’re not marketable startup ideas, but the “lone hacker” working on something huge that I wouldn’t even consider, and then getting it to work, is very impressive.
Now of course, he is standing on the shoulders of giants, so to speak, but hasn't he become very close to a giant himself now?
It is almost always true that your daily behavior speaks your deepest beliefs, and to put something like this together as quickly as the OP did...well, awesome work OP maybe now you can work on flying cars :)
To clarify the repo history, the bulk of the codebase is from October 2018 forward, the one exception being a tiny bootloader+kernel I worked on for two weeks (and originally lost interest in) earlier last year and then imported into this repo.
"the goal here is a marriage between the aesthetic of late-1990s productivity software and the power-user accessibility of late-2000s *nix" That sounds right up my alley. Will give this a try!
Anyhow, this project looks really inspiring. At least from a quick cursory glance. Looking forward to digging a little deeper tonight.
I beg to differ! While I do see that there are a a handful of very popular distros, there are tons more out there!
Spend a few minutes poking around DistroWatch[0] and see if you don't agree.
Some might see the grand unification a good thing for interoperability and developers - and I don't disagree with them. But it was fun looking at the different ways different distros would solve the same problem. Whereas now the biggest difference between a lot of distros is a great deal more superficial.
variety is the key description I used. Sure there are few outliers still but the rest are just systemd + (apt|rpm) and there this really the same as what Linux was like 20 years ago where even Debian and Redhat were distinctly different from one another. Even Arch has come into the fold somewhat over the years.
There's some cool experiments out there. Who knows anymore. One of the great things of everything (even on the desktop) being a web app, is it's really made many applications more portable, it's also slowed creativity and broader adoption. Right now, 90% of the apps and tools I use run under Windows, Mac and Linux, that's pretty huge. New OSes without at least enough support for electron/v8 and a few other bits will hold them back imho.
It's good and bad. I cannot speak for anyone else, to me these things are very cool. In the end, I have work to get done.
I haven't checked other parts, but if they are like that it would be more a very elaborate demo than something actually usable.
Still impressive even for a demo.
Now for the rest of my life, I will always have something to hack on. :)
This is such an inspiring and humbling sentiment!
Thank you for all your hard work on this impressive project.
Depending of the definition of "usable." It's surely usable for anybody who wants to learn the basic ideas.
It's written from the scratch, and just a small part of the whole system.
To get the idea how the networking stack were introduced to the famous systems see, for example, how may people were involved in creating the Windows networking stack with TCP/IP, at the moment the already had other kinds of networking, and as Berkeley sockets already existed for years:
"The idea for Windows Sockets was first proposed by JSB's Martin Hall at a Birds Of a Feather session at Fall Interop in San Jose in September 1991. Around 40 companies were formative members of the Windows Sockets group. Representatives from these companies gathered in Seattle in December 1991 to debate and resolve the basis of Windows Sockets. Considerable effort between then and January 1993, which involved a substantial amount of Internet-based email discussion, together with several meetings and 2 interoperability testing sessions (WinSockathons) led to version 1.1 of the Windows Sockets specification which is the definitive reference point for Windows Sockets today. WinSockathon II proved that Windows Sockets 1.1 is a viable standard for application/network implementation interoperability."
On 16 bit platforms, we needed to buy it as additional software package.
I totally agree with the author to do the minimum otherwise just one part can delay all.
"Comparing TCP/IP products for PCs"
"PathWay Access 3.2 (The Wollongong Group)" ... "The PathWay product installed more easily than all the rest. We found it amusing that Wollongong managed to squeeze its software into five disks while others needed up to 15 disks for essentially the same software"
Rapidly MVP as much as you can do you have something usable. Then go back and refine the warts as and when they become a nuisance.
I really hope the author or someone else writes sone high level documentation! Just knowing the design decisions would be great!
I worked for a set top box manufacturer where the lead engineer wrote an OS and a GUI system, from scratch, for our platform in less than a year. It had a bunch of syscall personalities. One for vxworks so we could port stuff from our existing platform and one for Linux so that people could write drivers for it based on the O'Reilly Linux device drivers book (which was current at the time). It also had a couple of others for odd things that we needed. It was incredibly well written. It only took me a couple of weeks to port it to PowerPC and the first week of that was just phaffing getting my cross compiler working properly.
In contrast, we had another couple of programmers trying to write a web browser for that platform. After a year they had something that could render primitive web pages but there was still a good chunk of the web that didn't work "quite right". After two years they were still in a similar position.
Operating systems are a dark art, and the person who wrote Serenity is very talented, but OSes are, at least, a tractable and well defined problem.
https://drive.google.com/file/d/1954ki8wzHT6axoj9vbFKj8XxFK5...
and it works! Boots in like .1 seconds. Very neat.
One strange thing, in QEMU, the mouse is all crazy and I can't control it in a usable way. Jumps around.
I am skeptical.
(They do have a point though; IBM PC compatible implies it would run on an IBM PC...)
Here someone is just pointing out a semantically incorrect or misleading statement. And we can say that's nitpicky, to a degree. It lacks some of the other nuance of the term 'bikeshedding,' though. If anything that was nitpicking also was bikeshedding, then what's the point of inventing such a term?
And yes, I'm being nitpicky about the term bikeshedding, and proud of it :p
(P.S.: As far as comparing the word nitpicking to bikeshedding, I think nitpicking already implies disproportionate attention to small details; hence the 'nit' part of it.)
The "IBM" part simply means the standard that IBM created, and doesn't have to imply that the software runs on an original IBM PC - rather, it implies that software that could run on an IBM PC also runs on such a machine. Hell, DOS still runs on bare metal on a modern machine.
Microsoft released a non-PC x86 device in 2001, the Xbox: https://en.wikipedia.org/wiki/Xbox_(console)