I'm trying to use gate_desc *idt_table
in a kernel module. The set_trap_gate()
function defined in desc.h uses this pointer. In desc.h is also a definition : extern gate_desc idt_table[]
.
I tried different things:
- use
idt_table
in my module without definition or affectation affect
idt_table
with my (valid)idt_table
address I get either anid_table
undefined warning during compilation or incomplete type foridt_table
.creating a new var named for instance
gate_desc *it = (gate_desc *)@;
And copy theset_trap_gate
,set_gate
,write_idt_entry
,pack_gate
functions from sched.h to my module file (renaming them, and using it instead ofidt_table
). This compiles fine but when inserting my module I get an unknown symbol in module (ret -1) error. (there is no reference in my module to idt_table, and the functions I use from sched do use my variable).
I tried to see where in the files included by sched.h was defined idt_table
, but couldn't find it!
Does someone know how I could use, the idt_table pointer from sched.h (affecting it with the corrct address) or create a new pointer?
Theoretically, you could implement a non-init-section
set_trap_gate()
via:But that'd be CPU-local, i.e. it's not guaranteed to modify any other IDT but the one of the CPU it's running on. Also, it might fall foul of writeprotected memory.
What exactly is it you're trying to achieve ?