2013-06-21

2013-06-21 - How Programs Talk to the Kernel

So I've decided how I'm going to implement the mechanism by which the newly created executables find the kernel library.

The original Linux kernel used software interupts for system calls which, while being a bit slow, were easily accessible from everywhere.  Later on, the linux kernel moved to using memory mapped kernel functions which are faster.

What I'm going to do is have a single interrupt based system call which provides the (process-specific?) address for a FindSymbol() function.  Using this mechanism, a new process can find this function, then use it to search for other symbols such as "write".  This way, as the program starts up, it can find the addresses of symbols it requires and set itself up.  This may cause an overhead on programs which are frequently started and stopped such as console tools, but this should be acceptable for now.

In the meantime, I still haven't actually put the interrupt handling back in yet.  Should probably do that, and may as well use the List structure to combine the handlers.  I guess I should create a list for each interrupt number, then just do an AddTail() for each handler in turn.  I should also put in the kmalloc() and kfree() using a slightly upgraded technology from last time.

No comments:

Post a Comment