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

AntKru

@AntKru

Joined May 31st, 2026

  • 33Devlogs
  • 1Projects
  • 2Ships
  • 30Votes
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
8
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
21
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
Open comments for this post

6h 25m 39s logged

Multitasking (Screenshot 1)

I decided to try to implement multitasking! The kernel can now switch tasks, but only one time. This is the first step in direction of real multitasking, but I still have much to do. It is interesting to see, How I realize how bad my implementations I did earlier are, because I don’t fully understand them. But now I can improve them!

Dynamic arrays (Screenshot 2)

I made a quick implementation of dynamic arrays for the keyboard driver, but as I realized that I need them to store a list of tasks, I decided to implement one optimized implementation I can use everywhere. I have implemented a very simple version and use it in the keyboard driver, but it isn’t optimized yet. In fact, it’s even worse than the one I had earlier in the keyboard driver, because every modification now requires a reallocation.

Road map

I am going to optimize dynamic arrays, and then continue with multitasking.

0
0
13
Open comments for this post

2h 51m 25s logged

PIT

I quickly wrote a simple PIT (Programmable Interval Timer) driver, so that I have a basic sleep function.
It isn’t really useful at the moment and not thread safe, but as it was very simple I thought why not?

APIC

I realized that MADT I/O APIC overrides also override the flags of entries, so I am using these now unless it’s overridden by the user.

Road map

As I have now a simple keyboard driver, I want to work on something new. Some things I am considering:

  • Multitasking
  • Filesystems
  • ELF loading
  • PCI
  • USB

All of this topics are completely new to me, so I will pick the one that looks the most simple and probably fail anyway.

0
0
15
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
  • 19.83x multiplier
  • 961 Stardust
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
15
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
12
Open comments for this post

5h 1m 58s 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
8
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
5
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
6
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
9
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
9
Loading more…

Followers

Loading…