hiw to set selector in the IDT
hiw to set selector in the IDT
I want to write c code that loads my idt table. (Using inline asm) i know how to fill all of the info for each entry except the selector, as far as i understanding it is the code segment for my handler , but how do i get the code segment for the handler in C ?
Re: hiw to set selector in the IDT
That's easy. The code selector is whatever you choose to set it to. C doesn't set it, you do.
Re: hiw to set selector in the IDT
so what should i set it ? is it important ? will my handler be called no matter what value of selector i use ?
Re: hiw to set selector in the IDT
Well, at what address are you running the code? (Where have you loaded it?) And what segment selectors have you defined in your GDT? You surely must know what selector you want to use for kernel code.
Really, this is very basic stuff and (at the risk of offending those who think I am being rude for not writing you a tutorial on memory addressing in the x86 processor) I'm not going to engage any longer with this question.
Really, this is very basic stuff and (at the risk of offending those who think I am being rude for not writing you a tutorial on memory addressing in the x86 processor) I'm not going to engage any longer with this question.
Re: hiw to set selector in the IDT
sorry for being stupid , i got confused with memory segmentation , both GDT entries and memory 64k chunks are called "segments".