Page 1 of 1

Strange Interrupt Problem

Posted: Thu Mar 18, 2004 3:02 pm
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

Re:Strange Interrupt Problem

Posted: Thu Mar 18, 2004 4:52 pm
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 ...

Re:Strange Interrupt Problem

Posted: Thu Mar 18, 2004 5:56 pm
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

Re:Strange Interrupt Problem

Posted: Fri Mar 19, 2004 4:21 am
by srg
Fixed! There was a problem with my Descriptors. I've sorted them out and it's woring beautifully

Thanks
srg