Getting GNU toolchain working in TOS

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

JonB
Captain Atari
Captain Atari
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Getting GNU toolchain working in TOS

Postby JonB » Tue Feb 21, 2012 10:24 pm

Hi all

Trying to get GNU g++, debugger, make, lib, etc working on the ST.

Can anyone advise how best to do this? I keep trying FTP sites (there are many out there), but most of them don't seem to work, I can't login as a guest. Can you recommend a site please?

Does anyone use g++ on the ST? If so, do the supplied libraries have GEM / TOS calls?

I do have Megamax C up and running, but a) I've no documentation :( and b) I would like to do OOP on the ST with C++.

Cheers

JonB
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12728
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Getting GNU toolchain working in TOS

Postby wongck » Tue Feb 21, 2012 11:06 pm

Please read this thread, may give you some pointers
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5103
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Getting GNU toolchain working in TOS

Postby simonsunnyboy » Wed Feb 22, 2012 5:26 pm

If you are working for a plain ST, AHCC might be a better choice. The GNU toolchain requires a lot of program swapping from disk, that takes time, even with a harddisk.

AFAIK those who use the GNU toolchain these days, only do it from a crosscompilation environment on the PC/Mac and not natively on an Atari machine.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 881
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: Getting GNU toolchain working in TOS

Postby jfl » Wed Feb 22, 2012 6:08 pm

simonsunnyboy wrote:If you are working for a plain ST, AHCC might be a better choice. The GNU toolchain requires a lot of program swapping from disk, that takes time, even with a harddisk.

AFAIK those who use the GNU toolchain these days, only do it from a crosscompilation environment on the PC/Mac and not natively on an Atari machine.

I beg to differ: I use GCC on my Falcon almost daily and wouldn't have it any other way. Granted, it's a 060 with 512MB RAM, which is probably the minimum requirement for current GCC versions.
Jean-François
GEMDict – GEMClip

JonB
Captain Atari
Captain Atari
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: Getting GNU toolchain working in TOS

Postby JonB » Wed Feb 22, 2012 9:45 pm

simonsunnyboy wrote:If you are working for a plain ST, AHCC might be a better choice. The GNU toolchain requires a lot of program swapping from disk, that takes time, even with a harddisk.

AFAIK those who use the GNU toolchain these days, only do it from a crosscompilation environment on the PC/Mac and not natively on an Atari machine.


No, it must be native, to retain that retro computing experience!

Is ACC a C++ compiler then?
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..

User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 881
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: Getting GNU toolchain working in TOS

Postby jfl » Wed Feb 22, 2012 10:07 pm

JonB wrote:
simonsunnyboy wrote:If you are working for a plain ST, AHCC might be a better choice. The GNU toolchain requires a lot of program swapping from disk, that takes time, even with a harddisk.

AFAIK those who use the GNU toolchain these days, only do it from a crosscompilation environment on the PC/Mac and not natively on an Atari machine.


No, it must be native, to retain that retro computing experience!

Is ACC a C++ compiler then?

AHCC is a C compiler. For C++, only g++ is available on Atari, and you won't be able to use current versions on a ST, and certainly not under TOS. As for previous ones, I don't know, but you might want to look up Warwick Allison and GEM++ (C++ classes for GEM). Maybe he had some sort of g++ ported to the ST too.
Jean-François
GEMDict – GEMClip

JonB
Captain Atari
Captain Atari
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: Getting GNU toolchain working in TOS

Postby JonB » Sat Feb 25, 2012 9:06 am

There seem to be a load of FTP sites out there with TOS binaries for all the GNU toolchain.

So I need to try and work out what I need...
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..

mikro
Hardware Guru
Hardware Guru
Posts: 2018
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: Getting GNU toolchain working in TOS

Postby mikro » Fri Mar 02, 2012 1:29 pm

JonB wrote:There seem to be a load of FTP sites out there with TOS binaries for all the GNU toolchain.

So I need to try and work out what I need...

