linux/bounds.h not found while compiling source of my driver - linux-kernel

I am developing drivers for my embedded device that has linux kernel version 2.6.32. In driver code, I am including linux/modules.h but on compiling, It gives me error linux/bounds.h not found.
I have downloaded kernel source from linux git repository. I have checked path settings. They are ok.
I checked my kernel source, there is no bounds.h file. So why my driver is expecting that. Error is coming due to including modules.h.

First, I need to run make command, so that it can generate and link all necessary files.

Related

Redis Problem compiling ReJSON Module for Windows

I have been trying to find or perhaps compile ReJSON Module for my Windows machine. I could not find any pre-compiled version of ReJSON Module that's why I thought of compiling it myself. So, I visited their GitHub page for source proceeded with following steps
1) Downloaded and Extracted the Zip Folder from https://github.com/RedisJSON/RedisJSON
2) Installed Cygwin with necessary packages
3) located the source directory and executed Make command
I got the following error
error: unrecognized command line option ‘-mmacosx-version-min=10.6’
Which I thought there is some configuration for MacOS in MakeFile. So, I searched all words with -mmacosx-version-min=10.6 and commented those lines so it could be excluded from Make process. It worked and showed some good progress but at the end now it gives some other errors
unrecognised emulation mode: acosx_version_min
I thought that I am doing it in wrong way. May be this ReJSON Module is simply not possible for Windows but there is no documentation about its eligibility for Windows. I am nowise in module compiling. Please show me some guidance. I am in desperate need of this ReJSON Module for Windows.
I am maintaining Redis for Windows fork and when I was working on version 4.0.x I ported ReJSON module to Windows as well, mainly for testing purposes and verification of changes related to modules in Redis for Windows itself. You can find the code here:
ReJSON module for Windows
This fork of ReJSON module should be still working and you should be able to compile it in Visual Studio, perhaps with small adjustments. If you do any - please submit a PR.

Where is tftp efi shell command?

Cannot find tftp command in shell.efi app from Tianocore.
When type tftp, got 'tftp' is not recognized as an internal or external command, operable program, or batch file. Help also doesn't know about it.
I looked at sources and found it is implemented in DynamicCommand directory. Maybe command must be loaded or activated somehow before using?
Edit: well, the only way i found to get tftp client working on Tianocore shell is building ShellPkg from sources. There is DynamicCommand/TftpDynamicCommand subdirectory contains tftp application. It will produce tftp.efi on package building finished. "Manual" can be found here. Still dont understand how to make shell with built-in tftp command and why Tianocore maintainers do not include procompiled tftp.efi in ShellBinPkg for example.
How to Run OVMF article contain information on how to get pre-built OVMF images:
Pre-built images are available at https://www.kraxel.org/repos/
These images are automatically built and track the latest OVMF code in the EDK II tree.
Some of these builds include a seabios CSM and can boot non-UEFI “legacy” operating systems. Note: seabios is GPLv3 licensed)
If your OS doesn’t work with RPM repositories, then you can manually download and decompress the RPM files under jenkins/edk2
You can find the latest OVMF RPM packages at kraxel repository. They contain the latest firmware and UefiShell.iso to boot. You will find tftp command you need and other cool stuff there.

Undefined symbols with Linux kernel driver build (NVidia)

I am having issues with my kernel driver build. I'm and building a custom (albeit very basic) NVidia RDMA driver and am receiving build warnings during the make file. Specifically it is looking for two NVidia API calls nvidia_p2p_put_pages and nvidia_p2p_get_pages. Using 'nm' is see these entry points are in the NVidia driver module (nvidia.ko). However, I'm not familiar enough with the internals of the Linux driver make file system to locate those entry points at build time.
The RDMA tool kit documentation refers to an extraction script "./NVIDIA-Linux-x86_64-.run" and a build directory. However, I was unable to locate any build files after extracting the latest driver sources.
As you can tell, I'm rather new to this. Any help would be greatly appreciated.
Thanks
The basic GPUDirect RDMA documentation is here.
As indicated in section 4.3, building an nvidia driver linux kernel module requires various driver header files and makefiles.
These files can be accessed as follows:
get an appropriate NVIDIA linux driver installer (.run file) such as 319.72 here
All nvidia linux driver installers have command line switch options. Basic options can be found by appending --help to the driver installer command string, such as:
sh NVIDIA-Linux-x86_64-319.72.run --help
more advanced options can be accessed with:
sh NVIDIA-Linux-x86_64-319.72.run --advanced-options
one of the advanced options is -x which will only extract the driver files, it will not "install" any:
sh NVIDIA-Linux-x86_64-319.72.run -x
This will create a directory where the files are available. Within this directory, the kernel directory has the necessary header files and a sample kernel module makefile which can be used to learn appropriate libraries to link against:
cd NVIDIA-Linux-x86_64-319.72/kernel

Should I care that the symbol version dump is missing? How do I get one?

I am trying to compile a driver that we have from source and I am working through the issues with a new target environment. One of the slightly disturbing things I see is the following warning:
WARNING: Symbol version dump /usr/src/linux-2.6.38/Module.symvers
is missing; modules will have no dependencies and modversions.
I spent a fair amount of time looking on the web and this is shown in output frequently when other questions are asked, but I didn't see any commentary about whether or not this is an issue.
In any case, how would I tell linux/ubuntu to generate Module.symvers?
Module.symvers is generated when the kernel itself is compiled and ought to be provided to the user as part of the kernel build environment package, however that may look on Ubuntu (possibly broken there?) Fedora and openSUSE for example ship one or more “kernel-devel” (and/or similarly-named) packages that ship this build environment and make the file reachable through /lib/modules/<version>/build/Module.symvers. When using a self-compiled kernel, substitue /lib/modules/version/build for the appropriate path to the build directory (where all the .o files are).

Compiling gdb for remote debugging

I'm trying to remote debug an application running on arm9
So far I've been able to cross compile and execute gdbserver on my device.
get gdb (7.2) sources and extract them
./configure --target=arm-none-linux-gnueabi --with-expat=/usr/local/lib/
make
cd gdb/gdbserver
./configure --host=arm-none-linux-gnueabi
make
tftp gdbserver to my device
run and connect via gdb to the device
gdbserver "seems" to start correctly and attach itself to my helloworld application
When I try to gdb to the remote server, I get
"warning: Can not parse XML target description; XML support was disabled at compile time"
Obviously, the compilation didn't take into account expat. I'm really unsure about how to specify the expat library path to the configuration script.
(old question but I stumbled into it via googling the same problem)
The problem is the missing "expat" lib. This is hard to guess because :
this lib is optional for compiling gdb
the "expat" name has no clear connection to XML...
So install "expat-dev" (with your packet manager or anything) and then relaunch ./configure. Be careful to install the "dev" version since we are doing recompilation and need the include files.
To be extra-sure, it's possible to add the "--with-expat" to the ./configure call so that it will stop with an error if expat is not found.
Somehow it worked anyway
Also, create a file ~/.gdbinit with
file /home/username/path/to/exec/exec_name
set sysroot /path/to/libraries/running/on/target/device
target remote HOST:PORT
b main

Resources