We will assume that you decide that you do not wish to write a user-space device, and would rather implement your device in the kernel. You will probably be writing writing two files, a .c file and a .h file, and possibly modifying other files as well, as will be described below. We will refer to your files as foo.c and foo.h, and your driver will be the foo driver.
[Should I include at the beginning of this section an example of chargen and charsink? Many writers do, but I don't know that it is the best way. I'd like people's opinions on this.]