Return to site

Drivers Boso Port Devices

broken image


Some USB devices, such as printers, scanners, and copiers require that the USB device software and drivers be installed before connecting the USB device to the computer. Always follow the installation documentation from the USB device manufacturer. While troubleshooting the USB device, you might need to disconnect the USB device from the computer. Pugs' pen drive was the device Shweta was playing with, when both of them sat down to explore the world of USB drivers in Linux. The fastest way to get the hang of it, and Pugs' usual way, was to pick up a USB device, and write a driver for it, to experiment with. The serial port ttySx (x=0,1,2, etc.) is major number 4. You can see this (and the minor numbers too) by typing: 'ls -l ttyS.' in the /dev directory. To find the device names for various devices, see the 'devices' file in the kernel documentation. There formerly was a 'cua' name for each serial port. Additionally, devices that bridge between bus types, such as a device driver that enables a parallel port device to emulate a SCSI or an AT Attachment Packet Interface (ATAPI) bus, are also known to generate an unknown-device response in Device Manager.

  1. Drivers Boso Port Devices Download
  2. Drivers Boso Port Devices List
NextPreviousContents

Common serial port names are /dev/ttyS0, /dev/ttyS1, etc. Thenaround the year 2000 came the USB bus with names like /dev/ttyUSB0 and/dev/ttyACM1 (for the ACM modem on the USB bus). Multiport serialcard used somewhat differnt names (depending on the brand) such as/dev/ttyE5.

Since DOS provided for 4 serial ports on the old ISA bus:COM1-COM4, or ttyS0-ttyS3 in Linux, most serial ports on the newer PCIbus used higher numbers such as ttyS4 or ttyS14 (prior to kernel2.6.13). But since most PCs only came with one or two serial ports,ttyS0 and possibly ttyS1 (for the second port) the PCI bus can now usettyS2 (kernel 2.6.15 on). All this permits one to have both ISAserial ports and PCI serial ports on the same PC with no nameconflicts. 0-1 (or 0-3) are reserved for the old ISA bus (or thenewer LPC bus) and 2-upward (or 4-upward or 14-upward) are used forPCI, where older schemes are shown in parentheses . It's not requiredto be this way but it often is.

If you're using udev (which puts only the device you have on yourcomputer into the /dev directory at boottime) then there's an easy wayto change the device names by editing files in /etc/udev/. Forexample, to change the name of what the kernel detects as ttyS3 towhat you want to name it: ttyS14, add a line similar to this to/etc/udev/udev.rules
BUS'pci' KERNEL'ttyS3',NAME='ttyS14'

On-board serial ports on motherboards which have both PCI and ISAslots are likely to still be ISA ports. Even for all-PCI-slotmotherboards, the serial ports are often not PCI. Instead, they areeither ISA, on an internal ISA bus or on a LPC bus which is intendedfor slow legacy I/O devices: serial/parallel ports and floppy drives.

Devices in Linux have major and minor numbers. The serial portttySx (x=0,1,2, etc.) is major number 4. You can see this (and theminor numbers too) by typing: 'ls -l ttyS*' in the /dev directory. Tofind the device names for various devices, see the 'devices' file inthe kernel documentation.

There formerly was a 'cua' name for each serial port and it behavedjust a little differently. For example, ttyS2 would correspond tocua2. It was mainly used for modems. The cua major number was 5 andminor numbers started at 64. You may still have the cua devices inyour /dev directory but they are now deprecated. For details seeModem-HOWTO, section: cua Device Obsolete.

For creating the old devices in the device directory see:

Dos/Windows use the COM name while the messages from the serial driveruse ttyS00, ttyS01, etc. Older serial drivers (2001 ?) used justtty00, tty01, etc.

The tables below shows some examples of serial device names. TheIO addresses are the default addresses for the old ISA bus (not forthe newer PCI and USB buses).

For more info see the usb subdirectory in the kernel documentationdirectory for files: usb-serial, acm, etc.

On some installations, two extra devices will be created,/dev/modem for your modem and /dev/mouse for amouse. Both of these are symbolic links to the appropriatedevice in /dev.

