Uzebox and Softgun Emulator Tutorial

The Uzebox now have a fully functional emulator! Download and discuss it here.
Post Reply
braddock
Posts: 26
Joined: Fri Jul 31, 2009 12:09 pm

Uzebox and Softgun Emulator Tutorial

Post by braddock »

Just delving into Uzebox. Here are my notes on how to install both the Uzebox and the Softgun emulators under Linux, and a few words of comparison.

I hope it shortens the learning curves of others...

Uzebox AVR Emulation - 7/31/09

There are two Uzebox emulators for Linux (that I know of).

-The Uzebox project has it's own emulator in the main
UzeboxTrunk source tree. The emulator is simple, easy to use,
and runs under both Linux and Windows. It does not have SD Card simulation (AFAIK).

-The large SoftGun general ARM and AVR emulation system also
has Uzebox emulation capability. It has SD Card simulation
and much much more, but is harder to setup and use, uses
sluggish VNC for graphics, and is (perhaps) less stable.

-Point of comparison: The Uzebox emulator is 2k lines of code,
while the SoftGun system is 192k lines of code!

UZEBOX EMULATOR

First, we try the Uzebox project's emulator (under Linux)

1) Download the Uzebox "kernel.zip" source from
http://code.google.com/p/uzebox/downloads/list
(I got the May 21, 2009 version)

2) unzip kernel.zip
Creates the UzeboxTrunk source hierarchy, which contains not
just the Uzebox kernel source, but also the emulator, demo
software, schematics, and sound data.

4) cd UzeboxTrunk/emulator

5) Install SDL library development package (Ubuntu Linux 9.04)
sudo apt-get install libsdl1.2-dev

6) 64-bit FIX: if you are running under 64-bit Linux, you MUST
make a fix or you will get a segmentation fault when you run.

On avr8.cpp line 60:
typedef unsigned long u32;

change to:
typedef unsigned int u32;

7) Compile the emulator
g++ -O3 -I/usr/include/SDL -lSDL avr8.cpp -o uzem

8) Run the emulator - demo "hex" files are in UzeboxTrunk/demo
./uzem ../demos/megatris.hex

9) Hit F1 to print keybindings and usage to stdout.

This emulator seems to work very well, and unless you need
more sophisticated hardware emulation (SD Card) it seems to be
the way to go.

SOFTGUN EMULATOR

Now, we try the SoftGun emulation system. This is a huge
complex system with a lot of capability.

I had difficulty with SoftGun's command line syntax and lack
of Uzebox-specific documentation, so the following
notes were hard-won.

1) Download (I got version 0.17) from:

http://softgun.sourceforge.net/
http://sourceforge.net/projects/softgun/

2) tar xvzf softgun-0.17.tgz

3) cd softgun-0.17/

4) make

5) sudo make install

6) mkdir ~/.softgun/

7) cp configs/uzebox.sg ~/.softgun/

8) mkdir ~/.softgun/data

9) EDIT ~/.softgun/uzebox.sg line 3 imagedir to point to your
home directory:
imagedir: /home/braddock/.softgun/data

10) softgun doesn't provide graphics - you need to use a VNC
client to connect to your machine. It is a bit of a pain.
Install:
sudo apt-get install xtightvncviewer

11) Get a .hex file from UzeboxTrunk/demos for testing. We'll use megatris.hex

12) softgun uzebox -l megatris.hex

13) Connect to the emulated device screen:
xtightvncviewer localhost:1

14) I haven't yet figured out the keybindings - not sure they
work. Some hints at:
http://softgun.sourceforge.net/uzebox.shtml

What I do to ease the pain of contantly re-launching VNC
whenever the emulator is started is to launch the following
loop in another terminal:

while true; do xtightvncviewer localhost:1; sleep 5; done

Good luck!
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox and Softgun Emulator Tutorial

Post by uze6666 »

Thanks for posting, that's some serious stuff! I'll add it to the WIKI since it's easier to find there.

-Uze
braddock
Posts: 26
Joined: Fri Jul 31, 2009 12:09 pm

Re: Uzebox and Softgun Emulator Tutorial

Post by braddock »

I see a thread here which has a download for the uzem emulator - is that newer than the version in the uzebox kernel tree?

Also, I just took a peek at the dev uzebox-beta4, and there appears to be some new SD code in the emulator. I only looked at the release from May before.

Does the new dev beta4 kernel tree version of uzem have working sd support, or is that still a work in progress?

Thanks,
Braddock Gaskill
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox and Softgun Emulator Tutorial

Post by uze6666 »

Yes SD support has been added recently (plus other goodies) here: http://code.google.com/p/uzebox/source/ ... e%3Dclosed. It should work fine, but it's still WIP and you need to dump the content of the SD card with a tool to use it (dump.c). I believe Eric (Pragma) was to add the possibility to simply specify a folder as the SD card root.

-Uze
Post Reply