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.
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?
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)
...
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
#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.
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 ...
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...