Adding Mouse Support

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

Adding Mouse Support

Post by VitalDragon »

I wanted to add mouse support, but it seems that I have to create my own driver or I'm not using int 33h correctly. How do you add mouse support using int 33h or by writing your own driver?
jrfritz

Re:Adding Mouse Support

Post by jrfritz »

If your in PMode you can't use those kind of interrupts, and if you are in PMode, you need to write a IDT for IRQs and interrupts to use the Mouse's IRQ and then write a driver.
VitalDragon

Re:Adding Mouse Support

Post by VitalDragon »

Ok, how would I write the IDT for IRQs and interrupts
jrfritz

Re:Adding Mouse Support

Post by jrfritz »

I'll help when I figure that out ;)

I'm trying to get mine to run right now.
VitalDragon

Re:Adding Mouse Support

Post by VitalDragon »

I found some stuff at http://www.nondot.org/sabre/os/articles ... ceDevices/

but it still uses int 33h to initialize the driver, is that right?
jrfritz

Re:Adding Mouse Support

Post by jrfritz »

Yes...but that 33h driver runs in Real mode...and you can't use real mode code in PMode unless you use v86...too much to learn when your just starting.
VitalDragon

Re:Adding Mouse Support

Post by VitalDragon »

Oh Ok, I guess I can try to use int 14h to read the COM Port
jrfritz

Re:Adding Mouse Support

Post by jrfritz »

Hold on here! If you need to use ints, you need a IDT! And ints are different in PMode! You need v86 if you are running in PMode and want 33h and 14h!
VitalDragon

Re:Adding Mouse Support

Post by VitalDragon »

I'm confused now. I don't even know if I'm in PMode or not now (I switched the resolution I'm in VESA 1.2 800x600 16.2M colors), but I'm using BIOS Interrupts, aren't BIOS Interrupts useable anywhere?
cobrab

Re:Adding Mouse Support

Post by cobrab »

If you are using BIOS interrupts you are in Real Mode
jrfritz

Re:Adding Mouse Support

Post by jrfritz »

Oh my...OS dever dosen't eve know if they are in pmode!
VitalDragon

Re:Adding Mouse Support

Post by VitalDragon »

Ok I get it now, I read a FAQ about PMode and Real Mode, but I See no reason to switch to Protected Mode.
jrfritz(Tom )

Re:Adding Mouse Support

Post by jrfritz(Tom ) »

(It's me tom, with a cookie problem...)

Well...PMode is powerful...protects your OS from apps messing it up....
DarylD

Re:Adding Mouse Support

Post by DarylD »

If you switch to protected mode you can use 4GB of ram and protection mechanisms.

If you don't mind being limited to 640K of ram, stay in real mode, all the bios interrupts are available.

I can tell you are wanting to code an OS by starting from the GUI, my opinion is thats a bad choice, everybody starts like that and hits a brick wall very quickly.

Get some books, learn how to REALLY do it!
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:Adding Mouse Support

Post by Perica »

..
Last edited by Perica on Fri Dec 01, 2006 8:37 pm, edited 1 time in total.
Post Reply