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

AntKru

@AntKru

Joined May 31st, 2026

  • 21Devlogs
  • 1Projects
  • 2Ships
  • 15Votes
Ship

I added a CLI the kernel, which was possible, because I finally have a keyboard driver! It only took so long, because it was actually difficult to write it: I thought I have to program the PIC, but it was already disabled so I had to learn the more complicated APIC.

There is a demo video in the README if you don't want to run the kernel.

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

  • 8 devlogs
  • 48h
Try project → See source code →
Open comments for this post

2h 20m 31s logged

I am shipping soon!

Some little improvements in messages

I improved some messages, so that the kernel looks more polished to new users.

v0.2.0

I released a new version, which is what I am shipping soon (if nothing goes wrong). It includes an interactive CLI, which was made possible with the new keyboard driver. I improved the scrolling performance a lot, which I personally really enjoy! Finally, I fixed a bug when printing numbers, so the printed memory map now has (mostly) correct addresses.

0
0
11
Open comments for this post

3h 9m 41s logged

The kernel is now interactive!

Demo CLI

I added a demo CLI (you can see it on the screenshot) where you can exit properly, run tests or view the old demo!

Keyboard driver

I had to fix some bugs with the keyboard driver, but now I think it works okay enough that the CLI is stable (previously, it kept parts from the old buffer when reading it again)

Road map

I want to add more features to the CLI, such as setting the log level. As you can see on the screenshot, the debug output disturbs the CLI.

0
0
9
Open comments for this post

5h 1m 26s logged

I FINALLY get interrupts from the keyboard!

PS/2 Keyboard driver

The problem was, that I mistook the IRQ number for the interrupt vector when calling my own function!
Now I can start expanding my keyboard driver. Currently, it already prints the pressed keys to the screen, as you can see on the screen shot.

Performance improvements when scrolling

After I finished the interrupt stuff, I can focus on improving the TTY in other areas, like the performance. I am using now memset() and memcpy() functions when scrolling the frame buffer, which itself is not an improvement: I optimized the two functions to use copy 8-byte blocks ad uint64_t instead of each byte individually, which made a significant difference. Scrolling with KVM acceleration is now almost instant on my PC, and without it is as fast as it was before with acceleration.

Road map

I want to improve the TTY with things like buffering, which should improve the performance even more.
When I have a solid TTY, I can rework the demo and ship again.

0
0
7
Open comments for this post

6h 21m 55s logged

I am still far away from getting interrupts from the keyboard, but I am still learning much and making progress on other parts of the kernel!

PMM

I added support for mapping pages manually, which means that I can program now the APICs! While debugging this, I also improved my Page Fault handler, which you can see on the screenshot.

APIC driver

