Where in kernel source "module load procedure"?

Hello.
I want try to do "signs" for kernel modules (task in university :stud ). It will be very simple. For example we have file with list of kernel modules and it`s signs:
Code:
module_name_1 0
module_name_2 1
module_name_3 0
...
So, if "sign" = 1, then accept module load, if "sign" = 0 - reject, if no module in list - reject too.

So, the question is where in kernel source i can insert such thing?
P.S. Sorry for bad English :)
 
See sys/kern/kern_linker.c (search for kldload(), this is the syscall handler), possibly also in sys/kern/kern_module.c.
 
thanks

thank you, this is what i was looking for.
procedure is "kern_kldload".
I added printf("%s", file) and it worked good.
Now i want to print kernel name in file. I tried to add
Code:
FILE *out_file;
fopen(.....
And there is no such functions, how can add needed for me libraries(headers) to /usr/src/sys/kern/kern_linker.c. For example, library with file manipulation.
Thanks for help!
 
So, how can read file content (for example /boot/signs.txt) from /usr/src/sys/kern/kern_linker.c?
 
Maybe you could load the contents into the kernel from the userland, via sysctl or device file? Opening files from inside the kernel is generally discouraged.
 
Back
Top