mov eax , cr0
or eax , 0x01
mov cr0 , eax



back to months list

Project : The "Microkernel" Operating System

Journal Entry Date : 2025.10.26

Today I added Pair class to the kernel. It's basically identical to the std::pair in the STL library. I also added the rudimentary implementation of the debug system that I was talking about previously :

class DebugMessageContainer {
public:
    DebugMessageContainer();
    bool add_debug_log(const debug_message_t &msg);
    
    LinkedList<debug_message_t*>debug_list_log_lvl[DEBUG_MAX_LOG_LEVEL+1];
    LinkedList<debug_message_t*>full_debug_list;
};

The implementation of the functions are so simple that it's not really important enough to put it here!

Anyways, while I was doing that, I had an idea of incorporating the ASan(Address Sanitizer) to my kernel. Basically, ASan is a tool made by Google that detects memory errors in C/C++. (Check out their github for more info.) Fortunately, they have something called KASan(Kernel Address Sanitizer) that's specifically designed to catch memory errors in kernel! I found this article that describes how to incorporate KASan into your kernel. It's a bit complicated, but if I scrutinize bunch of documents on ASan, I think it's not completely impossible to do so!

What I think I have to do is to first figure out how exactly this works, and implement bunch of functions required to run KASan on my kernel. The article references part of the Linux Kernel source related to KASan that has bunch of declaration to the kasan-related functions! It's seems... alot (really alot.) I hope that it's not impossible to do this... if I succeed, I might wanna have the portion of my KASan implementation as a separate open source project(well, if there's any that I provide to people as open-source..)