From branching out the kernel to the "microkernel-kasan," I haven't done that much of significant things, mainly because I'm still working on how to plan out the kernel's memory layout.
I searched up how Linux's virtual memory layout is, and, turns out, Linux just directly maps(= identity paging) all the available physical memory into upper parts of the kernel. I think Linux chose this model to clearly separate out user memory area and kernel memory area. There's some question I had about this memory map. How exactly does Linux manage physical memory? Does it have some physical page allocator that allocates a page, and sets a page table to do some magics and stuff? I honestly don't know...
I'll write couple of things I learned from all these memories and stuff...
This has been a myth for me, for a long time. NUMA is sort of a "design" that's used in multiprocessing. Apparently, for these kinds of systems(multiprocessor computers), you have something called "local memory" for each processors, a memory that's more faster to access from one processor. Basically, "memory accesstime depends on the memory location relative to the processor."(according to this article in Wikipedia) So, the basis of NUMA is that it's faster for one CPU to access its "local" memory than to access other memory region that's local to another CPUs. Linux accounts for this difference of memory access performance by dividing the memory into multiple nodes, and does some magic to make the memory access faster with some fancy algorithm. I don't want to go into that rabbit hole, but later in the development, I might want to check it out. (Just to see the glimpse of how Linux managed to implement it.. hehe)
I realized Linux kernel directly map all the physical memory into a virtual memory space. But this doesn't quite answer some qustions I have.. For instance, how exactly does kernel make a space for the page table? And, most importantly, how does kernel manage the physical memory, when they're not contiguous and separated into bunch of chunks?
One thing I also learned is that kernel has two stages in setting up the higher half kernel: stage 1 sets up the page tables, and jumps into the stage 2 where the kernel operates on the higher-half address space. (It should also be noted that we need to have linker script that expects the kernel's relocation of address.) I think my kernel also needs to be separated into two stages, just like Linux.