Charm may be installed on the Raspberry Pi and any member of the RISC PC family including the ARMini and the RISC PC emulator (RPCEmu), and works with RISC OS 2 through 5. In case you have less than 5MB of free memory you will need to edit the !Charm !Boot file to reduce the memory allocated by wimpslot -next 5000K (500K is sufficient for most things except multiple large file edits)
If Charm is to be run on a RISC OS installation emulated under Windows or Linux, version 0.8.11 of RPCEmu can be installed from:
In my experience of testing with the emulator, the dynamic recompiler version is considerably faster and now as stable as the standard version, and I would recommend using it.
In order to unpack the Charm zip download under RISC-OS you will need a copy of !SparkFS. If you do not already have this, a free self extracting version (splug.bas) can be obtained from:
In order to install this, copy it to the root of the RISC OS hard drive, set its file type to Basic and double click on it. Once this has been installed, you may optionally also download and use the following extract only version of !SparkFS:
Size : 341.36 Kb
Type : zip
Again, copy this to the root of the RISC OS hard drive. change its RISC OS file type to Zip or Archive using the file menu and extract it using the previously installed !SparkFS application. Please note simply unzipping using Windows or Linux into the HostFS directory will lose all RISC OS file type associations and so the application will not run correctly.
Charm is supplied under the conditions of the GNP GPLv3 license:
Please do not remove the GPL headers from the supplied source files, and add your name and contact details if modifying them. Refer to the license a copy of which is also included under the charm directory in the download for further information.
Download the following zip archive (set its RISC OS file type to Zip (a91) or Archive (ddc) if zip is not recognised) and unpack the charm directory it contains into the root directory (or directory of your choice) of the RISC-OS hard drive (HostFS, SDFS, ADFS etc) using either the !SparkFS application.If you already have user projects in $.charm.user be sure to save these before replacing your old installation and to copy them back after. You will also need to recompile and link against the new libraries, and may need to make source code modifications to accommodate any API and object file format changes.
Size : 1810.477 Kb
Type : zip
Further information about the author is available from: http://www.qu-bit.co.uk
Platforms based on ARM chips that implement Vector Floating Point version 2 such as the Raspberry Pi can re-build the Charm distribution to obtain an order of magnitude improvement in floating point performance at the cost of a loss of precision from the default floating point emulator extended precision IEEE-754 Floating Point Arithmetic standard (approximately 19 decimal digits) to double precision (approximately 15 decimal digits) :-
- Select Target VFP from the !Charm shell menu.
- Drag the lib and tools folders (in that order) on to the shell icon to re-build the tools.
- Execute the following obey file (set type to Obey) to relink the Charm tools for VFP support :
Size : 0.561 Kb
Type : unknown
- Drag the charm folder on to the Charm shell to completely re-build Charm.
Please note that if your platform does not contain the necessary VFP coprocessor hardware or software you can expect undefined instruction traps when trying to execute programs that have been built with the Target VFP option! Furthermore because the VFP and FPE use disjoint register and instruction sets, all modules that are linked to create a program must have been with the same VFP setting.
The latest RISCOS distribution for the Raspberry Pi can be downloaded from here and instructions on how to install it from here. This includes a Charm release, which may not necessarily be the latest available from this website, however fortunately upgrading to the latest release is a relatively simple process.
The files for each Charm project are normally housed under a suitably named project directory e.g. edit for the Charm editor.
Charm uses the following disc sub-directories within a project directory :-
- src Compiler source files
- arm Assembler source files
- obj Compiler or assembler object files
In the above diagram map is an optional text file containing program linkage information and program is either a RISC OS application or module file. The other boxes represent project sub-directories.
Charm source code files are held in the src directory. These are read by the compiler and compiled into assembler source files which may be written into the arm directory.
Assembly source code files are held in the arm directory. These are read by the assembler and assembled into object files which are written into the obj directory.
Object files are held in the obj directory. These are read by the linker and linked into programs.
As an optimisation, armc may (and usually does) invoke the arma core internally without the need for assembler source to be created in files in the arm directory :
Apart from the above sub-directories, the project directory usually contains a 'build file which instructs the Charm shell which order to compile modules in and tells the linker how to build the program.
You can use the supplied !NewProject utility to quickly create conforming skeleton user projects. Version 2.4 is the first 32 bit compatible Charm release, and as such the recommendation is to install it under RISC OS 5 and StrongARM SA-110 or later, although it is backwards compatible with RISC OS 2, 3 and 4 running 26 bit ARM cores (e.g. ARM3).
If the Shift key is held down, Text and Obey files are loaded into the Charm editor (be sure to increase Applications Tasks Next before editing a large quantity of text to avoid heap exhaustion).
Those of you wishing to use third party editors such as !StrongEd and throwback must ensure the DDEUtils module is loaded (select Throwback option on main menu).
Run the !Charm application and drag source files, directories or !build files on to the Charm icon to build them. While a compilation, assembly or link is in progress, the Charm shell icon will change colour from blue to either yellow, red or green respectively. The Charm log window if displayed shows build progress.
User project directories are typically sub-directories under the top level user charm directory e.g. $.charm.user.MyProject already contains a simple project generated using the !NewProject application. It is however also possible to create Charm project directories anywhere on the same filing system, with the advantage that installing a new Charm release does not required the user to backup and restore existing user projects in order to retain them.
The following Charm system variables to point to directories in which common files are stored :-
- Charm$Home charm root installation directory
- Charm$Path same as above (allows charm: to be used as a filing system prefix)
- Charm$Dir charm home directory of !Charm application
- Charm$AppsDir charm applications directory
- Charm$DemosDir charm demos directory
- Charm$Edit the editor help file edithelp
Hard disc users are recommended to use the application versions of the Charm utilities. The following aliases are required to run the utilities :-
- Alias$Edit editor <Charm$AppsDir>.edit
- Alias$Armc compiler <Charm$AppsDir>.armc
- Alias$Arma assembler <Charm$AppsDir>.arma
- Alias$Arml linker <Charm$AppsDir>.arml
- Alias$Search search <Charm$AppsDir>.search
It is also possible to edit source files using the Charm editor by dragging them or their containing directories on to the Charm icon while holding down the Shift key.
In addition, It is possible to drag a selection of files and/or directories on to the Charm icon in order to build or edit (shift key down) a group of files.
The following development utilities are provided in the installation archive :-
- edit Source code editor
- armc Charm high level language compiler
- arma ARM assembler
- arml Linker
- search Search utility
- shell Charm shell
- !Charm Charm desktop shell application
Both module and application versions are supplied except for the shell and search applications.
Although the Charm utilities may be run from the command line, they are more simply executed from the desktop using the Charm shell with which they are integrated to provide build logging and pop-up window error handling.