RISC for Dogs (5)

Figure 1: Still resting?  Lazy bones!

(continued from page 4):

On the previous page we talked about FAT32 formatted USB thumb drives.  These are auto-mounted upon insertion, but it’s a good idea to dismount them before pulling them out:

  • *Dismount [<disc spec>]   (general form for dismount command)

Assuming we have only one FAT32 thumbdrive,

  • *FAT32FS   (declare that we want to work with the FAT drives)
  • *SHOWFREE -FS Fat32Fs 0 (check drive 0 to see if it’s the one we want)
  • *DISMOUNT Fat32_0 (assuming that Fat32_0 is the drive name)

The response to the last line should be:

  • “Dismounted drive 0”

If such a message doesn’t appear, the drive spec/name was probably specified incorrectly.  I have seen some inconsistencies while playing with thumb drives using the command line, so I always use the GUI to dismount. In fact, it’s a lot easier to middle click the thumbdrive’s icon on the icon bar, and then click “Dismount” because you don’t have to specify anything.

A few other handy command line commands that I use often:

  • *ex                      (similar to ls -lh directory listing on Linux)
  • *exec <script>  (execute a script)
  • *inetstat           (show all sockets)
  • *showstat        (show link status)

The thing to remember is that the middle mouse button is as important or more important than the left button.  Once, you get used to using it, things run more smoothly.

The OS runs at 600 MHz on a Pi2 by default.  While for most things I find that 600 MHz is fine, putting these lines into the config.txt file should speed the performance to 900 Mhz:

  • force_turbo=1
  • arm_freq=900
  • core_freq=250
  • adram_freq=450

The OS has a package manager called PackMan.  Just like in other operating systems, the target repositories can be specified, from which to grab packages. The repository text file list for sources is in Choices:PackMan.Sources, accessible via !Director.  Some packages are at:

These are the official packages for the Pi at the moment, and pre-specified in the Choices:PackMan.Sources file.  Other repos may be added.  There’s one at drobe.co.uk, for instance.  The first time the PackMan program is run, it will download the repo info for the listed repos.  The package manager is a little less binary oriented than other operating systems, so for instance the URLs (above) can be read as text files, wherein the text contains package urls that allow the zips to be downloaded directly.

But, why do that?  Instead, I click on the PackMan icon in the Apps folder, and then left-click the PackMan icon in the icon bar.  A nice dialog appears, filled with a list of packages that may be added.  Double-clicking any of them brings up another dialog describing what will be installed, dependencies, and so on.  Clicking the install button starts the installation.  A progress bar details the two main stages: download, and extraction/installation.   PackMan does all the work of “merging” the !Boot and !System dirs if they exists.  Much easier.

I mentioned on the last page that the Norcraft compiler (the commercial version on the NutPi development USB stick) is necessary for building the OS.  But, for userland apps, GCC can be used.  I used PackMan to install gcc-4.7 and its libs.  After launching a taskwindow and typing “gcc -v” I received an “out of memory” message.  It seems that Wimpslots are set to a relatively low memory resource level per slot, to allow for a lot of them.  But, the gcc compiler needs more memory.   Per a post on the riscosopen.org forum, I found several ways to increase the memory allocated for gcc, so to make it work.

One way is to open the Tasks Manager by left clicking the raspberry. Then, the Next Wimpslot bar can be dragged to the right to increase the memory.  GCC works when I drag the bar to 16MB or more, press F12 to launch a taskwindow (or middle-click an select a task window), and then run “gcc -v” inside the task window.

Another way to do this, pointed out by a forum member, is to tack this onto the end of GCC’s !Run file:

  • TaskWindow “gcc -v” -WimpSlot 16000k

The latter way seems easier to me, because it happens every time automatically. The result of a gcc invocation with the modified !Run file should be:

gcc -v
  Using built-in specs
  GCC version 4.7.4 (GCCSDK GCC 4.7.4 Release 3)
  Press space or click mouse to continue

It’s interesting to note that the default memory allotment for programs is 512k, which points to the fact that programs on RISCOS generally have a small memory requirement.

Read More …

RISCOS is a product of Castle Technology Limited (“Castle”) and its licensors at:
http://www.castle-technology.co.uk/  This author and site are not affiliated with them in any way.

Note: This author and site is not affiliated with the Raspberry Pi in any way. For information about those projects visit  http://www.raspberrypi.org “Raspberry Pi” is a trademark of the Raspberry Pi Foundation.