Historical note: Formerly (in the 1990s) the use of/dev/modem (as a link to the modem's serial port) wasdiscouraged since lock files might not realize that it was really say/dev/ttyS2. The newer lock file system doesn't fall intothis trap so it's now OK to use such links.

Inspect the connectors

Inspecting the connectors may give some clues but is often notdefinitive. The serial connectors on the back side of a PC areusually DB connectors with male pins. 9-pin is the most common butsome are 25-pin (especially older PCs like 486s). There may be one9-pin (perhaps ttyS0 ??) and one 25-pin (perhaps ttyS1 ??). For two9-pin ones the top one might be ttyS0.

If you only have one serial port connector on the back of your PC,this may be easy. If you also have an internal modem, a program likewvdial may be able to tell you what port it's on (unless it's a PnPthat hasn't been enabled yet). A report from setserial (atboot-time or run by you from the command line) should help youidentify the non-modem ports.

If you have two serial ports it may be more difficult. You could haveonly one serial connector but actually have 2 ports, one of whichisn't used (but it's still there electronically). First check manuals(if any) for your computer. Look at the connectors for meaningfullabels. You might even want to take off the PC's cover and see ifthere are any meaningful labels on the card where the internal ribbonserial cables plug in. Labels (if any) are likely to say something like'serial 1', 'serial 2' or A, B. Which com port it actually is willdepend on jumper or PnP settings (sometimes shown in a BIOS setupmenu). But 1 or A are more likely to be ttyS0 with 2 or B ttyS1.

Send bytes to the port

Labels are not apt to be definitive so here's another method. Ifthe serial ports have been configured correctly per setserial, thenyou may send some bytes out a port and try to detect which connector(if any) they are coming out of. One way to send such a signal is tocopy a long text file to the port using a command like: cpmy_file_name /dev/ttyS1. A voltmeter connected to the DTR pin (seeSerial-HOWTO for Pinout) will display a positive voltage as soon asyou give the copy command.

The transmit pin should go from several volts negative to a voltagefluctuating around zero after you start sending the bytes. If it doesn't(but the DTR went positive) then you've got the right port but it'sblocked from sending. This may be due to a wrong IRQ, -clocal beingset, etc. The command 'stty -F /dev/ttyS1 -a' should showclocal (and not -clocal). If not, change it to clocal.

Another test is to jumper the transmit and receive pins (pins 2 and 3of either the 25-pin or 9-pin connector) of a test serial port. Thensend something to each port (from the PCs keyboard) and see if it getssent back. If it does it's likely the port with the jumper on it.Then remove the jumper and verify that nothing gets sent back. Notethat if 'echo' is set (per stty) then a jumper creates an infiniteloop. Bytes that pass thru the jumper go into the port and come rightback out of the other pin back to the jumper. Then they go back inand out again and again. Whatever you send to the port repeats itselfforever (until you interrupt it by removing the jumper, etc.). Thismay be a good way to test it as the repeating test messages halt whenthe jumper is removed.

As a jumper you could use a mini (or micro) jumper cable (sold in someelectronic parts stores) with mini alligator clips. A small scrap ofpaper may be used to prevent the mini clips from making electricalcontact where it shouldn't. Metal paper clips can sometimes be bentto use as jumpers. Whatever you use as a jumper take care not to bendor excessively scratch the pins. To receive something from a port,you can go to a virtual terminal (for example Alt-F2 and login) andtype something like 'cp /dev/ttyS2 /dev/tty'. Then at another virtualterminal you may send something to ttyS2 (or whatever) by 'echotest_message > /dev/ttyS2'. Then go back to the receive virtualterminal and look for the test_message. See Serial Electrical Test Equipment for more info.

Connect a device to the connector

Another way to try to identify a serial port is to connect somephysical serial device to it and see if it works. But a problem hereis that it might not work because it's not configured right. A serialmouse might get detected at boot-time if connected.

You may put a device, such as a serial mouse (use 1200 baud), on a portand then use minicom or picocom to communicate with that port. Thenby clicking on the mouse, or otherwise sending characters with thedevice, see if they get displayed. It not you may have told picocomthe wrong port (such as ttyS0 instead of ttyS1) so try again.

