Free Pascal - now on Atari TOS

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

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

User avatar
ChainQ
Atarian
Atarian
Posts: 4
Joined: Sat Jan 21, 2017 9:35 am
Location: 1 AU, EU, DE/HU
Contact:

Free Pascal - now on Atari TOS

Postby ChainQ » Sat Jan 21, 2017 11:03 am

Hi folks,

I found this older topic here, but didn't want to revive it after 5 years... So, if there's any interest, over the past few months, I've been porting Free Pascal Compiler to the Atari TOS. Free Pascal is an Open Source Pascal and Object Pascal compiler, and it's developed in itself. The Atari support is now in a working stage, and builds for Atari TOS from the current SVN trunk.

What's there:
- Atari TOS support in the compiler and runtime libraries. They're advanced enough that the compiler can compile itself, and then the resulting binary runs on TOS, and is able to compile Pascal sources to working binaries. It's probably too slow to be practical on real hardware though, which I don't even have (yet). But it's a pretty solid cross-compiler.
- Probably plenty of bugs. :)

Missing stuff:
- MiNT support, and along with that a lot of things, like longer filenames, etc
- It wasn't tested on real hardware and most TOS/MiNT versions (but it works pretty well in Hatari, and tries not to do any "weird" things, so it should work, I guess).
- Bits and pieces of the runtime libraries are not implemented, like environment variable handling, a file truncate function, better CON: support, and few other minor things
- Larger chunks of additional packages, like networking, threading (for MiNT, if applicable), graphics support, etc.
- OS bindings for most of the TOS/BIOS/GEM/VDI/AES/etc functions. Only a little more than what's needed to run the compiler itself is there, but it's very easy to add more. I just didn't have the time. Probably a good task for an enthusiast to start. ;)
- Executables containing 68020+ relocations seem to blow up the linker(s), so 68000 only for now. (The compiler supports most of the 68k family, incl. ColdFire, but this is not utilized for Atari yet.)

What's needed:
- Users. Someone who would tell me what's the next step, in developing it. Someone who could test it, report bugs, work on simple stuff like the OS bindings, see it with an Atari-user and developer eye, etc.

I did a blogpost here (in Hungarian, but contains screenshots!), so see it there in action.

The Free Pascal Wiki also has an entry about Atari TOS support.

There are no binary releases yet. The Wiki documents how to build a cross compiler for yourself. If anyone needs a cross-build for his fav. OS, and unable to build it himself, please contact me. The build process has minimal dependencies (more or less: GNU binutils and/or vlink and vasm from vbcc) and only takes a few minutes on a reasonably fast PC or Mac. I'm no Atari guy myself, so probably I won't put a lot more work in the compiler and runtime libs if there's no interest. We'll try to not break what we have though. :)

The Atari parts of the runtime libs sources are here.
The Atari TOS support package sources (should contain full OS bindings, eventually) are here.
Free Pascal Compiler for m68k - an Amiga fan outside his comfort zone

vido
Atari Super Hero
Atari Super Hero
Posts: 541
Joined: Mon Jan 31, 2011 7:39 pm

Re: Free Pascal - now on Atari TOS

Postby vido » Sun Jan 22, 2017 7:55 pm

This is great news to me. I hope there will be also Coldfire version as I use only my FireBee regarding Atari computers.
Free Pascal would be great adition to development tools for it.

mpattonm
Captain Atari
Captain Atari
Posts: 159
Joined: Mon Oct 21, 2002 8:52 am
Location: Czech republic
Contact:

Re: Free Pascal - now on Atari TOS

Postby mpattonm » Sun Jan 22, 2017 8:06 pm

Wonderful! Please keep on!

User avatar
ChainQ
Atarian
Atarian
Posts: 4
Joined: Sat Jan 21, 2017 9:35 am
Location: 1 AU, EU, DE/HU
Contact:

Re: Free Pascal - now on Atari TOS

Postby ChainQ » Mon Jan 23, 2017 1:42 pm

Thanks for the feedback. Next I'll try to find a not so painful way to work on the OS bindings, because proper bindings will open up a lot of possibilities.

About the CF support, it's definitely doable. I tried to connect the FireBee team already, but sadly got no response at all to my e-mail. The FireBee is definitely an attractive target, because the compiler's CF support was only tested using QEMU on Linux, and not real hardware. But I don't think I'll be able to afford one in the near future.
Free Pascal Compiler for m68k - an Amiga fan outside his comfort zone

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2057
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: Free Pascal - now on Atari TOS

Postby charles » Tue Jan 24, 2017 2:28 am

I use pascal however have had to place my useage on hold due to recent house move ..getting back into now ,,this is good news !

will try
many thanks !
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

