Comtrol eCos User Manual

Page 773

Advertising
background image

Writing New Devices - target

have some limitations: there is no support for nested interrupts, interrupt priorities, or a separate interrupt stack.
Supporting those might be appropriate when targetting a simulator that attempts to model real hardware accurately,
but not for the simple emulation provided by the synthetic target.

Of course the actual implementation of the ISR and DSR functions will be rather different for a synthetic target
device driver. For real hardware the device driver will interact with the device by reading and writing device regis-
ters, managing DMA engines, and the like. A synthetic target driver will instead call

synth_auxiliary_xchgmsg

to perform the I/O operations.

There is one other significant difference between interrupt handling on the synthetic target and on real hardware.
Usually the eCos code will know which interrupt vectors are used for which devices. That information is fixed when
the target hardware is designed. With the synthetic target interrupt vectors are assigned to devices on the host side,
either via the target definition file or dynamically when the device is instantiated. Therefore the initialization code
for a target-side device driver will need to request interrupt vector information from the host-side, via a message
exchange. Such interrupt vectors will be in the range 1 to 31 inclusive, with interrupt 0 being reserved for the
real-time clock.

669

Advertising