You are browsing as a guest. Sign up (or log in) to start making projects!

AntKru

@AntKru

Joined May 31st, 2026

  • 41Devlogs
  • 1Projects
  • 4Ships
  • 68Votes
Ship

What I did

In the latest release I improved the usability of the CLI and added a PCI driver. On the ahci branch I have worked on an AHCI (Used for reading from SATA drives) driver, but it isn’t finished yet.

What was challenging

The AHCI driver is very difficult to implement and is far from ready (The AHCI controller can now be initialized by the kernel, but it can’t read from drives, yet). For this reason I decided not to include it in the release, but if you want to see what I worked on check out the ahci branch!

What I am proud of

I really enjoyed writing the AHCI driver, it is a cool feeling to have two manuals opened at the same time and trying to understand what they want to tell you. Even though the driver isn’t finished yet, I put much work into it.

How to try the kernel

Video

In the README of the git repo is a video, where you can see the latest release in action.

Release ISO

I’ve linked the release page, where you can download the ISO and run it with QEMU:

qemu-system-x86_64 kern.iso

Note for macOS users:

If you want to run it on macOS with UTM, you have to force a PS/2 controller: https://docs.getutm.app/settings-qemu/qemu/#force-ps2-controller

Building the kernel

If you want to build the kernel, for example to check out the ahci branch, follow the build instructions in the README.

  • 5 devlogs
  • 22h
  • 19.22x multiplier
  • 421 Stardust
Try project → See source code →
Open comments for this post

2h 57m 55s logged

Usability improvements

As I won’t be able to finish the AHCI driver, I decided to improve the usability. I added dbg/dbgclr commands to allow easier debugging by only printing specific debug messages. The CLI got some big improvements, it will now detect commands even with trailing spaces. the loglevel command was renamed to logl for faster typing. Both logl and dbg accept their input now as CLI arguments instead of asking the user themselves.

Roadmap

After stardance I will probably take a little break, but then I want to continue on the AHCI driver, so that I finally can read files from SATA drives! And even after that, there are many more things to explore, like ELF loading, USB, Networking…

0
0
17
Open comments for this post

7h 56m 3s logged

AHCI update

I continued working on AHCI, the memory management problem was actually a problem in my AHCI driver…. Anyway, the AHCI driver has made some progress. I sadly couldn’t post for such a long time, as there where no visible changes, so here is a screenshot of some debugging messages I added while working on it. The initialization code is almost finished, but I am still very far away from reading actual files.

Roadmap

As stardance is ending soon, I will try to do some stuff users actually see and finish AHCI later. One idea I had is to add a command to only show specific debug messages. I also will update the demo to demonstrate more recent features.

0
0
18
Open comments for this post

4h 39m 46s logged

Memory management problems…

It seems like there was a critical bug sleeping inside my memory manager. It appeared since I started using the PMM in my AHCI driver, but I think the problem is in the virtual memory manager. For this reason I am working currently on the memory manager instead of the AHCI driver.

Roadmap

As soon as I fix the MM, I will continue on the AHCI driver. It probably won’t be finished until the end of stardance.

0
0
18
Open comments for this post

2h 37m 27s logged

AHCI! (SATA)

I am jumping a little bit fast form PCI to AHCI, but I think the PCI driver is as good as I need it right now, and if I learn that it isn’t, I will fix it. Anyway, I am starting to work on AHCI! This is really cool, as this allows me to communicate to storage devices! At the moment the kernel just lists connected devices, but that’s just the beginning!

Roadmap

The AHCI driver is in a very early stage, and it will take me a lot of time to finish, as AHCI is relatively complicated and the documentation isn’t written for beginners like me ;-)

0
0
26
Open comments for this post

3h 41m 34s logged

PCI!

I am starting to write a PCI driver, which opens a new world to me! As you can see, the kernel is already able to print some information on boot about connected PCI devices. I also added a function that can search for a specific PCI device by it’s class, which will help me to implement drivers for specific PCI devices.

Roadmap

The real reason I am implementing PCI is that I need it to find the AHCI controller. The AHCI controller can be used to access connected storage devices, which is my long-term goal.

0
0
25
Ship

I have released the next version of my own kernel! The biggest feature I added is multitasking. While it doesn’t look that special, it was actually very difficult to make my kernel switch between different tasks!

Here are some notes on how to try the project:

If you don’t want/can’t run it, you can look at the video in the readme.

If you want to run it on macOS with UTM, you have to force a PS/2 controller: https://docs.getutm.app/settings-qemu/qemu/#force-ps2-controller

  • 15 devlogs
  • 65h
  • 19.56x multiplier
  • 1269 Stardust
Try project → See source code →
Open comments for this post

1h 20m 55s logged

Release 0.3.0

I finished the release, including the new borders command! The visible bugs that I found are also fixed, please report them if you find some!

Roadmap

The kernel isn’t finished yet, I will continue to improve it and see how far I will get.

0
0
12
Open comments for this post

4h 4m 30s logged

Final improvements before the next release

Status bar

I moved the status bar from the bottom to the top and removed the borders, in my opinion it looks better this way.

Framebuffer borders

I am already working on a new command which will make it possible to see the borders of the framebuffer in QEMU. This will be useful for debugging while keeping the UI simple.

Bugs

