Skip to Content

Adding New System Call and Recompiling the Kernel

Hi All, I need to add my own system call to be able to handel the Interrupts in the User Space. I need to know the right sequence of steps to add a new System Call and Recompile Kernel. Taking in Consedration that I'm using: Kernel 2.6.13 GCC 4.1 Fedora Core 4

Please Help me.

Thank you.

Ahmed Hashim's picture

i didn't b4 but i hope that can help

phaeronix's picture

Well to do anything related t

Well to do anything related to the kernel you have to learn about the linux kernel. I have gathered the following from reading LKML:

here's another useful quote from LKML :

"Start with head.S in /arch/i386 and follow the code from there.

That's where everything begins."

"in 2.6.13 here it's in /arch/i386/kernel/head.S but nothing find couldn't handle."

Personally I think any IRQ handling should be left to the kernel and the appropriate module handling the hardware that generated the IRQ. In userspace you wait for the kernel to tell you that something happened ( hotplug event ? over netlink for example ? ) and act accordingly.

However I haven't studied the kernel code deeply yet. I will do so when I have time , therefore just check a simple example of how stuff is done in the kernel ( the COM port handling for example ) and follow it.

I hope this helps.

It's never over till it's over.

Thank You

Thank you for your help. I'll try to access these pages and tell you the result when I'am done

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Dr. Radut | forum