user@lldcoder:~$ cat welcome.txt

Low level code, explained

Practical write-ups on Linux, system programming, device drivers and Python. Real code, real kernels, no hand-waving.

Featured · Device drivers · 14 min read

Write your first Linux character driver from scratch

Build a loadable kernel module, register a character device, and talk to it from user space with open, read and write.

Read the article
/* hello_chardev.c */
static int __init hello_init(void)
{
    major = register_chrdev(0, "hello",
                            &fops);
    pr_info("hello: major %d
", major);
    return 0;
}
module_init(hello_init);

Latest posts

View all posts

About

I’m the person behind LLD Coder. I write about the layers of Linux most tutorials skip: system calls, kernel modules and the code that talks to hardware.

Every post comes with code you can build and run yourself.

Get in touch

Get new posts by email

One email when a new article is published. No spam.

You can unsubscribe at any time.