OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:48 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: What is the "address" when initialising an 8259 PIC?
PostPosted: Tue Oct 08, 2019 5:48 pm 
Offline
Member
Member

Joined: Fri Jan 26, 2018 11:43 am
Posts: 64
I'm writing an assembly routine to set up the 8259 PIC chip using the following information: https://www.eeeguide.com/programming-8259/
I'm a bit confused as to what it could mean by the "interrupt vector address" -- wiki.osdev mentions this same thing in the 8259 programming tutorial.
The reason this confuses me is, why would the PIC need to know any kind of memory address? I was under the impression that the PIC simply sent an offset to the CPU, and the CPU added that offset to the base address of the IDT to get the ISR (oh yes I should've mentioned I'm in 32-bit protected mode, so am setting up an IDT rather than an IVT, if that matters.)
So my question is, what is the interrupt vector address? And out of interest, what is it by default?


Top
 Profile  
 
 Post subject: Re: What is the "address" when initialising an 8259 PIC?
PostPosted: Tue Oct 08, 2019 10:20 pm 
Offline
Member
Member

Joined: Tue Mar 04, 2014 5:27 am
Posts: 1108
It's not a memory address in ICW2. It's the base interrupt number (bits 7 through 3 of it; bits 2 though 0 are zeroes). By default the interrupt numbers are 0x08+0...7 (for master PIC/IRQ0...7) and 0x70+0...7 (for slave PIC/IRQ8...15).


Top
 Profile  
 
 Post subject: Re: What is the "address" when initialising an 8259 PIC?
PostPosted: Wed Oct 09, 2019 1:18 am 
Offline
Member
Member

Joined: Fri Jan 26, 2018 11:43 am
Posts: 64
alexfru wrote:
It's not a memory address in ICW2. It's the base interrupt number (bits 7 through 3 of it; bits 2 though 0 are zeroes). By default the interrupt numbers are 0x08+0...7 (for master PIC/IRQ0...7) and 0x70+0...7 (for slave PIC/IRQ8...15).

Ooooh, thank you so much!
Would it be useful to change the addresses from the default? I think I read somewhere that the 0x08+0...7 addresses are reserved by the CPU or something, would it perhaps be a good idea to change the interrupt numbers for the master PIC to 0x80+0...7?
And just to make sure I'm absolutely certain here - say my PICs are configured to their default address settings, and IRQ0 interrupts, the CPU would then look up the 0x08th entry in the IDT?
Thanks!

EDIT: I just worked out the answer to my first question there, yes the first 32 interrupts are reserved to be interrupts for exceptions :)


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: No registered users and 25 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