Shop OBEX P1 Docs P2 Docs Learn Events
Catalina 3.4 — Parallax Forums

Catalina 3.4

RossHRossH Posts: 5,512
edited 2012-04-29 17:32 in Propeller 1
All,

UPDATE: Catalina 3.5 is now available. See here.

Catalina 3.4 is now available on SourceForge (here). A Windows "one touch" installer is provided which installs both Catalina and Code::Blocks, as well as Linux (32 and 64 bit) tar/gzip files.

Release 3.4 is a full release of Catalina. Here is a list of the changes:
  1. Fixed a bug in setjmp()/longjmp() implementation - these routines were not correctly saving/restoring the registers, which meant register variables were being lost.
  2. Fixed a bug in the code generator which meant that multiply, divide and mod operations were not being "spilled" properly in case another such operation was performed before the result of the first was saved, leading to corrupt values. This occurred most commonly in parameter lists that contained arithmetic expressions for more than one such parameter.
  3. The Windows "One touch" installer now does not install the Catalina source code by default - it is now an option. This was done to improve the install speed on slower Windows machines.
  4. The Windows "One touch" installer now prompts before overwriting any modified versions of "Custom" configuration files – these are any files with a name like Custom_*.* in the basic, simple or target folders - this ensures any custom modifications are not accidentally lost just because an upgrade to a new version of Catalina is installed. However, note that completely uninstalling Catalina will delete these files.
  5. Fixed error message detection for Homespun errors - some messages were not being correctly identified as errors.
  6. Fixed an error in building the utilities for the SuperQuad – the script used tried to build them using the LARGE memory mode, but this gave an error message about the mode being not supported. Now it builds them with the SMALL memory model (this makes no difference to boards that support both SMALL and LARGE).
  7. Modified the DracBlade_HMI.inc file to allow TV HMI options, since some DracBlades now support TV output. However, the default is still HIRES_VGA, so for TV support you must specifically define the TV symbol (or HIRES_TV or LORES_TV).
  8. The default size for all XMM programs is now 16M (16777216), so it is no longer necessary to specify the -M option in most circumstances (except when also using the -e option, or all .eeprom files will end up 16M in size).
  9. Rewrote the LMM Support, XMM Support and EMM Support sections in the Catalina Reference Manual to clarify the different targets and loader options.
  10. Fixed the demo build_all scripts to make the program names align with the Code::Blocks names for the same programs.
Ross.

UPDATE: Some users have reported their Code::Blocks Tools menu is empty (apart from a single Configure Tools... entry) after installing Catalina and Code::Blocks. This situation occurs when installing Catalina as a user that does not have administrator rights. In this case, you will have to manually set up the Code::Blocks default.conf file for that user (which is where the menu entries are stored). You will also have to set this up for each additional user on the same PC that wants to use Code::Blocks.

Attached to this post is a sample default.conf file. You will have to put this file in the windows %APPDATA%\codeblocks folder. One way to do this is to shut down Code::Blocks, open a Winodws command window and then type the following commands:
cd %APPDATA%
mkdir codeblocks
cd codeblocks
notepad default.conf
Then copy the contents of the attached file to this file (you should delete any existing content). Then save it and restart Code::Blocks. Note that if the codeblocks directory already exists (i.e. you have already run Code::Blocks at least once) you will see an error message when you try to create it - just igore it and carry on.
«13456711

