[OpenBIOS] fcode rom loading

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue Jun 28 15:14:00 CEST 2011

On 27/06/11 18:24, Bob Breuer wrote:

> I'm trying to get the sparc32 OpenBIOS to load an fcode rom, but it's
> not working.  After byte-load, it reports out of memory.
> Here's the steps I'm using to setup a simple rom which just sets the
> device name to "QEMU,test", and then trying to run it:
> fd000000 1000 l!
> 00000020 1004 l!
> 12095145 1008 l!
> 4d552c74 100c l!
> 65737401 1010 l!
> 1412046e 1014 l!
> 616d6501 1018 l!
> 10000000 101c l!
> cd /iommu/sbus
> " /iommu/sbus" select-dev
> new-device
> 1000 1 byte-load
> Here, OpenBIOS will report out of memory.

Hmmm that's interesting - I'm not sure that anyone has played with Fcode 
on SPARC32 before (goes and looks...).

Looks as if there isn't enough memory within Forth to initialise the 
Fcode tables on SPARC32:

0 > debug alloc-fcode-table
Stepper keys: <space>/<enter> Up Down Trace Rstack Forth
0 > alloc-fcode-table
: alloc-fcode-table  ( Empty )
ffd29320: (lit)  ( 4096 )
ffd29328: cells  ( 10258 )
ffd2932c: alloc-mem  out of memory.
0 >

Wow - 0x10258 is 66Kbytes which is more than enough to saturate the 
Forth memory. You may be able to get things further by increasing 
MEMORY_SIZE in arch/sparc32/openbios.c, but you'll probably hit the 2M 
limit for the ELF image size before you get there :(

Does anyone else have a better idea as to how we could better allocate 
the memory or reduce the memory requirement for the Fcode table? Could 
we allocate a region of memory using the OFMEM API rather than internal 
Forth memory for instance?



Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs

More information about the OpenBIOS mailing list