Hello Friends,
Maybe this may not be interesting for some - but for kernel newbies who have got a little comfortable writing code and want kernel modules along with the advantages without going into the complexity of building kernel module-loader (ELF dynamic-linker) may want to pay attention here!
Well, my kernel - the Silcos Kernel (@GitHub https://github.com/SukantPal/Silcos-Kernel) uses a initialization module - in the `/Initialization` directory. You don't need any type of configuration - other than using the grub.cfg file and listing your kernel, first - along with other secondary kernel modules after that. It will call the entry-pointer while linking.
Note that, it supports only IA32 architecture and relocates the kernel-modules to 0xC0000000 (3-GB). You'll need to enable paging carefully (for an example implementation of an kernel ontop of this initializer see the `/KernelHost` folder and go to `/Arch/IA32/Boot/Entry.S and Main.cpp`), and you won't be able to access global objects before doing so.
Other than that - this Initor module will pass on all information on the stack including - where the environment was loaded in physical memory, total size of segments, symbols, and all environment data, a global symbol table, string tables, the multiboot table, and even it will allocate page-frame entries for you physical memory allocator (well that can be disable if you declare a `sizeof_mmframe` macro with the value zero). In addition, at the end of the kernel environment, an AUTO_DAT buffer is provided of 32-KB size for storing page-tables and a stack - so you won't need any global objects before paging is enabled.
This kernel supports C++ although the KernelHost calls the constructors later on. See the Initor wiki - https://github.com/SukantPal/Silcos-Kernel/wiki/Initor for more information! Please give feedback on this!
Silcos Initializer - usable on other kernel
-
- Posts: 23
- Joined: Tue Dec 12, 2017 6:51 am
- Libera.chat IRC: XtremeCoder