ldd4 icon indicating copy to clipboard operation
ldd4 copied to clipboard

kernel version

Open minshallj opened this issue 10 years ago • 3 comments

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.

minshallj avatar Oct 31 '14 03:10 minshallj

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;

chakpongchung avatar Dec 05 '16 16:12 chakpongchung

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

pkumarg avatar Sep 11 '17 13:09 pkumarg

I found a transplant for linux 5.10 https://github.com/d0u9/Linux-Device-Driver. Maybe helpful.

Freed-Wu avatar Oct 02 '23 10:10 Freed-Wu