Loading ISR's
Loading ISR's
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.
Only Human
- Pype.Clicker
- Member

- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Loading ISR's
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.
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
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
btw i dont have a memory manager as yet the reason being i don't know how to start. Please help
Only Human
-
Curufir
Re:Loading ISR's
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
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?
So what can i do?
Only Human
-
Curufir
Re:Loading ISR's
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.
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.
