Newbie question to i/o

Thomas Doerfler Thomas.Doerfler at
Mon Feb 25 08:01:36 UTC 2002


> the systems i know allocated a piece of static storage to all major
> (device) and minor (unit) instances of a device driver. if an interrupt
> was connected to the device the systems interrupthandler setup a pointer
> for the static data area of that device. currently i've no idea how to
> setup a static data area for every minor device and have a pointer
> defined to this area when the interrupt service routine is entered.
> can anybody please explain the mechanisms behind the screnn to me and
> all other who don't know? thank you very much.

In RTEMS, it is the responsibility of the device driver to 
allocate any resources needed for device operation. So if you 
want to implement the static storage area, the device driver 
must allocate it (using a "region" or "malloc" call), 
initialize it with proper data (whatever is needed there) and 
store its address for further use. An alternative aproach 
would be to define an array of data structures/buffers in the 
device driver source code, with one element for each minor 
device number used.

Then, in the interrupt handler, you must determine, for which 
minor device you are working, you may use the vector number of 
the interrupt or some device specific information to 
distinguish that. Then you can use the proper pointer to the 
minor device data area.

So in short, you have to "emulate" the mechanism you mentioned 
on your own.

	Thomas Doerfler.

> --
> Schöne Grüße aus Reutlingen
> Wolfram Wadepohl
> Entwicklung
> --
> Transport- und Lagersysteme
> Dieselstraße 6
> D-72770 Reutlingen - Betzingen
> Tel.  +49 (0)71 21/5 14-2 89
> Fax   +49 (0)71 21/5 14-2 99
> eMail W.Wadepohl at
> --

IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at
PGP public key available at: http://www.imd-

More information about the users mailing list