Missing connectors

If the software shows that you have more serial ports than youhave connectors for (including an internal modem which counts as aserial port) then you may have a serial port that has no connector.Some motherboards come with a serial port with no cable or externalserial DB connector. Someone may build a PC from this and decide notto use this serial port. There may be a 'serial' connector and labelon the motherboard but no ribbon cable connects to its pins. To usethis port you must get a ribbon cable and connector. I've seendifferent wiring arrangements for such ribbon cables so beware.

If you don't use devfs (which automatically creates such devices) anddon't have a device 'file' that you need, you will have to create it.Use the mknod command or with the MAKEDEV shell script.Example, suppose you needed to create ttyS0:

The MAKEDEV script is easier to use.See the man page for it. For example, if you needed to make thedevice for ttyS0 you would just type:

If the above command doesn't work (and you are the root user), lookfor the MAKEDEV script in the /dev directory and run it.

Alcatel network & wireless cards driver download for windows. Download Alcatel smartphone drivers or install DriverPack Solution software for driver scan and update. Acme USB Remote NDIS Network Device. ALCATEL Android Modem 9018. ALCATEL Android Modem 901E. ALCATEL Gobi 3000 Wireless HS-USB Ethernet Adapter 920D. Download Alcatel Wi-Fi device drivers or install DriverPack Solution software for driver scan and update. Qualcomm Gobi 2000 Wireless HS-USB Ethernet Adapter 9205. Windows XP, 7, 8, 8.1, 10 (x64, x86) Category: Wi-Fi devices. Subcategory: Alcatel Wi-Fi devices. Driver Intel Audio. Driver G-Sensor. Making innovative technology accessible for all to Enjoy.Now. Bring more joy into your life with the latest news, offers and more from Alcatel. See the release notes and the readme.txt file for installation instructions, supported hardware, what's new, bug fixes, and known issues. This download installs base drivers, Intel® PROSet for Windows. Device Manager, and Intel® PROSet Adapter Configuration Utility for Intel® Network Adapters with Windows® 10.

This handles the devices creation and should set the correct permissions.For making multiport devices see Making multiport devices in the /dev directory.

Clientron is dedicated to be the professional thin client and embedded computing ODM provider for over 13 years and now we are the top 1 independent thin client manufacturers in the world. With providing Design, Manufacturing and Service support func. Driver downloads for windows 7. Intel® Graphics Driver for Windows. 15.40 This download installs the Intel® Graphics Driver for Braswell, 4th and 5th generations. Driver: Windows 10, 32-bit. Windows 10, 64-bit. Windows 8.1, 32-bit. 3 more: 15. Latest: 2/5/2021: Intel® Graphics - Windows® 10 DCH Drivers. Clientron introduces the latest 15' fanless economical POS terminal - PT2000 Clientron showcases multiple innovations of Thin Client, POS and Embedded IPC at Computex Taipei 2018 Clientron introduces the multi-display thin client F620 based on the 3rd Generation of AMD R series CPU for end user computing Consolidate your Intelligent Industrial. With more than 35 years experiences in design, manufacturing, and after-sales-service, Clientron offers high quality and technology leading solutions, including POS, Kiosk, Thin Client and Automotive Electronics. We commit to continuously provide better IoT client solutions and services for our partners and customers to build an intelligent e-World. Clientron Thermal Receipt Printer PRT650, top paper loading, front paper loading, POS Thermal Printer supports auto cutter and easy drop-in paper loading for paper.

NextPreviousContents -->

Note

This topic is for developers who are creating drivers for keyboard and mouse HID clients. If you are looking to fix a mouse or keyboard, see:

This topic discusses keyboard and mouse HID client drivers. Keyboards and mice represent the first set of HID clients that were standardized in the HID Usage tables and implemented in Windows operating systems.

Keyboard and mouse HID client drivers are implemented in the form of HID Mapper Drivers. A HID mapper driver is a kernel-mode WDM filter driver that provides a bidirectional interface for I/O requests between a non-HID Class driver and the HID class driver. The mapper driver maps the I/O requests and data protocols of one to the other.

