Programmed Exception Handling

From: Anant Narayanan
Date: Thu Jan 24 2008 - 10:12:23 EST


Good day,

I'm trying to implement a binary format loader for a foreign executable format, and have a few questions regarding the same:

1) The executable format is static, and thus, there's no dynamic/ shared library loading involved. Is it ok to leave `load_shlib' of `linux_binfmt' unimplemented?

2) During execution of the foreign executable, system calls are notified via an interrupt (or programmed exception in intel terminology) - 0x64. This is different from the interrupt raised by linux for system calls - 0x80. Thus, I'd like to be able to intercept these interrupts and handle them gracefully (eg: call a real linux system call via INT 0x80 instead). I think using `set_system_gate()' is the way to do that, is it possible to call that function in a kernel module to register my interrupt handler?

3) Is there a method by which the kernel manages allocation of programmed exceptions? What happens when another module which also wants to intercept INT 0x64 is loaded?

I'm not subscribed to the list, and would appreciate it if you could CC me on any replies.

Thank you for your time.

--
Anant
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/