hey
i wrote a PIC-remap function but it didn't work..
Then i copied the one from the FAQ
it didn't work to..
what to do?
i used it like this:
remap_PIC(0x20,0x28);
setVector(0x21, (void *)(frmKBD));
k_printf("press a key");
asm:
_frmKBD
pusha
pushf
call _KBD
popf
popa
iret
C:
void KBD()
{
unsigned char t;
t = inp(0x60);
outp(0x20,0x20);
k_printf("\n...and now turn around!");
return;
}
thx, dunno what's wrong
PIC
Re:PIC
ok:
this for PIC-remap
void PIC()
{
outp(0x20, 0x11);
outp(0xA0, 0x11);
outp(0x21, 0x20);
outp(0xA1, 0x28);
outp(0x21, 0x04);
outp(0xA1, 0x02);
outp(0x21, 0x01);
outp(0xA1, 0x01);
outp(0x21, 0x01);
outp(0xA1, 0x01);
return;
}
as someone showed here
void KBD()
{
unsigned char t;
t = inp(0x60);
outp(0x20,0x20);
k_printf("...and now turn around!\n");
return;
}
irq handler:
[extern _KBD]
[global _frmKBD]
_frmKBD:
pusha
pushf
call _KBD
popf
popa
this for PIC-remap
void PIC()
{
outp(0x20, 0x11);
outp(0xA0, 0x11);
outp(0x21, 0x20);
outp(0xA1, 0x28);
outp(0x21, 0x04);
outp(0xA1, 0x02);
outp(0x21, 0x01);
outp(0xA1, 0x01);
outp(0x21, 0x01);
outp(0xA1, 0x01);
return;
}
as someone showed here
void KBD()
{
unsigned char t;
t = inp(0x60);
outp(0x20,0x20);
k_printf("...and now turn around!\n");
return;
}
irq handler:
[extern _KBD]
[global _frmKBD]
_frmKBD:
pusha
pushf
call _KBD
popf
popa
Re:PIC
i know that's not belonging to this thread but abless told me not to open a new thread if i have a question but to think...well..here is my prob:
i splitted the Kernel into a few files..
but now i get 3rd exception(13) and running in bogus memory if i just run k_printf("somewhat") or something
that's a bit annoying..
maybe you know why
i splitted the Kernel into a few files..
but now i get 3rd exception(13) and running in bogus memory if i just run k_printf("somewhat") or something
that's a bit annoying..
maybe you know why
Re:PIC
Probly a problem with your kprintf...
I have a good kprintf in my Pk0.3:
http://gd.tuwien.ac.at/opsys/linux/sourceforge-sorted/fF/fritzos/Prekernel0-3.zip
And other old FritzOSes:
http://gd.tuwien.ac.at/opsys/linux/sourceforge-sorted/fF/fritzos/
I have a good kprintf in my Pk0.3:
http://gd.tuwien.ac.at/opsys/linux/sourceforge-sorted/fF/fritzos/Prekernel0-3.zip
And other old FritzOSes:
http://gd.tuwien.ac.at/opsys/linux/sourceforge-sorted/fF/fritzos/
Re:PIC
When you say you split your kernel up into files im assuming you mean the source code. If you have compiled it into seperate files and are loading them it will probably be that the data segment and code segment registers are wrong. If it is your soucre then make sure that you have compiled each file into an object and linked them all together.
It's not as silly as it sounds i forgot to compile a Object Module in before and wondered why the hell it kept crashing with page faults.
Peter
It's not as silly as it sounds i forgot to compile a Object Module in before and wondered why the hell it kept crashing with page faults.
Peter