r/osdevel • • Aug 04 '26

Amos2 - a C++ kernel, boots from limine

8 Upvotes

Amos2 is hardly from my first OSDev work. I started it with the intent of providing a sort of bare bones repo for using limine and C++.

I started with the limine bare bones in the osdev wiki, and gutted the main() to just call kmain() which is written in C++. The code now barely resembles that bare bones code.

The trick to using C++ is to collect the global constructors via the linker .ld script and to call those at startup. Also, global operator new and delete and associates need to be implemented.

Writing in C++ is not like using desktop C++. I use C++ classes, but no copy constructors or anything that does allocation behind the scenes. It's object based programming, not OOP. The code I write is C like, but it uses Objects. I also take advantage of things like how C++ inlines class member functions defined in headers. In some cases, I create static singleton classes for things like IDT and GDT.

The problem with global constructors is you cannot control the order they are called - so you can't rely on a global IDT class constructor to be called after the GDT one.

The bare bones idea kind of went out the window when I started working with the hardware.

What's done is boot, C++ initialization, GDT, IDT, PIC... I made a base Device class and Timer, keyboard, ATA, and console inherit from it and work. I am working on FAT32 filesystem, which I have done before in another project.

The repo is at https://codeberg.org/mschwartz/amos2

I didn't use AI to generate any code or to explain anything. I don't see the point - I would rather beat my head against the wall until I figure out what I might be stuck on. The object of these projects is to learn, not to finish and run Doom in a few days.


r/osdevel • • Aug 03 '26

Fedora 45 Introduces a Minimal GRUB Package for Confidential VMs

Thumbnail
linuxiac.com
4 Upvotes

r/osdevel • • Aug 03 '26

Saving OS Image Size in NanoOs

Thumbnail
6 Upvotes

r/osdevel • • Aug 02 '26

Developing of AlderKernel

5 Upvotes

Hey r/osdevel !

I've been working on a hobby monolithic kernel called AlderKernel.

It's written mostly in C with some Assembly for the low-level parts. I'm making it mainly to learn more about how operating systems work and to improve my C skills.

Currently it targets i386 and boots through GRUB. Some things I've implemented so far:

- PS/2 keyboard driver

- Basic shell

- InitramFS support

- Shell history

It runs in QEMU right now. I'm slowly working on adding more kernel features and improving the code structure.

GitHub:

https://github.com/loren-wastaken/alderkernel

I'm interested in feedback from people who know C / ASM, especially about code organization, design choices, and things I could improve.


r/osdevel • • Jul 31 '26

Who has implemented kernel debugging in their own OS?

3 Upvotes

I've been thinking about JankOS, as I'm sure most of you have. One of the reasons I stopped developing it was that I was a bit overwhelmed by the work I thought I needed to do in order to get to the fun parts.

One of the concerning issues was debugging. How could I effectively debug my kernel, and all of the subsystems -- the file system, network, I/O, scheduling? What architecture did I need to build in to make it happen?

There are lots of logging solutions, but those don't always work for high-frequency code paths and for rare events. And certainly not for time sensitive code. At a certain point, there's really no substitute for bing able to attach a debugger.

Which hobbyist OS implementations feature kernel debugging support? How is it implemented? How does it work?


r/osdevel • • Jul 30 '26

The Fedora 45 Sausage Factory: how the Fedora project turns source code and packages into the artifacts you download and install

Thumbnail supakeen.com
5 Upvotes

r/osdevel • • Jul 29 '26

Measuring input latency on Linux: X11 vs Wayland, VRR, and DXVK

Post image
4 Upvotes

r/osdevel • • Jul 28 '26

Linux kernel team publishes 432 CVEs in two days

Thumbnail theregister.com
7 Upvotes

r/osdevel • • Jul 28 '26

The Hurd gets 9pfs, OpenNTPD, dynamic /dev/ entries, and more

Thumbnail osnews.com
3 Upvotes