Build Kernel Module

Discussion of developmental aspects of the MiSTer Project.
User avatar
sonik
Posts: 91
Joined: Sun May 09, 2021 3:31 pm
Location: Brazil
Has thanked: 15 times
Been thanked: 17 times

Build Kernel Module

Unread post by sonik »

I want to build and test a simple kernel module on Mister.
It's possible to ssh into mister and compile the module there or must cross compile?
There's any guidance?
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: Build Kernel Module

Unread post by RealLarry »

You have to cross compile. Guidance is here https://github.com/MiSTer-devel/Main_Mi ... for-MiSTer
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
sonik
Posts: 91
Joined: Sun May 09, 2021 3:31 pm
Location: Brazil
Has thanked: 15 times
Been thanked: 17 times

Re: Build Kernel Module

Unread post by sonik »

Need to build and deploy entire kernel?
Or it's possible to just build a module, copy and load with depmod?
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: Build Kernel Module

Unread post by RealLarry »

sonik wrote: Thu May 27, 2021 5:58 pmNeed to build and deploy entire kernel?
Yes.
Or it's possible to just build a module, copy and load with depmod?
No. MiSTer isn't using any module as it is driven by a monolithic kernel.
RTFM. But if you couldn't get it to work, talk to me about it again and I may bake one for you.
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
christian776
Posts: 11
Joined: Wed Jun 22, 2022 2:33 pm

Re: Build Kernel Module

Unread post by christian776 »

Hi !
I'm very new to Mister and Kernel development, so I thought I could ask here to make sure I'm following the right steps. I'd like to compile support for a TP Link Bluetooth adapter model UB500 that is being detected by Mister by it doesn't seem to work when scanning for devices. Some people seem to have patched `btusb.c` for Linux in Ubuntu like in here https://askubuntu.com/questions/1370663 ... untu-21-10, so I was wondering if this could also apply for Mister. Thanks!
riperme
Posts: 1
Joined: Mon Jun 27, 2022 8:55 am

Re: Build Kernel Module

Unread post by riperme »

christian776 wrote: Wed Jun 22, 2022 2:40 pm Hi !
I'm very new to Mister and Kernel development, so I thought I could ask here to make sure I'm following the right steps. I'd like to compile support for a TP Link Bluetooth adapter model UB500 that is being detected by Mister by it doesn't seem to work when scanning for devices. Some people seem to have patched `btusb.c` for Linux in Ubuntu like in here https://askubuntu.com/questions/1370663 ... untu-21-10, so I was wondering if this could also apply for Mister. Thanks!
Hi,

I also have this adapter (TP Link UB500) and although it seems to work (the logo appears in the Mister menu) but it does not find any device.
I've read the tutorial about how to compile the Mister kernel to know what to do to make it works.

And that's right, the UB500 works.

The only thing that I worry is the "weight" of the zImage_dtb. The size of the original kernel is about 7.5MB and my compilation is about 6.8MB.
I entered this forum to see if there was a document or something that says the basic configuration of the kernel, and the base to this configuration add the UB500. It may be that with the configuration that I have made, I have left something basic for the correct functioning of the Mister. But the truth is, I've been using it for 1 month and I don't notice anything.

If you want to try it I can send it you by email.

Bye.
christian776
Posts: 11
Joined: Wed Jun 22, 2022 2:33 pm

Re: Build Kernel Module

Unread post by christian776 »

That's great news ! I'm actually interested on what guides/steps did you follow to get the kernel compiled with support for UB500. Thanks!
thiagoauler
Posts: 10
Joined: Sat Aug 27, 2022 11:03 pm
Been thanked: 1 time

Re: Build Kernel Module

Unread post by thiagoauler »

Hi,
I have the same BT dongle (UB500, icon shows but doesn't pair) and a wifi dongle that already works.
As stated in the latest commit, the BT dongle should work after recompiling the kernel manually (https://github.com/MiSTer-devel/Linux-K ... 3cac71a392).

I followed the steps in the wiki page (https://github.com/MiSTer-devel/Main_Mi ... for-MiSTer). The new kernel I compiled boots OK, but doesn't work wifi anymore, and the BT icon doesn't appear either.

In the guide there is an optional step to modify ".cofig" file... I haven't changed anything here. Is it necessary to edit it? Is there something else I'm missing?
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 243 times

Re: Build Kernel Module

Unread post by wizzo »

You can give my one a shot:

https://github.com/wizzomafizzo/mrext/b ... zImage_dtb

I use the same dongle with a patch I found and compiled all the bt and wifi stuff into the kernel instead of using modules. No issues. I expect this'll be fixed eventually because the latest commit for this on the official kernel is pretty much identical to the one I applied.
thiagoauler
Posts: 10
Joined: Sat Aug 27, 2022 11:03 pm
Been thanked: 1 time

Re: Build Kernel Module

Unread post by thiagoauler »

Wizzo,
Thank you SO MUCH!
Worked Great!!
Post Reply