PrintLogo

Creating a ROM Image with bvi




You can use bvi to create and edit image files. We are using this to create a poor man's PAL using old 2716 EPROMS, but there are certainly other uses. Start by setting the mode memmove. This will let you expand the file on the fly, something that is a bit rare with binary editors:

usr-1@wrk-1 o2 $ bvi ruk
00000000  01                                              .
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
:set memmove

I inserted 01. I want to fill up the ROM with that for now. The decimal repeat commands don't seem to work right with the version of bvi I'm using, but just hold down the . key, and you can fill up 2048 bytes pretty quickly:

000007B0  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
000007C0  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
000007D0  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
000007E0  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
000007F0  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
00000800  
:wq

Let's check out the size:

usr-1@wrk-1 o2 $ ls -l ruk
-rw-r--r--    1 usr-1   users        2048 Apr 29 04:08 ruk
usr-1@wrk-1 o2 $ 

Cool. Let's edit FF:

000000E0  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
000000F0  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 02 ................
00000100  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
:wq

Bvi also comes with bmore, which we can use to verify our file:

usr-1@wrk-1 o2 $ cat ruk | bmore
00000000  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
*
000000F0  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 02 ................
00000100  01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ................
*
usr-1@wrk-1 o2 $ 

Very nice. We can burn this image directly on to a 2716 EPROM.



This article comes from Coprolite:
http://coprolite.com/

The URL for this story is:
http://coprolite.com/art40.html

Copyright 1997-2006 Coprolite.com. Read our Terms of Use.