Kern
- 11 Devlogs
- 25 Total hours
64-bit Kernel
64-bit Kernel
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.
I finally figured out how I can integrate the external library! Now I can skip instructions when an interrupt is executed and continue execution
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.
I added a demo to show the features of my kernel. The kernel is almost ready for the first ship!
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.
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.
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.
I have added a normal font which makes things way simpler. I also improved the general tty: scrolling, new lines and tabs work now!
I spend so much time to fix a stupid bug (taking the address of a pointer instead of the address stored in the pointer), but know I can display characters from my ugly psf2 font! At least I learned more about gdb.
I implemented a set_pixel function, so that I can set specific pixels on the framebuffer. The next step will probably be to display text, maybe with a font made with psfedit, my project for flavortown. I also published my code on GitLab, which means I will try to build ISOs with gitlab CI at some point.
I have started to work on my kernel! I just set up my project structure but it does not work as you can see on the screenshot. I will look at it tomorrow. I have already tried to write a kernel earlier this week, but it was an i686 kernel with multiboot 2. Also, I had to copy much code from the limine template, but I will go beyond that when the kernel runs. This means, that I have a weird mix of makefile and meson, as the example uses make but I prefer meson. As I do not want to set up long mode myself, my new kernel uses limine instead of multiboot. My current plan is to get it to run and then publish the source code. Later, I might try to remove make completely and only rely on meson for building the iso.