duxing2007 / ldd3-examples-3.x Goto Github PK
View Code? Open in Web Editor NEWport ldd3 source code examples after linux 3.x
License: Other
port ldd3 source code examples after linux 3.x
License: Other
Awesome work on this port effort. Current repository name does not fully represent the code base since there are branches for kernel versions 4.x. This is a useful project and would be a shame if people missed it because of the 3.x in the name.
Build fails under ArchLinux with 4.19.8-arch1-1-ARCH. After adding code #include<linux/sched/signal.h>
it's ok.
cpchung:sbull$ make
make -C /lib/modules/4.4.0-51-generic/build M=/home/cpchung/code/ldd3-examples-3.x/sbull modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-51-generic'
CC [M] /home/cpchung/code/ldd3-examples-3.x/sbull/sbull.o
/home/cpchung/code/ldd3-examples-3.x/sbull/sbull.c: In function ‘sbull_make_request’:
/home/cpchung/code/ldd3-examples-3.x/sbull/sbull.c:210:2: error: too many arguments to function ‘bio_endio’
bio_endio(bio, status);
^
In file included from include/linux/blkdev.h:18:0,
from /home/cpchung/code/ldd3-examples-3.x/sbull/sbull.c:21:
include/linux/bio.h:465:13: note: declared here
extern void bio_endio(struct bio );
^
/home/cpchung/code/ldd3-examples-3.x/sbull/sbull.c: In function ‘setup_device’:
/home/cpchung/code/ldd3-examples-3.x/sbull/sbull.c:368:38: warning: passing argument 2 of ‘blk_queue_make_request’ from incompatible pointer type [-Wincompatible-pointer-types]
blk_queue_make_request(dev->queue, sbull_make_request);
^
In file included from /home/cpchung/code/ldd3-examples-3.x/sbull/sbull.c:21:0:
include/linux/blkdev.h:963:13: note: expected ‘blk_qc_t ()(struct request_queue *, struct bio ) {aka unsigned int ()(struct request_queue *, struct bio )}’ but argument is of type ‘void ()(struct request_queue *, struct bio *)’
extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
^
scripts/Makefile.build:264: recipe for target '/home/cpchung/code/ldd3-examples-3.x/sbull/sbull.o' failed
make[2]: *** [/home/cpchung/code/ldd3-examples-3.x/sbull/sbull.o] Error 1
Makefile:1418: recipe for target 'module/home/cpchung/code/ldd3-examples-3.x/sbull' failed
make[1]: *** [module/home/cpchung/code/ldd3-examples-3.x/sbull] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-51-generic'
Makefile:26: recipe for target 'default' failed
make: *** [default] Error 2
I want to play with the code for Chapter 3. The scr layout file mentions that chapter 3 scull.c is in the root. There aren't any files in the root, but some of the others are in the misc directories, but not scull.c. It also seems to be missing from the original tarball from o'reilly and other GitHub versions.
Am I missing something obvious?
Thanks, Paul
First, thank you for your excellent work.
I believe you would be better off having a branches named linux-3.18.y
rather than origin/linux-3.18.y
. The issue arises from pushing with the following (from Documentation/git-misc.md
):
git push origin origin/linux-3.18.y:origin/linux-3.18.y
Instead just do:
git push origin linux-3.18.y:linux-3.18.y
make: *** /lib/modules/3.10.0-327.36.3.el7.x86_64/build: No such file or directory. Stop.
[root@localhost ldd3-examples-3.x-origin-linux-3.10.y]# uname -r
3.10.0-327.36.3.el7.x86_64
cpchung:scullc$ sudo ./scullc_load
insmod: ERROR: could not insert module ./scullc.ko: Invalid module format
cpchung:scullc$ git branch
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.