Mouse, and stuff.....

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
vbbrett

Mouse, and stuff.....

Post by vbbrett »

Hey,

Okay, Heres what I have:
booted with Grub.
PIC's remapped.
in pmode(of course)

Could someone give some explanations on the mouse and how I could implement it into my kernel. Also, kind of a sidenote, the pic is remapped, but I think that only IRQ 0 and 1 are turned on. I think that's called masking. Explanation on what masking is and how I could do it would be nice.
I don't know the IRQ for the mouse, or how to read it, but I do have a keyboard driver up and running.

I was told many times that the PIC remapping documentation is hard to understand. Therefore I don't have the best idea of what the entirety of the code does. I DO KNOW that the first few lines take the IRQ adresses(correct word?) and put them somewhere out of the way. I'm confused. Thanks for staying with my terrible composition!


Brett

My PIC code:

outportb(0x20, 0x11);
outportb(0xA0, 0x11);
outportb(0x21, 0x50);
outportb(0xA1, 0x50+8);
outportb(0x21, 0x04);
outportb(0xA1, 0x02);
outportb(0x21, 0x01);
outportb(0xA1, 0x01);
outportb(0x21, ~0xFF);
outportb(0xA1, ~0xFF);
Slasher

Re:Mouse, and stuff.....

Post by Slasher »

If you plan to sucessfully program an OS then you have to take the time and pain to read the specs for the hardware you want to support.
Without this, you would have a nightmare debugging your OS.
These links are what you need
http://www.mega-tokyo.com/forum/index.p ... eadid=3254
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:Mouse, and stuff.....

Post by Pype.Clicker »

1. afaik you should have a small delay between each command sent to the PIC (either trying to *read* an I/O port or with a small busy loop) if you want it to work properly on every chipsets

2. your 'ICW4' is not correct. You should use '0x0d' for the master and 0x09 for the slave. "1,1" will only work with Intel chipset that are hardwired to support only Intel environment, but not on chipsets that fully emulates the 8259 chip.

3. know what mouse is to be implemented ... and keep in mind that if you want a slave-interrupt to be received and process correctly
Post Reply