RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Page "Part 8/versions/new" does not exist. Please create it now, or hit the "back" button in your browser.

HAL Device overview

Hardware Abstraction Layer
» HAL Device API
» 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:

XXXDevice->Activate(XXXDevice);

A simple call to a activate a device from assembler might look like:

LDR    R0, XXXDevice
MOV    LR, PC
LDR    PC, [R0, #deventry_activate]      ; R0-R3,R12 corrupted

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.

Information source: Kernel.Docs.HAL.NewAPI in CVS
Revised on February 3, 2010 20:10:06 by W P Blatchley (147)? (127.0.0.1)
Edit | Back in time (1 revision) | See changes | History | Views: Print | Source | Linked from: Hardware Abstraction Layer, HAL Device API

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys