Kernel Modules and Is Writing a Kernel Module Available for Usage on the BBB/Kernel Stuff

Hey There, Seth here. Um, is writing a kernel module available to be used once it is instantiated and if so, if the kernel module is instantiated, can the module be used to control specific peripherals on the BBB?

For instance and I am making a shot in the dark here…

  1. Write kernel module
  2. Install kernel module after compilation
  3. Use so said module

Does that sound correct?

Seth

P.S. I have this book and the specifics are not so much of a heading but a vague passthrough. I am trying to find out exactly what it would take to get a kernel module registered on the BBB for use later after a boot.

Oh and would it matter if I used 5.10.x and have you noticed the dynamic kernel module loading being different from, say kernel 5.10.x to 6.11.x, separate kernels?

Seth

P.S. I am wrapping my head around this articulation slowly to promote findings better.

Update on module building here…

Loud is the fashion! Seriously…I am getting closer to a remote. Yea boy!

    if(gpio_request(GPIO_OUT, "gpio_dev"))
    {
        printk(KERN_INFO "gpio_dev: %s unable to get GPIO_OUT\n", __func__);
        ret = -EBUSY;
        goto Done;
    }

In that code snippet, would you say that __func__ is relative or needs to be placed in this context?

yup, those are the basics

is this a user or kernel space function?

1 Like

Here is a good video on building kernel modules… https://www.youtube.com/watch?v=kptfcbRfFvU

Regards,

2 Likes

@amf99 . Kernel.

It is of an older model kernel function. Not current by any means.

at 14 minutes, the sound dies out.

I guess there were technical issues.

Seth

P.S. After about so many minutes, the sound arrived again. I am watching it again…thank you.

insmod: ERROR: could not insert module gpio.ko: Operation not permitted

I know the GPIO pins associated with the BY-AI are already allocated to the headers from the chip to the peripherals and so on…

I am trying to write a GPIO kernel module for future reference now: I cannot use insmod, as I am not permitted for some reason…

So, what do you think I can do about writing kernel modules that work on the BY-AI? I mean…is there a small science dedicated to it all or something?

My kernel module builds. This is nice but I cannot supply the correct data to the BY-AI for it to allow me to use insmod right now.

Seth

Update

I got it! This has been concluded…