Page 1 of 1

How should I write a kernel module?

Posted: Thu May 17, 2018 6:48 am
by itsmevjnk
Hi,
I am developing a kernel with initrd support and I need to write kernel modules that control storage devices. What format should I use for the modules? How should I load them?

Re: How should I write a kernel module?

Posted: Thu May 17, 2018 7:26 am
by FusT
Basically, it's all up to you.
It's your OS so you get to decide on what format to use. The choice of format (ELF/PE/roll-your-own/....) impacts how you should load them.

See https://wiki.osdev.org/Modular_Kernel, especially the "Forum Threads" section to get an idea on how to implement such a system.