The APIC driver should now be able to configure IRQs on the I/O APIC to get delivered to the local APIC, but I can’t test it as I still don’t know why I can’t get interrupts from the keyboard :-(

Road Map

I am still working on getting interrupts from the keyboard, which is my main goal before the next ship. I currently suspect that my PS/2 driver is broken.

0
0
4
Open comments for this post

7h 34m 1s logged

I prefer this devlog format, so I will stick to it.

I/O APIC

As I explained earlier, I need to configure the APIC to get interrupts. I think I only need the I/O APIC and not the local APIC, if I understand the limine documentation correctly. But when trying to access it’s registers, I got a page fault. It seems like I need to manually map the registers to virtual memory, which brings me to…

Physical Memory Manager

I need to do what I already feared when starting to write the PMM, manually editing page tables. I am working on a function which will map pages (Including the I/O APIC registers) to virtual addresses. For this, I need to walk the complete paging structure:
PML4 (from cr3) -> PDPT -> PD -> PT
I can already parse it until I have the PT’s address, but when accessing the PT I get a page fault, as you can see on the screenshot.

Road map

I just wanted to post this update so that the next devlog is not too long. I will continue to work on the PMM, until I can access the I/O APIC’s registers.

0
0
3
Open comments for this post

8h 20m 51s logged

I did not post for some time, so this devlog will be relatively long.

PS/2 driver (Screenshot 1)

I wanted to get the PIC to work, but as I had no idea why it didn’t work I thought that the PS/2 Controller might not be in a functioning state. So, I wrote a PS/2 driver which initializes the Controller, and also detects connected devices!

PIC -> APIC

After that, I finally found out that limine already sets up the APIC, which means that the PIC is no longer functional. So I decided that my next big goal is to learn how ACPI and APIC work…

ACPI (Screenshot 2)

As you can see on the screenshots, I started working on an ACPI driver, which is already able to find tables like the MADT, which I need to find the APICs

UEFI

This does not have anything to do with the progress of my project, but I learned how to use UEFI in QEMU, so that I can debug my ACPI driver better.

Road map

I will have to learn now how APICs work, so that I can get interrupts from the keyboard. Then, I can improve the keyboard driver, which should make the kernel way more fun to use!

0
0
6
Open comments for this post

6h 4m 2s logged

I have finished implementing the memory manager!
free() will now call pmm_free() to free unused pages. At the moment it does not make any difference, but if I want to extend the PMM it will have saved me the work.

Also, I split the demo from the main function so that it is more maintainable.

Log messages with the log level DEBUG will now only appear in debug builds. This made the output much more readable, as you can see in the screenshots.

0
0
5
Open comments for this post

9h 36m 46s logged

I have added a simple memory manager to my kernel! It was only possible with the help from kmos, a project I found while voting. I didn’t know how to start writing a physical memory manager, but in that kernel I found that I have to use the limine HHDM request to have simple access to physical addresses.

Then I could implement the rest completely myself.

The last thing left to do until I’m satisfied with my memory manager, is to free pages in the PMM after using free()

0
0
5
Ship

I made an x86_64 kernel using the limine boot protocol. I don't know what the most difficult thing was, as even most basic things are very complicated for me as a beginner in osdev. I still have to learn much and the kernel will be improved, but I thing it kind of works now.

I have a video demo in the readme, if you don't have `qemu`.

When building, remember to clone the submodules (`git submodule init && git submodule update`). You need `xorriso` to build the ISO. Sorry for mixing `meson` and `make`, but in the README is a guide. Please use clang, gcc is very complicated.

  • 13 devlogs
  • 30h
  • 17.21x multiplier
  • 509 Stardust
Try project → See source code →
Open comments for this post

50m 29s logged

Now I am actually shipping! I had a bug that occured only when compiling with optimization level 2 or higher (which I used in the release CI). As I am working now on a Debian machine, I made it also compile on Debian stable by not requiring a new objcopy version.

On the screenshot you can see the bug.

0
0
4
Open comments for this post

4h 1m 45s logged

I will ship the kernel now for the first time! I added a libk (like a libc but for the kernel) and implemented some cool functions like printf(), which I could use for cool error messages with hex numbers like the one on the screenshot.

0
0
3
Open comments for this post

2h 29m 38s logged

I sadly don’t have much to say, because I did make almost no progress. I am trying to use the PIC to get interrupts from the keyboard, but it doesn’t work for some reason. Maybe I will try to use APIC instead, but it’s more complicated.

0
0
4
Open comments for this post

2h 15m 43s logged

I finally figured out how I can integrate the external library! Now I can skip instructions when an interrupt is executed and continue execution

0
0
1
Open comments for this post

1h 3m 53s logged

I just wanted to implement an interrupt handler specific to divide error, but it turned out to be way more difficult than I thought!

To continue execution after the interrupt, I have to manually increment the instruction pointer manually. But to know by which amount, I need to now the size of the whole instruction. To find it I wanted to use a library called Zydis, but I could not get it to compile, because clang generates calls to memset() and memcpy(). As I can not link with the standard library, I will have to find a solution tomorrow.

0
0
1
Open comments for this post

3h 6m 47s logged

I added a demo to show the features of my kernel. The kernel is almost ready for the first ship!

0
0
2
Open comments for this post

3h 14m 49s logged

After giving up on the memory manager, I added logging and very basic interrupt handling. I will ship the project when I have a demo of all the features and published ISOs.

0
0
2
Open comments for this post

2h 15m 1s logged

As I have now a very basic way to interact with the kernel, I will try to move on to more complex topics. At the moment I try to understand how memory management exactly works (specifically, how to write a physical memory manager), but it’s difficult to find information about it. Until now, I have requested a memory map from limine and can display it in a table.

0
0
1
Open comments for this post

1h 43m 35s logged

I implemented enter key press detection before doing anything else, so that I can interact somehow with the kernel. I did it with IO Ports instead of interrupts for now (because I don’t know how to set up interrupts), which means it only works with PS/2 Keyboards. Luckily, qemu shows the keyboard as a PS/2 Keyboard.

0
0
3
Open comments for this post

2h 31m 59s logged

I have added a normal font which makes things way simpler. I also improved the general tty: scrolling, new lines and tabs work now!

0
0
2
Loading more…

Followers

Loading…