How should I write a kernel module?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
itsmevjnk
Member
Member
Posts: 32
Joined: Fri Apr 13, 2018 10:18 am
Location: Melbourne, VIC, Australia

How should I write a kernel module?

Post 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?
Just a procrastinating uni student doing stupid things (or not doing them at all)...

SysX: https://github.com/itsmevjnk/sysx.git
FusT
Member
Member
Posts: 91
Joined: Wed Sep 19, 2012 3:43 am
Location: The Netherlands

Re: How should I write a kernel module?

Post 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.
Post Reply