Don't be silly. On normal ST it's unusable plus it's an awfully old version (2.8.x vs 4.7.x nowadays). So the compiler is most likely buggy, the C/C++ libs are probably buggy and if you think about STL or modern C++ features, just forget it, there weren't available in that time. Nobody will be able to help you with such ancient setup.

JonB
Captain Atari
Captain Atari
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: Getting GNU toolchain working in TOS

Postby JonB » Fri Mar 02, 2012 1:56 pm

mikro wrote:
JonB wrote:There seem to be a load of FTP sites out there with TOS binaries for all the GNU toolchain.

So I need to try and work out what I need...

Don't be silly. On normal ST it's unusable plus it's an awfully old version (2.8.x vs 4.7.x nowadays). So the compiler is most likely buggy, the C/C++ libs are probably buggy and if you think about STL or modern C++ features, just forget it, there weren't available in that time. Nobody will be able to help you with such ancient setup.


There is no need to be rude.

All STs are an "ancient setup". That's why we have a community, so we can ask questions and share knowledge. If you don't want to help, please don't post such discouraging messages...
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5103
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Getting GNU toolchain working in TOS

Postby simonsunnyboy » Fri Mar 02, 2012 5:36 pm

I fear mikro is right in desccribing that the GNU toolchain for plain TOS is severely outdated.
However you are hereby invitied to prove him wrong and maybe compile a more modern version with it.

At this point, it should be pretty clear, there are no users of the GNU toolchain on plain TOS around on this forum. So you can help the community by posting your own practical findings and solutions on it.

I personally would like to have a full native GNU toolchain for TOS that would run on 4MB ST class machines. My own attempts failed back in the past, maybe because I did insist on floppy usage back then. These days my personal favourite is AHCC, also because I personally don't see much benefit in using C++ over C for most embedded tasks (and ST programming is actually just a subdiscipline of programming embedded systems)
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

JonB
Captain Atari
Captain Atari
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: Getting GNU toolchain working in TOS

Postby JonB » Fri Mar 02, 2012 7:45 pm

simonsunnyboy wrote:ST programming is actually just a subdiscipline of programming embedded systems


I don't agree 100% with you there, unless you mean "game programming", which generally needs a real time executive running behind the scenes. I think, other than that, there are very few similarities between the ST and an embedded computer, other than, say "its processor has a Von Neumann architecture" or some other generic microcomputer related statement. On the other hand, you may be referring to the need to be efficient with limited resources (memory, CPU cycles, I/O etc), in which case it is quite possible to write tight code in C++, as long as you keep inheritance hierarchies relatively simple, and don't try to be too clever with design patterns (that book has a lot to answer for).

What I actually want to do is resurrect a GEM program I wrote many years ago, and it really lends itself to a proper OO implementation. At the moment all I have is Megamax C with no documentation; sure, I could download some new compilers but I thought I might as well go the whole hog and go GNU. To be honest, I didn't realise these early versions were in such a state. I think porting the code itself would be a challenge, but that's the beauty of it - it is a hobby after all.

I'm happy to document my experiences here if you like, but I think I'd rather come at it from a kind of "this is how it works for me" angle rather than the opposite "why won't it work??". So my OP was to ask where the best place was to get the latest working binaries from.

So... what I did find was an archive with nine zip files. Some French chap had just copied his own (presumed working) GNU environment and put it on 9 floppies. Thes were uploaded somewhere. So, thinking it might help things, I grabbed and installed them. It sort of works, sort of, but not very well. I have bash, for example, but it dosn't seem to like the DOS text file mode of the ST, which leads to all sorts of problems when reading the bash.rc file. I have already got elvis (vi clone) but it really is sluggish (see my other thread on that one). Works well, otherwise. All of the normal *nix type commands appear to work, but redirection to a file and pipe joins in the shell are not working. Funny thing is, redirection is broken in my gulam shell too (despite the docs saying otherwise).

Oh well..

:)
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5103
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Getting GNU toolchain working in TOS

Postby simonsunnyboy » Fri Mar 02, 2012 9:32 pm

