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

Catalina 3.4

1567911

Comments

  • RossHRossH Posts: 5,512
    edited 2012-01-08 03:53
    sicoloco55 wrote: »
    Im new to Catalina and I was wondering if there's some manual or any examples about simple programs.
    Im programming in SPIN but I like more C.

    Thanks :D

    Hi sicoloco55

    Sorry to take so long to answer. I've been out of internet range for the last couple of weeks.

    Catalina C is 100% pure ANSI C. So the best book I can refer you to is the The C Programming Language - anything you find in there should compile and run. If you are at all interested in C you will want to buy, beg or steal a copy of this book (make sure you get the second edition - the first edition describes the C language prior to the ANSI standard). This book is probably the best book on progamming ever written, and still the bible for C programmers.

    In the meantime, any book on ANSI C will do, and there are several online - e.g. The C Book,

    Also, if you just download and install Catalina and look in the Catalina\demos directory, you'll find there's plenty of examples - and there is a reference guide and tutorial document in the main Catalina directory.

    Ross.
  • richaj45richaj45 Posts: 179
    edited 2012-01-20 00:56
    Hello:

    I am wondering if the Prop GCC development is undermining the Catalina tool?

    Also why would Parallax move to support a GCC port when the Catalina is available and from what i read is being continuously improving?

    Thanks for the BW

    Rich
  • Heater.Heater. Posts: 21,230
    edited 2012-01-20 01:53
    Parallax would like to make more Propeller sales, naturally, and hence they are addressing the huge world of commercial embedded systems developers.
    There is a perception that such "professional" developers demand the C language and will not look at Spin or assembler solutions. Further that they expect GCC as it is in use for pretty much every other micro-controller.
    Requiring GCC may not make much sense but I suspect that is the case generally.
    Hence the GCC for Propeller effort.
    I hope both propgcc and Catalina have success and long lives.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-01-20 01:58
    righaj45: You may well ask ;)
    I have no idea except that some believe they need GCC for the professional market. Frankly, Catalina is pretty damn good and has lots of environments. And best of all, its pretty stable.
  • FernandFernand Posts: 83
    edited 2012-01-20 02:13
    Just got a QuickStart board a couple of days ago and have been getting my
    feet wet with the Prop. SPIN works ;-)

    Since the QuickStart is not on the list of environments, and I'm having trouble
    setting options (redefinition of PROPTERM etc), is there a ready-made project
    I can load up and have it compile, load into RAM (or EEPROM), that will have
    printf() working with the Parallax Terminal on a USB Com port? In other words
    something to get started from the IDE with a known working set of options?
    Thanks!
  • RossHRossH Posts: 5,512
    edited 2012-01-20 02:25
    richaj45 wrote: »
    Hello:

    I am wondering if the Prop GCC development is undermining the Catalina tool?

    Also why would Parallax move to support a GCC port when the Catalina is available and from what i read is being continuously improving?

    Thanks for the BW

    Rich

    Hi Rich,

    GCC does not really undermine Catalina, and nor does Catalina really undermine GCC. GCC support for the Propeller is a useful addition to the toolset of professional C/C++ developers who already use GCC and don't want to have to learn anything else.

    Catalina is a simpler compiler (i.e. ANSI C only, no C++) which is likely to be appealing to existing Propeller users, and also likely to be easier for hobbyists who already know Spin but want to learn C without having to deal with the additional complexity that comes with the GCC tool chain (which is a Linux-based toolchain which requires additional support - such as MinGW or Cygwin - to work under Windows).

    Also, Catalina will continue to move in the direction of better Spin integration. I don't think GCC will ever support Spin.

    So - two different compilers for two different markets. If the Prop 2 takes off I wouldn't be surprised to see other compilers emerge. I'm sure someone somewhere is already working on an LLVM backend for the Propeller. In some ways, LLVM might be a better fit for the Propeller architecture than GCC anyway.

    Ross.
  • RossHRossH Posts: 5,512
    edited 2012-01-20 03:58
    Fernand wrote: »
    Just got a QuickStart board a couple of days ago and have been getting my
    feet wet with the Prop. SPIN works ;-)

    Since the QuickStart is not on the list of environments, and I'm having trouble
    setting options (redefinition of PROPTERM etc), is there a ready-made project
    I can load up and have it compile, load into RAM (or EEPROM), that will have
    printf() working with the Parallax Terminal on a USB Com port? In other words
    something to get started from the IDE with a known working set of options?
    Thanks!

    I don't have a QuickStart board, but it isn't difficult to support. I suppose I really should add it as a standard platform since a few people seem to have them these days - I'll post a set of Catalina configuration files that adds specific support for it over the weekend

    In the meantime, it will work if you just specify the DEMO board (to set the correct clockspeed) and limit yourself to the PC (or PROPTERM) HMI options - e.g:
    cd demos
    catalina hello_world.c -lc -D DEMO -D PC
    payload -i hello_world
    

    Note that you need the new version of payload (i.e. 3.5.1) that supports the interactive terminal option (i.e. -i). See the second post in this thread.

    Ross.
  • ersmithersmith Posts: 6,097
    edited 2012-01-20 04:58
    RossH wrote: »
    I don't think GCC will ever support Spin.
    Why would you say that? There's already a Spin to C++ converter. Granted it isn't part of the official propgcc release, but I would not be surprised to see some kind of Spin compilation strategy become part of propgcc.

    Anyway, I'll add to the chorus here that says that Catalina and GCC can certainly co-exist (and to some degree complement each other). Catalina is somewhat more hobbyist focused, and GCC somewhat more professionally focused, but both are useful for all kinds of projects. All the other "serious" platforms (x86, amd64, arm, powerpc, etc.) have multiple C compilers available, I don't see why the Propeller should be any different :-).

    Eric
  • RossHRossH Posts: 5,512
    edited 2012-01-20 14:43
    ersmith wrote: »
    Why would you say that? There's already a Spin to C++ converter. Eric

    Yes, I know about and applaud your efforts to convert Spin to C++ - but the resulting program is not a Spin program. There were some stats somewhere about Spin program code sizes vs C program code sizes. I think it showed that C programs were around 4 times larger than the equivalent Spin programs, Unfortunately this negates one of the key advantages of Spin - i.e. it's compact code size.

    This means that on the Prop 1, many Spin programs converted to C++ won't be able to run - they would simply end up too large. However, your Spin to C++ converter would be a good solution for people who currently use a Prop 1 and want to use a Spin-like language on the Prop 2, since the Prop 2 has enough RAM to run Prop 1 Spin programs converted to C++.

    Have Parallax confirmed whether there is going to be an "official" Spin compiler/interpreter for the Prop 2?

    Ross.
  • FernandFernand Posts: 83
    edited 2012-01-20 15:03
    RossH wrote: »
    I don't have a QuickStart board, but it isn't difficult to support. I suppose I really should add it as a standard platform since a few people seem to have them these days - I'll post a set of Catalina configuration files that adds specific support for it over the weekend

    In the meantime, it will work if you just specify the DEMO board (to set the correct clockspeed) and limit yourself to the PC (or PROPTERM) HMI options - e.g:

    Note that you need the new version of payload (i.e. 3.5.1) that supports the interactive terminal option (i.e. -i). See the second post in this thread.

    Ross.

    Thanks! I don't mind working from the command line later on, but am I mistaken to believe I can work from within the IDE? So I should try selecting DEMO and PROPTERM?

    It would be really nice if someone coming to the Prop from comfortably working with Arduinos could just install Catalina, open the first project and have it download and start blinking a default LED like on an Arduino. It would make an ENORMOUS difference in the number of people choosing the Prop. Any chance of you setting that up?
  • RossHRossH Posts: 5,512
    edited 2012-01-20 16:46
    Fernand wrote: »
    Thanks! I don't mind working from the command line later on, but am I mistaken to believe I can work from within the IDE?
    Yes. I only suggesed using the command line so you can use the new version of payload, which has a terminal emulator built in.
    Fernand wrote: »
    So I should try selecting DEMO and PROPTERM?
    Yes, I think the DEMO board has the same clock as the QuickStart board, so you can use that to set the correct clock configuration (which is all you really need if you are using a terminal emulator).

    As for PROPTERM, in general you're better off using PC rather than PROPTERMINAL (note - not PROPTERM - my bad!) - PC is intended for general purpose terminal emulators, whereas PROPTERMINAL is intended specifically for programs that use the PropTerminal program (which I think is also the same program as the one mentioned here).
    Fernand wrote: »
    It would be really nice if someone coming to the Prop from comfortably working with Arduinos could just install Catalina, open the first project and have it download and start blinking a default LED like on an Arduino. It would make an ENORMOUS difference in the number of people choosing the Prop. Any chance of you setting that up?

    Yes, I agree - the trouble is that there are just SO MANY Propeller platforms, all completely different in clock, pin and device configuration, whereas the Arduino (being a platform and not a chip) - has essentially only one.

    There have been many (unsuccessful) attempts to come up with a standard Propeller platform, and Catalina has tried to support all of them as they came out. I just haven't specifically added the QuickStart platform yet. However, it's quite easy to add support for it yourself. It just requires editing a couple of files in the target subdirectory (see the description of setting up the CUSTOM target on page 18 ofthe Getting Started with Catalina guide).

    Ross.
  • RossHRossH Posts: 5,512
    edited 2012-01-20 19:07
    All,

    Attached is a file (CUSTOM_DEF.inc) that should be copied into the Catalina target directory to compile programs for the QuickStart board (or in fact any board with a standard 5Mhz crystal). All I have done is remove the line in the file that deliberately throws an error (which is in there to remind you to edit the file to suit your platform!).

    Maybe I should just distribute the file this way in the first place, so that new users with a "vanilla" Propeller board (like the QuickStart) can run programs immediately without having to edit anything.

    To use it, just select the the CUSTOM platform from the Code::Blocks IDE, or define the symbol CUSTOM on the command line. Also, since the QuickStart board has no TV or VGA, you should define the PC symbol if you want to use stdio. Or the PROPTERMINAL symbol if you want to use that program. For instance (assuming you are using payload version 3.51, available in the second post in this thread):
    cd demos
    catalina -lci othello.c -D CUSTOM -D PC
    payload -i othello
    

    Now you can play "othello" on your QuickStart board!
    Ross.
  • ersmithersmith Posts: 6,097
    edited 2012-01-20 19:53
    RossH wrote: »
    Yes, I know about and applaud your efforts to convert Spin to C++ - but the resulting program is not a Spin program. There were some stats somewhere about Spin program code sizes vs C program code sizes. I think it showed that C programs were around 4 times larger than the equivalent Spin programs, Unfortunately this negates one of the key advantages of Spin - i.e. it's compact code size.

    Just to be pedantic, let's not confuse "Spin" the language with the "Spin Virtual Machine", i.e. the bytecodes that the built in Spin interpreter can read. Other compilers could produce spin byte codes, and (obviously) Spin can be compiled to LMM rather than SVM.

    Eric
  • FernandFernand Posts: 83
    edited 2012-01-20 22:01
    RossH wrote: »
    All,

    Attached is a file (CUSTOM_DEF.inc) that should be copied into the Catalina target directory to compile programs for the QuickStart board (or in fact any board with a standard 5Mhz crystal). All I have done is remove the line in the file that deliberately throws an error (which is in there to remind you to edit the file to suit your platform!).

    Maybe I should just distribute the file this way in the first place, so that new users with a "vanilla" Propeller board (like the QuickStart) can run programs immediately without having to edit anything.

    To use it, just select the the CUSTOM platform from the Code::Blocks IDE, or define the symbol CUSTOM on the command line. Also, since the QuickStart board has no TV or VGA, you should define the PC symbol if you want to use stdio. Or the PROPTERMINAL symbol if you want to use that program. For instance (assuming you are using payload version 3.51, available in the second post in this thread):
    cd demos
    catalina -lci othello.c -D CUSTOM -D PC
    payload -i othello
    

    Now you can play "othello" on your QuickStart board!
    Ross.

    I'm going to try it, but I've compiled programs and gotten a rather large .binary (24k) and not sure what to do next. I did try loading it with bstl.exe with no luck. Is there a way to just get the IDE to compile and load the program into RAM over a USB COM port?

    It does look like 5 Mhz is the currrent standard. I've been whining about the lack of standards, but maybe now with boards like the ASC, the Gadget Gangster Prop Platform USB and (maybe) the QuickStart, it's moving where I'd like to see it, which is to join the Arduino community and offer them an upgrade path instead of everybody doing their own thing.
  • RossHRossH Posts: 5,512
    edited 2012-01-20 22:39
    Fernand wrote: »
    I'm going to try it, but I've compiled programs and gotten a rather large .binary (24k) and not sure what to do next. I did try loading it with bstl.exe with no luck. Is there a way to just get the IDE to compile and load the program into RAM over a USB COM port?

    24k? Is that for the "othello" program? If so, something is wrong there - it should be around 13k. Paste your build log here and I'll figure out why.

    As for loading, once your project is compiled just use Download to Hub RAM from the Tools menu.
    Fernand wrote: »
    It does look like 5 Mhz is the currrent standard. I've been whining about the lack of standards, but maybe now with boards like the ASC, the Gadget Gangster Prop Platform USB and (maybe) the QuickStart, it's moving where I'd like to see it, which is to join the Arduino community and offer them an upgrade path instead of everybody doing their own thing.

    Given the nature of these forums, it will never happen!

    Ross.
  • RossHRossH Posts: 5,512
    edited 2012-01-20 23:01
    Fernand,

    Just on your 24k binary size - it just occurred to me that you are probably compiling "hello world" with the simplest possible options. The following does indeed generate a binary file around 24k:
    catalina -lc hello_world.c -D CUSTOM -D PC
    

    However, don't panic! The following command generates a binary file under 6k:
    catalina -lci hello_world.c -D CUSTOM -D PC -W-Dprintf=t_printf -D NO_KEYBOARD -D NO_ARGS
    

    There are other options available that can bring this code size down further (to around 5k). To explain some of this, read the section that begins on page 90 of the Catalina Reference Manual.

    Ross.
  • RossHRossH Posts: 5,512
    edited 2012-01-20 23:13
    ersmith wrote: »
    Just to be pedantic, let's not confuse "Spin" the language with the "Spin Virtual Machine", i.e. the bytecodes that the built in Spin interpreter can read. Other compilers could produce spin byte codes, and (obviously) Spin can be compiled to LMM rather than SVM.

    Eric

    Hi Eric,

    Don't worry about being pedantic. - I often am :)

    I meant that it is not a Spin program inasmuch as it could not be executed on any current Propeller chip (since it would be too large). But I agree that eventually such programs could be executed on a Prop 2. That's why I wondered whether Parallax is going to release an equivalent of the current SVM for the Prop 2. If they do, that would be another way of executing Spin programs on the Prop 2. If they don't, your technique may be the only hope for Spin programmers, and consequently Spin would probably die out as a language (why bother with it if you were to lose its main attraction, which is its small code footprint?).

    Ross.
  • FernandFernand Posts: 83
    edited 2012-01-20 23:24
    RossH wrote: »
    24k? Is that for the "othello" program? If so, something is wrong there - it should be around 13k. Paste your build log here and I'll figure out why.

    As for loading, once your project is compiled just use Download to Hub RAM from the Tools menu.



    Given the nature of these forums, it will never happen!

    Ross.

    Ross, thanks so much for the CUSTOM, but there is no such thing in the Tools menu. In fact it's entirely empty but for the Configure Tools item.

    Now I don't mind this sort of thing in small doses, I've been trying to hack it, I mean manually setting environment variables, extending the PATH, running some of the build scripts, e.g. Error: Catalina_XMM.spin (927, 1): Unterminated #IFDEF, trying to run it from the cmd prompt, edited the simple_test.c to use #define OUTPUTS 0x000F0000 to set ports 16-23 on the QuickStart (did I get it right?), but it's got WAY too many things not as you expect, and WAY too many things that I haven't the foggiest idea as to what belongs where. I mean, think about it.

    Either Catalina Blocks installs 100% correctly like a Windows program with everything runnable from a User account and as a starting point first act will, at the push of a specified menu item, reliably compile and load up and execute a simple blinker, where the user's only choice is the Prop pin number to blink and the host side USB/COM port to use, well, maybe also the Prop clock speed, or it's steep enough to consume HUGE amounts of time, I mean literally days. Just when I thought I wasn't going to have to do another cc -o again .. ;-) I've done enough for X lifetimes. You know what I like these days? Delphi and C++Builder.

    BTW, I managed to (I can't remember exactly the steps, I compiled, got a binary, and I think I used bstl to upload, but maybe by then I used Payload) get the PropTerm's Rx light blinking apparently from my printf() loop, but what's the sending baudrate? Nothing I tried works. And I have no idea how far I am from usability.
  • RossHRossH Posts: 5,512
    edited 2012-01-21 00:05
    Fernand wrote: »
    Ross, thanks so much for the CUSTOM, but there is no such thing in the Tools menu. In fact it's entirely empty but for the Configure Tools item.
    I've had something like this reported once before, but I've not been able to reproduce it. What version of Windows are you using? Also, did you already have Code::Blocks installed, or are you using the version included with Catalina?

    My suggestion would be to uninstall and reinstall Catalina. If that doesn't fix your Tools menu, please post a copy of your Code::Blocks default.conf file (this is where the Tools entries are specified). You will find this in the Windows directory %APPDATA%\codeblocks
    Fernand wrote: »

    Now I don't mind this sort of thing in small doses, I've been trying to hack it, I mean manually setting environment variables, extending the PATH, running some of the build scripts, e.g. Error: Catalina_XMM.spin (927, 1): Unterminated #IFDEF, trying to run it from the cmd prompt, edited the simple_test.c to use #define OUTPUTS 0x000F0000 to set ports 16-23 on the QuickStart (did I get it right?), but it's got WAY too many things not as you expect, and WAY too many things that I haven't the foggiest idea as to what belongs where. I mean, think about it.
    Fair enough - but why are you trying to do any of this stuff? Under Windows, just use the Catalina installer. You don't need to mess about with environment variables, paths or build scripts. Unfortunately I have no idea what pins the QuickStart board uses for LEDs - check your QuickStart manual.
    Fernand wrote: »

    Either Catalina Blocks installs 100% correctly like a Windows program with everything runnable from a User account and as a starting point first act will, at the push of a specified menu item, reliably compile and load up and execute a simple blinker, where the user's only choice is the Prop pin number to blink and the host side USB/COM port to use, well, maybe also the Prop clock speed, or it's steep enough to consume HUGE amounts of time, I mean literally days. Just when I thought I wasn't going to have to do another cc -o again .. ;-)
    For most people, it does. Sorry you're having a problem. After installing, everything should work as advertised, and you should be able to build, load and execute a blinking LED program (there is one called test_leds.c in the Code::Blocks demos workspace) with only a single edit to specify which pin to use to flash the LED. In your case (since you have a non-supported Propeller board) you would also have had to delete a single line in the CUSTOM_DEF.inc file - but I already did that for you.
    Fernand wrote: »

    BTW, I managed to (I can't remember exactly the steps, I compiled, got a binary, and I think I used bstl to upload, but maybe by then I used Payload) get the PropTerm's Rx light blinking apparently from my printf() loop, but what's the sending baudrate? Nothing I tried works. And I have no idea how far I am from usability.

    If you have gotten that far, then you are already there. The baud rate defaults to 115200 (you can change it in the files PC_Text.spin and PC_Keyboard.spin in the target folder if you like). What terminal emulator do you use? You should just be able to open it to the appropriate COM port and see the output of your printf() statement.

    Ross.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-01-21 01:16
    As a suggestion, use PST (Parallax Serial Terminal) program on the Windows pc just in case there is a problem with the terminal program you are using. It comes with the
    PropTool install.

    I did not have any install problems and the hello world ran as expected. I just followed the manual. However, I did get help from Ross to build a new RamBlade3 driver because I needed to understand how to build the test programs.

    Please note I know nothing about any of these make files, GCC, the Catalina environment, etc. This is all new to me, so I was grateful it worked straight off. I now run 2 batch files to compile and download my test code within a command prompt although initially I used CodeBlocks.

    My problems are with all the include files... because I want to use an existing PIC C program and need to modify it to compile. I guess it does not help that I am not a C programmer either.
  • FernandFernand Posts: 83
    edited 2012-01-21 04:38
    So close. Or as the saying around my lab goes "Dis time for sure". Sigh. I'll give it a reinstall. In fact I THINK I saw some menu items in Tools after installation and then they were gone.

    The Quickstart Board (available at Radio Shack!) has 8 LEDs, on pins 16..23, and 8 circuit board printed touch switches on pins 0...7 in addition to TX/RX and power LED.
  • FernandFernand Posts: 83
    edited 2012-01-21 04:52
    Nope. Uninstalled. Reinstalled. The Tools menu is still empty. Doing a build of hello world completes. And now what? Where's the executable? Figuring it probably has all the wrong options, I tried to set options to CUSTOM, PC term, TINY, Stdio, and now it won't compile, tons of errors.

    Running Windows 7 "Home premium", running as a User. No, I will not run as Admin. It requested privs during install, so I gave 'em. Had to work the firewall/antivirus a lot of times durng install as it was doing illegitimate stuff, but I granted permission on each one. I am surprised that it has defeated security and made directories like /bin in Catalina read-write for everyone. Bin??? What legit program needs to write to /bin?
  • FernandFernand Posts: 83
    edited 2012-01-21 05:06
    Here if DEFAULT.conf

    I did add PAYLOAD.EXE to the Tools menu, but had no idea what params it needed.



    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>.
    <CodeBlocksConfig version="1">
    ... bla bla bli, bla bla bla ....
    </CodeBlocksConfig>
  • RossHRossH Posts: 5,512
    edited 2012-01-21 17:02
    Fernand wrote: »
    Nope. Uninstalled. Reinstalled. The Tools menu is still empty. Doing a build of hello world completes. And now what? Where's the executable? Figuring it probably has all the wrong options, I tried to set options to CUSTOM, PC term, TINY, Stdio, and now it won't compile, tons of errors.

    Running Windows 7 "Home premium", running as a User. No, I will not run as Admin. It requested privs during install, so I gave 'em. Had to work the firewall/antivirus a lot of times durng install as it was doing illegitimate stuff, but I granted permission on each one. I am surprised that it has defeated security and made directories like /bin in Catalina read-write for everyone. Bin??? What legit program needs to write to /bin?

    Hi Fernand,

    Thanks for posting your default.conf file (you might want to edit that post and remove it - I got what I needed, and it makes the thread hard to follow!).

    I have managed to reproduce the problem. You should not have to run Catalina as Admininstrator - the installer should ask for Administrator permission only during the install process - but even so, when installing Catalina to a non-admin user account it does not appear to correctly write the initial default.conf file. The file you posted is one created by Code::Blocks because it didn't find it when it was first run. Fortunately, this is easy enough to fix.

    After installing Catalina as a non-admin user, you may be missing both the Tools menu entries and possibly the LCCDIR environment variable (since I noticed that for some reason this option may not be checked by default in some cases - so if you reinstall, please be sure to check this option).

    If you have already set up the LCCDIR environment variable yourself (e.g. to C:\Program Files\Catalina) and just want to add the Tools menu entries, I have attached a copy of the correct default.conf - shut down Code::Blocks and copy this to your %APPDATA%\codeblocks folder (just copy it over any existing default.conf file).

    When the Tools menu is intact, you should be able to compile any of the programs in the "demos" workspace - open the workspace from C:\Program Files\Catalina\codeblocks\demos.workspace and select one of the projects (e.g. the test_suite). Set up the CUSTOM and PC options and then compile it. Then you should be able to download it using the Download to Hub RAM entry on the Tools menu - it will find the executable and the port to use automatically.

    The test_suite program is a good one to try because it will wait for user entry between each step - so you will not miss the output. When you have downloaded it, start your terminal emulator and open the appropriate port at 115200 baud. Then press ENTER a couple of times.

    Ross.

    EDIT: Found the problem! When installing Catalina from a non-admin user account, the installer package prompts for the password of an admin account since it needs administrator permission to install some things - but it then proceeds to set up the Code::Blocks default.conf file for the admin user, not the user doing the install! I'll add a note about this behaviour to the first post of this thread until I can fix the installer.
  • FernandFernand Posts: 83
    edited 2012-01-22 03:15
    So where do those DEMOS get compiled into? And doesn't c:\program files (x86)\Catalina\bin need to be added to the path? And is it supposed to go into Local or Roaming or whichever AppData?

    Thanks, Ross, I'll try it. But I doubt it's all fixed. Of course an installer that's running as Admin sets EVERYTHING up for Admin unless it's carefully planned. From a cmd prompt started as Admin do a DIR /AH in the C:\Users directory. There's a default account and virtual directories, there are techniques for copying startup profile data from the starting default space into each user's space when he first runs the program, then each user works on his own set of profiles. A good installer will set that up for you. But then a user can't just be jumping around and compiling stuff in system directories. There are a lot of subtle things connected with NT's security and it's about time!

    I stopped running as an admin a long time ago, I'm on the 'net, and there are private loops in-house that must be kept safe. Too many viruses out there. I'm glad Microsoft is finally making use of what's been available in NT for what, 18 years, after costing us literally billions in losses due to Windows 98's lack of security. I've contracted for Microsoft, I heard it all. Their incredible argument for keeping Windows 95 and not switching to NT sooner was "cost of extra memory". And then it was "users don't want to be bothered". Meanwhile that POS 16 bit DOS-Windows, or WINDOW as it was called by those who knew what was happening, was costing every business a fortune due to constant crashes and virus infections. And they HAD a solution in NT, they just didn't sell it to the masses. THAT's what the courts should have nailed them for.

    But the implications of a properly secured system are widespread. I've had to change a LOT of little things in my own programs. A program cannot write to protected directories. It cannot write to protected registry objects. It has to play by the rules. You can't just open up permissions as a convenience, these are now multi-user-capable machines. If I'm going to code (or run) a hack, I install it in my own space. That IS an option to consider in the meantime. But the overall benefits of better security are enormous. You, or a virus running as you, can do a del *.* /s from root directory and at most it will delete your own stuff, it can't touch the system or other accounts' files. What I'm saying is that It would be really nice if you stopped running as an Admin long enough to really get the hacks out of Catalina so it's predictable and solid. Just sayin' ...

    Sorry if I sound harsh, it's just so near and yet so far ;-)
  • RossHRossH Posts: 5,512
    edited 2012-01-22 03:59
    Fernand wrote: »
    So where do those DEMOS get compiled into?
    The demos get compiled to wherever the projects in the workspace says to compile them to. In the case of the "hello world" project in the demos workspace, it will be something like C:\Program Files\Catalina\codeblocks\hello_world\bin\Release (or \Debug). This is really a Code::Blocks issue, not a Catalina issue - i.e. I don't have much control over it.
    Fernand wrote: »
    Thanks, Ross, I'll try it. But I doubt it's all fixed. Of course an installer that's running as Admin sets EVERYTHING up for Admin unless it's carefully planned. From a cmd prompt started as Admin do a DIR /AH in the C:\Users directory. There's a default account and virtual directories, there are techniques for copying startup profile data from the starting default space into each user's space when he first runs the program, then each user works on his own set of profiles. A good installer will set that up for you. But then a user can't just be jumping around and compiling stuff in system directories. There are a lot of subtle things connected with NT's security.
    In this case, the problem is not with Windows per se, but with Code::Blocks, and that way it sets itself up. However, I have just tried it from both an admin and a non-admin account, and once it is set up correctly, everything seems to work as expected.
    Fernand wrote: »
    I stopped running as an admin a long time ago, I'm on the 'net, and there are private loops in-house that must be kept safe. Too many viruses out there. I'm glad Microsoft is finally making use of what's been available in NT for what, 18 years, after costing us literally billions in losses due to Windows 98's lack of security. I've contracted for Microsoft, I heard it all. Their incredible argument for keeping Windows 95 and not switching to NT sooner was "cost of extra memory". And then it was "users don't want to be bothered". Meanwhile that POS 16 bit DOS-Windows, or WINDOW as it was called by those who knew what was happening, was costing every business a fortune due to constant crashes and virus infections. And they HAD a solution in NT, they just didn't sell it to the masses. THAT's what the courts should have nailed them for.
    We could argue about this for weeks! :) In my view, even Windows NT had a very simpleminded security model. To make up for its shortcomings, Windows Vista/7 seems to have a security model so complex and cumbersome that mere mortals cannot possibly either comprehend or use it. The "folder virtualization" kludge is a good case in point - it is (apparently) only there to make up for previous bad design decisions, and makes a developers everyday job a confusing nightmare. Again this is just my opinion, but I don't think anything Microsoft has come up with has ever approached in simplicity or elegance the security model that true multi-user operating sytems like Unix or VMS have had for decades. But then Microsoft was a late comer to multi-user, and I also understand that simplicity and elegance is not a very useful business model - which is probably why many companies that offered VMS and Unix support are now bankrupt (even though the operating systems themselves are still very much alive and well) but Microsoft is still alive and twitching even after the Vista fiasco nearly bankrupted them. So it goes. :(
    Fernand wrote: »
    But the implications of a properly secured system are widespread. I've had to change a LOT of little things in my own programs. A program cannot write to protected directories. It cannot write to protected registry objects. It has to play by the rules. You can't just open up permissions as a convenience, these are now multi-user-capable machines. If I'm going to code (or run) a hack, I install it in my own space. That IS an option. But the overall benefits of better security are enormous. You, or a virus running as you, can do a del *.* /s from root directory and at most it will delete your own stuff, it can't touch the system or other accounts' files. What I'm saying is that It would be really nice if you stopped running as an Admin long enough to really get the hacks out of Catalina so it's predictable and solid. Just sayin' ...
    Well, always willing to learn if there is a real problem here. But as I said, I've just installed Catalina as a non-admin user, and everything appears to work as advertised.

    Let me know if you continue to have problems, and I will fix them.

    Ross.
  • FernandFernand Posts: 83
    edited 2012-01-22 04:43
    No it would not work. I finally took the quickfix way, as follows.

    1) Install in a writable directory in your own filespace, e.g. c:\users\you\My Documents\Dvt\Catalina
    The inter-space in \My Documents should be OK as the directory name is virtualized to Documents, but
    if you're worried, create a different folder in the root of your user space, e.g. c:\users\you\Progs\Catalina

    2) Provide Admin password when asked. If your security watchdog keeps alerting about
    "dangerous stuff" keep granting permission with "remember" option.

    3) After installation manually add the location to your profile's PATH,
    e.g. c:\users\you\My Documents\Dvt\Catalina\bin. You can set the PATH in
    Control Panel -> System->Advanced System Settings -> Environment Variables

    4) If you're using one of the new 80 Mhz boards, write the new Custom_def.inc
    over the one in Catalina\Targets

    5) Update current version of Payload.exe by overwriting the one in Catalina\bin

    6) Copy the new default.conf over the one in c:\users\you\AppData\Roaming\Codeblocks

    7) Run Codeblocks, select Open an existing project,
    open C:\users\you\My Documents\Dvt\Catalina\codeblocks\test_leds.cbp
    Then navigate in the left workspace pane to test_leds.c

    8) Edit line 6 for your board to pick one or more LEDs. This is a bit pattern
    picturing the I/O pins. P0 would be 0x00000001. For the Quickstart this should read:

    #define BITMASK 0x00FF0000 // Use I/Os 16..23 (Debug LEDs on Quickstart)

    9) Menu Build -> build
    If your security watchdog keeps alerting, keep granting permission with "remember"
    option (or you will be repeating it, a lot).

    10) Menu Tools -> Download to HUB RAM. Watch the board and look for blinkin' TX/RX LEDs.

    11) Watch 'em 8 LEDs blink on your QuickStart. If you have fewer LEDs, watch what you got.

    So, yes, we got here. Thanks so much, Ross.
    Now what were you saying about arguing for weeks?
  • Heater.Heater. Posts: 21,230
    edited 2012-01-22 04:57
    Grief, they say Linux is hard to use. Thank God I haven't needed to use Windows since 1998 or so.
  • FernandFernand Posts: 83
    edited 2012-01-22 06:18
    Blame the Codeblocks installer, not Windows ;-) But, seriously, this is a workaround
    and documented to the letter, so anybody can make it work. It took a coupla days
    to get here.
  • Heater.Heater. Posts: 21,230
    edited 2012-01-22 13:15
    Blame the Codeblocks installer, not Windows

    I can't do that. It would undermine my entire world model:)
    It took a coupla days to get here.

    Exactly:)
Sign In or Register to comment.