How to write a keyboard driver?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to write a keyboard driver?
# 1  
Old 01-13-2009
How to write a keyboard driver?

How to write a keyboard driver with interrupt driven? the platform is ARM and the interface is SRAMC with I/O mapped. What should my handler and read fucntions contains? and I want to know how to map the memory by using the ioremap() function? when exactly we have to use mmap()can you please help me out with some kinda psuedo code.
warm regards,
Ravi Kulkarni
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Debian

Debian Etch - install us-keyboard driver

Hi, i'm using a debian-4.0r1 on an old subnet machine. I have to extend it with an other keyboard . What i have is a DVD of etch 4.0r7. How can i install and load the keyboard-driver for the us-keyboard? Can anybody please give me a hint how to do that? Thanks in advance (0 Replies)
Discussion started by: IMPe
0 Replies

2. Ubuntu

Kernel panics : trying to write / read on tiny tty driver

I'm a beginner to the Linux programming and trying my hands on some device driver examples while practising. The below code (a trimmed down version of tiny_tty.c from ldd3 book) loads perfectly using insmod and I'm able to see it in /proc/tty/drivers , /proc/modules and device nodes are getting... (1 Reply)
Discussion started by: diwsdiwa
1 Replies

3. UNIX for Dummies Questions & Answers

Problem getting vertical bar with British keyboard layout on US (physical) keyboard

Hi, I've got a bit of a ridiculous problem and wasn't sure where to post it. I need to use the vertical bar for piping in Bash but, as per the title, am using a UK layout on a US (physical) keyboard which doesn't have a key for it in the place I'd expect. I've tried using xbindkeys and Unicode... (7 Replies)
Discussion started by: crunchgargoyle
7 Replies

4. Hardware

Difference between platform driver,codec driver and Machine driver

In general terms what are the differences platform driver,codec driver and Machine driver? (1 Reply)
Discussion started by: rupeshkp728
1 Replies

5. Programming

Access keyboard driver

(USING FEDORA 16) I am using following command: cat `pwd`/pci-0000:00:1d.0-usb-0:1.3:1.0-event-kbd to access the keyboard driver to make a key logger ,but what i am getting is just some hash code ,please help me decrypt it. Thanks. (1 Reply)
Discussion started by: jayeshsharma52
1 Replies

6. UNIX for Advanced & Expert Users

Questions about the Linux console keyboard driver / translation tables

Hi there, I am trying to understand the logic of the Linux keyboard driver, I am not sure if this is the right place to ask, but I don't know where else I could. Btw. I am talking about an unicode console here. 1.) The Linux kernel (currently) can take 256 translation tables (keymaps),... (2 Replies)
Discussion started by: Bill Cosby
2 Replies

7. Solaris

SUNWglmr -- rasctrl environment monitoring driver for i2c or SCSI device driver ?

I've been researching minimizeing Solaris 8 and found that on the web page http://www.sun.com/bigadmin/content/packagelist/s8u7PkgList/p2.html the package SUNWglmr is listed as "rasctrl environment monitoring driver for i2c, (Root) (32-bit)" while in the document "Solaris 8 minimize-updt1.pdf"... (1 Reply)
Discussion started by: roygoodwin
1 Replies
Login or Register to Ask a Question
VKBD(4) 						   BSD Kernel Interfaces Manual 						   VKBD(4)

NAME
vkbd -- the virtual AT keyboard interface SYNOPSIS
device vkbd DESCRIPTION
The vkbd interface is a software loopback mechanism that can be loosely described as the virtual AT keyboard analog of the pty(4), that is, vkbd does for virtual AT keyboards what the pty(4) driver does for terminals. The vkbd driver, like the pty(4) driver, provides two interfaces: a keyboard interface like the usual facility it is simulating (a virtual AT keyboard in the case of vkbd, or a terminal for pty(4)), and a character-special device ``control'' interface. The virtual AT keyboards are named vkbd0, vkbd1, etc., one for each control device that has been opened. The vkbd interface permits opens on the special control device /dev/vkbdctl. When this device is opened, vkbd will return a handle for the lowest unused vkbdctl device (use devname(3) to determine which). Each virtual AT keyboard supports the usual keyboard interface ioctl(2)s, and thus can be used with kbdcontrol(1) like any other keyboard. The control device supports exactly the same ioctl(2)s as the virtual AT keyboard device. Writing AT scan codes to the control device gener- ates an input on the virtual AT keyboard, as if the (non-existent) hardware had just received it. The virtual AT keyboard control device, normally /dev/vkbdctl<N>, is exclusive-open (it cannot be opened if it is already open) and is restricted to the super-user. A read(2) call will return the virtual AT keyboard status structure (defined in <dev/vkbd/vkbd_var.h>) if one is available; if not, it will either block until one is or return EWOULDBLOCK, depending on whether non-blocking I/O has been enabled. A write(2) call passes AT scan codes to be ``received'' from the virtual AT keyboard. Each AT scan code must be passed as unsigned int. Although AT scan codes must be passes as unsigned ints, the size of the buffer passed to write(2) still should be in bytes, i.e., static unsigned int codes[] = { /* Make Break */ 0x1e, 0x9e }; int main(void) { int fd, len; fd = open("/dev/vkbdctl0", O_RDWR); if (fd < 0) err(1, "open"); /* Note sizeof(codes) - not 2! */ len = write(fd, codes, sizeof(codes)); if (len < 0) err(1, "write"); close(fd); return (0); } Write will block if there is not enough space in the input queue. The control device also supports select(2) for read and write. On the last close of the control device, the virtual AT keyboard is removed. All queued scan codes are thrown away. SEE ALSO
kbdcontrol(1), atkbdc(4), psm(4), syscons(4) CAVEATS
The vkbd interface is a software loopback mechanism, and, thus ddb(4) will not work with it. Current implementation of the syscons(4) driver can accept input from only one keyboard, even if it is virtual. Thus it is not possible to have both wired and virtual keyboard to be active at the same time. It is, however, in principal possible to obtain AT scan codes from the different sources and write them into the same vir- tual keyboard. The virtual keyboard state synchronization is the user's responsibility. HISTORY
The vkbd module was implemented in FreeBSD 6.0. AUTHORS
Maksim Yevmenkin <m_evmenkin@yahoo.com> BSD
August 12, 2004 BSD