ldd4
ldd4 copied to clipboard
kernel version
Which kernel are you building this against? When I try to build this on a kernel > 3.10 I get this error
/home/jacob/dev/ldd4/misc-modules/seq.c: In function ‘ct_init’:
/home/jacob/dev/ldd4/misc-modules/seq.c:97:2: error: implicit declaration of function ‘create_proc_entry’ [-Werror=implicit-function-declaration]
entry = create_proc_entry("sequence", 0, NULL);
^
/home/jacob/dev/ldd4/misc-modules/seq.c:97:8: warning: assignment makes pointer from integer without a cast
entry = create_proc_entry("sequence", 0, NULL);
^
/home/jacob/dev/ldd4/misc-modules/seq.c:99:8: error: dereferencing pointer to incomplete type
entry->proc_fops = &ct_file_ops;
This can be fixed by using proc_create
(see Documentation/filesystems/seq_file.txt
from the latest tree line 65 for reference or search for create_proc here https://www.kernel.org/doc/Documentation/filesystems/seq_file.txt)
After fixing that more errors pop up, so I'd like to know which kernel you intend to base the latest book off of so I might try to compile these myself.
I have the same questions on Linux cpchung 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
/home/cpchung/code/ldd4/misc-modules/seq.c: In function ‘ct_init’: /home/cpchung/code/ldd4/misc-modules/seq.c:97:10: error: implicit declaration of function ‘create_proc_entry’ [-Werror=implicit-function-declaration] entry = create_proc_entry("sequence", 0, NULL); ^ /home/cpchung/code/ldd4/misc-modules/seq.c:97:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion] entry = create_proc_entry("sequence", 0, NULL); ^ /home/cpchung/code/ldd4/misc-modules/seq.c:99:8: error: dereferencing pointer to incomplete type ‘struct proc_dir_entry’ entry->proc_fops = &ct_file_ops;
Just submitted the changes to fix this issue. Still working on one more issue in same code base related to proc file access.
One can follow in forked version: https://github.com/pkumarg/ldd4
I found a transplant for linux 5.10 https://github.com/d0u9/Linux-Device-Driver. Maybe helpful.