~bryanb/eudyptula

468898c47e4495017e1a94f5b70df76abd8ef931 — Bryan Brattlof 3 years ago 18c4b96
task 6: add task readme
2 files changed, 41 insertions(+), 1 deletions(-)

M readme.rst
A tasks/06/readme
M readme.rst => readme.rst +4 -1
@@ 21,4 21,7 @@ Here are the links to each task's readme:

4. The Coding Style Rules: `task <https://git.bryanbrattlof.com/eudyptula-challenge/tree/tasks/04/readme>`__

5. Using Hotplug Tools: `task <https://git.bryanbrattlof.com/eudyptula-challenge/tree/tasks/05/readme>`__
5. Module Loading Macros: `task <https://git.bryanbrattlof.com/eudyptula-challenge/tree/tasks/05/readme>`__

6. Miscellaneous Character Drivers: `task <https://git.bryanbrattlof.com/eudyptula-challenge/tree/tasks/06/readme>`__
   

A tasks/06/readme => tasks/06/readme +37 -0
@@ 0,0 1,37 @@
Task 06
=======

Nice job with the module loading macros, those are tricky, but a very
valuable skill to know about, especially when running across them in
real kernel code.

Speaking of real kernel code, let's write some!

The task this time is this:

  - Take the kernel module you wrote for task 01, and modify it to be a
    misc char device driver.  The misc interface is a very simple way to
    be able to create a character device, without having to worry about
    all of the sysfs and character device registration mess.  And what a
    mess it is, so stick to the simple interfaces wherever possible.

  - The misc device should be created with a dynamic minor number, no
    need running off and trying to reserve a real minor number for your
    test module, that would be crazy.

  - The misc device should implement the read and write functions.

  - The misc device node should show up in /dev/eudyptula.

  - When the character device node is read from, your assigned id is
    returned to the caller.

  - When the character device node is written to, the data sent to the
    kernel needs to be checked.  If it matches your assigned id, then
    return a correct write return value.  If the value does not match
    your assigned id, return the "invalid value" error value.

  - The misc device should be registered when your module is loaded, and
    unregistered when it is unloaded.

  - Provide some "proof" this all works properly.