Providing Kernel Services
Posted: Thu Jan 18, 2007 6:55 am
Hello,
I am just about implementing some kernel services now, using software interrupt 0x30. The idea is to build this hand in hand with my libc and basic API.
When servicing the interrupt, I use eax as a function selector, which seems fairly standard and I can see 2 main ways to interpret which function I am calling:
1. A massive switch() statement calling functions or doing the actual implementation as necessary.
2. An array of function pointers, so that eax is simply an index in to this array, which is kmalloc'd and filled at boot-time.
My gut feeling is that the second of these implementations should be both neater and faster. Any thoughts?
Cheers,
Adam
I am just about implementing some kernel services now, using software interrupt 0x30. The idea is to build this hand in hand with my libc and basic API.
When servicing the interrupt, I use eax as a function selector, which seems fairly standard and I can see 2 main ways to interpret which function I am calling:
1. A massive switch() statement calling functions or doing the actual implementation as necessary.
2. An array of function pointers, so that eax is simply an index in to this array, which is kmalloc'd and filled at boot-time.
My gut feeling is that the second of these implementations should be both neater and faster. Any thoughts?
Cheers,
Adam