There are still some obvious bugs: My printf() implementation seems to break with invalid format strings and I have a bug in my memory manager which prevents me from merging the command showing the screen borders into main.

Roadmap

I will try to fix the bugs, but the features are now complete. I want to release the new version tomorrow.

0
0
20
Open comments for this post

7h 48m 22s logged

printf compatability

I improved the printf() compatability, so that I can pad numbers with or 0. This is very useful, for example I now can use it to display time and date properly.

Roadmap

I don’t know yet what’s the next thing to do, maybe I will ship soon.

0
0
14
Open comments for this post

4h 6m 37s logged

Status bar!

I added a status bar which show the current time. It is very basic, but makes the OS look way more friendlier in my opinion. Sorry for the weird messages in the main window, I am currently debugging my printf implementation.

Roadmap

I still have a problem with printing dates: The year 2006 would be printed as 206, because the RTC has seperate registers for year and century, so if century is 20 and year is 6 it prints 206.

0
0
10
Open comments for this post

2h 36m 29s logged

“Windows”

I am making it possible to split the framebuffer into multiple views. This should make it more easy to have a more advanced UI than a CLI already inside the kernel. Hopefully there will be user processes at some point, but I want to have a nice looking OS before that.

Roadmap

I still have to fix some things (as visible on the screenshot). After that, I can try to make use of it and add a status bar or a separate command window.

0
0
22
Open comments for this post

4h 31m 54s logged

RTC

The kernel can now read the current time from the Computer’s RTC! At the moment, you can’t select the time zone, so the time is probably in UTC, depending on how the computer is configured.

Roadmap

I am planning to improve the use experience, for example by using multiple “windows”, to maybe even have a status bar.

0
0
22
Open comments for this post

4h 14m 20s logged

GCC support

I added GCC support, which should (hopefully) make debugging easier for me. I can’t show it really on the screenshot, trust me, it is compiled with gcc!

Roadmap

I have still bugs in my multitasking system. Currently I get a page fault when compiling with optimization >-O2 with clang, the next step is to test it with GCC.

0
0
32
Open comments for this post

2h 41m 21s logged

Mutexes

I implemented a simple mutex (which isn’t perfect yet, but it works). As visible on the screenshot, I used it to make it impossible for the test tasks to print at the same time. One problem with it is that it currently runs hlt after releasing a mutex so that a different task has a chance to acquire it, which doesn’t seem like the best solution to me.

Roadmap

I am making the terminal position atomic, so that I don’t need mutexes for output, which I can not use in interrupt handlers

0
0
15
Open comments for this post

5h 53m 23s logged

Multitasking!

I fixed the last bug (that I could find) and multitasking works now! On the screenshot you can see two tasks trying to print the numbers 0-19 at the same time. The CLI even waits until the tasks are finished!

Road map

The output is still a little bit broken, so I want to implement output buffering and mutexes, so that multiple threads can’t print at the same time.

0
0
8
Open comments for this post

6h 15m 56s logged

Multitasking…

I am still working on multitasking, but I am stuck currently. I am trying to modify the stack frame so that asm_switch_task is called after iretq, but it doesn’t work. As you can see on the screenshot, I get a page fault as soon as it tries to switch tasks (in the debugging process I had it switch 2-3 times before it crashes, which is not really better)

Road map

My highest priority is to get task switching to work consistently. After that, I will see what I can polish.

0
0
5
Open comments for this post

2h 24m 46s logged

SSE register state switching!

The kernel will now switch the SSE register state lazily, but I still have two problems:

  • The Part for the registers in the TCB must be 16 byte aligned, which it currently not guaranteed
  • The interrupt handlers are not allowed to use SSE instructions, but I have no way of verifying this

Road map

I think it is time to write a version of malloc() which can guarantee a specified alignment. After that, I can try to actually switch tasks automatically with a simple scheduler! I will probably use the PIT interrupt to switch to the next task in a list.

0
0
11
Open comments for this post

4h 33m 38s logged

It probably doesn’t sound special, but it is as important as everything else:

SSE support

SSE is an extension of the CPU which has 16 128-bit registers, but is rarely used. This means, that saving all of these registers every time a task switch occurs would cost some performance. For this reason, the CPU has a bit that can be set to indicate that a task switch occurred. In most cases, nothing happens and the registers are kept in their original state. But if a task needs to use SSE instructions, the CPU generates an interrupt, which manually saves the SSE registers. This is what I am working on currently.

Custom ISR wrapper

All interrupt handlers use now my custom wrappers, which made possible that I can work on SSE support.

0
0
15
Open comments for this post

5h 2m 5s logged

Array optimization (Screenshot 1)

I now actually optimized the dynamic array type, which means that it allocates memory in bigger chunks instead of every time an element is added / removed. In the process I added some debug logging, so typing is now very difficult if you don’t know how it works with log level LOG_DEBUG.

Custom ISR wrapper (Screenshot 2)

I finally decided to implement my own wrapper for ISRs instead of relying on __attribute__((interrupt)). This should allow me to use floating point math with the FPU in the future. Also, I can now read more registers on interrupt (screenshot).

Road map

I am currently working on making all ISRs compatible with my wrapper. Then I will continue trying to get multitasking to work.

0
0
11
Loading more…

Followers

Loading…