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

HAL OS layout and headers

Hardware Abstraction Layer
» HAL/OS layout and headers

The OS is linked to run at a particular base address. Pre-HAL OS’s were linked to run at <n>MB, that is on a MB alignment to allow efficient MMU section mapping. For simplicity, the HAL/OS layout can allow a fixed maximum size for the HAL, currently set at 64k. Then the OS base address will be <n>MB+64k. This allows a HAL of up to 64K to be placed at the bottom of a ROM below the OS, and the HAL/OS combination to still be section-mapped. A ROM should be portable to hardware variants merely by replacing the 64k HAL
block.

A more flexible system would only sacrifice MMU mapping efficiency. The HAL and OS could be placed in any desired way, provided that each is contiguous in physical memory.

OS image header

The OS starts with a header including a magic word – this aids probing and location of images. The OS header format is defined as:

Word 0: Magic word ("OSIm" - &6D49534F)
Word 1: Flags
            bit 0 => image supports compression
            bits 1-31 reserved
Word 2: Image size (bytes)
Word 3: Offset (bytes) from OS base to table of OS routine entry points
Word 4: Number of entries in table
If the 'supports compression' flag is set:
Word 5: Compressed image size (bytes)
Word 6: Offset (bytes) from OS base to decompression header
Word 7: Compression offset (bytes)

For details of how compressed ROMs operate, see the Compressed ROMs page.

HAL descriptor block

The HAL itself should have whatever header is required to start the system. For example on ARM7500 16→32 bit switch code is required, and on the 9500 parts a special ROM header and checksum must be present. A HAL descriptor block, instead of a header, can be placed somewhere in the HAL. A pointer to this block is passed by the HAL to the OS in the RISCOS_Start call:

Word 0: Flags
            bit 0 => uncachable workspace (32K) required
            bits 1-31 reserved
Word 1: Offset (bytes) from descriptor to start of HAL (will be <= 0)
Word 2: HAL size (bytes)
Word 3: Offset (bytes) from descriptor to table of HAL routine entry points
Word 4: Number of entries in table
Word 5: Size of HAL static workspace required (bytes)
Information source: Kernel.Docs.HAL.HAL_API in CVS
Unused source: Kernel.Docs.HAL.Entries in CVS
Revised on February 5, 2012 12:20:55 by Jeffrey Lee (213) (91.84.11.161)
Edit | Back in time (2 revisions) | See changes | History | Views: Print | Source | Linked from: Hardware Abstraction Layer, ROM image format

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
  • Export
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