-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add LKM in Ariane using ariane-sdk #43
Comments
a) Correct. You probably will need to enable loadable kernel module support in the kernel first (with a KConfig flag before kernel compilation) before you are able to load your kernel module. |
Thank you for your useful comments @Moschn! And for your help overall with our issues in this git, we really appreciate it. I think I found a useful article to help me understand the KConfig flags concept: https://www.linuxjournal.com/content/kbuild-linux-kernel-build-system I'll come back with any questions I might have. It is my first time going through this procedure. |
Hi, regarding enabling "loadable module support" I can see that there is an option in a Kconfig file in the following location
I think this is the option that when enabled will load the modprobe programs (insmod, rmmod, etc.). Am I right on this? Does anyone know what change should I make in this file to enable it? Also if I
By that I suppose that even if I do any change inside the Kconfig file, it will be discarded by the Buildroot. How can I do the necessary change then? Thank you in advance for your responses and time. Kind regards, |
I think I am making some progress with this. I can see in the
As stated at the end of the provided code above, if I execute in the same folder the command
For the above, I need to respond with a Y/N to parametrize the kernel. I went over a lot of them and I suppose that at some point it will prompt me to enable/disable the support for loadable modules, but since I am no expert at this, it is risky to do it manually. Then I found that in the Which file do I need to alter in order to set the Thank you for your help on this. Kind regards, |
I think I solved it and I was able to load the modprobe tool inside the Linux kernel to enable the loadable module support.
I must say that the file is a bit misleading because there is a comment on top that mentions that the file is autogenerated and not for editing, although it is used as is inside the Makefile.
I would really appreciate it if someone could confirm that this is how we enable loadable module support, so I can close this issue. Thank you in advance for your responses. Kind regards, |
Seems correct to me |
Update floating-point cluster's reset interface.
(Solved below) I am trying to load a kernel module. I have enabled the Module Utilities flags on what is now cva6-sdk/configs/busybox64.config as done in this issue, and now lsmod, rmmod and modprobe are recognized as commands, and I am able to insmod a module. But I cannot rmmod said module, or use modprobe -r. Here is what I tried:
I believe this has something to do with the CONFIG_MODULE_UNLOAD parameter. In ./buildroot/dl/linux/git/.config,
Yet in /buildroot/output/build/linux-v5.10.7/.config it is not
I suppose the latter is the one that is actually implemented. Here is my driver code and Makefile:My driver code is the following from here
My makefile is as follows adapted from here:
|
As it often happens, all it takes to solve something is to post an issue... I added the following to cva6-sdk/configs/linux64_defconfig:
And after re-building the image, this is ./buildroot/output/build/linux-v5.10.7/.config:
After building the module again (new kernel), it works (save for the dual-printing, which is a separate issue):
|
Hi,
I am trying to add a Linux Kernel Module inside the Linux image generated using the ariane-sdk of Ariane and I would like to know if the following steps are correct. After searching the topics opened about similar issues here in git, I found the following:
a) To add an LKM I need to either compile it directly in the Linux kernel or build a loadable kernel module and load it from the SD card on the
rootfs
. In the 2nd case, I need also to activate the support for loadable kernel modules #270.b) In order to add the LKM, I will have to compile it with the riscv64-unknown-linux-gnu-gcc compiler and get the corresponding binary file (.elf). I will then need to copy this file in the ./rootfs directory of the ./ariane-sdk folder and build the new image (#25). In this way, I will be able to see the binary file inside Ariane's
rootfs
and run it. Am I correct on this? Is this considered the first case of compiling the LKM directly on the Linux kernel?c) The LKM I am planning to add is pretty simple, basically it is this one. I want to use printk() and just print from inside the kernel. But I saw in #39, that printing from kernel is not possible. Is this really the case?
Thank you in advance for your help on this. Any advice will be greatly appreciated.
Kind regards,
Nassos
The text was updated successfully, but these errors were encountered: