
Introduction to SerenityOS Programming - rogerclark
https://awesomekling.github.io/Introduction-to-SerenityOS-GUI-programming/
======
akling
Hello friends! Author here. Happy to answer any questions about SerenityOS and
its programming environment. :)

~~~
bananaboy
This is amazing! I love it! I have a couple of random questions. What video
mode does the GUI environment run in? Does it boot directly into the GUI or
can it run headless as well? Do you have a more detailed overview of the
different parts of the OS and its current capabilities?

~~~
akling
Hi bananaboy! The system currently boots into 1024x768x32 by default. It uses
the Multiboot protocol to request that the bootloader sets a video mode before
passing control to the kernel. That allows the system to work in tons of
places where we don't have a proper video card driver yet :)

As DAlperin mentioned, it's possible to boot it headless although it's not
something that gets a lot of focus since this is primarily intended as a GUI
system.

I have some presentation and "code tour" videos[1] on my YouTube channel where
I go into great detail about how some parts of the system work. If you would
like to know about the SerenityOS internals in-depth, it's a pretty good place
to start. :)

[1]
[https://www.youtube.com/playlist?list=PLMOpZvQB55be9pGeYypHg...](https://www.youtube.com/playlist?list=PLMOpZvQB55be9pGeYypHgPB8XjXbAPOTm)

~~~
bananaboy
Thank you! I’ll have a look at your videos!

------
thom
So glad this project is still going! I remember looking at the userspace code
last time it was linked here and marveling at how clean and uncluterred it
was.

~~~
akling
Hi thom! I'm glad you remember it that way :) Hopefully the userspace code is
still clean and uncluttered. The project keeps growing at a pretty high pace
and I do sometimes worry that quality suffers. Nothing that a little "let's
calm down and work on stability for a moment" can't fix yet though.

------
Aaronstotle
This is great! I found SerenityOS after it got posted here a few months ago
and I've been keeping up with your videos. Unrelated note, how stable is
SerenityOS on baremetal? Would love to have it up & running on a spare desktop
in the near future.

~~~
akling
Hi Aaronstotle! I don't run it on bare metal myself, but there are a couple of
other developers who mess around with it somewhat regularly. You should have a
fair chance of getting it running on hardware that's a decade old or so.

There are people actively working on various things like ACPI, AHCI and NVMe
right now, but hardware support takes time. That said, things have been moving
at a pretty decent pace :)

~~~
Aaronstotle
Yes, I've noticed things have definitely picked up steam in the last six
months, especially considering all your security improvements. Is there an
irc/chat you and other people hang out in?

~~~
akling
Oh indeed, and it's been super fun learning about security!

The main community hub for the project is #serenityos on Freenode :)

------
blattimwind
This basically looks like a cleaned up Qt API. (Which is a good thing, the
basic design works really well for applications, it only gets annoying if you
want "apps" and fully customized look and feel, animating everything)

~~~
akling
Hi blattimwind! Yes, it is heavily inspired by (the excellent) Qt. I worked on
the Qt team in the past, so the influence is unavoidable :)

------
jwjones
Wow, this is very cool. I am merely a BSD/Linux/UNIX hobbyist (I do not write
code), but I love the concept and implementation of SerenityOS. Very clean and
fast. The window manager reminds me of icewm, one of my favorites. And I love
the global-style application menu on the top bar. I will be keeping an eye on
your progress; I look forward to a bootable iso some day. Great work!

------
axilmar
Very nice and clean GUI library.

Clean GUI C++ libraries like this always make me think that Microsoft
deliberately chose to not implement such a nice C++ GUI API for Windows and
instead gave us the horrible MFC in order to lock us in into Visual Basic and
other proprietary projects.

If Microsoft had given us a clean C++ API for Windows, the world of
programming would be very different today.

~~~
speedplane
> If Microsoft had given us a clean C++ API for Windows, the world of
> programming would be very different today.

I mean, Win32 was a relatively clean C library. Not beautiful by any means,
but it worked and was well documented. At the time it was huge, but it's
pretty irrelevant today. If they did it in C++ instead of C, how could it have
been different.

~~~
axilmar
I wouldn't call the Win32 API clean. To me, it's one of the worst APIs I have
ever encountered.

It worked and it was well documented, but that does not mean its design is
very nice. To me, that is.

~~~
highspeedmobile
There would be no surprise to this since the Win32 GUI APIs were created at a
time when C++0x was widely used compared to what you see with APIs created in
C++11 and onwards.

I guess the latter is the case for SerenityOS and other OSes with integrated
GUIs.

~~~
akling
Indeed, SerenityOS has been using C++17 from the start, and will be using any
helpful C++20 features as soon as they are available in compilers. We're
already using templated lambdas in a couple of places :)

------
bArray
Please update the title to include GUI, i.e. "Introduction to SerenityOS GUI
programming".

~~~
yellowapple
Is there some reason why an introduction to SerenityOS GUI programming cannot
also be an introduction to SerenityOS programming as a whole? Especially
considering that the graphical interface seems to be the focal point of
SerenityOS (much like it is for Windows or BeOS/Haiku or classic Mac OS).

~~~
bArray
> Is there some reason why an introduction to SerenityOS GUI

> programming cannot also be an introduction to SerenityOS

> programming as a whole?

It could be, but it's vague. The original title was very much to the point, I
don't understand why 'GUI' was dropped.

------
connor-brooks
Wow! Very nice

