PIC problems

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
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

PIC problems

Post by kmtdk »

Hi all.
well
this little thing (PIC) has always given me trouble, and still does.
all irq works before i remap, but as soon as i have remaped, and undmasked all int ( enabled), nothing get though.
Just to be sure, i have remapped all IRQ's to some test handlers, witch never gets called..
so why wont the PIC not allow any commands ??


the code is 99% the same as the tutorial (i know, but you cant realy change that), brokenthorn (Neon)

a hint or any clue and i would be so GLad ( last time i tried this pice, it did the same) :|

kmt dk

edit:
i works if i call the IRQs directly,

i have testet it on RHW, and bochs, and both does not like it ..
Attachments
PIC.printer.asm
a function i used in the testing, to print the state of every IRQ, ..( know that "skriv" function is missing)
(1.19 KiB) Downloaded 67 times
PIC.ASM
The pic init part, and some other functions for pic
(2.17 KiB) Downloaded 68 times
IRQ.printer.asm
the IRQ handlers, to show whicht one gets called
(3.63 KiB) Downloaded 42 times
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: PIC problems

Post by Combuster »

Oh god, danish comments..... :shock: :D

I think I traced your bug to the enabling of interrupts - you read the second port and assume its the interrupt mask, however its giving you the interrupt request mask, which is a whole different story.

You should keep a local copy of the interrupt mask, update that, then send it rather than attempting to read its previous value from the PIC
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

Re: PIC problems

Post by kmtdk »

I think i know the error now ( thanks for the replay ( you could also have said OCW 3 insted :D))

so that is what the tutorial misses( brokenthorn (neon's)) [how could i have overlooked the line "after initalizing, the IRR is set"]

KMT dk
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
Post Reply