aboutsummaryrefslogtreecommitdiff
path: root/src/mouse.c
AgeCommit message (Collapse)AuthorFilesLines
2009-03-01Consistently disable irqs at start of each assembler entry point.Kevin O'Connor1-2/+4
Always disable irqs at start of each entry point. Be consistent with clearing direction flag after disabling interrupts.
2009-01-17Cleanup keyboard reset handling.Kevin O'Connor1-1/+1
Use custom timeouts when issuing a reset. Handle 1-byte returns from reset in ps2 code. Do full keyboard reset even in coreboot mode. Send set scan mode command during reset.
2009-01-15Change license from GPLv3 to LGPLv3.Kevin O'Connor1-1/+1
Change license of contributions from Kevin O'Connor from GPLv3 to LGPLv3 (or later). Since the work as a whole is based on Kevin's contributions and the "bochs bios" which has a license of LGPL (v2 or later), this effectively makes the work as a whole available under LGPLv3 (or later).
2009-01-04Make sure ps2 port command reads are from the desired device.Kevin O'Connor1-11/+12
Discard reads from real-time events or from a different device. Also, improve the kbd/mouse diagnostic messages.
2009-01-01Reduce stack usage of hw irq handlers.Kevin O'Connor1-4/+5
Avoid using call16_int() -- it consumes too much stack space. Instead, use a new function (call16_simpint). This assumes that the handler wont corrupt regs - which should be a safe assumption, because if they did corrupt regs they wouldn't work on any bios. Avoid enabling irqs in the hw irq handlers - there are no loops in the handlers that could cause any notable latency.
2008-12-29Introduce GET/SET_EBDA2() macros - they take a cached ebda seg.Kevin O'Connor1-22/+27
For those places that repeatedly read/write to the ebda, caching the ebda segment improves code generation.
2008-12-13Implement GET/SET_GLOBAL(...) instead of using GET/SET_VAR(CS, ...)Kevin O'Connor1-1/+1
2008-11-26Enable a default hw irq handler.Kevin O'Connor1-3/+2
Also, only route hw irqs to their handlers when they are enabled. (This ensures that if a subsystem is disabled that the default hwirq handler will be used.) Add helper macros to declare the extern asm handlers. Always enable the RTC hwirq at startup (as opposed to when it is first used). Fix bug in default handler - wrong bit was used for checking the cascaded irq.
2008-08-17Misc minor improvements.Kevin O'Connor1-1/+1
Update TODO list. Improve comments in boot.c. Use debug port 0x0402 instead of 0x0403 (bochs prefers the latter). Fix formatting of debug messages in kbd.c. Use proper return check for kbd and mouse init.
2008-07-21Support ps2 port RESET commands that respond with 1 or 2 bytes.Kevin O'Connor1-1/+1
Some devices only respond with 1 byte - if they timeout reading the second byte, don't fail the whole operation - just continue and handle the 1 byte.
2008-07-21Add additional config options to remove parts of code.Kevin O'Connor1-0/+3
Added options CONFIG_BOOT, CONFIG_SERIAL, CONFIG_LPT, CONFIG_KEYBOARD, CONFIG_BOOTMENU. Also extended coverage of existing options to ensure full code got removed.
2008-07-20Rewrite ps2 port (keyboard/mouse) handling.Kevin O'Connor1-173/+83
Use command sending code for communicating with the ps2 port.
2008-07-19Misc fixes and updates.Kevin O'Connor1-4/+2
Minor code cleanups. Fix parenthesis imbalance in keyboard led test. The printf() call is only used in 32bit mode - make this explicit to the compiler - it improves the code generation. Clear the screen after initializing the vga option rom.
2008-07-04Extract 'struct bregs' out of biosvar.h; clean up header includes.Kevin O'Connor1-1/+2
2008-06-28Improve some debugging output.Kevin O'Connor1-3/+0
Replace DEBUGF calls with dprintf calls. Make ata calls consistently use 'int' return codes. Make each error return code in ata.c use a unique negative number.
2008-06-14Cleanup handling of interrupt controller (PIC).Kevin O'Connor1-1/+14
Add new file (pic.h) with helpers for accessing the PIC. Move irq enabling code to the files that use those interrupts. Also, don't setup for floppy if floppy support not enabled.
2008-06-12Support config driven debugging of each irq handler.Kevin O'Connor1-2/+2
This allows one to easily enable verbose output from handlers.
2008-03-11Don't save/restore flags and ebp on external calls - saves on stack space.Kevin O'Connor1-5/+2
It isn't necessary to save ebp - just mark it as clobbered. The only important flag to save/restore is irqs - manually fixup all callers.
2008-03-11Reduce stack usage for ISRs; minor fixes.Kevin O'Connor1-2/+5
Don't back up all registers on isr handlers - they don't read/modify them. This saves stack space. extended_bios_data_area_s must be packed to match ebda spec. Enable irqs on int 08 - follows old bochs bios code. Fix bug in int 76 -- should clear disk_interrupt_flag not floppy_harddisk_info. Make sure we alert in disk_ret on failure case. int 18/19 entry points need to setup cld/%ds too. asm in handle_1587 clobbers flags - note that in clobber list.
2008-03-09Replace debug_exit calls with debug info while setting a failure.Kevin O'Connor1-19/+19
Calling debug_exit at the end of a call doesn't help much - several of the registers are already clobbered at this point. It also increases stack usage because it prevents call tail optimization in many places.
2008-03-05Rename VISIBLE macro for better control.Kevin O'Connor1-1/+1
VISIBLE16 is used to mark functions externally available in 16bit code. VISIBLE32 is for 32bit functions.
2008-03-02Bug fixes; get mouse working.Kevin O'Connor1-4/+2
Fix bug in post causing PIC2 to not be initialized properly. Only run ata_detect if CONFIG_ATA enabled. Improve debugging aids - introduce debug_isr(); move DEBUGF to each file. Enable mouse by default. Fix bug in floppy causing extra test of PORT_FD_STATUS on recalibrate. Always disable/enable kbd in handle_09 event.
2008-03-02Initial support for ps/2 mouse.Kevin O'Connor1-8/+398
The code doesn't work, but most things are present.
2008-02-25Version 0.1.2rel-0.1.2Kevin O'Connor1-0/+2
2008-02-25Version 0.1.1rel-0.1.1Kevin O'Connor1-0/+35