loop - double fault

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.
LOneWoolF

Re:loop - double fault

Post by LOneWoolF »

um, yea, but, i don't use bochs
that thing can't find my vga font, but i installed it! with the script, and manually... but what for do i have 5 PCs at home? *gg* 6... and 2 of that 6 share a screen... :)

ok lez go and try 2 correct that ICW :)

GreeZ
LOneWoolF


i can't get that to work...
what values do i need?
isn't
sfnm+8086 enough?

not easy

isn't the code on that tut correct?
http://osdev.neopages.net/tutorials/pic.php

maybe there is another error?
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:loop - double fault

Post by Pype.Clicker »

no. The code on that tutorial will work with some chipsets, but not all. Only the ICW4 must be adapted, so i don't think a complete new tutorial is needed. The 8085/8086 bit must be defined to "8086" (i think it's a 1) and the slave/master bit must be set to master on 0x21 and to slave on 0xA1 (hehe. i guess you would never have found this on your own :p -- joking of course)
LOneWoolF

Re:loop - double fault

Post by LOneWoolF »

guess what, i got bochs to work... lol
ok it says

Code: Select all

...
00000000000i[XGUI ] [x] Mouse off
00000004256i[BIOS ]  rombios.c,v 1.85.2.1 2003/01/16 21:58:42 cbothamy Exp $
00000330043i[KBD  ] reset-disable command received
00000506792e[HD   ] device set to 0 which does not exist
00000507085e[HD   ] device set to 1 which does not exist
00000650185p[PIC  ] >>PANIC<< write to port 20h = 21
00000650185i[SYS  ] Last time is 1055503411
00000650185i[XGUI ] Exit.
...

that means i send the icw4 that way? (now with code of the FAQ on mega-tokyo,... i found that code and wanted to try :)

Code: Select all

...
   outb(PIC1_DATA, ICW4_8086+ICW4_BUF_MASTER);
   io_wait();
   outb(PIC2_DATA, ICW4_8086+ICW4_BUF_SLAVE);
   io_wait();
...
---
erm, same error...
i think, i'm stuck in a complete wrong thought....
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:loop - double fault

Post by distantvoices »

hmmm... here is what runs for me without trouble:

Code: Select all

#define INT_CTL 0x20
#define INT2_CTL 0xa0
#define INT_CTLMASK 0x21
#define INT2_CTLMASK 0xa1
#define ICW1 0x11
#define ICW4 0x01

and here is the function definition:

void init_pics(int pic1,int pic2){
  outport(INT_CTL,ICW1);
  outport(INT2_CTL,ICW1);
  outport(INT_CTLMASK,pic1);
  outport(INT2_CTLMASK,pic2);
  outport(INT_CTLMASK,4);
  outport(INT2_CTLMASK,2);
  outport(INT_CTLMASK,ICW4);
  outport(INT2_CTLMASK,ICW4);
  outport(INT_CTLMASK,0xff);
}
It runs on my *old* machine, it runs on bochs, it runs on my *new* machine, it runs on some other ones too... mixed bits, various motherboards, various cpu's ... no problem with it. I have to admit, I have learned this way by heavy researching and then cutting several tutorials down to the nitty gritty.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
LOneWoolF

Re:loop - double fault

Post by LOneWoolF »

thx

and sorry for my "shouting" in fewer posts...

i'll try that when i come back home
----------------------------------------
(sorry for capitals... but read.... then you'll understand... :) )

I HAVE TO LOL!!!
not my remapPIC function was wrong....
my outb was wrong
LOneWoolF

Re:loop - double fault

Post by LOneWoolF »

I have an interesting question:
Why do my interrupts work... (like we've seen)
but my keyboard not?
i did exactly what i did with the interrupts...

maskIRQ(1);
AddInt(IRQ1 (second var of an ENUM starting with 0x20), _isrkey, 0);
unmaskIRQ(1);

_isrkey calls _isr_key{ printf("-->KEY_PRESSED");}
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:loop - double fault

Post by Pype.Clicker »

note that if you don't send an "EOI" signal when the timer completes, all other interrupts remains blocked ...

Also note that no keyboard interrupt will be triggered as long as the pending byte hasn't been read out of 0x60 port ...
LOneWoolF

Re:loop - double fault

Post by LOneWoolF »

timer?
do u mean the IRQ0? (i added it and it wasn't even called a first time..<-)

and what about the AEOI for ICW?

ok i noticed, my ints and isr never sent the EOI, but now i added
SendEOI

wich does
outb(MASTER, EOI);
master = 0x20
eoi = 0x20...

outb(0x20, 0x20)looks strange, is that correct? 'cause thaz what the idtsample kernel does ...
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:loop - double fault

Post by Pype.Clicker »

yep. outb(0x20,0x20) is just the right way to signal the end of interrupt.
And no, it wouldn't be wise to turn on auto-end of interrupt as Intel infrastructure require 0x20,0x20 to be sent. As you probably ignore how "auto-EOI" is supposed to work, whether intel CPU provides the required info to the PIC to make it work or even if your chipset implements that feature ...
LOneWoolF

Re:loop - double fault

Post by LOneWoolF »

hihi
not even the timer fires an irq... they seem to be killed... but the exception-ints work... weird...

i dunno what to do...

yes i know i'm getting on your nervs with my sources... again i added it<-

[attachment deleted by admin]
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:loop - double fault

Post by Pype.Clicker »

One thing you should ask yourself is "what is the state of the IRQ mask register" ?

Clearly, you masked independently every interrupt but IRQ0, then unmasked IRQ1...

But what was the initial value of irqs ?
Also, are you aware of the fact unmasking irq8..f will have no effect until you unmask irq2 aswell ?

i would suggest you read the mask status (i.e. inb(0x21)) and display it before you rely on its content. Remember the "USHORT irqs;" statement will *not* enforce irqs==0 at start until you actually clear the BSS region before you enter C code...
LOneWoolF_PublicPC

Re:loop - double fault

Post by LOneWoolF_PublicPC »

K i now read the irq stat into my USHORT irqs; and checkit, but nothing changed....
Post Reply