Forth Lesson 22: Difference between revisions

From OLPC
Jump to navigation Jump to search
(First cut)
 
Line 18: Line 18:


ok hex
ok hex
ok d4019000 1000 mmap constant gpio
ok d4019000 1000 mmap constant gpio-base
ok gpio 154 + l@ .
ok gpio-base 154 + l@ .

For pinmux (MFPR) access:

ok d401e000 1000 mmap constant mfpr-base
ok mfpr-base 2b8 + l@ .

Revision as of 19:18, 20 May 2011

Mitch Bradley's Forth and
Open Firmware Lessons:

Using Forth Under Linux

You can run Forth under Linux and use it to inspect I/O devices.

On XO-1.75

Get http://dev.laptop.org/~wmb/armforth, http://dev.laptop.org/~wmb/armtools.dic, and http://dev.laptop.org/~wmb/mmap.fth . Copy them into your home directory on an XO-1.75 .

Then do:

 $ sudo -s
 # ./armforth armtools.dic mmap.fth -
 ok

Now you can use mmap to get access to I/O devices.

 ok hex
 ok d4019000 1000 mmap  constant gpio-base
 ok gpio-base 154 + l@ .

For pinmux (MFPR) access:

 ok d401e000 1000 mmap  constant mfpr-base
 ok mfpr-base 2b8 + l@ .