Windows provides system-supplied HID mapper drivers for HID keyboard, and HID mice devices.

Architecture and overview

The following figure illustrates the system-supplied driver stacks for USB keyboard and mouse/touchpad devices.

Drivers Boso Port Devices Download

The figure above includes the following components:

  • KBDHID.sys – HID client mapper driver for keyboards. Converts HID usages into scancodes to interface with the existing keyboard class driver.
  • MOUHID.sys – HID client mapper driver for mice/touchpads. Converts HID usages into mouse commands (X/Y, buttons, wheel) to interface with the existing keyboard class driver.
  • KBDCLASS.sys – The keyboard class driver maintains functionality for all keyboards and keypads on the system in a secure manner.
  • MOUCLASS.sys – The mouse class driver maintains functionality for all mice / touchpads on the system. The driver does support both absolute and relative pointing devices. This is not the driver for touchscreens as that is managed by a different driver in Windows.
  • HIDCLASS.sys - The HID class driver. The HID Class driver is the glue between KBDHID.sys and MOUHID.sys HID clients and various transports (USB, Bluetooth, etc).

The system builds the driver stack as follows:

  • The transport stack creates a physical device object (PDO) for each HID device attached and loads the appropriate HID transport driver which in turn loads the HID Class Driver.
  • The HID class driver creates a PDO for each keyboard or mouse TLC. Complex HID devices (more than 1 TLC) are exposed as multiple PDOs created by HID class driver. For example, a keyboard with an integrated mouse might have one collection for the standard keyboard controls and a different collection for the mouse.
  • The keyboard or mouse hid client mapper drivers are loaded on the appropriate FDO.
  • The HID mapper drivers create FDOs for keyboard and mouse, and load the class drivers.

Important notes:

  • Vendor drivers are not required for keyboards and mice that are compliant with the supported HID Usages and top level collections.
  • Vendors may optionally provide filter drivers in the HID stack to alter/enhance the functionality of these specific TLC.
  • Vendors should create separate TLCs, that are vendor specific, to exchange vendor proprietary data between their hid client and the device. Avoid using filter drivers unless critical.
  • The system opens all keyboard and mouse collections for its exclusive use.
  • The system prevents disable/enabling a keyboard.
  • The system provides support for horizontal/vertical wheels with smooth scrolling capabilities.

Driver Guidance

Microsoft provides the following guidance for IHVs writing drivers:

  1. Driver developers are allowed to add additional drivers in the form of a filter driver or a new HID Client driver. The criteria are described below:

    1. Filters Drivers: Driver developers should ensure that their value-add driver is a filter driver and does not replace (or be used in place of) existing Windows HID drivers in the input stack.

      • Filter drivers are allowed in the following scenarios:
        • As an upper filter to kbdhid/mouhid
        • As an upper filter to kbdclass/mouclass
      • Filter drivers are not recommended as a filter between HIDCLASS and HID Transport minidriver
    2. Function Drivers: Alternatively vendors can create a function driver (instead of a filter driver) but only for vendor specific HID PDOs (with a user mode service if necessary).

      Function drivers are allowed in the following scenarios:

      • Only load on the specific vendor's hardware
    3. Transport Drivers: Windows team does not recommend creating additional HID Transport minidriver as they are complex drivers to write/maintain. If a partner is creating a new HID Transport minidriver, especially on SoC systems, we recommend a detailed architectural review to understand the reasoning and ensure that the driver is developed correctly.

  2. Driver developers should leverage driver Frameworks (KMDF or UMDF) and not rely on WDM for their filter drivers.

  3. Driver developers should reduce the number of kernel-user transitions between their service and the driver stack.

  4. Driver developers should ensure ability to wake the system via both keyboard and touchpad functionality (adjustable by the end user (device manager) or the PC manufacturer). In addition on SoC systems, these devices must be able to wake themselves from a lower powered state while the system is in a working S0 state.

  5. Driver developers should ensure that their hardware is power managed efficiently.

    • Device can go into its lowest power state when the device is idle.
    • Device is in the lowest power state when the system is in a low power state (for example, standby (S3) or connected standby).

Keyboard layout

A keyboard layout fully describes a keyboard's input characteristics for Microsoft Windows 2000 and later versions. For example, a keyboard layout specifies the language, keyboard type and version, modifiers, scan codes, and so on.

See the following for information about keyboard layouts:

  • Keyboard header file, kdb.h, in the Windows Driver Development Kit (DDK), which documents general information about keyboard layouts.

  • Sample keyboard layouts.

To visualize the layout of a specific keyboard, see Windows Keyboard Layouts.

For additional details around the keyboard layout, visit Control PanelClock, Language, and RegionLanguage.

Supported buttons and wheels on mice

The following table identifies the features supported across different client versions of the Windows operating system.

FeatureWindows XPWindows VistaWindows 7Windows 8 and later
Buttons 1-5Supported (P/2 & HID)Supported (PS/2 & HID)Supported (PS/2 & HID)Supported (PS/2 & HID)
Vertical Scroll WheelSupported (PS/2 & HID)Supported (PS/2 & HID)Supported (PS/2 & HID)Supported (PS/2 & HID)
Horizontal Scroll WheelNot SupportedSupported(HID only)Supported(HID only)Supported(HID only)
Smooth Scroll Wheel Support (Horizontal and Vertical)Not SupportedPartly SupportedSupported (HID only)Supported (HID only)

Activating buttons 4-5 and wheel on PS/2 mice

The method used by Windows to activate the new 4&5-button + wheel mode is an extension of the method used to activate the third button and the wheel in IntelliMouse-compatible mice:

  • First, the mouse is set to the 3-button wheel mode, which is accomplished by setting the report rate consecutively to 200 reports/second, then to 100 reports/second, then to 80 reports/second, and then reading the ID from the mouse. The mouse should report an ID of 3 when this sequence is completed.
  • Next, the mouse is set to the 5-button wheel mode, which is accomplished by setting the report rate consecutively to 200 reports/second, then to 200 reports/second again, then to 80 reports/second, and then reading the ID from the mouse. Once this sequence is completed, a 5-button wheel mouse should report an ID of 4 (whereas an IntelliMouse-compatible 3-button wheel mouse would still report an ID of 3).

Note that this is applicable to PS/2 mice only and is not applicable to HID mice (HID mice must report accurate usages in their report descriptor).

Standard PS/2-compatible mouse data packet format (2 Buttons)

ByteD7D6D5D4D3D2D1D0Comment
1YoverXoverYsignXsignTagMRLX/Y overvlows and signs, buttons
2X7X6X5X4X3X2X1X0X data byte
3Y7Y6Y5Y4Y3Y2Y1Y0Y data bytes

Note

Windows mouse drivers do not check the overflow bits. In case of overflow, the mouse should simply send the maximal signed displacement value.

Standard PS/2-compatible mouse data packet format (3 Buttons + VerticalWheel)

ByteD7D6D5D4D3D2D1D0Comment
100YsignXsign1MRLX/Y signs and R/L/M buttons
2X7X6X5X4X3X2X1X0X data byte
3Y7Y6Y5Y4Y3Y2Y1Y0Y data bytes
4Z7Z6Z5Z4Z3Z2Z1Z0Z/wheel data byte

Standard PS/2-compatible mouse data packet format (5 Buttons + VerticalWheel)

ByteD7D6D5D4D3D2D1D0Comment
100YsignXsign1MRLX/Y signs and R/L/M buttons
2X7X6X5X4X3X2X1X0X data byte
3Y7Y6Y5Y4Y3Y2Y1Y0Y data bytes
400B5B4Z3Z2Z1Z0Z/wheel data and buttons 4 and 5

Important

Notice that the Z/wheel data for a 5-button wheel mouse has been reduced to four bits instead of the 8 bits used in the IntelliMouse-compatible 3-button wheel mode. This reduction is made possible by the fact that the wheel typically cannot generate values beyond the range +7/-8 during any given interrupt period. Windows mouse drivers will sign extend the four Z/wheel data bits when the mouse is in the 5-button wheel mode, and the full Z/wheel data byte when the mouse operates in the 3-button wheel mode.

Buttons 4 & 5 on are mapped to WM_APPCOMMAND messages and correspond to App_Back and App_Forward.

Devices not requiring vendor drivers

Vendor drivers are not required for the following devices:

  • Devices that comply with the HID Standard.
  • Keyboard, mouse, or game port devices operated by the system-supplied non-HIDClass drivers.

Kbfiltr sample

Kbfiltr is designed to be used with Kbdclass, the system class driver for keyboard devices and I8042prt, the function driver for a PS/2-style keyboard. Kbfiltr demonstrates how to filter I/O requests and how to add callback routines that modify the operation of Kbdclass and I8042prt.

For more information about Kbfiltr operation, see the following:

Boso
  • The ntddkbd.h WDK header file.

  • The sample Kbfiltr source code.

Kbfiltr IOCTLs

IOCTL_INTERNAL_I8042_HOOK_KEYBOARD

The IOCTL_INTERNAL_I8042_HOOK_KEYBOARD request does the following:

  • Adds an initialization callback routine to the I8042prt keyboard initialization routine.
  • Adds an ISR callback routine to the I8042prt keyboard ISR.

The initialization and ISR callbacks are optional and are provided by an upper-level filter driver for a PS/2-style keyboard device.

After I8042prt receives an IOCTL_INTERNAL_KEYBOARD_CONNECT request, it sends a synchronous IOCTL_INTERNAL_I8042_HOOK_KEYBOARD request to the top of the keyboard device stack.

After Kbfiltr receives the hook keyboard request, Kbfiltr filters the request in the following way:

  • Saves the upper-level information passed to Kbfiltr, which includes the context of an upper-level device object, a pointer to an initialization callback, and a pointer to an ISR callback.
  • Replaces the upper-level information with its own.
  • Saves the context of I8042prt and pointers to callbacks that the Kbfiltr ISR callback can use.

IOCTL_INTERNAL_KEYBOARD_CONNECT

The IOCTL_INTERNAL_KEYBOARD_CONNECT request connects the Kbdclass service to the keyboard device. Kbdclass sends this request down the keyboard device stack before it opens the keyboard device.

After Kbfiltr received the keyboard connect request, Kbfiltr filters the connect request in the following way:

  • Saves a copy of Kbdclass's CONNECT_DATA (Kbdclass) structure that is passed to the filter driver by Kbdclass.
  • Substitutes its own connect information for the class driver connect information.
  • Sends the IOCTL_INTERNAL_KEYBOARD_CONNECT request down the device stack.

If the request is not successful, Kbfiltr completes the request with an appropriate error status.

Kbfiltr provides a template for a filter service callback routine that can supplement the operation of KeyboardClassServiceCallback, the Kbdclass class service callback routine. The filter service callback can filter the input data that is transferred from the device input buffer to the class data queue.

IOCTL_INTERNAL_KEYBOARD_DISCONNECT

The IOCTL_INTERNAL_KEYBOARD_DISCONNECT request is completed with a status of STATUS_NOT_IMPLEMENTED. Note that a Plug and Play keyboard can be added or removed by the Plug and Play manager.

For all other device control requests, Kbfiltr skips the current IRP stack and sends the request down the device stack without further processing.

Callback routines implemented by Kbfiltr

KbFilter_InitializationRoutine

See PI8042_KEYBOARD_INITIALIZATION_ROUTINE

The KbFilter_InitializationRoutine is not needed if the I8042prt default initialization of a keyboard is sufficient.

I8042prt calls KbFilter_InitializationRoutine when it initializes the keyboard. Default keyboard initialization includes the following operations:

  • reset the keyboard
  • set the typematic rate and delay
  • set the light-emitting diodes (LED)

KbFilter_IsrHook

See PI8042_KEYBOARD_ISR. This callback is not needed if the default operation of I8042prt is sufficient.

The I8042prt keyboard ISR calls KbFilter_IsrHook after it validates the interrupt and reads the scan code.

KbFilter_IsrHook runs in kernel mode at the IRQL of the I8042prt keyboard.

KbFilter_ServiceCallback

See PSERVICE_CALLBACK_ROUTINE.

The ISR dispatch completion routine of the function driver calls KbFilter_ServiceCallback, which then calls the keyboard class driver's implementation of PSERVICE_CALLBACK_ROUTINE. A vendor can implement a filter service callback to modify the input data that is transferred from the device's input buffer to the class data queue. For example, the callback can delete, transform, or insert data.

Moufiltr sample

Moufiltr is designed to be used with Mouclass, the system class driver for mouse devices used with Windows 2000 and later versions, and I8042prt, the function driver for a PS/2-style mouse used with Windows 2000 and later. Moufiltr demonstrates how to filter I/O requests and add callback routines that modify the operation of Mouclass and I8042prt.

For more information about Moufiltr operation, see the following:

  • The ntddmou.h WDK header file.

  • The sample Moufiltr source code.

Moufiltr control codes

IOCTL_INTERNAL_I8042_HOOK_MOUSE

The IOCTL_INTERNAL_I8042_HOOK_MOUSE request adds an ISR callback routine to the I8042prt mouse ISR. The ISR callback is optional and is provided by an upper-level mouse filter driver.

I8042prt sends this request after it receives an IOCTL_INTERNAL_MOUSE_CONNECT request. I8042prt sends a synchronous IOCTL_INTERNAL_I8042_HOOK_MOUSE request to the top of the mouse device stack.

After Moufiltr receives the hook mouse request, it filters the request in the following way:

  • Saves the upper-level information passed to Moufiltr, which includes the context of an upper-level device object and a pointer to an ISR callback.
  • Replaces the upper-level information with its own.
  • Saves the context of I8042prt and pointers to callbacks that the Moufiltr ISR callbacks can use.
Devices
  • The ntddkbd.h WDK header file.

  • The sample Kbfiltr source code.

Kbfiltr IOCTLs

IOCTL_INTERNAL_I8042_HOOK_KEYBOARD

The IOCTL_INTERNAL_I8042_HOOK_KEYBOARD request does the following:

  • Adds an initialization callback routine to the I8042prt keyboard initialization routine.
  • Adds an ISR callback routine to the I8042prt keyboard ISR.

The initialization and ISR callbacks are optional and are provided by an upper-level filter driver for a PS/2-style keyboard device.

After I8042prt receives an IOCTL_INTERNAL_KEYBOARD_CONNECT request, it sends a synchronous IOCTL_INTERNAL_I8042_HOOK_KEYBOARD request to the top of the keyboard device stack.

After Kbfiltr receives the hook keyboard request, Kbfiltr filters the request in the following way:

  • Saves the upper-level information passed to Kbfiltr, which includes the context of an upper-level device object, a pointer to an initialization callback, and a pointer to an ISR callback.
  • Replaces the upper-level information with its own.
  • Saves the context of I8042prt and pointers to callbacks that the Kbfiltr ISR callback can use.

IOCTL_INTERNAL_KEYBOARD_CONNECT

The IOCTL_INTERNAL_KEYBOARD_CONNECT request connects the Kbdclass service to the keyboard device. Kbdclass sends this request down the keyboard device stack before it opens the keyboard device.

After Kbfiltr received the keyboard connect request, Kbfiltr filters the connect request in the following way:

  • Saves a copy of Kbdclass's CONNECT_DATA (Kbdclass) structure that is passed to the filter driver by Kbdclass.
  • Substitutes its own connect information for the class driver connect information.
  • Sends the IOCTL_INTERNAL_KEYBOARD_CONNECT request down the device stack.

If the request is not successful, Kbfiltr completes the request with an appropriate error status.

Kbfiltr provides a template for a filter service callback routine that can supplement the operation of KeyboardClassServiceCallback, the Kbdclass class service callback routine. The filter service callback can filter the input data that is transferred from the device input buffer to the class data queue.

IOCTL_INTERNAL_KEYBOARD_DISCONNECT

The IOCTL_INTERNAL_KEYBOARD_DISCONNECT request is completed with a status of STATUS_NOT_IMPLEMENTED. Note that a Plug and Play keyboard can be added or removed by the Plug and Play manager.

For all other device control requests, Kbfiltr skips the current IRP stack and sends the request down the device stack without further processing.

Callback routines implemented by Kbfiltr

KbFilter_InitializationRoutine

See PI8042_KEYBOARD_INITIALIZATION_ROUTINE

The KbFilter_InitializationRoutine is not needed if the I8042prt default initialization of a keyboard is sufficient.

I8042prt calls KbFilter_InitializationRoutine when it initializes the keyboard. Default keyboard initialization includes the following operations:

  • reset the keyboard
  • set the typematic rate and delay
  • set the light-emitting diodes (LED)

KbFilter_IsrHook

See PI8042_KEYBOARD_ISR. This callback is not needed if the default operation of I8042prt is sufficient.

The I8042prt keyboard ISR calls KbFilter_IsrHook after it validates the interrupt and reads the scan code.

KbFilter_IsrHook runs in kernel mode at the IRQL of the I8042prt keyboard.

KbFilter_ServiceCallback

See PSERVICE_CALLBACK_ROUTINE.

The ISR dispatch completion routine of the function driver calls KbFilter_ServiceCallback, which then calls the keyboard class driver's implementation of PSERVICE_CALLBACK_ROUTINE. A vendor can implement a filter service callback to modify the input data that is transferred from the device's input buffer to the class data queue. For example, the callback can delete, transform, or insert data.

Moufiltr sample

Moufiltr is designed to be used with Mouclass, the system class driver for mouse devices used with Windows 2000 and later versions, and I8042prt, the function driver for a PS/2-style mouse used with Windows 2000 and later. Moufiltr demonstrates how to filter I/O requests and add callback routines that modify the operation of Mouclass and I8042prt.

For more information about Moufiltr operation, see the following:

  • The ntddmou.h WDK header file.

  • The sample Moufiltr source code.

Moufiltr control codes

IOCTL_INTERNAL_I8042_HOOK_MOUSE

The IOCTL_INTERNAL_I8042_HOOK_MOUSE request adds an ISR callback routine to the I8042prt mouse ISR. The ISR callback is optional and is provided by an upper-level mouse filter driver.

I8042prt sends this request after it receives an IOCTL_INTERNAL_MOUSE_CONNECT request. I8042prt sends a synchronous IOCTL_INTERNAL_I8042_HOOK_MOUSE request to the top of the mouse device stack.

After Moufiltr receives the hook mouse request, it filters the request in the following way:

  • Saves the upper-level information passed to Moufiltr, which includes the context of an upper-level device object and a pointer to an ISR callback.
  • Replaces the upper-level information with its own.
  • Saves the context of I8042prt and pointers to callbacks that the Moufiltr ISR callbacks can use.

Moufiltr Callback Routines

IOCTL_INTERNAL_MOUSE_CONNECT

The IOCTL_INTERNAL_MOUSE_CONNECT request connects Mouclass service to a mouse device.

IOCTL_INTERNAL_MOUSE_DISCONNECT

The IOCTL_INTERNAL_MOUSE_DISCONNECT request is completed by Moufiltr with an error status of STATUS_NOT_IMPLEMENTED.

For all other requests, Moufiltr skips the current IRP stack and sends the request down the device stack without further processing.

Callback routines

MouFilter_IsrHook

See PI8042_MOUSE_ISR.

A MouFilter_IsrHook callback is not needed if the default operation of I8042prt is sufficient.

Drivers Boso Port Devices List

The I8042prt mouse ISR calls MouFilter_IsrHook after it validates the interrupt.

To reset a mouse, I8042prt goes through a sequence of operational substates, each one of which is identified by an MOUSE_RESET_SUBSTATE enumeration value. For more information about how I8042prt resets a mouse and the corresponding mouse reset substates, see the documentation of MOUSE_RESET_SUBSTATE in ntdd8042.h.

MouFilter_IsrHook runs in kernel mode at the IRQL of the I8042prt mouse ISR.

MouFilter_ServiceCallback

See PSERVICE_CALLBACK_ROUTINE

The ISR DPC of I8042prt calls MouFilter_ServiceCallback, which then calls MouseClassServiceCallback. A filter service callback can be configured to modify the input data that is transferred from the device's input buffer to the class data queue. For example, the callback can delete, transform, or insert data.





broken image