As an ICC user, and one who has looked through your implementation, I think you have summed up the differences pretty well. I still don't get how to put together an XMM image after reading your doc otherwise, I would be doing that for the 2 boards I have. If you summaried your XMM build process, that would help. For example, is it possible to use it without first writing EEPROM ? I would much rather download a binary.
Richard has added XMM extensions to a private build of ICC ... and that's what I've been using. The ball is in his court for productizing XMM-ICCPROP.
ICC does offer some extentions to C89 such as one line comments and enhanced printf (no dynamic arrays or inline functions).
GNU C is the Linux variety. Linux relies heavily on inline functions. I've never seen a dynamic array in Linux but that doesn't rule them out.
At the moment, I use HAM (http://forums.parallax.com/showthread.php?p=628778). Although HAM stands for Hydra Asset Manager, I don't think it is Hydra-specific, I believe it should work on any Propeller Platform with an external EEPROM larger than 32K - which you have to have to run the resulting XMM program anyway.
I'll go through the steps I use to compile/load the startrek demo (this is from memory - check my docs and HAM itself for details):
1. Compile your Catalina program as an XMM ('-x2') file, and generate an eeprom image ('-e') of the result:
lcc startrek.c -o startrex_xmm -Wl-x2 -Wl-e
This should give you a 64K eeprom file called startrek_xmm.eeprom. This is a pure PASM program, and needs to be combined with an XMM target.
2. Choose your target - For startrek you need to use the hires TV XMM target. You will find an eeprom file in the Catalina 'target' subdirectory called xmm_hires.eeprom. All the XMM targets are 32K eeprom files. If you need to modify them, just compile them with any SPIN compiler and overwrite the existing eeprom files.
3. Start HAM. It is a drag-and-drop application that shows you the layout of an imaginary eeprom up to 128K. You drag and drop the file xmm_hires.eeprom and set its start address to $0000. Then drag and drop the file startrek_xmm.eeprom and set its start address to $8000. You can do this by just dragging and dropping both files in the correct order and then pressing the 'Compress Assets' button. This gives you (in the PC memory) an image of what you need to program into the Propeller's eeprom. Unfortunately, you can't simply save the result to file on the PC at this point - you have to actually upload it.
4. To upload the image into the Propeller's eeprom, you first upload the HAM driver to the Propeller. That takes about 15 seconds. Then you upload the actual eeprom image to the Propeller. This takes about 1 minute.
That's it - reset the Propeller, and enjoy 'Super Star Trek' in all its original monochrome character-based glory!
If you want to save a copy of the eeprom locally for future use, you need to use HAM again - you again upload the HAM driver to the Propeller, but this time you download the entire Propeller eeprom to a local PC file. Unfortunately, I think HAM always saves it in .eeprom format, not .binary format.
It should be easy to write a program that does essentially the same job without requiring either HAM or a Propeller - i.e. just input two .eeprom files and output a combined .eeprom file. If I get time, I'll add this to the next release of the Catalina Binder to make the whole thing a one step process.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Sorry, been busy for a few days. One thing I want to make clear is that we spend A LOT OF effort in optimizing the code from the LCC. Remember our bread and butter are things like compiler for the 8 bits AVR where code size is paramount. So for example, we have automatic register allocation and can pack multiple variables into the same registers if their uses do not overlap etc. We also have capability to do dataflow and peephole, far more extensive than plain LCC facility.
These features will be worked on and enabled on the Propeller C as demand warrants.
That's an outstanding answer and I really appreciate the effort you took to write it up.
I recently purchased the non-commercial version of the ICC compiler and planned to upgrade to the commercial version as soon as I had more time to evaluate it. So far I really like it. It's much better than the PIC C compilers that I have worked with in terms of features and documentation. The only major limitation is that it only works on windows. An ICC Linux/OSX version, even if it was only a command line version, would be a huge improvement. A Code::Blocks + ICC would be a sweet combo.
Although, I am intensely interested in Catalina, esp. if it supports Linux/OSX. I personally prefer OSX.
As an aside, the propeller HW design is absolutely fascinating, especially in its simplicity. I was really getting tired of all dizzying architectures of the PICs. It was hard to keep track of the various caveats and etc.
No worries - enjoy your Propeller programming whichever compiler you choose to use. It's a great piece of engineering.
And if you get a chance to do any direct comparisons, by all means post the results. If ImageCraft wins they'll sell more compilers - but that doesn't cost me anything. And if Catalina wins then richard will have to actually implement some of those code optimizations, which will make his users happy, and will probably end up with him selling more compilers in the long run anyway.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
More "drive by answers," sorry, it will be a crazy weekend for me...
re: Jazzed and XMM
I'd like ICC-XMM to work on a couple reference platforms such as your board and Clous99's board before release. There never seems to be enough time to do everything I want or need though, so things move in spurts.
re: Linux / OSX
As I have communicated with Graham, our next-gen IDE will likely be based on code::Blocks, and all the compiler tools will be ported to Linux/OS X. Release time TBD. See first bullet.
I don't want it but purely to satisfy my curiosity. Will you be able to use Catalina to compile and run linux (or some other os) now that you have the XMM mode? With 512kB it must be getting close...
There are linux systems that run in less space, so it should be possible once I put the data segments into XMM as well as the code segments. But linux really also needs virtual memory and disk storage. I don't know of anyone that has a disk drive connected to a Prop yet - but I suppose it's only a matter of time [noparse]:)[/noparse]
Virtual memory is fairly trivial to implement in software, but on the Prop doing it this way would probably be too slow to be much real use even using fast XMM. VM should really be done in hardware. Of course, first we had LMM, then XMM, so the next logical step is VMM [noparse]:)[/noparse]
More likely is that someone will port one of the non-virtual RTOS's specifically designed for embedded applications.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
There are linux systems that run in less space, so it should be possible once I put the data segments into XMM as well as the code segments. But linux really also needs virtual memory and disk storage.
Linux also relies on a number of extensions to GCC and has historically been quite awkward to port to other compilers. There is a non-mmu variant floating around that runs on a 640k 8086/8 processor, but with no mmu you lose fork and porting traditional tools becomes somewhat harder. Busybox will run on a non-mmu system though.
My mips router here has 4MB of Flash and 16MB of ram and runs linux quite comfortably, but you either need more non-compressed storage and hacks for XIP (eXecute In Place) or lots more RAM than you are planning on for XMM stuff. You'd also need to develop a new architecture for linux, and while it's not very difficult to port, without GCC and a stable architecture already in place you are starting from a lot further down stream.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
RossH: "I don't know of anyone that has a disk drive connected to a Prop"
Yes you do, what about all the projects here using SD cards? How do you think CP/M gets along.
Anyway Linux will run quite happily without swap space on a disk drive. For sure implementing virtual memory in PASM will result in the slowest ever Linux machine[noparse]:)[/noparse]
There is always Minix.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
You're right - trouble is that on the Hydra I can't have both the XMM and SD expansion cards plugged in at the same time. Which means my "swapfile" speed is limited to how fast I can insert and remove the cards. My arms are getting tired [noparse]:)[/noparse]
Maybe when I get that TriBladeProp that Cluso keeps promising ...
Ross.
P.S. Contiki looks like it could be a goer. Unfortunately, some of us still have to work for a living!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
RossH: "Unfortunately, some of us still have to work for a living!"
But fortunately often people want to pay us to do what we like best, hack on software and hardware and play with gadgets. Which just by happy coincidence is actually of use to someone somewhere.
For example: Having been "resting" for some time and hence having the free time to mess with the Propeller and other goodies I find that in my new position there may well be a space for the Prop in the big picture. A previous "resting" period had me working night and day building up my own embedded system with this new off the wall Linux OS. I've been paid to work on Linux full time ever since. Amazing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I am here because I want to ask you if there are any plans to Port this Compiler to Mac OSX, like Brads Spin IDE which is available for 3 Platforms Win32,Linux and OSX
The only reason I do not offer Mac support is that I have no access to a Mac.
Since the Catalina sources are available, it should simply be a matter of compiling them. All you need to get started is have access to an existing C compiler on the Mac (such as gcc, which is available). Once you can compile lcc on the Mac, from then on lcc (and hence Catalina) can compile itself. As you say, both bstc and Homespun can run on a Mac, so there is really nothing preventing Mac support.
I'd be happy for someone to take this on, and let me know of any changes required. I don't think there should be any (except maybe to build scripts), but if there are I'll incorporate them into the common Catalina source.
Ross.
P.S. An alternative approach is to use a Windows emulation layer on the Mac - but I know how most Mac addicts would react to that suggestion!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I'm working on it. The problem is that I don't currently have a platform that provides anywhere near enough RAM or file storage space - at least not at the same time.
I only have a Hydra to work with, so I can currently have EITHER access to XMM RAM OR access to an SD Card for storage. I can't have both at the same time. I have a full implementation of the C file and stream processing library functions that can access files on the SD Card, but I can't test it because when I run it from XMM I can't see the SD Card - and I just can't get the #@$#@# to fit into 32K so that I don't need to use XMM!
Until I can get around this, Catalina will not be able to compile Catalina. To be more precise - since Catalina is a cross-compiler - it is actually lcc that can compile Catalina. So we actually need to use Catalina to compile lcc for the Prop, then run lcc on the Prop to compile Catalina on the Prop - but there is no point in even trying this yet since to run lcc on the Prop it needs access to a file system - hence the work on the file system.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
catalina.c: In function ‘main’:
catalina.c:1269: warning: incompatible implicit declaration of built-in function ‘exit’
catalina.c:1323: warning: incompatible implicit declaration of built-in function ‘exit’
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I have only one question for what is the ICC in the source tree and how could I build catalina with all libs or is catalina.c just everything?
Is catalina only a front of the ICC?
Oh and after trying to build lcc:
cc -g -o /usr/local/lib/catalina/source/lcc/build/ops /usr/local/lib/catalina/source/lcc/build/ops.o
cp /usr/local/lib/catalina/source/lcc/build/rcc.exe /usr/local/lib/catalina
cp: /usr/local/lib/catalina/source/lcc/build/rcc.exe: No such file or directory
rcc.exe??? Linux? build_lcc.linux...
Is there a description how to build everything and also use it?
Oh and I still haven't got a propeller but look forward to get one so I can't test the compiled code...
You can probably ignore the warnings on compiling catalina.c What compiler are you using?
But the program catalina.c is only the binder (I probably should change the name of this program - it seems to confuse lots of people!). The actual compiler is implemented as a code generator buried way down in the lcc source tree - most of it is in the file 'catalina.md' in the lcc/src directory.
When you build the entire lcc source tree (there is a makefile in there that you may need to modify), you will end up with the three executable files - cpp.exe lcc.exe and rcc.exe (or just plain cpp, lcc and rcc under linux). Here is what all the components do:
lcc.exe is a "wrapper" program that accepts arguments and then invokes the various phases of compilation - i.e. cpp.exe, rcc.exe, catalina.exe. You will probably need to modify this if your environment works differently (different pathnames etc).
cpp.exe is the C preprocessor - a fairly standard part of any C compiler.
rcc.exe is the actual C compiler, which in turn invokes the Catalina code generator.
catalina.exe is the binder - Catalina does not use a linker, but a binder does much the same job - e.g. resolves references to library functions. It then invokes homespun to do the final assembly.
Once lcc is build you then use it to build the library.
I'm sorry it's so complex - I'll try and get around to generating some build documentation for the next release, but in the meantime you should look at the documentation for lcc itself - see www.cs.princeton.edu/software/lcc/
Tthe easiest thing maybe to compile it under windows or linux first (if you have access to a suitable machine) so you can see how it all fitst together before attempting to port it.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I'd suggest at least playing with SPIN - it's a language specifically designed to take advantage of the capabilities of the Propeller. But then by all means use C if you're more familiar with it.
Let me know that Propeller platform you end up buying, and I'll make sure that there are some preconfigured targets for you to use with Catalina (you'll see what I mean when you download the Catalina documenation at the top of this thread).
Ross.
P.S. Your offer of help greatly appreciated. There's always seems to be more to do than I have time available to do it in.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Well done on the C compiler. Great for people on low incomes like myself.
For fun I am looking at exploring how to explore and develop a compiler/s and/or interpreter for various targets.
For micros C is my language (ASM if desperate).
I have a general science background (Degree), and an engineering-based Associate Degree in computer systems technology, including x8086; RISC, CISC micros, ;ASM, C++ and C programming and architecture; interfacing, electronics. The associate degree was completed for interest after being medically retired.
Unfortunately due to health issues I have not been able to follow through in my university studies started last year in computer engineering and computer science. I no longer work due to these health issues.
Obviously a lifetime of experience that you have would also be helpful.
Have many books on architecture, micros, computer science/engineering - need more specific stuff relating to development of compilers for target platforms.
Any books and other resources ( e.g. websites of university courses) that you can please steer me toward?
Gosh you've got me there - before I started on Catalina it was so long since I did any compiler work that I can't even remember what books I used to have on my bookshelf. I remember a book called "Compiler Construction" but can't remember anything else about it. But while looking it up I came across this web site en.wikibooks.org/wiki/Compiler_Construction which looks quite useful.
The main thing I remember is that you can read all about language grammars, and it is all very interesting (ll0, ll1, lr0 etc etc - for examples of each see smlweb.cpsc.ucalgary.ca/example-grammars/) - but you probably won't really LEARN it until you get down to actually building a parser for one, and find out how complex it can be. And of course most "real world" languages don't fit neatly into any of these categories anyway. Language designers just love putting in features that seem designed solely to frustrate the life of compiler builders.
I'd suggest starting with something really simple. Use tools like lex and yacc (or bison - whatever you are familiar with) to build a simple expression parser - it can be surprisingly satisfying to define your own grammer, even if that grammer does nothing more than allow you to evaluate simple expressions such as "(4 * (6 - 3))" and print out the correct answer. But even such a simple grammer can be complex once you add error reporting and recovery - you can often get something working in 10 minutes that can then take you a week to get to the state that it recovers gracefully from the most trivial of typos, and correctly tells the user where and how they went wrong - especially when you have to look ahead several symbols from where the error is to try and guess what it was they may actually have been trying to say.
If you are particularly interested in C, then lcc is obviously a good place to start (see www.cs.princeton.edu/software/lcc/). You could perhaps look at the lcc book. I've not read it, but I've just ordered copy - I'll report what I think when it arrives. Since all my work on lcc has been on the back end (i.e. the code generator), I have not actually needed the book, which I'm sure concentrates mostly on the front end (i.e. the language parser) - till now.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Dale: Not sure what level you are pitching your question at but as a compiler ignoramus myself I was totally enchanted with this famous series of articles: compilers.iecc.com/crenshaw/
Over the years I've tried to read various tomes on compiler construction and parsers etc. I always find them totally impenetrable. For example the famous "Dragon" books: "Compilers: Principles, Techniques, and Tools" by Aho and co.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
The Problem is I build it for LINUX and it trys to move a rcc.EXE why I run the build_lcc.linux and why does it try to move a rcc.exe because there is none....
Hope you understand my Problem because I have no Idea...
Comments
As an ICC user, and one who has looked through your implementation, I think you have summed up the differences pretty well. I still don't get how to put together an XMM image after reading your doc otherwise, I would be doing that for the 2 boards I have. If you summaried your XMM build process, that would help. For example, is it possible to use it without first writing EEPROM ? I would much rather download a binary.
Richard has added XMM extensions to a private build of ICC ... and that's what I've been using. The ball is in his court for productizing XMM-ICCPROP.
ICC does offer some extentions to C89 such as one line comments and enhanced printf (no dynamic arrays or inline functions).
GNU C is the Linux variety. Linux relies heavily on inline functions. I've never seen a dynamic array in Linux but that doesn't rule them out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
At the moment, I use HAM (http://forums.parallax.com/showthread.php?p=628778). Although HAM stands for Hydra Asset Manager, I don't think it is Hydra-specific, I believe it should work on any Propeller Platform with an external EEPROM larger than 32K - which you have to have to run the resulting XMM program anyway.
I'll go through the steps I use to compile/load the startrek demo (this is from memory - check my docs and HAM itself for details):
1. Compile your Catalina program as an XMM ('-x2') file, and generate an eeprom image ('-e') of the result:
This should give you a 64K eeprom file called startrek_xmm.eeprom. This is a pure PASM program, and needs to be combined with an XMM target.
2. Choose your target - For startrek you need to use the hires TV XMM target. You will find an eeprom file in the Catalina 'target' subdirectory called xmm_hires.eeprom. All the XMM targets are 32K eeprom files. If you need to modify them, just compile them with any SPIN compiler and overwrite the existing eeprom files.
3. Start HAM. It is a drag-and-drop application that shows you the layout of an imaginary eeprom up to 128K. You drag and drop the file xmm_hires.eeprom and set its start address to $0000. Then drag and drop the file startrek_xmm.eeprom and set its start address to $8000. You can do this by just dragging and dropping both files in the correct order and then pressing the 'Compress Assets' button. This gives you (in the PC memory) an image of what you need to program into the Propeller's eeprom. Unfortunately, you can't simply save the result to file on the PC at this point - you have to actually upload it.
4. To upload the image into the Propeller's eeprom, you first upload the HAM driver to the Propeller. That takes about 15 seconds. Then you upload the actual eeprom image to the Propeller. This takes about 1 minute.
That's it - reset the Propeller, and enjoy 'Super Star Trek' in all its original monochrome character-based glory!
If you want to save a copy of the eeprom locally for future use, you need to use HAM again - you again upload the HAM driver to the Propeller, but this time you download the entire Propeller eeprom to a local PC file. Unfortunately, I think HAM always saves it in .eeprom format, not .binary format.
It should be easy to write a program that does essentially the same job without requiring either HAM or a Propeller - i.e. just input two .eeprom files and output a combined .eeprom file. If I get time, I'll add this to the next release of the Catalina Binder to make the whole thing a one step process.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Sorry, been busy for a few days. One thing I want to make clear is that we spend A LOT OF effort in optimizing the code from the LCC. Remember our bread and butter are things like compiler for the 8 bits AVR where code size is paramount. So for example, we have automatic register allocation and can pack multiple variables into the same registers if their uses do not overlap etc. We also have capability to do dataflow and peephole, far more extensive than plain LCC facility.
These features will be worked on and enabled on the Propeller C as demand warrants.
// richard
That's an outstanding answer and I really appreciate the effort you took to write it up.
I recently purchased the non-commercial version of the ICC compiler and planned to upgrade to the commercial version as soon as I had more time to evaluate it. So far I really like it. It's much better than the PIC C compilers that I have worked with in terms of features and documentation. The only major limitation is that it only works on windows. An ICC Linux/OSX version, even if it was only a command line version, would be a huge improvement. A Code::Blocks + ICC would be a sweet combo.
Although, I am intensely interested in Catalina, esp. if it supports Linux/OSX. I personally prefer OSX.
As an aside, the propeller HW design is absolutely fascinating, especially in its simplicity. I was really getting tired of all dizzying architectures of the PICs. It was hard to keep track of the various caveats and etc.
Kind regards,
graham
No worries - enjoy your Propeller programming whichever compiler you choose to use. It's a great piece of engineering.
And if you get a chance to do any direct comparisons, by all means post the results. If ImageCraft wins they'll sell more compilers - but that doesn't cost me anything. And if Catalina wins then richard will have to actually implement some of those code optimizations, which will make his users happy, and will probably end up with him selling more compilers in the long run anyway.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
re: Jazzed and XMM
I'd like ICC-XMM to work on a couple reference platforms such as your board and Clous99's board before release. There never seems to be enough time to do everything I want or need though, so things move in spurts.
re: Linux / OSX
As I have communicated with Graham, our next-gen IDE will likely be based on code::Blocks, and all the compiler tools will be ported to Linux/OS X. Release time TBD. See first bullet.
Thanks and regard,
IDE? Why would you need an IDE when you have commands as simple and self-explanatory as:
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
That makes perl look readable!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
There are linux systems that run in less space, so it should be possible once I put the data segments into XMM as well as the code segments. But linux really also needs virtual memory and disk storage. I don't know of anyone that has a disk drive connected to a Prop yet - but I suppose it's only a matter of time [noparse]:)[/noparse]
Virtual memory is fairly trivial to implement in software, but on the Prop doing it this way would probably be too slow to be much real use even using fast XMM. VM should really be done in hardware. Of course, first we had LMM, then XMM, so the next logical step is VMM [noparse]:)[/noparse]
More likely is that someone will port one of the non-virtual RTOS's specifically designed for embedded applications.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Linux also relies on a number of extensions to GCC and has historically been quite awkward to port to other compilers. There is a non-mmu variant floating around that runs on a 640k 8086/8 processor, but with no mmu you lose fork and porting traditional tools becomes somewhat harder. Busybox will run on a non-mmu system though.
My mips router here has 4MB of Flash and 16MB of ram and runs linux quite comfortably, but you either need more non-compressed storage and hacks for XIP (eXecute In Place) or lots more RAM than you are planning on for XMM stuff. You'd also need to develop a new architecture for linux, and while it's not very difficult to port, without GCC and a stable architecture already in place you are starting from a lot further down stream.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
www.sics.se/contiki
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Yes you do, what about all the projects here using SD cards? How do you think CP/M gets along.
Anyway Linux will run quite happily without swap space on a disk drive. For sure implementing virtual memory in PASM will result in the slowest ever Linux machine[noparse]:)[/noparse]
There is always Minix.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
You're right - trouble is that on the Hydra I can't have both the XMM and SD expansion cards plugged in at the same time. Which means my "swapfile" speed is limited to how fast I can insert and remove the cards. My arms are getting tired [noparse]:)[/noparse]
Maybe when I get that TriBladeProp that Cluso keeps promising ...
Ross.
P.S. Contiki looks like it could be a goer. Unfortunately, some of us still have to work for a living!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
But fortunately often people want to pay us to do what we like best, hack on software and hardware and play with gadgets. Which just by happy coincidence is actually of use to someone somewhere.
For example: Having been "resting" for some time and hence having the free time to mess with the Propeller and other goodies I find that in my new position there may well be a space for the Prop in the big picture. A previous "resting" period had me working night and day building up my own embedded system with this new off the wall Linux OS. I've been paid to work on Linux full time ever since. Amazing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Good fortune to you.
If I spend too much more of my time on the Prop, I may be in for a period of "resting" myself [noparse]:)[/noparse]
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I am here because I want to ask you if there are any plans to Port this Compiler to Mac OSX, like Brads Spin IDE which is available for 3 Platforms Win32,Linux and OSX
Best regards,
Infinity
The only reason I do not offer Mac support is that I have no access to a Mac.
Since the Catalina sources are available, it should simply be a matter of compiling them. All you need to get started is have access to an existing C compiler on the Mac (such as gcc, which is available). Once you can compile lcc on the Mac, from then on lcc (and hence Catalina) can compile itself. As you say, both bstc and Homespun can run on a Mac, so there is really nothing preventing Mac support.
I'd be happy for someone to take this on, and let me know of any changes required. I don't think there should be any (except maybe to build scripts), but if there are I'll incorporate them into the common Catalina source.
Ross.
P.S. An alternative approach is to use a Windows emulation layer on the Mac - but I know how most Mac addicts would react to that suggestion!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I'm working on it. The problem is that I don't currently have a platform that provides anywhere near enough RAM or file storage space - at least not at the same time.
I only have a Hydra to work with, so I can currently have EITHER access to XMM RAM OR access to an SD Card for storage. I can't have both at the same time. I have a full implementation of the C file and stream processing library functions that can access files on the SD Card, but I can't test it because when I run it from XMM I can't see the SD Card - and I just can't get the #@$#@# to fit into 32K so that I don't need to use XMM!
Until I can get around this, Catalina will not be able to compile Catalina. To be more precise - since Catalina is a cross-compiler - it is actually lcc that can compile Catalina. So we actually need to use Catalina to compile lcc for the Prop, then run lcc on the Prop to compile Catalina on the Prop - but there is no point in even trying this yet since to run lcc on the Prop it needs access to a file system - hence the work on the file system.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
catalina.c: In function ‘main’:
catalina.c:1269: warning: incompatible implicit declaration of built-in function ‘exit’
catalina.c:1323: warning: incompatible implicit declaration of built-in function ‘exit’
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I have only one question for what is the ICC in the source tree and how could I build catalina with all libs or is catalina.c just everything?
Is catalina only a front of the ICC?
Oh and after trying to build lcc:
cc -g -o /usr/local/lib/catalina/source/lcc/build/ops /usr/local/lib/catalina/source/lcc/build/ops.o
cp /usr/local/lib/catalina/source/lcc/build/rcc.exe /usr/local/lib/catalina
cp: /usr/local/lib/catalina/source/lcc/build/rcc.exe: No such file or directory
rcc.exe??? Linux? build_lcc.linux...
Is there a description how to build everything and also use it?
Oh and I still haven't got a propeller but look forward to get one so I can't test the compiled code...
best regards,
Infinity
Post Edited (Infinity) : 6/2/2009 9:17:23 PM GMT
Soon as I have my propeller hardware I will be trying this C compiler out.
I'm used to the free gcc compiler for the Atmel chips.
Maybe I won't have to bother with spin.
Maybe I can someday help with writing a bit of code for this compiler
You can probably ignore the warnings on compiling catalina.c What compiler are you using?
But the program catalina.c is only the binder (I probably should change the name of this program - it seems to confuse lots of people!). The actual compiler is implemented as a code generator buried way down in the lcc source tree - most of it is in the file 'catalina.md' in the lcc/src directory.
When you build the entire lcc source tree (there is a makefile in there that you may need to modify), you will end up with the three executable files - cpp.exe lcc.exe and rcc.exe (or just plain cpp, lcc and rcc under linux). Here is what all the components do:
- lcc.exe is a "wrapper" program that accepts arguments and then invokes the various phases of compilation - i.e. cpp.exe, rcc.exe, catalina.exe. You will probably need to modify this if your environment works differently (different pathnames etc).
- cpp.exe is the C preprocessor - a fairly standard part of any C compiler.
- rcc.exe is the actual C compiler, which in turn invokes the Catalina code generator.
- catalina.exe is the binder - Catalina does not use a linker, but a binder does much the same job - e.g. resolves references to library functions. It then invokes homespun to do the final assembly.
Once lcc is build you then use it to build the library.I'm sorry it's so complex - I'll try and get around to generating some build documentation for the next release, but in the meantime you should look at the documentation for lcc itself - see www.cs.princeton.edu/software/lcc/
Tthe easiest thing maybe to compile it under windows or linux first (if you have access to a suitable machine) so you can see how it all fitst together before attempting to port it.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I'd suggest at least playing with SPIN - it's a language specifically designed to take advantage of the capabilities of the Propeller. But then by all means use C if you're more familiar with it.
Let me know that Propeller platform you end up buying, and I'll make sure that there are some preconfigured targets for you to use with Catalina (you'll see what I mean when you download the Catalina documenation at the top of this thread).
Ross.
P.S. Your offer of help greatly appreciated. There's always seems to be more to do than I have time available to do it in.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Well done on the C compiler. Great for people on low incomes like myself.
For fun I am looking at exploring how to explore and develop a compiler/s and/or interpreter for various targets.
For micros C is my language (ASM if desperate).
I have a general science background (Degree), and an engineering-based Associate Degree in computer systems technology, including x8086; RISC, CISC micros, ;ASM, C++ and C programming and architecture; interfacing, electronics. The associate degree was completed for interest after being medically retired.
Unfortunately due to health issues I have not been able to follow through in my university studies started last year in computer engineering and computer science. I no longer work due to these health issues.
Obviously a lifetime of experience that you have would also be helpful.
Have many books on architecture, micros, computer science/engineering - need more specific stuff relating to development of compilers for target platforms.
Any books and other resources ( e.g. websites of university courses) that you can please steer me toward?
Anything is appreciated.
Cheers
Dale
Gosh you've got me there - before I started on Catalina it was so long since I did any compiler work that I can't even remember what books I used to have on my bookshelf. I remember a book called "Compiler Construction" but can't remember anything else about it. But while looking it up I came across this web site en.wikibooks.org/wiki/Compiler_Construction which looks quite useful.
The main thing I remember is that you can read all about language grammars, and it is all very interesting (ll0, ll1, lr0 etc etc - for examples of each see smlweb.cpsc.ucalgary.ca/example-grammars/) - but you probably won't really LEARN it until you get down to actually building a parser for one, and find out how complex it can be. And of course most "real world" languages don't fit neatly into any of these categories anyway. Language designers just love putting in features that seem designed solely to frustrate the life of compiler builders.
I'd suggest starting with something really simple. Use tools like lex and yacc (or bison - whatever you are familiar with) to build a simple expression parser - it can be surprisingly satisfying to define your own grammer, even if that grammer does nothing more than allow you to evaluate simple expressions such as "(4 * (6 - 3))" and print out the correct answer. But even such a simple grammer can be complex once you add error reporting and recovery - you can often get something working in 10 minutes that can then take you a week to get to the state that it recovers gracefully from the most trivial of typos, and correctly tells the user where and how they went wrong - especially when you have to look ahead several symbols from where the error is to try and guess what it was they may actually have been trying to say.
If you are particularly interested in C, then lcc is obviously a good place to start (see www.cs.princeton.edu/software/lcc/). You could perhaps look at the lcc book. I've not read it, but I've just ordered copy - I'll report what I think when it arrives. Since all my work on lcc has been on the back end (i.e. the code generator), I have not actually needed the book, which I'm sure concentrates mostly on the front end (i.e. the language parser) - till now.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Over the years I've tried to read various tomes on compiler construction and parsers etc. I always find them totally impenetrable. For example the famous "Dragon" books: "Compilers: Principles, Techniques, and Tools" by Aho and co.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
The Problem is I build it for LINUX and it trys to move a rcc.EXE why I run the build_lcc.linux and why does it try to move a rcc.exe because there is none....
Hope you understand my Problem because I have no Idea...
Best regards,
Infinity