Quantcast
Channel: Thinking too much » VirtualBox
Viewing all articles
Browse latest Browse all 5

The QuadPawn programming environment on a DSO Quad

$
0
0

This post describes my brief experience with Petteri Aimonen‘s QuadPawn interpreter to run larger programs from the DSO Quad‘s 2MB USB drive. I’ve dabbled with compiling Pawn programs under both WinXP and FreeBSD/Wine.

Background

Back in January I received a DSO Quad portable oscilloscope., whose Flash storage has room for four separate APP(lications) of 32Kbyte each. The primary APP (in slot #1, and booted by default) is the manufacturer’s digital oscilloscope functionality. Additional APPs can be compiled and installed in one of the other 32K memory slots, but 32K is not really a lot of space. QuadPawn is a custom variant of PAWN, itself “…a simple, typeless, 32-bit extension language with a C-like syntax.” The small size of PAWN (and hence QuadPawn) allows the interpreter to reside inside one of the DSO Quad’s 32K APP slots, and then run programs stored in the DSO Quad’s  2MB USB drive storage.

Getting started

I first grabbed PAWN_002.HEX and installed it in the APP #4 slot of my DSO Quad (see steps here). Then, I launched QuadPawn by restarting the DSO Quad while holding down button #4. [Edit: 31jan13 -- Petteri has continued to work on QuadPawn, and his latest version is PAWN_006.HEX, available here.]

Petteri provides a number of demo QuadPawn programs as .amx files on this website. I successfully copied the  FreqResponse, voltemetr and calibration programs onto my DSO Quad’s 2MB USB drive of the DSO and ran them. (For some reason I needed to reboot QuadPawn to see the newly copied .amx files, as pressing “Refresh” inside the QuadPawn app did not initially work as expected.)

So far, Yay!

Installing the QuadPawn dev environment under WinXPsp3 / VirtualBox 4.1.8

Writing one’s own QuadPawn programs requires two development tools — the Quincy IDE (from the developers of Pawn) and Petteri’s customised Pawn compiler and build environment. My first experiment was to install the development environment under my Virtualbox-based WinXP host.

First, I  grabbed http://www.compuphase.com/pawn/pawn-4.0.4548.exe and launched the self-extracting .exe file. This installed “Program Files\Pawn\“ into my WinXP environment.

Second, I grabbed Petteri’s customised dev environment – from https://github.com/PetteriAimonen/QuadPawn/downloads I clicked on the “Download as zip” button, which pointed to https://github.com/PetteriAimonen/QuadPawn/zipball/master and downloaded “PetteriAimonen-QuadPawn-ver0.02-1-g8359ca3.zip”  [Edit 31jan13 -- The repository has been rearranged -- now you would go to https://github.com/PetteriAimonen/QuadPawn and click "Download repository as zip"]

Uzipped this file under “My Documents” to obtain “My Documents\PetteriAimonen-QuadPawn-ver0.02-1-g8359ca3\PetteriAimonen-QuadPawn-8359ca3“.

Referring to this path as <PAQP> from now on, I launched the IDE (“Program Files\Pawn\bin\quincy.exe“), selected Tools->Options (F2) and set the Compiler path to “<PAQP>\Compiler\bin“. This tells the Quincy IDE to utilise Petteri’s executables rather than the IDE’s own executables.

Building QuadPawn program under WinXPsp3 / VirtualBox 4.1.8

Petteri’s compiler takes programs stored in .pawn files and creates QuadPawn executables as .amx files. Both .pawn and .amx files default to being located under “<PAQP>\Programs“.

I compiled (press F7) his example Hello.pawn program into a Hello.amx file, then copied Hello.amx to the DSO Quad’s 2MB USB drive (note, not the DSO Quad’s bootloader USB drive). My DSO Quad was already running QuadPawn, so I simply pressed “Refresh” and QuadPawn saw the new Hello.amx application. Selected it, and ran it successfully.

As a test I modified both the Hello.pawn and voltmetr.pawn programs by changing some text printed to the screens, recompiled and confirmed the resulting .amx files  reflected those changes.

Some notes:

  • QuadPawn’s .amx files are limited to 8.3 file name formats (msdosfs limit)
  • The program names that appear on the DSO Quad’s screen are derived either from the .amx file name, or from the ‘new const program_name{}=‘ parameter specified in the .pawn file prior to ‘#include <metadata>
  • The Quincy IDE’s “Run” or “Transfer” options are unavailable since the IDE doesn’t know about the DSO Quad as such

The QuadPawn WinXP dev environment under Wine 1.3.27 / PC-BSD 8.2

To remove a dependency on running WinXP inside VirtualBox, I also tried running dev environment under Wine 1.3.27 on my PC-BSD 8.2 desktop. Installed pawn-4.0.4548.exe as with WinXP and unzipped PetteriAimonen-QuadPawn-ver0.02-1-g8359ca3.zip under /home/gja (which maps to “My Documents” under my Wine installation).

The Quincy IDE installed okay, and after I configured the Compile path to point to my /home/gja/... version of Petteri’s PAWN compiler, I was able to edit, compile and execute Petteri’s “Hello World” program (even with “Overlay code generation” enabled under Tools->Options).

Since the resulting .amx files were already on my local machine (gjadesktop) it was a simple task to ‘cp’ the .amx file to /media/MINIDSO (where the DSO Quad’s USB drive is mounted when plugged into my PCBSD desktop), followed by ‘sync’ to ensure the .amx file is fully written.

[gja@gjadesktop]/home/gja(103)% cp PetteriAimonen-QuadPawn-ver0.02-1-g8359ca3/PetteriAimonen-QuadPawn-8359ca3/Programs/hello.amx /media/MINIDSO/ && sync

Curiously, the Quincy GUI’s lower window area (where build result output, log output, search  output are visible) seems to refuse to switch to Log messages or Search results windows. (cf. installing Pawn under ‘real’ Windows XP under VirtualBox, where the lower windows worked fine.)

The GUI also seems to struggle when I’ve opened a number of files, then close some of them — the tabs remain visible (although non-functional) until I minimise then re-open the GUI window.

Provided I’m careful with the GUI’s poor interaction with Wine, I can definitely compile QuadPawn programs for the DSO Quad using PC-BSD / Wine.



Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images