Comments

  • RossHRossH Posts: 5,512
    edited 2011-10-26 03:42
    Looks like I found my first bug in release 3.4 ...

    The version of the XMM EEPROM loader causes an error because symbols I2C_PIN and I2C_DEV are being redefined. Replace the version in the Catalina\target folder with the attached version. This will only affect you if you are building XMM programs to be programmed into EEPROM.

    Also, I have attached here the new version of payload (Windows only). Replace the version in the Catalina/bin folder with the attached version for faster downloads, and with the new interactive terminal mode added.

    Ross.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-26 04:29
    Nice work Ross. Easy to setup and run.
    1024 x 768 - 107K
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-10-26 04:58
    Just a general question, does this version have a Propeller specific lib? Some common commands that are used would be: pause/wait, high, low, ..., etc. Before I try to do it myself, has this been done already?

    Ray
  • RaymanRayman Posts: 14,834
    edited 2011-10-26 07:50
    Cool. I'll have to try out the Toledo Chess again...
    BTW: Did you use my versions of FlashPoint_Def and Inc for this release? I'll change my guides if you did...
  • RaymanRayman Posts: 14,834
    edited 2011-10-26 10:39
    Ross, I have a basic question about Catalina for you...
    Is there some kind of hidden stack space somewhere, like there is in Spin.
    There was a recent thread where a Spin code went bezerk because it ran out of stack space.
    Can this happen in Catalina too?
  • Heater.Heater. Posts: 21,230
    edited 2011-10-26 10:53
    Rayman,
    What do you mean by "hidden stack space" in Spin?
    As far as I can see it is all out in plain sight.
    The top level object has it's stack in the free space at the top of HUB. Methods run in other COGs have their stacks where the programmer has defined them to be.
    It might be a bit tricky knowing how much stack you need for your objects and that is true in C as well.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-26 10:59
    Thanks Ross. I will install later today.
  • RaymanRayman Posts: 14,834
    edited 2011-10-26 11:32
    Heater. wrote: »
    Rayman,
    What do you mean by "hidden stack space" in Spin?
    As far as I can see it is all out in plain sight.

    Yes, it's hidden in plain sight. You don't tell it where it is or how big it is, the stack just takes up residence in left over space.
    The worst part is that there are no errors or warnings if stack space is breached...
    I'm a fan of SPIN, but the stack is one weak point.
    I am just wondering if Catalina has the same issues...
  • Heater.Heater. Posts: 21,230
    edited 2011-10-26 13:39
    Rayman,
    Ah yes, hidden in plain sight.
    This is not really Spin's fault. Languages like C, Pascal, Ada etc have the same problem.
    In general it's impossible for the compiler to know your run time stack usage at compile time. Especially if there is any possibility of recursion.
    Some compilers for some languages do count up all the params and local variables used by functions and allocate stacks or issue errors accordingly. This is quite a complex thing for a compiler to do an still fails in the face of recursion.
    In fact I have only seen one compiler do this, for the X chip.
    Of course on operating systems like Windows and linux this issue is really hidden as potentially gigantic stacks that are never actually fully used can be created as virtual memory.
  • TorTor Posts: 2,010
    edited 2011-10-26 14:00
    Even on Linux and *nix platforms the stack issue came back again with POSIX threads.. initially the default stack space for threads was typically just 8 KB, which is way too low in case your thread is just a pthread_create() wrapper around a normal large multi-function program, or otherwise coded without stack concerns (as that is almost never a concern for non-threaded programs.. your stack size is in the order of your entire virtual memory availability for your process, i.e. at least hundreds of megs).
    So, when threads arrived you would often have to do things like
    pthread_attr_getstacksize (&thread_attributes, &stack_size);
    if (stack_size < 200*1024) { /* If less than 200KB */
       pthread_attr_setstacksize (&thread_attributes, (200*1024));
    ..
    
    The default thread stack size has increased a bit nowadays, but it still pays to check it if you have code which e.g. allocates big arrays on the stack (that's just declaring an array inside a function).

    -Tor
  • RossHRossH Posts: 5,512
    edited 2011-10-26 14:56
    Rayman wrote: »
    Cool. I'll have to try out the Toledo Chess again...
    BTW: Did you use my versions of FlashPoint_Def and Inc for this release? I'll change my guides if you did...

    Oops! I forgot all about that. Sorry - next release.

    Ross.
  • RossHRossH Posts: 5,512
    edited 2011-10-26 14:58
    Rsadeika wrote: »
    Just a general question, does this version have a Propeller specific lib? Some common commands that are used would be: pause/wait, high, low, ..., etc. Before I try to do it myself, has this been done already?

    Ray

    Yes, there are propeller-specific functions described in the Catalina Reference Manual - see the section "Cog Functions" on page 42.

    Ross.
  • RossHRossH Posts: 5,512
    edited 2011-10-26 14:59
    Rayman wrote: »
    Ross, I have a basic question about Catalina for you...
    Is there some kind of hidden stack space somewhere, like there is in Spin.
    There was a recent thread where a Spin code went bezerk because it ran out of stack space.
    Can this happen in Catalina too?

    Yes, running out of stack space is possible in Catalina (as it is in most languages). But (unlike Spin) at least you don't have to reserve a specific amount in advance - Catalina will use whatever Hub Ram is available as stack space.

    Ross.
  • RaymanRayman Posts: 14,834
    edited 2011-10-26 16:39
    That's interesting... Is the stack space only in HUB ram? If you're in "large" mode, would it be in SRAM instead?

    Does a program just go haywire, like with Spin, when it runs out of stack space?
  • RossHRossH Posts: 5,512
    edited 2011-10-26 17:28
    Rayman wrote: »
    That's interesting... Is the stack space only in HUB ram? If you're in "large" mode, would it be in SRAM instead?

    Does a program just go haywire, like with Spin, when it runs out of stack space?

    In procedural stack-based languages like C, the stack is critical. For example, all parameters and local variables in all functions are allocated on the stack (or else in registers). So having the stack in SRAM would be way too slow. However, with the LARGE memory model, the heap and all global variables are in SRAM

    And yes, your program will just go haywire if it runs out of stack space. Typically, it would start overwriting the heap, or perhaps some plugin data (like the screen buffer). One day I'll add a stack "tide mark" capability to Catalina to allow you to assess your stack usage at run-time. It's on my "to do" list :smile:.

    Ross.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-27 00:26
    I have downloaded and been running all afternoon. Nice.

    Ross: I put Catalina in C:\Catalina34 folder. I did not uninstall Catalina3.3 that resides in another folder. I modified the "use_catalina.bat" file to point to the Catalina folder. Was this necessary (didn't check beforehand).?
  • RossHRossH Posts: 5,512
    edited 2011-10-27 00:43
    Cluso99 wrote: »
    I have downloaded and been running all afternoon. Nice.

    Ross: I put Catalina in C:\Catalina34 folder. I did not uninstall Catalina3.3 that resides in another folder. I modified the "use_catalina.bat" file to point to the Catalina folder. Was this necessary (didn't check beforehand).?

    Probably not. What determines which version of Catalina will be used is the setting of the LCCDIR environment variable. Just make sure this is set to which ever version you want to use, and then use_catalina should not need to be modified.

    Ross.
  • KMyersKMyers Posts: 433
    edited 2011-10-27 10:36
    Wow!!! Down 10 days with the flu, come back at look at all the activity and development going on with Catalina!! Uninstalled 3.2 and installed 3.4 on my Vista laptop, No problems all looks like its running great!

    Thanks Ross!
  • RaymanRayman Posts: 14,834
    edited 2011-10-27 14:35
    Ross, I'm using Super Star Trek (sst) now to test out my RamPage modules.
    It's very convenient. Only downside is the download takes >1 minute. I think I need to figure out how to load from SD card...
    Can I do this from within Code::Blocks? I think I need to copy over the sst.binary file to the SD card myself, right?
    Then what? Can I start it then from inside Code::Blocks?
  • RossHRossH Posts: 5,512
    edited 2011-10-27 14:45
    Rayman wrote: »
    Ross, I'm using Super Star Trek (sst) now to test out my RamPage modules.
    It's very convenient. Only downside is the download takes >1 minute. I think I need to figure out how to load from SD card...
    Can I do this from within Code::Blocks? I think I need to copy over the sst.binary file to the SD card myself, right?
    Then what? Can I start it then from inside Code::Blocks?

    Hi Rayman,

    You can build Catalyst from the Code::Blocks Tools menu (this will build the core binary, which is all you really need - you don't need any of the utilities or demo programs). Then program the resulting catalyst.bin (which will be in the catalyst\bin subdirectory) into EEPROM. From then on you can just copy any binary from the Code::Blocks release folder to an SD card and then launch it within Catalyst. Be sure to rename the file to have a DOS 8.3 filename, with a .bin extension - this is the one thing I have not figured out how to make Code::Blocks do!

    Ross.
  • RaymanRayman Posts: 14,834
    edited 2011-10-27 15:20
    How do I program catalyst to EEPROM within Code::Blocks?
    I was thinking the "Program EEPROM" tool would program the eeprom with the sst file and not Catalyst. Is that wrong?
  • RossHRossH Posts: 5,512
    edited 2011-10-27 15:40
    Rayman wrote: »
    How do I program catalyst to EEPROM within Code::Blocks?
    I was thinking the "Program EEPROM" tool would program the eeprom with the sst file and not Catalyst. Is that wrong?

    Yes, that's wrong :)

    I didn't create a specific tool for programming Catalyst. I can do so in the next release if you would like. Or you can create one yourself. The command to add would be very simple:
    payload -e "%LCCDIR%\catalyst\bin\catalyst.bin"
    

    You can just run this from a Catalina Command Line window, or add a new entry to the Code::Blocks Tool menu.

    Ross.
  • RaymanRayman Posts: 14,834
    edited 2011-10-27 18:21
    Ok, I think a new "Tool" for the next version that would program Catalyst into EEPROM would be nice.
    I suppose I can't just download Catalyst to RAM and have it run sst.binary off of the SD card, right?

    Maybe another nice addition would be a Tool that brought up an explorer window with my sst.binary file in it, so I wouldn't have to hunt for it.
    (Pretty lazy, aren't I?)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-27 19:16
    Hi Rayman,

    It seems we are both at the 'cutting edge' of using this.

    Rather than put Catalyst in eeprom, I took the initial step of keeping Kyedos as my OS and running Catalyst (another OS) from Kyedos. This works well. However I'm not quite ready to make Catalyst my eeprom OS as I ran into problems with Catalyst rebooting once it had run a program. In fact I couldn't get programs to 'reboot' at all (which on my setup ought to run Kyedos). As a simple test, I tried running Catalyst from itself and that hung the system.

    I am not sure how much of Catalyst stays around after it runs another program. Kyedos does not stay around at all, but any program running under Kyedos "ends" by issuing a reboot to the propeller. Because Kyedos loads off the eeprom very quickly (about a second) this approach seems to work. Catalyst seems fast too.

    But I'm not sure what approach Ross has taken with Catalyst. What would happen for instance, if you had Catalyst in eeprom and you ran a C program that just had an empty "main"? Would that jump back into Catalyst again?
  • RossHRossH Posts: 5,512
    edited 2011-10-27 19:33
    Rayman wrote: »
    Ok, I think a new "Tool" for the next version that would program Catalyst into EEPROM would be nice.
    I suppose I can't just download Catalyst to RAM and have it run sst.binary off of the SD card, right?
    Yes, you could do that - just add a suitable AUTOEXEC.TXT file to the SD Card so Catalyst finds it when it starts.
    Rayman wrote: »
    Maybe another nice addition would be a Tool that brought up an explorer window with my sst.binary file in it, so I wouldn't have to hunt for it.
    (Pretty lazy, aren't I?)

    Sure are! :)

    Ross.
  • RossHRossH Posts: 5,512
    edited 2011-10-27 19:35
    Dr_Acula wrote: »
    Hi Rayman,

    It seems we are both at the 'cutting edge' of using this.

    Rather than put Catalyst in eeprom, I took the initial step of keeping Kyedos as my OS and running Catalyst (another OS) from Kyedos. This works well. However I'm not quite ready to make Catalyst my eeprom OS as I ran into problems with Catalyst rebooting once it had run a program. In fact I couldn't get programs to 'reboot' at all (which on my setup ought to run Kyedos). As a simple test, I tried running Catalyst from itself and that hung the system.

    I am not sure how much of Catalyst stays around after it runs another program. Kyedos does not stay around at all, but any program running under Kyedos "ends" by issuing a reboot to the propeller. Because Kyedos loads off the eeprom very quickly (about a second) this approach seems to work. Catalyst seems fast too.

    But I'm not sure what approach Ross has taken with Catalyst. What would happen for instance, if you had Catalyst in eeprom and you ran a C program that just had an empty "main"? Would that jump back into Catalyst again?

    Dr_A, Catalyst leaves nothing in memory. When your C program exits it reboots the Propeller, and if Catalyst is loaded in EEPROM it will restart.

    Ross.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-27 20:18
    Catalyst leaves nothing in memory.

    Great - that will make it pretty much the same as Kyedos.

    I must say that I am really getting to like the code::blocks/catalina combo. It makes programming a pleasure!
  • RossHRossH Posts: 5,512
    edited 2011-10-27 20:23
    Dr_Acula wrote: »
    Great - that will make it pretty much the same as Kyedos.
    Hrummph!.... I think you mean Kyedos is beginning to look like Catalyst! :smile:
    Dr_Acula wrote: »
    I must say that I am really getting to like the code::blocks/catalina combo. It makes programming a pleasure!
    Certainly does!

    Ross.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-27 20:49
    Hrummph!.... I think you mean Kyedos is beginning to look like Catalyst!

    Yes oops, got that the wrong way round LOL.

    Though seriously, one thing that might be an issue is that there may be some who do not know what 'catalyst' is. KyeDOS has 'DOS' in the name for a reason, and I wonder if Catalyst is not getting the recognition it deserves because it is not entirely obvious what it is? Maybe in the future the word 'catalyst' could be associated with a one line statement saying that it is a simple operating system for the propeller that allows you to run programs stored on an SD card.

    Or whatever one line description you like.

    Hmm - maybe we need a promo photo. Here is a photo of 'catalyst' - an operating system for the propeller. And here it is running a compiled version of "Hello World". And here is the source for "Hello World".

    I'm looking at the full page ad from Parallax on the back page of Circuit Cellar right now. Maybe one day Catalina could be in that photo :)
  • RossHRossH Posts: 5,512
    edited 2011-10-27 21:04
    Dr_Acula wrote: »
    ...there may be some who do not know what 'catalyst' is. KyeDOS has 'DOS' in the name for a reason ...

    LOL! You're showing your age, Dr_A :smile:

    Ask any kid what DOS means and they'd probably think you mean either the Nintendo game Dawn of Shadow - of if they were real geeks they might think you meant Denial of Service (although come to think of it, the latter is surprisingly accurate when describing a Microsoft O/S).

    Ross.
Sign In or Register to comment.