Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel version #1

Open
minshallj opened this issue Oct 31, 2014 · 3 comments
Open

kernel version #1

minshallj opened this issue Oct 31, 2014 · 3 comments

Comments

@minshallj
Copy link

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.

@chakpongchung
Copy link

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;

@pkumarg
Copy link

pkumarg commented Sep 11, 2017

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

@Freed-Wu
Copy link

Freed-Wu commented Oct 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants