Shop OBEX P1 Docs P2 Docs Learn Events
Catalina 3.8 & 3.9 — Parallax Forums

Catalina 3.8 & 3.9

RossHRossH Posts: 5,462
edited 2012-11-01 04:39 in Propeller 1
All,

I've just posted a new release of Catalina (3.9) to SourceForge. I've posted the usual Windows "one touch" installer (here), and Linux 32 bit and 64 bit versions (here). This is not yet release 4, but that release is taking longer than I had hoped, so I thought it was time I released what is finished. Release 3.9 fixes a CMM code generator bug that existed in Catalina 3.8.

The main thing this release does is complete the addition of the new Compact Memory Mode (CMM) to Catalina, which reduces the size of C programs to well under half the size of the equivalent LMM program. In many cases it gives results comparable in size to Spin - only faster! I have made some additional code size reductions in the CMM support since the 3.7 beta release, but nothing very dramatic - mostly, I've just concentrated on completing all the libraries and peripheral utilities (the multithreading library in particular was far more difficult than I anticipated).

But now, any C program that compiles using LMM will also compile using CMM - even if it uses multiple threads or multiple cogs (or both). All the existing Catalina plugins and libraries are supported, and all the Catalina loaders, debuggers and other utilities now handle CMM correctly - in most instances it is completely transparent. All you need to do is use the switch -C COMPACT on the Catalina command line (or select COMPACT mode in Code::Blocks).

Anyone using the 3.7 beta release should upgrade as soon as possible. The CMM kernel in that release was fairly sound, but a few of the CMM library functions were missing or broken, and the beta version of the BlackBox source-level debugger had a few major bugs in the CMM support - but these are all now sorted, so you can now do gdb-style source level debugging of C programs whether they are CMM, LMM or XMM. The CMM version of the Catalina Optimizer is also included (the LMM/XMM version is still an optional component you can buy if you want to).

To demonstrate the benefits of CMM, I have included the new Virtual Graphics plugin and library (based on my original Spin Virtual VGA driver) and a C version of the classic SpaceWar! program that uses it. The Virtual Graphics plugin supports high resolution VGA graphics that are compatible with the Parallax graphics objects but at a very low memory cost. This is required to run the high resolution version of the SpaceWar program. But even when using this plugin, when SpaceWar is compiled as an LMM program it is far too large to run, and when compiled as XMM it is far too slow be much fun (and it also runs out of cogs!) - but (a bit like Goldilocks and the Three Bears) when compiled as a CMM program, it turns out to be just right!, with a size that is comparable with the original Spin version (it's about 40% larger) but significantly faster (the Spin version was really too slow). The program can be run on any bare-bones propeller (but it requires one with a VGA output). Gamepad and keyboard support are both included. A sound driver will be forthcoming in release 4 (or sooner if I can figure out what's wrong with the blasted thing!).

Ross.

Update: I've had one report of installation problems with Catalina 3.8, possibly caused by installing 3.8 over the top of a previous version. If you are upgrading from a previous version of Catalina and run into problems such as the symbol LODI being undefined, or the function C_arg_setup being multiply defined, then I'd recommend a complete uninstall of any old version of Catalina before reinstalling Catalina 3.8. Alternatively, install Catalina 3.8 to a different directory.

Comments

  • simonlsimonl Posts: 866
    edited 2012-09-23 03:05
    Wow Ross!

    Whilst I'm not a C programmer (it's an itch I never seem to be able to scratch!) I can see that you put in a HUGE amount of work to keep Catalina ahead of the competition. Well done.
  • RossHRossH Posts: 5,462
    edited 2012-09-23 04:59
    simonl wrote: »
    Wow Ross!

    Whilst I'm not a C programmer (it's an itch I never seem to be able to scratch!) I can see that you put in a HUGE amount of work to keep Catalina ahead of the competition. Well done.

    Competition? What competition? :lol:
  • RaymanRayman Posts: 14,670
    edited 2012-09-23 08:47
    I like the sound of that "Virtual Graphics plugin" that runs in CMM mode... Have to check that out...
    Also, I want to see if I can get a Catalina project working with the Visual Studio editor...
  • KMyersKMyers Posts: 433
    edited 2012-09-23 10:33
    Great work! Cant wait to try it out next week as time might free up!
  • RossHRossH Posts: 5,462
    edited 2012-09-23 15:37
    Rayman wrote: »
    I like the sound of that "Virtual Graphics plugin" that runs in CMM mode... Have to check that out...
    Also, I want to see if I can get a Catalina project working with the Visual Studio editor...

    Hi Rayman,

    The Virtual Graphics plugin runs in any mode - it's just that it's most useful in CMM mode. This is because in LMM mode the code is generally too large, and in XMM mode the code is generally too slow.

    Do you mean using a Code::Blocks project file in Visual Studio? I don't think that's possible. But if you just want to edit C source files in Visual Studio, that should be ok (although I'm not sure why you'd want to do that - Code::Blocks has a pretty decent code editor).

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-09-25 03:31
    All,

    Linux versions (32 and 64 bit) now uploaded to SourceForge. Also, there is an "errata" file for Windows users, but you don't really need it for Windows - the errata file only contains some changes to the Linux-related stuff that I found while building the Linux versions - and those fixes are included in the Linux versions anyway.

    Also, I should have pointed out that Catalina release 3.8 can be compiled and run on a Mac under OSX. The build scripts automatically detect OSX and make the necessary adjustments. The only thing not working under OSX is the serial port stuff. I don't actually own a Mac, so I can't debug that. Someone with a Mac once promised to do so (can't remember who) but I never heard anything more. One day I'll borrow one and get that working, but in the meantime you can compile Catalina programs under OSX and load them using the Catalyst SD card loader.

    Ross.
  • ersmithersmith Posts: 6,054
    edited 2012-09-26 05:11
    I tried to build the following program under Catalina 3.8:
    #include <stdio.h>
    
    int n;
    
    int main() {
       for (n = 0; n < 8; n++) {
        printf("hello world number %d\n", n);
      }
      return 0;
    }
    
    The command line I used was:
    catalina hello.c -lc
    
    I got the following error:
    Error: .\Catalina.spin (276, 7): Unknown symbol LODI
      jmp #LODI
           ^
    
    If I add "-C COMPACT" to the command line I get instead:
    Error: .\Catalina.spin (146, 1): C_arg_setup is already defined
    
    Am I doing something wrong?
  • RossHRossH Posts: 5,462
    edited 2012-09-26 05:48
    Am I doing something wrong?

    No, that should work - I just tried it here, and it did work.Check your CATALINA_DEFINE variable is not set to something odd by executing unset CATALINA_DEFINE, and also check your LCCDIR variable is set to the right directory by executing the command catalina_env.

    Then recompile - if that doesn't work, post the output of the compilation command and I'll try to diagnose the problem.

    Ross,

    P.S. I just downloaded and installed Catalina 3.8 from SourceForge on a clean computer, and it worked ok. Perhaps something is wrong with installing it over an existing version? If the above doesn't work, I'd suggest uninstalling any old versions of Catalina, or installing it to a new directory.
  • RossHRossH Posts: 5,462
    edited 2012-09-27 01:54
    ersmith wrote: »
    ...
    Error: .\Catalina.spin (146, 1): C_arg_setup is already defined
    
    Am I doing something wrong?

    Did you get this sorted? I can make the above error happen if I mix target files from Catalina 3.6 with Catalina 3.8 - I moved the function C_arg_setup from catalina_default.s to lmm_progbeg.s (or cmm_progbeg.s etc) - so if you mix a version of one file from Catalina 3.6 with the other from Catalina 3.8 this function could end up multiply defined. One way I can think of that this might occur is if you installed Catalina 3.8 over the top of Catalina 3.6, but did so without administrator privilege or when one of the files was in use - so it failed to overwrite. I would have expected the installer to throw an error in this case, but maybe not.

    Best advice is to always delete the previous version of Catalina, or install each version to a different directory.

    Ross.
  • amossamamossam Posts: 35
    edited 2012-09-27 03:22
    RossH wrote: »
    All,
    Also, I should have pointed out that Catalina release 3.8 can be compiled and run on a Mac under OSX. The build scripts automatically detect OSX and make the necessary adjustments. The only thing not working under OSX is the serial port stuff. I don't actually own a Mac, so I can't debug that. Someone with a Mac once promised to do so (can't remember who) but I never heard anything more. One day I'll borrow one and get that working, but in the meantime you can compile Catalina programs under OSX and load them using the Catalyst SD card loader.

    Ross.

    hey!
    i would like to try Catalina, and i'm on OSX, but what package to download? for linux 64 bit?

    thx
  • RossHRossH Posts: 5,462
    edited 2012-09-27 04:31
    amossam wrote: »
    hey!
    i would like to try Catalina, and i'm on OSX, but what package to download? for linux 64 bit?

    thx
    Hi amossam,

    Donwload either of the linux packages - the only difference between the two is in the compiled binaries (which you can't use anyway). There are some instructions for compiling Catalina under Linux in the Catalina Reference Manual - this describes packages you need to install and the steps you need to go through (see page 106).

    The main thing you need is a version of GCC (I think I used xcode, but there is another alternative whose name I can't recall - it doesn't really matter as long as you end up with a working version of GCC).

    I got Catalina and Code::Blocks to compile and run, but not the serial port support - because all I have is a VirtualBox image of OSX, and Virtualbox doesn't support serial ports for OSX. And the Mac serial support seems to be a bit non-standard anyway.

    If you run into problems let me know and I will try to assist..

    Ross.
  • ersmithersmith Posts: 6,054
    edited 2012-09-27 05:02
    RossH wrote: »
    P.S. I just downloaded and installed Catalina 3.8 from SourceForge on a clean computer, and it worked ok. Perhaps something is wrong with installing it over an existing version? If the above doesn't work, I'd suggest uninstalling any old versions of Catalina, or installing it to a new directory.

    I thought I had deleted the old version, but something must have still been there (some registry keys? I don't know). Anyway, uninstalling and then re-installing seems to have fixed it.

    Thanks for your help,
    Eric
  • RossHRossH Posts: 5,462
    edited 2012-09-27 18:11
    ersmith wrote: »
    I thought I had deleted the old version, but something must have still been there (some registry keys? I don't know). Anyway, uninstalling and then re-installing seems to have fixed it.

    Thanks for your help,
    Eric

    Glad you got it sorted. Catalina doesn't use any registry keys, and if you installed to the same location then the environment variables should have been correct. All I can think of is that some file lock or permission problem caused the installer to be unable to overwrite one of the previous files.

    When I get some time I'll do a bit of "robustness" testing on the installer. For now, I'll just update the announcement at top of this thread to indicate that a complete uninstall/reinstall is recommended.

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-09-29 00:49
    All,

    Just need to clarify something I posted earlier ...
    The Virtual Graphics plugin runs in any mode - it's just that it's most useful in CMM mode. This is because in LMM mode the code is generally too large, and in XMM mode the code is generally too slow.

    This is almost true! The new Virtual Graphics plugin and library work in COMPACT, LMM (TINY) or XMM (SMALL) mode. However, they do not work in XMM (LARGE) mode - as someone has just pointed out to me!

    I don't believe this is a very significant issue, since I don't believe this library will currently be used much in XMM mode (SMALL or LARGE). However, I will look at fixing this in a future release - especially since I have some work in progress to boost Catalina's XMM performance, which might make this option more attractive.

    Ross.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-09-29 02:42
    Finally, I got it! Catalina C versus GCC C. Use the best supported, especially for the LMM.
    simonl wrote: »
    Wow Ross!

    Whilst I'm not a C programmer (it's an itch I never seem to be able to scratch!) I can see that you put in a HUGE amount of work to keep Catalina ahead of the competition. Well done.
  • RossHRossH Posts: 5,462
    edited 2012-09-29 18:42
    Finally, I got it! Catalina C versus GCC C. Use the best supported, especially for the LMM.

    Hi Loopy. Thanks for the endorsement .... I think ... :confused:

    Did you perhaps mean to say CMM? Catalina clearly has best support in that area.

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-10-06 05:40
    All,

    To fix a bug in the CMM code generator, I have just released a Windows installer for Catalina 3.9. Linux packages will take another day or so.

    More details to follow, but I recommend anyone using CMM should update as soon as possible (the bug only affected CMM, LMM and XMM were fine).

    Apologies for the inconvenience.

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-10-06 22:11
    All,

    Linux packages (32 & 64 bit) for Catalina 3.9 now available on sourceforge.

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-10-21 05:24
    All,

    Catalina now has a fully functional sound plugin and support library. See the attached zip file for a beta version. Using it is as simple as linking with the new sound library - e.g:
    catalina sound_demo.c -lc -lsound -C C3
    

    The README.TXT file included in the zip file has more details, including how to install the plugin and compile the demos.

    The sound_demo program included can be compiled in COMPACT, TINY, or SMALL mode for the HYDRA, the C3 or any other Propeller board with compatible audio hardware. The sound library will also work in LARGE mode, but this simple demo program will not.

    Also included is a new version of the SpaceWar! program with the original sound effects reinstated (yay!). This program must be compiled in COMPACT mode, and does not need any XMM RAM, but even so it is just slightly too large to load normally, and must therefore be compiled to use the Catalina two-phase EEPROM loader. The program can then be loaded into a 64kb EEPROM using a program such as the Hydra Asset Manager.

    Note that with the addition of the sound plugin, the program can no longer be run on the C3 using the keyboard for input, because there are just not enough cogs to do so - however, it could run on the C3 using a gamepad with a little effort.

    The sound plugin and sound library will become one of the standard libraries in the next release of Catalina.

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-10-22 00:33
    All,

    I have a question regarding Catalina's new sound plugin - Nick Sabalausky (the author of the Spin original) ended up with two versions:
    1. 22KHz, 16-bit, 6 Channels
    2. 11KHz, 16-bit, 9 Channels
    Since I don't have much need for 9 independent sound channels, I tend to only ever use the 22KHz driver - but if anyone needs the other one, I could include both, and allow you to choose between them using appropriate command line symbols (e.g. SOUND_22KHZ or SOUND_11HKZ).

    Anyone?

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-10-23 01:09
    All,

    I've decided that Catalina needs its own dedicated EEPROM loader to simplify loading programs into EEPROMs larger than 32kb. Catalina can now build LMM or CMM programs where the code can occupy almost the whole of the 32kb of Hub RAM (once all the plugins have been loaded into the 16kb of Cog RAM) - but such programs cannot be loaded very easily on platforms that do not have an SD Card (and hence cannot use the Catalyst two-phase loader).

    In such cases, programs are often needlessly limited to as little as 16kb of code - i.e. only half of what is available on the Propeller!

    Using the Hydra Asset Manager works ok, but it is quite difficult and cumbersome to use, and (as far as I can tell) is not maintained any longer.

    I will add the EEPROM programmer to Payload as another optional load phase (using Payload's existing multi-phase load capability) much like the current XMM loader, but for EEPROMs rather than XMM RAM - i.e. you will be able to use simple commands to compile and load programs, such as:
    catalina program.c -C EEPROM        <--- compile the program to include the two-phase EEPROM loader
    payload EEPROM program              <--- load the program into a 64kb EEPROM ready for execution
    

    I intend to base the EEPROM programming code on Mike Green's sdspiFemto.spin object - it seems to support a suitably wide variety of EEPROMS, and so should be usable on most platforms and most EEPROM sizes (although you can still only use 64kb).

    Does anyone have any experience with this object, and know of any types of EEPROM that it cannot program? If so, can anyone recommend another (similar) object that might be more suitable to start from?

    Thanks,

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-10-27 18:46
    All,

    I have just confirmed that Catalina compiles and runs perfectly well on the Raspberry Pi - you can use your Pi to compile C programs, and then download them to your Propeller from the Pi (note: you need an external USB Hub to do this, and it will need to be a powered Hub if the Propeller board is powered via USB).

    You can build Catalina for the Pi yourself from the Linux sources - you just need to install a few additional Pi packages first (e.g. bison, flex, monodevelop, libncurses5).

    The only problem I found while building Catalina on the Pi was in the build_index batch file that lives in many of the library source subdirectories (e.g. source/lib/libc, source/lib/libci etc etc). It refers to /bin/sh and really should have referred to /bin/bash - I will fix this in the next release, but in the meantime there are two workarounds:

    1. Edit all instances of this file this to specify /bin/bash instead of /bin/sh
    2. Make /bin/sh a link to /bin/bash, as it is on most Linux installations (the Pi uses /bin/dash instead):
    cd /bin
    sudo mv sh old_sh
    sudo ln -s bash sh
    

    If there is enough interest I will post a Pi package in addition to the standard Windows & Linux packages (to save everyone having to build it themselves).

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-10-29 15:57
    RossH wrote: »
    I've decided that Catalina needs its own dedicated EEPROM loader to simplify loading programs into EEPROMs larger than 32kb. Catalina can now build LMM or CMM programs where the code can occupy almost the whole of the 32kb of Hub RAM (once all the plugins have been loaded into the 16kb of Cog RAM) - but such programs cannot be loaded very easily on platforms that do not have an SD Card (and hence cannot use the Catalyst two-phase loader).

    An update - I now have a working EEPROM add-on for the Payload loader for programming EEPROMs larger than 32k (Payload could already program 32k EEPROMs). This simplifies loading CMM programs that want to use the whole 32k of Hub RAM for code or data space - and hence end up with a binary larger than 32k even though they execute on a normal Propeller with only 32k of Hub RAM.

    Previously, you needed to use a separate utility to load such programs (such as the Hydra Asset Manager). Now you can just use Payload for everything.

    I have so far tried it on the C3 and the Hydra, and it works ok. But before I release it I want to try it on a few more configurations - if anyone is interested, and already has Catalina and a Propeller with an EEPROM of 64k or larger, please PM me and I will send you an "alpha" version.

    Thanks,

    Ross.
  • max72max72 Posts: 1,155
    edited 2012-10-30 02:14
    RossH, your mail box is full.
    Massimo
  • RossHRossH Posts: 5,462
    edited 2012-10-30 02:50
    max72 wrote: »
    RossH, your mail box is full.
    Massimo

    Sorry - just cleared it a bit - please try again!
  • RossHRossH Posts: 5,462
    edited 2012-10-31 01:45
    All,

    The only requests I have had so far are from Hydra users, so I thought I'd post the binaries here instead of emailing them individually. The attached file contains an updated version of payload, the new EEPROM loader (which can load EEPROMs up to 128k - the largest I have tried it on) and also a copy of the SpaceWar program (compiled for the Hydra) to demonstrate it. This version will only work on the Hydra, since the EEPROM loader needs to be compiled for a particular clock speed, and the Hydra has an unusual one. If you want to try the new EEPROM loader on another platform, you will still have to email or PM me and I will send you one compiled for that platform.

    This version of SpaceWar has sound effects enabled, which makes the program large enough to require the use of the two-phase EEPROM loader. It can be programmed into the EEPROM on a bare Hydra, or on any of the Hydra extension boards. Note that the program is a CMM program - it does not require XMM RAM, but it must be loaded into EEPROM, since the binary file is larger than 32k.

    To try it, unzip all the files into a directory and enter:
    .\payload EEPROM spacewar
    

    Note the ".\" - you must execute this version of payload, and not one you may already have installed as part of Catalina. The only difference is that previous versions of payload specifically disallowed the serial loading of this type of binary, since they knew it would not be loaded correctly - but the EEPROM loader now makes this possible.

    Ross.
  • RossHRossH Posts: 5,462
    edited 2012-11-01 00:24
    All,

    I have had some responses from non-Hydra users, so I 'm posting another set of binaries to try the EEPROM loader. The attached file contains an updated version of payload, the EEPROM loader and also a copy of the Othello program to demonstrate it.

    This version of Othello has been compiled to use the serial port, and has been compiled with -C EEPROM to force it to use the EEPROM loader. It should work on any Propeller with a 5Mhz clock and an EEPROM size of 64Kb (or larger).

    To try it, unzip all the files into a directory (you don't need Catalina installed) and enter:
    .\payload -i EEPROM othello
    
    As with the previous set of binaries, note the ".\" - you must execute this version of payload, and not one you may already have installed as part of Catalina.

    Also notice the "-i" parameter - this invokes the interactive mode of Payload, which offers a simple terminal emulator. Press CTRL+D when you are done.

    Please report any Propellers that don't work with this version (and please tell me the type and size of EEPROM you have).

    Ross.
  • max72max72 Posts: 1,155
    edited 2012-11-01 03:34
    It works here both on 64 and 128 (atmel AT24C1024B) eeproms.
    Propeller Platform clone, 5MHz.

    Massimo
  • RossHRossH Posts: 5,462
    edited 2012-11-01 04:39
    max72 wrote: »
    It works here both on 64 and 128 (atmel AT24C1024B) eeproms.
    Propeller Platform clone, 5MHz.

    Massimo

    Thanks, Massimo.

    I'll package the new EEPROM loader up as a patch release for Catalina 3.9 sometime soon - maybe this weekend.

    By the way, for platforms that do have some kind of XMM RAM, the EEPROM loader will also allow XMM programs to be stored in EEPROM.

    I think I may rename all the Catalina loaders to make them more intuitive. For example, on the C3 (which has a variety of possible memory configurations) you could have the following load options:
    payload EEPROM program   <--- store a program in EEPROM
    payload FLASH program    <--- store a program in FLASH
    payload SRAM program     <--- store a program in SRAM 
    payload program          <--- store a program in Hub RAM
    

    Ross.
Sign In or Register to comment.