www.flickr.com
tres frijoles' photos More of tres frijoles' photos
You are here: tearsoffire.org > Projects Web > LinuxProjects > LinuxModules r4 - 22 Jun 2007 - 19:38 - ChristopherPepe


Start of topic | Skip to actions

LinuxModules

First Module

I just inserted my first kernel module. being the hello world of modules its utterly useless except for making me feel good. i'm reading O'Reillys Linux Device Drivers 3 which they have gratiously provided for free (that also makes me feel good).

#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
    printk(KERN_ALERT "Hello, world\n");
    return 0;
}
static void hello_exit(void)
{
    printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);

while i'm getting the basics under my belt i probably won't post much here. please stay tuned...

real drivers

-- ChristopherPepe - 21 Sep 2006

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding tearsoffire.org? Send feedback