Slashdot Mirror


Become a Linux Kernel Hacker and Write Your Own Module

M-Saunders (706738) writes "It might sound daunting, but kernel hacking isn't a mysterious black art reserved for the geekiest of programmers. With a bit of background knowledge, anyone with a grounding in C can implement a new kernel module and understand how the kernel works internally. Linux Voice explains how to write a module that creates a new device node, /dev/reverse, that reverses a string when it's written to it. Sure, it's not the most practical example in the world, but it's a good starting point for your own projects, and gives you an insight into how it all fits together."

1 of 143 comments (clear)

  1. Re:First Tutorial I've seen with Goto... by frank_adrian314159 · · Score: 3, Informative

    Just like any other construct - when it makes the code more clean, clear, correct, and/or optimized. These are tradeoffs.

    For instance, let's say you have a function having a deeply nested conditional:

    if (!a) {
        if (!b) {
            if (!c) {
    ...

    } } }

    This code might be more simply understood as:

    if (a) goto done;
    if (b) goto done;
    if (c) goto done;
    ...
    done:
    ...

    --
    That is all.