//---------------------------------------------------------------- // amod.s // // This is a minimal Linux kernel module written in assembly // language for the GCC compiler's built-in assembler: 'as'. // It does nothing but display messages (using 'printk'). // // assemble using: user$ as -o amod.o amod.s // install using: root# /sbin/insmod amod.o // remove using: root# /sbin/rmmod amod // // NOTE: Developed and tested using kernel version 2.4.20. // // programmer: ALLAN CRUSE // written on: 05 APR 2003 //---------------------------------------------------------------- .section .text init_module: push $str1 call printk pop %eax xor %eax, %eax ret cleanup_module: push $str2 call printk pop %eax ret .section .rodata str1: .string "Installing assembly module\n" str2: .string "Removing assembly module\n" .section .modinfo kernel_version: .string "2.4.20" __module_license: .string "license=GPL"