h6. [[Hardware Abstraction Layer]] h6(. » [[HAL Device API]] h6((. » Overview The HAL introduces the new concept of a "device". A device is a logical representation of a component of hardware. Each active device is uniquely identified by a constant pointer to a device descriptor. The descriptor is a structure which contains information about the device and a series of entry points to perform usually simple operations on the device. Devices can be provided by the Bootloader, or by RISC OS modules. Devices provided outside the Bootloader are, in principle, hot swappable, although it is up to device drivers using it whether they can support this. Throughout this document, device descriptors are described in terms of C, although the scheme maps naturally to assembler or C++. All device calls use the base ATPCS calling standard (R0-R3 arguments/return values, R4-R11 preserved, R12 corrupted), to permit straightforward use from C or assembler. From C: <pre> XXXDevice->Activate(XXXDevice); </pre> A simple call to a activate a device from assembler might look like: <pre> LDR R0, XXXDevice MOV LR, PC LDR PC, [R0, #deventry_activate] ; R0-R3,R12 corrupted </pre> If an assembler device driver module is using a lot of device calls, it might be preferable to move the workspace pointer from the traditional R12 to R11. h6. Information source: Kernel.Docs.HAL.NewAPI in CVS