Okay... I was doing everything but the last step. I did the naive thing and just added the name to the end of modules.dep. Didn't seem to do anything for me - "simple" still doesn't seem to load on boot. However, with this latest version, I can load it with "insmod", and load and unload it with "modprobe" (as shown by "lsmod"). Good progress!
No output. Why should it? You haven't told the kernel where to find init_module or cleanup_module, have you? Here's the relevant portion of Agner's disassembly of Peter's "cpuid.ko":
SECTION .gnu.linkonce.this_module align=128 noexecute ; section number 9, data
__this_module: ; byte
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0000 _ ........
db 00H, 00H, 00H, 00H, 63H, 70H, 75H, 69H ; 0008 _ ....cpui
db 64H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0010 _ d.......
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0018 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0020 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0028 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0030 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0038 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0040 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0048 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0050 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0058 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0060 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0068 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0070 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0078 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0080 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0088 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0090 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0098 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 00A0 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 00A8 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 00B0 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 00B8 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 00C0 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 00C8 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 00D0 _ ........
db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 00D8 _ ........
db 00H, 00H, 00H, 00H ; 00E0 _ ....
dd init_module ; 00E4 _ 00000000 (d)
dd 00000000H, 00000000H ; 00E8 _ 0 0
dd 00000000H, 00000000H ; 00F0 _ 0 0
dd 00000000H, 00000000H ; 00F8 _ 0 0
dd 00000000H, 00000000H ; 0100 _ 0 0
dd 00000000H, 00000000H ; 0108 _ 0 0
dd 00000000H, 00000000H ; 0110 _ 0 0
dd 00000000H, 00000000H ; 0118 _ 0 0
dd 00000000H, 00000000H ; 0120 _ 0 0
dd 00000000H, 00000000H ; 0128 _ 0 0
dd 00000000H, 00000000H ; 0130 _ 0 0
dd 00000000H, 00000000H ; 0138 _ 0 0
dd 00000000H, 00000000H ; 0140 _ 0 0
dd 00000000H, 00000000H ; 0148 _ 0 0
dd 00000000H, 00000000H ; 0150 _ 0 0
dd 00000000H, 00000000H ; 0158 _ 0 0
dd 00000000H, 00000000H ; 0160 _ 0 0
dd 00000000H, 00000000H ; 0168 _ 0 0
dd 00000000H, 00000000H ; 0170 _ 0 0
dd 00000000H, 00000000H ; 0178 _ 0 0
dd 00000000H, 00000000H ; 0180 _ 0 0
dd 00000000H, 00000000H ; 0188 _ 0 0
dd 00000000H, 00000000H ; 0190 _ 0 0
dd 00000000H, 00000000H ; 0198 _ 0 0
dd 00000000H, 00000000H ; 01A0 _ 0 0
dd 00000000H, 00000000H ; 01A8 _ 0 0
dd 00000000H, 00000000H ; 01B0 _ 0 0
dd 00000000H, 00000000H ; 01B8 _ 0 0
dd 00000000H, 00000000H ; 01C0 _ 0 0
dd 00000000H, 00000000H ; 01C8 _ 0 0
dd 00000000H, 00000000H ; 01D0 _ 0 0
dd 00000000H, 00000000H ; 01D8 _ 0 0
dd 00000000H, 00000000H ; 01E0 _ 0 0
dd 00000000H, 00000000H ; 01E8 _ 0 0
dd 00000000H, 00000000H ; 01F0 _ 0 0
dd 00000000H, 00000000H ; 01F8 _ 0 0
dd 00000000H, 00000000H ; 0200 _ 0 0
dd 00000000H ; 0208 _ 0
dd cleanup_module ; 020C _ 00000000 (d)
dd 00000000H, 00000000H ; 0210 _ 0 0
dd 00000000H, 00000000H ; 0218 _ 0 0
dd 00000000H, 00000000H ; 0220 _ 0 0
dd 00000000H, 00000000H ; 0228 _ 0 0
dd 00000000H, 00000000H ; 0230 _ 0 0
dd 00000000H, 00000000H ; 0238 _ 0 0
dd 00000000H, 00000000H ; 0240 _ 0 0
dd 00000000H, 00000000H ; 0248 _ 0 0
dd 00000000H, 00000000H ; 0250 _ 0 0
dd 00000000H, 00000000H ; 0258 _ 0 0
dd 00000000H, 00000000H ; 0260 _ 0 0
dd 00000000H, 00000000H ; 0268 _ 0 0
dd 00000000H, 00000000H ; 0270 _ 0 0
dd 00000000H, 00000000H ; 0278 _ 0 0
As you can see, there's more in that section than just the name (and zeros). I tried to do similar with your code. First thing that happens is Nasm whines about undefined symbols. I'm quite sure that your "global init_module:" is not enough. I think you need:
global init_module
init_module:
for it to work. I tried that - still no output. I ASSume that int 80h writes to stdout work from within the kernel... but everybody seems to use "kprintf". Peter's cpuid.ko also declares "global __this_module". I didn't try that. Perhaps it would help?
I suppose the "hello" example - written in C - produces output? Where would I find that?
More later, if I get to it.
Best,
Frank