XO 4 Hardware peek and poke

From OLPC
Revision as of 04:28, 18 July 2013 by Wad (talk | contribs) (First save, not yet finished)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Remember the BASIC peek() and poke() commands ? Hardware debugging frequently needs such an interface, and one is built into the XO-4 laptop.

Introduction

While peek() and poke() exposed the raw machine, the rest of BASIC is best forgotten. The forth language provides an ideal low-overhead interpreter for hardware debugging, and much of the XO hardware debugging involved working in the XO laptop's native Open Firmware over a serial console. This page discusses a method for playing around with the bare metal on the XO-4 laptop while running Linux.

While this discussion is only correct for the XO-4 laptop, most of it applies verbatim to the XO-1.75 laptop and with some modifications to XO-1.5

sdkit

On OLPC OS builds, a Forth interpreter (sdkit) capable of accessing the hardware is available in /runin/sdkit-arm. It can be started from a Terminal:

$ su
# cd /runin/sdkit-arm
# RUNIN_PATH=/runin ./sdkit.sh
ok 

Much more information about using sdkit is available in Forth_Lesson_22.

XO-4 HDMI Registers

In order to access hardware registers such as the HDMI controller, you first need to map a range of the physical address space into the virtual address space used within sdkit: