ebitengine / purego

Apache License 2.0
1.95k stars 63 forks source link

Can I now build kernel modules in Go? #188

Closed shehackedyou closed 6 months ago

shehackedyou commented 6 months ago

I have been trying to figure out a way to build kernel modules in Go and have been hitting a wall over and over. With Libc do you think i can call in linux headers to make the module? Or would more things have to be created first for that to work.

It would make a fantastic example case for teaching people to use the project and how powerful it is if it is possible like I think it is.

TotallyGamerJet commented 6 months ago

I do not know much about how Linux kernel modules work. However, this project is solely focused on calling system shared object files in userspace.

You may find some of my other repos helpful. They customize the building process of go to run it in obscure environments. Such as the Limine one.

shehackedyou commented 6 months ago

So this is just to access system calls previously only available going through libc?

I really appreciate your answer, it filled in a lot of details for me. Because I want to understand this better it seems like a useful tool.

TotallyGamerJet commented 6 months ago

It can call any C function so you could use it for creating guis or games. Which is what it is used for in Ebitengine.

shehackedyou commented 6 months ago

Realized it would also make hacking games like counter-strike in purego now should be a lot easier. Kernel modules are a special kind of SO, soo Ill get familiar with the code.