Strange Interrupt Problem

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
srg

Strange Interrupt Problem

Post by srg »

Hi

In my kernel initalisation I have setup GDT and GDTR, page tables, and paging, IDT and IDTR and I have assembly wrappers ready.

Now here is where it gets strange, If I fire off an interrupt, either by hardware or with the Int instruction, when it jumps into the ISR, my CS selector's base address goes up my 0x100000 (1MB) all on it's own!!

For Example: If I'm currently executing at:
0008:0x100825 (phys: 0x100825)
And I Int to an ISR at:
0008:0x100840 (phys: 0x100840)
I end up at:
0008:0x100840 (phys: 0x200840) ???

I don't get any faults or errors, it just executes untill the end of memory!!

What could be going on?
Thanks
srg
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:Strange Interrupt Problem

Post by Pype.Clicker »

the stack would be overriding the GDT ? unlikely ...

what may occur is that the GDT actually holds a wrong value but you haven't reloaded CS segment since that value has been set up, so still working with the "old" base.

try replacing your "int nn" test with

Code: Select all

   jmp 0x0008:.here
.here:
and see what happens ...
srg

Re:Strange Interrupt Problem

Post by srg »

Pype.Clicker wrote: the stack would be overriding the GDT ? unlikely ...

what may occur is that the GDT actually holds a wrong value but you haven't reloaded CS segment since that value has been set up, so still working with the "old" base.

try replacing your "int nn" test with

Code: Select all

   jmp 0x0008:.here
.here:
and see what happens ...
I've added this as a small function after first setting up the GDT and I get a "Running in Bogus memory" error in bochs, I'll look at it tomorrow.

Interestingly, I didn't get this error with the interrupts,

Thanks
srg

Re:Strange Interrupt Problem

Post by srg »

Fixed! There was a problem with my Descriptors. I've sorted them out and it's woring beautifully

Thanks
srg
Post Reply