//---------------------------------------------------------------- // redcolor.c // // This is the source-code for an installable Linux Kernel // Module (LKM), written with inline assembly language; it uses // Intel's 'rep stosw' instruction to fill the (text-mode) // display with red-colored blank-space characters, as was // demonstrated in class. Use our 'mmake.cpp' to compile. // // compile with: $ ./mmake // install with: $ /sbin/insmod redcolor.ko // remove using: $ /sbin/rmmod redcolor // // NOTE: Written and tested on Linux kernel version 2.6.10 // // programmer: ALLAN CRUSE // written on: 10 MAR 2005 //---------------------------------------------------------------- #include int init_module( void ) { asm(" cld "); // forward processing used asm(" movl $0xC00B8000, %edi "); // vram address (for text) asm(" movw $0x4020, %ax "); // character and attribute asm(" movl $0x4000, %ecx "); // size of vram (in words) asm(" rep stosw "); // fill the text-mode vram return 0; // return-code for SUCCESS } void cleanup_module( void ) {} MODULE_LICENSE("GPL");