In windows GUI programming we use to have dll from where we can import the symbols of dll once it is loaded.
Now i am trying my hand with .So linux shared library.
We can access shared library functions easily as mentioned in this link.
http://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
Suppose i want to read & write USART for serial communication using routines written in shared library.
-
How will my shared library access — USART driver system call interfaces — if driver is stically linked to kernel?
-
If driver is loded using Modprobe or insmode then — how can shared library access the USART driver?
Do driver have to export symbols in this case?
Your shared library is to be used by user-space application, while the driver lives in the kernel. You don’t link user-space apps directly with kernel symbols, but request kernel services via system calls, which are well defined and numbered for a given kernel build. Take a look here for an overview.