Loading ISR's

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Loading ISR's

Post 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.
Only Human
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Loading ISR's

Post 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.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Loading ISR's

Post 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
Only Human
Curufir

Re:Loading ISR's

Post 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?
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Loading ISR's

Post 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?
Only Human
Curufir

Re:Loading ISR's

Post 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.
Post Reply