Page 1 of 1

Loading ISR's

Posted: Sat Sep 27, 2003 11:23 am
by Neo
I have created a separate segment to load the interrupt handlers, my problem now is i dont know how to specifically load the ISR code into this segment address. For e.g. the selector segment starts at the 2Mb I have written a function LoadException which loads the Exceptions at some random address, so how do i relocate this or alternatively load it at the 2Mb address.

Re:Loading ISR's

Posted: Mon Sep 29, 2003 3:26 am
by Pype.Clicker
if you have a segment that start at 2MB, you should not need relocation: just link your "extension" so that it will be starting at offset 0 and the MMU will nicely perform the relocation at real time.

Now, keep in mind that you'll need far call/far return everytime you get "out" of your 'interrupt handlers' code segment.

Re:Loading ISR's

Posted: Fri Oct 03, 2003 12:08 pm
by Neo
Sorry about the delay but what I have a binary kernel so how do i do this. Right now the ISR's are in a file called isr.c and the kernel links to kernel.bin .So how do i get the isr file to load at 2MB .
btw i dont have a memory manager as yet the reason being i don't know how to start. Please help

Re:Loading ISR's

Posted: Fri Oct 03, 2003 1:13 pm
by Curufir
Is there some reason you can't just use something like 'rep movsb' to shift everything up to the required address range yourself?

Re:Loading ISR's

Posted: Sat Oct 04, 2003 11:39 am
by Neo
yeah thats what i wanted to do intially but consider this I have a wrapper for the interrupts which ultimately calls a C function (say _int_0) now when i relocate this the call _int_0 will still point to the old address which may be in another segment.Pls correct me if i'm wrong here.
So what can i do?

Re:Loading ISR's

Posted: Sat Oct 04, 2003 1:41 pm
by Curufir
Run through your idt after the relocation and adjust all the entry point offsets.

Since you know where you moved everything to this shouldn't present any major difficulties. After that reload the idt to get rid of any cached entries and you should be good to go.