Showing changes from revision #2 to #3:
Added | Removed | Changed
This section details the intricacies of the early hardware used by RISC OS. A number of different models of RISC OS computers are classified as Archimedes. Each Archimedes model of computer had an ARM 2 or ARM 3 as the CPU. Several different chips supported the ARM processor. These chips were designed by Acorn Computers Ltd, and were proprietary chips.
RISC OS 2 and RISC OS 3.11 were used with this class of hardware. The information is no longer valid or useful with RISC OS 5, but is available here for completeness.
The list of chips used within the original Acorn Archimedes range of computers is as follows:
The ARM processor ships used with the Archimedes range of computers were the ARM 2 and ARM 3 which are based on the ARM v2(as) architecture. Newer versions of processors introduced new processor modes, and other important features.
An important limitation of the ARM v2(as) architecture is it’s 26-bit address. This results in only 64 MB of addressable memory (2^26^ = 64 MB). The address bus was 26-bits in size because R15 used to store the address, was also used to store the status register.
The ARM range of processors uses 32-bit words. Each instruction fits into a single word. It also has a 32-bit data bus so that complete instructions can be fetched in a single step.
ARM 2 and ARM 3 processors can operate in four different modes. They are as follows:
Mode | Use for mode |
---|---|
User Mode | Mode normally used by applications |
Supervisor Mode (SVC) | Mainly used by SWI instruction |
Interrupt Mode (IRQ) | Used to handle peripherals when they issue interrupt requests |
Fast Interrupt Mode (FIQ) | Used to handle peripherals that issue fast interrupt requests |
Supervisor Mode, Interrupt Mode and Fast Interrupt Mode are all privileged modes that allow extra control over the computer.
If the ARM processor is forced to change mode, you must follow this with a no-op command. This is to avoid contention, by allowing the processor time to complete writing to the registers, before switching to the other mode.
Twenty seven 32-bit registers are available on the ARM 2 and ARM 3 processor. Of those, only 16 are available within RISC OS. Some registers are shared across different modes, while others are not. The table below shows this:
User Mode | SVC Mode | IRQ Mode | FIQ Mode |
---|---|---|---|
R0 | |||
R1 | |||
R2 | |||
R3 | |||
R4 | |||
R5 | |||
R6 | |||
R7 | |||
R8 | R8_fiq | ||
R9 | R9_fiq | ||
R10 | R10_fiq | ||
R11 | R11_fiq | ||
R12 | R12_fiq | ||
R13 | R13_svc | R13_irq | R13_fiq |
R14 | R14_svc | R14_irq | R14_fiq |
R15 (PC/PSR) |
Two registers have special functions. They are:
In addition, RISC OS has a convention of using R13 (R13_svc and R13_irq) as private stack pointers for each Processor Mode.
All other registers are deemed as general purpose.
As mentioned above, R15 is used as the Program Counter (PC_) and the Processor Status Register (_PSR). 24-bits is used for the PC, and 8-bits for the PSR.
The contents of R15 is as follows:
Bit | Contents |
---|---|
0 – 1 | Processor Mode Flag1 |
00 = User Mode | |
01 = FIQ Mode | |
10 = IRQ Mode | |
11 = SVC Mode | |
2 – 25 | Program Counter (PC) |
26 | FIQ disable flag (set for disable) |
27 | IRQ disable flag (set for disable) |
28 | Conditional Flag – OverFlow (V) |
29 | Conditional Flag – Carry (C) |
30 | Conditional Flag – Zero (Z) |
31 | Conditional Flag – Negative (N) |
1 The Processor Mode Flags are not stored in R15, but simply appended to the Program Counter when fetching instructions, thus forming a 26-bit address. The Program Counter must always be word-aligned, and the bottom two bits of the address must always be zero.
R14 (R14_svc, R14_R14_irq and R14_fiq) are used as subroutine link registers. R14 receives a copy of the PC and PSR when a Branch and Link instruction is executed. R14_svc, R14_R14_irq and R14_fiq are used to store the values of R15 when any of the following events occur:
RISC OS has a convention of using R13 (R13_svc and R13_irq) as private stack pointers for each Processor Mode.
Any routines written that are called from User Mode, but run in SVC or IRQ mode will need to use some of the shared register R0 to R12. Therefore, you must preserve the registers on a stack before you later the registers, and subsequently restore them before returning from your routine.
SVC and IRQ Mode stacks must b full descending stacks and ending at a megabyte boundary. System stack locations should not be changed, however, if they are changed, please note that they are reset to their default locations when errors are generated, and when applications are started.
Routine in FIQ mode require a faster response, so there are seven private registers in FIQ Mode. These should be enough registers to avoid the overhead of having to save them to a stack and using the shared registers. However, if you need to do so, you should use R13_fiq as the stack pointer.
You can use R13 and/or R13_fiq as conventional registers is they are not used as stack pointers.
The VIDC chip controls the computer’s video and sound. The data is read from RAM into buffers and then processed and converted into the necessary analogue signals to drive the video output displays and sound system. The VIDC can handle many different display and sound formats.
There are three buffers for input data. They are:
Each buffer is of the type FIFO (first-in, first-out). Data is requested in blocks of four 32-bit words at a time. The MEMC chip controls the addressing and fetching of the data under DMA (Direct Memory Access) control.
Data from the video buffer is converted and processed. The are as follows:
The registers that control the video system provide a wide range of options. They are as follows:
1 Different versions of the VIDC chip can handle different clock speeds. The original version was 24 MHz, whereas the newer versions could be 25.175 or 36 MHz.
Up to eight separate channels of mono sounds is provided by the VIDC chip. Each channel can be assigned a stereo position (between left to right) by the use of eight stereo image registers.
Data from the buffer is converted and processed. The following steps taken:
The cursor data controls a pointer than can be up to 32 pixels wide, and an unlimited number of rasters high, although RISC OS restricts this to a maximum of 32 rasters in height. The pixels can be transparent or can be any of three of the 4,096 possible colours.
The cursor may be positioned anywhere on the screen (within the border).
The IOC chip manages the peripherals and interrupts throughout the computer. It controls a data bus that peripherals are connected to. In addition, it also provides numerous internal functions that are accessed without any wait states, and a flexible control port.
The IOC communicates to the rest of the system via the high speed system bus. It is able to handle different speeds of data transfers via the Input/Output or expansion bus automatically.
The specification of the IOC chip is as follows:
RISC OS views the IOC and peripherals as memory-mapped devices. Most peripherals are byte-wide, and word aligned. A single memory instruction can be used to perform any of the following:
A wide range of peripherals are supported by the IOC chip including those that require an interruptible I/O cycle.
The following functions are provided by the IOC chip:
The MEMC chip is used as the interface between the ARM, VIDC and IOC and memory. A single clock input provides all the timing signals by the ARM chip set.
It provides the control signals needed by memory of different speed. The specifications are as follows:
The MEMC chip maps the physical memory into a 16 MB slot, with the base address at 32 MB. RISC OS does not address this slot directly; instead it addresses another 32 MB logical slot within the 64 MB logical address space.
Each page of the slot that RISC OS addresses can be:
RISC OS can only read and write from pages that have one-to-one mappings. One-to-many mappings is used to hide pages of applications away when several applications are sharing the same address within the window environment. These addresses start from &8000 upwards, although of course, the pages are not held at &8000.
The physical memory is divided into physical pages. The 32 MB of logical space is divided into logical pages of the same size. The logical page is mapped to the physical page, and the MEMC keeps track of this.
The MEMC chip has 128 pages to use for its memory mapping. Each page is used to translate a logical address to a physical address. This is achieved by using a content-addressable memory (CAM). Most Archimedes machines use the full 128 pages, but some like the Archimedes 305 only uses 64 pages.
If the MEMC chip does use 128 pages, or any constant number, then:
The maximum amount of memory that a single MEMC chip can access is 4MB. If more memory is required, more MEMC chips must be added (in a master > slave scenario).
The table below provides an example of a ‘typical’ Archimedes computer and it’s page sizes. The values are only provided for guidance, and must not be relied upon across the whole Archimedes range of computers.
Physical RAM size | Page size | No. of Logical pages |
---|---|---|
0.5 MB | 8 kb | 4 K |
1 MB | 8 kb | 4 K |
2 MB | 16 kb | 2 K |
4 MB | 32 kb | 1 K |
8 MB | 32 kb | 1 K |
16 MB | 32 kb | 1 K |
To read the computer’s page size, you may use the OS_ReadMemMapInfo SWI.
RISC OS programs a minimum of 128 pages, even though it may not use them all. The reasons for this are:
There are three different protection modes are available to the MEMC chip:
Each page of memory is set at one of three different protection levels:
The protection level in conjunction with the protection mode, specifies whether read and/or write access to a page of memory is allowed. This is determined as follows:
Protection Level | ||||
---|---|---|---|---|
Mode | 0 | 1 | 2 | Information |
Supervisor | R/W | R/W | R/W | This is the most privileged mode. The MEMC is in this mode whenever the ARM chip is in one of its privileged modes. |
Operating System | R/W | R/W | R | The MEMC chip enters this mode by setting a bit in the MEMC’s control register (which can only be changed if the ARM is in privileged mode) |
User | R/W | R | None | This is the least privileged mode. RISC OS allows it read/write access only to unprotected pages in the logically mapped RAM, and read access to the ROM space |
Any attempt to access protected memory from an insufficient protection mode, results in the MEMC trapping the exception and sending an abort signal to the ARM processor.
The table below show the memory map of a RISC OS Archimedes computer.
IMAGE GOES HERE (UPDATED WIKI REQUIRED)
The MEMC chip also provides three programmable address generators to support Direct Memory Access (DMA). They are used for: