Adding an executable binary to kernel image

519 views Asked by At

I have a driver (not dealing with any file operations but just a .c file) which reads all clock configuration registers and calculates the clocks present on the board and it will print them on the console.

My question is can we add this .c file and build some .bin binary so that if we execute it from the console it should print the clocks.

1

There are 1 answers

2
Vikram N On

Your question and explanation are contradictory. If you want driver to be in-built to kernel image then you won't get .ko(.bin) file to execute it later.

For your requirement I would suggest you to write a userspace application which reads registry values (may be using mmap) and print the output on console. You may place this binary in /usr/bin directory, so that the binary is accessible in console directly.