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

Compile fail Debian 11, kernel 5.10 #69

Open
edbird opened this issue Sep 28, 2021 · 4 comments
Open

Compile fail Debian 11, kernel 5.10 #69

edbird opened this issue Sep 28, 2021 · 4 comments

Comments

@edbird
Copy link

edbird commented Sep 28, 2021

I have just deployed a Debian 11 VM to start working through the LDD3 book.

I followed the instructions on the readme page of this project and encountered some build problems.

The first of these I believe is just a warning, I am not sure if this is harmless or not.

mapper.c:40:9: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]

The second of these is the following:

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

I have no idea what this means. Given the instructions on the readme page do not have any mention of this (as far as I can see?) I guess this is a more serious issue.

I'm new to kernel/device driver development, so I am by no means an expert when it comes to this.

@enderson-pan
Copy link

enderson-pan commented Oct 8, 2021

If you are using ubuntu 20.04 or 18.04,sudo apt install linux-headers-$(uname -r) && sudo reboot , and DO NOT execute the command export KERNELDIR=/path/to/linux,execute cd ldd3; make directly, the scripts in makefile will find the header of the ubuntu and finish the build.

@dwalkes
Copy link
Collaborator

dwalkes commented Nov 7, 2021

@edbird not sure if you've gotten past these yet, but for the first issue I suspect we are just missing #include <stdlib.h> in

#include <limits.h>
.

For the second question it looks like there's similar reponses in https://stackoverflow.com/questions/50361990/how-to-solve-kernel-configuration-is-invalid-issues regarding linux headers, curious if you've tried this.

@edbird
Copy link
Author

edbird commented Dec 5, 2021

Sorry for the delayed response.

Following the instructions above: DO NOT execute export KERNELDIR=... and running make inside ldd3 directly, everything seems to compile ok.

@edbird
Copy link
Author

edbird commented Dec 5, 2021

I can post this as a seperate question, or elsewhere if neccessary, however since a thread on building exists as an issue here it seemed to make sense to at least ask this question.

Chapter 2 contains a section on Compiling Modules. (In my book this starts on page 23.)

Given that the compile process for Debian differs from that of what is written in the book, can anyone give me any information about how section Compiling Moduels from Chapter 2 might differ as well?

In particular, the book talks about building a kernel from a standard kernel source, and states that this is required for building kernel modules from the book. However that doesn't appear to be the case on my system. I did not build a standard linux kernel. (At least as far as I recall.)

I did download a source for a kernel, but since I did not set KERNELDIR env. variable, the compile process for the example kernel modules from the book (this repository) cannot depend on the fact that I downloaded a kernel source.

Does the question make sense?

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

3 participants