vido
Atari Super Hero
Atari Super Hero
Posts: 541
Joined: Mon Jan 31, 2011 7:39 pm

Re: Free Pascal - now on Atari TOS

Postby vido » Tue Jan 24, 2017 9:35 am

ChainQ wrote:About the CF support, it's definitely doable. I tried to connect the FireBee team already, but sadly got no response at all to my e-mail. The FireBee is definitely an attractive target, because the compiler's CF support was only tested using QEMU on Linux, and not real hardware. But I don't think I'll be able to afford one in the near future.

If you will have something to test on the FireBee I will do it gladly if I could.
If you are serious about make FireBee compatible, maybe you could get one of the development FireBees if it is awailable to lend.

Mathias
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Dec 20, 2008 4:51 pm
Location: Vienna

Re: Free Pascal - now on Atari TOS

Postby Mathias » Fri Jan 27, 2017 9:20 pm

ChainQ wrote:About the CF support, it's definitely doable. I tried to connect the FireBee team already, but sadly got no response at all to my e-mail. The FireBee is definitely an attractive target, because the compiler's CF support was only tested using QEMU on Linux, and not real hardware. But I don't think I'll be able to afford one in the near future.
I haven´t recived anything at any mailadress. Please try acpinfo at firebee dot org again. Or if I don´t answer within 24 hours, drop me a PM here.

Pascal is really needed for the FireBee. There is no Pascal compiler recently for ColdFire, but several developers asked about it. Even an very important Audio Project, which is done in Pascal. The question is how compatible it might be to Pure Pascal and others that are known at Atari? But this has to be discussed by developers.

So please consider to keep up the great work and perhaps even for v4e!
MegaST 4 with Sounddesigner II MegaBus hardware and 56001, Hades 040, MagiC Mac at Mac OS 9 and a FireBee.

User avatar
ChainQ
Atarian
Atarian
Posts: 4
Joined: Sat Jan 21, 2017 9:35 am
Location: 1 AU, EU, DE/HU
Contact:

Re: Free Pascal - now on Atari TOS

Postby ChainQ » Sat Jan 28, 2017 11:06 am

Mathias wrote:I haven´t recived anything at any mailadress. Please try acpinfo at firebee dot org again. Or if I don´t answer within 24 hours, drop me a PM here.

Maybe it was my fault. I sent a mail in mid-December to a gmx.net e-mail address, I got from Frank Wille of VBCC fame. Now I re-sent my mid-December e-mail to the address above.

Mathias wrote:Pascal is really needed for the FireBee. There is no Pascal compiler recently for ColdFire, but several developers asked about it. Even an very important Audio Project, which is done in Pascal. The question is how compatible it might be to Pure Pascal and others that are known at Atari? But this has to be discussed by developers.

Well, I have absolutely no experience with other Atari Pascal compilers. But Free Pascal sports a wide variety of Pascal dialects, even exotic ones like Mac Pascal, plus it already has some minor Amiga-specific syntax extensions. So if there's really a demand, and Pure Pascal (et.al.) has big differences to other standard dialects, it's possible to add it, although this is a non-trivial amount of work. The rest is just library and OS bindings work, I assume. (Which means, slightly time consuming but less technically challenging, usually.) This is again, boils down to other people reporting me what should I add/fix and what should be priority at least or showing me source which should compile and now doesn't, and ideally even sending some patches, given the whole shebang is opensource... :)

Mathias wrote:So please consider to keep up the great work and perhaps even for v4e!

Perhaps. ;) Well, in fact the current code generator should work better for the CF as for normal 68k, as it doesn't know about 68k subregisters (.w and .b sizes) and just tries to extend everything to 32bit, before doing arithmetic or other operations on values. This works OK for 020+, good for '060, but really not so great on '000, performance wise. On the other hand, this is what CF needs, so it would be the best there. :) (It's a bit more complicated, and improvements are planned on this, but this is the big overview.)
Free Pascal Compiler for m68k - an Amiga fan outside his comfort zone

User avatar
ChainQ
Atarian
Atarian
Posts: 4
Joined: Sat Jan 21, 2017 9:35 am
Location: 1 AU, EU, DE/HU
Contact:

Re: Free Pascal - now on Atari TOS

Postby ChainQ » Tue Jan 31, 2017 1:40 pm

As a quick update, Marcus "Alb42" Sackrow, maintainer of the AROS port, who operates the FPC build server for Amiga-like systems, now provides a Linux/x86_64 hosted Atari cross compiler build as well. Grab it from here.

Edit: it's a nightly build, so fresh every night with the latest FPC improvements. Also, if you would need such cross-build for another platform, tell us.
Free Pascal Compiler for m68k - an Amiga fan outside his comfort zone


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 1 guest