Suresh
Suresh

Reputation: 121

Getiing Unknown symbol ***_******(err 0) while reading or writing from linux kernel module

I know that reading or writing(i/o) from kernel is a bad thing but under some circumstances I have to do that and while reading many sites I got the code from things you should never do in kernel so thought of trying it. While making module.while compiling it was giving me

WARNING: "sys_write" [/path/to/file/file.ko] undefined! WARNING:"sys_open" [/path/to/file/file.ko] undefined!

but I thought of inserting the module while inserting the module I was getting

insmod: ERROR: could not insert module file.ko: Unknown symbol in module

To get an answer for that I crawled through some sites(c-unkown symbol class create) but I had

MODULE_LICENSE("GPL");

in my module code and mean while searching I got the way to make available the unknown symbols while making the modules. which is from Documenats/kbuild/modules.txt.

Then I made

make KBUILD_EXTRA_SYMBOLS='/home/lunako/Documents/ker_write/Module.symvers'

still no result. What I should do now ? Thanks

Upvotes: 1

Views: 2082

Answers (1)

stdcall
stdcall

Reputation: 28920

I would discourage you to continue what you're doing, but if you insist, you need to export the sys_open function so it could be used by modules. search for EXPORT_SYMBOL macro

BTW, you need to recompile the kernel to make this symbol available for kernel modules.

Upvotes: 2

Related Questions