The "this is how it works for me" angle is exactly what I meant. Describe what works for you, it seems it did not work for others sofar.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12728
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Getting GNU toolchain working in TOS

Postby wongck » Sat Mar 03, 2012 4:06 am

JonB wrote:I'm happy to document my experiences here if you like, but I think I'd rather come at it from a kind of "this is how it works for me" angle rather than the opposite "why won't it work??". So my OP was to ask where the best place was to get the latest working binaries from.


Would be nice if you can add these findings, howtos into our AF wiki page on programming.
I have created a new section for you to start with called "Using GNU toolchain". Feel free to change those stubs as I have no idea how would be best for you to document it.
Thanks mate.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

JonB
Captain Atari
Captain Atari
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: Getting GNU toolchain working in TOS

Postby JonB » Sat Mar 03, 2012 9:21 am

Nice one, wongck... ha ha, no pressure then...

;)
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12728
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Getting GNU toolchain working in TOS

Postby wongck » Sat Mar 03, 2012 12:33 pm

sorry mate, no pressure. Just did not want your findings to float off to nowhere if they are not collected.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

joska
Hardware Guru
Hardware Guru
Posts: 4382
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Getting GNU toolchain working in TOS

Postby joska » Sat Mar 03, 2012 6:29 pm

JonB wrote:Trying to get GNU g++, debugger, make, lib, etc working on the ST.


Unless you want to go insane - drop it. There are some old versions that's *can* be run on the ST, but that doesn't mean that it's usable. I have used these versions on a Falcon030 but quickly stopped. It's just too resource hungry.

If you want to develop programs in C++ for the ST I strongly recommend cross-compiling on a more powerful machine. Using ARAnyM is also a very good option, then you would atleast run the compiler under TOS/MiNT.

If you want to use an OO programming language on a ST there's not many choices. In fact, I can only think of one language and that's Pure Pascal. PP will be usable on a ST with atleast 4Mb and a harddrive of some sort.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2448
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece
Contact:

Re: Getting GNU toolchain working in TOS

Postby christos » Sat Mar 03, 2012 6:35 pm

I believe there's also an OO extension for gfa basic. Other than that I'd agree with joska (didn't know pp was object oriented btw).
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org

JonB
Captain Atari
Captain Atari
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: Getting GNU toolchain working in TOS

Postby JonB » Sun Mar 04, 2012 9:42 am

joska wrote:Unless you want to go insane - drop it. There are some old versions that's *can* be run on the ST, but that doesn't mean that it's usable. I have used these versions on a Falcon030 but quickly stopped. It's just too resource hungry.


Ummm... Err... Sounds like the "nays" have it! I haven't actually got g++ to do anything more than tell me the version, it keeps exiting with a value of 1 to the shell (i.e., abnormally). Been hacking about with bash as well; seems OK but has some wierdness around interpreting the bash.rc file (CR/LF problem I think).

As I said before, this is just for fun... I might try getting BusyBox compiled; I think it might offer something better than "good old Gulam"..
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..

JonB
Captain Atari
Captain Atari
Posts: 303
Joined: Fri Dec 02, 2011 5:01 pm

Re: Getting GNU toolchain working in TOS

Postby JonB » Sun Mar 04, 2012 9:43 am

christos wrote:I believe there's also an OO extension for gfa basic. Other than that I'd agree with joska (didn't know pp was object oriented btw).


Oooh OO GFA Basic? Sounds like a great deal of fun!
Too many retro computers here: 1040STfm, Mega4, Ultrasatanx2 , Amiga A500, A500+ and A1200, Acorn Atom x2, BBC Micro, Electron, Spectrum 48k x2, +48, +128k, QL, Oric Atmos, ZX81, Memotech MTX512, Amstrad 6128 x2..

User avatar
rudis
Captain Atari
Captain Atari
Posts: 163
Joined: Mon Feb 14, 2011 9:41 am

Re: Getting GNU toolchain working in TOS

Postby rudis » Sun Mar 04, 2012 11:22 am

OT/OB-LIB from RUN-Software


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 2 guests