OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:45 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: interrupt emitted when I enable maskable interrupts
PostPosted: Tue Dec 04, 2018 7:30 am 
Offline

Joined: Wed Feb 15, 2017 8:29 am
Posts: 17
Hi, I am early in the development of a little kernel, and I am already facing something I don't know how to solve.

I want to enable interrupts but when the line "sti" is executed there is always an interrupt emitted and I don't know why. I set up the IDT to call interrupt handlers that display the interrupt vector of the handler on the screen when it is executed.

I verified with Bochs that everything was well configured by looking what it thought my GDT and IDT was, and watching bits per bits these tables on the RAM, and it was. At least, it was configured the way I want it to be, it may be the wrong way :oops:

When I execute my kernel with Bochs, it always displays me a "(8)" (VirtualBox too) when maskable interrupts are enabled. 8 is for double fault so I tried to run my (tiny little)kernel on real hardware to have more info and I came up with this result "(15)(15)(15)(8)(15)" (photo of the result : https://www.cjoint.com/c/HLenjb7VIDv). An Intel reserved exception is causing the double fault. Well... That won't help me a lot

If somebody can look at my code to tell me what I am doing wrong I will really appreciate it. I have surely misunderstood something but, after about a month of investigations, I can't find it. The code is at https://github.com/DridriLaBastos/BeetleOS/tree/resolving-idt-issue


Top
 Profile  
 
 Post subject: Re: interrupt emitted when I enable maskable interrupts
PostPosted: Tue Dec 04, 2018 7:52 am 
Offline
Member
Member

Joined: Tue May 13, 2014 3:02 am
Posts: 280
Location: Private, UK
I can't see any code in your repository to remap/mask IRQs from the PIC. Thanks to the rather slapdash design of the original IBM PC, by default, the IRQ mappings conflict with the CPU exception interrupts (while these exceptions didn't exist when the PC was designed, the interrupt vectors were always documented as "reserved" by Intel).

As such, I suspect your "double fault" is actually IRQ 0 - the system timer. Interrupt 15 is IRQ 7, which is known to produce "spurious" interrupts on real hardware.

The wiki contains details of how to remap the PIC and mask IRQs.

_________________
Image


Top
 Profile  
 
 Post subject: Re: interrupt emitted when I enable maskable interrupts
PostPosted: Tue Dec 04, 2018 9:38 am 
Offline

Joined: Wed Feb 15, 2017 8:29 am
Posts: 17
mallard wrote:
As such, I suspect your "double fault" is actually IRQ 0 - the system timer. Interrupt 15 is IRQ 7, which is known to produce "spurious" interrupts on real hardware.

You were right, I tried to disable the PICs for testing purposes, and then nothing happened on both bochs and real hardware, thank you very much =D>

I am only working with Intel IA32 manual, it's my mistake


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 68 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group