Help Compiling TOS 2.06/2.08/3.06 in any language

GFA, ASM, STOS, ...

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

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sat Mar 04, 2017 5:31 pm

Perhaps I could get a copy of your mupfel setup?
Jo Even

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

User avatar
crashman
Captain Atari
Captain Atari
Posts: 160
Joined: Sat May 29, 2010 2:23 am
Location: Vilanova i la Geltrú - Barcelona
Contact:

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby crashman » Sat Mar 04, 2017 6:22 pm

No problem. That's my Gemini bin folder.
Just look out that there's also all the files from the bin folder of the Source code.
Sorry, too many tests, and I'm in a hurry now to clean it, sorry.
You do not have the required permissions to view the files attached to this post.
260ST, 520ST, 520ST+, 520STFM, 1040STE, 4160STE, STACY 2, MEGA ST2, MEGA ST4, MEGA STE, TT030, FALCON030, FALCON030 with Centurbo 2rB, Firebee
SH204, Megafile 30, Megafile 60, Megafile 44
SM124, SM125, SM146, SC1224, SC1435
Satandisk, Ultrasatan, HxC SD, Hxc SD Slim, NetUSBee, CosmosEX, Gotek HxC, MicroCosmos
2600VCS, LYNX, LYNX II, JAGUAR

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sat Mar 04, 2017 7:06 pm

Thanks, but I'm afraid it did not make a difference :(

What made a difference was to switch from a real machine to Hatari, and put the TOS source on a host-FS drive. Apparently host-FS understands "/", while GEMDOS FS does not.

I still got an error though, this time from sed:

Code: Select all

sed: can't read sections.i: file not found


The file is actually named "sections.inc". The file name is truncated somehow either by sed or by Hatari.

Edit: Seems like sections.i is a file generated by GEN, and gen fails to find the source file SECTIONS.INC.
Jo Even

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

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sat Mar 04, 2017 7:34 pm

crashman wrote:And, if using Hatari, removing a "NUL" from the makefile.common


What exactly did you change here?
Jo Even

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

User avatar
crashman
Captain Atari
Captain Atari
Posts: 160
Joined: Sat May 29, 2010 2:23 am
Location: Vilanova i la Geltrú - Barcelona
Contact:

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby crashman » Sat Mar 04, 2017 7:41 pm

You can workaround this by removing the "> NUL:" in the toplevel file Makefile.common, line 59:

RUN_OPTIMIZE_1 = ${BIN}optimize${EXEEXT} $*.s > NUL:

I change it to:

RUN_OPTIMIZE_1 = ${BIN}optimize${EXEEXT} $*.s
# > NUL:

So "> NUL:" it's ignored.
260ST, 520ST, 520ST+, 520STFM, 1040STE, 4160STE, STACY 2, MEGA ST2, MEGA ST4, MEGA STE, TT030, FALCON030, FALCON030 with Centurbo 2rB, Firebee
SH204, Megafile 30, Megafile 60, Megafile 44
SM124, SM125, SM146, SC1224, SC1435
Satandisk, Ultrasatan, HxC SD, Hxc SD Slim, NetUSBee, CosmosEX, Gotek HxC, MicroCosmos
2600VCS, LYNX, LYNX II, JAGUAR

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sat Mar 04, 2017 8:01 pm

I'm afraid that did not make any difference.

This is the problem:

Code: Select all

GEN ../common/sections.mak
../COMMON/SECTIONS.INC, # line 1: can't open source file ../COMMON/SECTIONS.INC

sed: can't read sections.i: file not found
make: *** [../common/sections.mak] Error 2
make: *** [all] Error 1
Jo Even

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

User avatar
crashman
Captain Atari
Captain Atari
Posts: 160
Joined: Sat May 29, 2010 2:23 am
Location: Vilanova i la Geltrú - Barcelona
Contact:

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby crashman » Sat Mar 04, 2017 8:22 pm

Are you using Hatari or real atari?
Mine is a simple folder, Gemdos emulation on Hatari.
Gemini on the root.
A folder called tos on root.
Path to tos in Gemini.
Mupfel, cd to tos, and make.
260ST, 520ST, 520ST+, 520STFM, 1040STE, 4160STE, STACY 2, MEGA ST2, MEGA ST4, MEGA STE, TT030, FALCON030, FALCON030 with Centurbo 2rB, Firebee
SH204, Megafile 30, Megafile 60, Megafile 44
SM124, SM125, SM146, SC1224, SC1435
Satandisk, Ultrasatan, HxC SD, Hxc SD Slim, NetUSBee, CosmosEX, Gotek HxC, MicroCosmos
2600VCS, LYNX, LYNX II, JAGUAR

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sat Mar 04, 2017 8:26 pm

crashman wrote:Are you using Hatari or real atari?


Hatari, GEMDOS emulation. Does not work on real hardware due to forward slashes which are not accepted by GEMDOS.

crashman wrote:Path to tos in Gemini.


Exactly how does your $PATH look like?
Jo Even

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

User avatar
crashman
Captain Atari
Captain Atari
Posts: 160
Joined: Sat May 29, 2010 2:23 am
Location: Vilanova i la Geltrú - Barcelona
Contact:

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby crashman » Sat Mar 04, 2017 8:40 pm

Ups, not at home right now.
Write back as soon as I can.
260ST, 520ST, 520ST+, 520STFM, 1040STE, 4160STE, STACY 2, MEGA ST2, MEGA ST4, MEGA STE, TT030, FALCON030, FALCON030 with Centurbo 2rB, Firebee
SH204, Megafile 30, Megafile 60, Megafile 44
SM124, SM125, SM146, SC1224, SC1435
Satandisk, Ultrasatan, HxC SD, Hxc SD Slim, NetUSBee, CosmosEX, Gotek HxC, MicroCosmos
2600VCS, LYNX, LYNX II, JAGUAR

User avatar
crashman
Captain Atari
Captain Atari
Posts: 160
Joined: Sat May 29, 2010 2:23 am
Location: Vilanova i la Geltrú - Barcelona
Contact:

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby crashman » Sat Mar 04, 2017 10:13 pm

export PATH="$GEMINIHOME\bin;$GEMINIHOME\scripts;$GEMINIHOME\tos\bin;$GEMINIHOME\tos;."

That's on PROFILE, in the user folder.
260ST, 520ST, 520ST+, 520STFM, 1040STE, 4160STE, STACY 2, MEGA ST2, MEGA ST4, MEGA STE, TT030, FALCON030, FALCON030 with Centurbo 2rB, Firebee
SH204, Megafile 30, Megafile 60, Megafile 44
SM124, SM125, SM146, SC1224, SC1435
Satandisk, Ultrasatan, HxC SD, Hxc SD Slim, NetUSBee, CosmosEX, Gotek HxC, MicroCosmos
2600VCS, LYNX, LYNX II, JAGUAR

ThorstenOtto
Captain Atari
Captain Atari
Posts: 178
Joined: Sun Aug 03, 2014 5:54 pm

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby ThorstenOtto » Sun Mar 05, 2017 2:02 am

joska wrote:What made a difference was to switch from a real machine to Hatari, and put the TOS source on a host-FS drive. Apparently host-FS understands "/", while GEMDOS FS does not.


That's true. There shouldn't be much references to extrenal files with "/" in their name, except for some include files. Unfortunately there is a bug in Atari's port of the preprocessor, that prevents you specifying a -I switch more than once (or more precisely, only the last one would be actually used). The only solution to this would be to store all include files in the same folder, wether being from the library or from other programs.

The include statements in the makefiles should not be affected by this, though.

joska wrote:The file is actually named "sections.inc". The file name is truncated somehow either by sed or by Hatari.


sections.i is a temporary file that is used to create sections.mak from sections.inc. The commands are at the end of config.mak in the toplevel directory. You might try to run make V=1 to better see which commands actually get executed.

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sun Mar 05, 2017 8:54 am

ThorstenOtto wrote:The include statements in the makefiles should not be affected by this, though.


Those are affected. I never get as far as running any of the Alcyon components before the make process fails. On a TOS filesystem it fails at the very first line of the makefile. Changing the include statements in the makefile to use backslash fix that problem.

ThorstenOtto wrote:sections.i is a temporary file that is used to create sections.mak from sections.inc. The commands are at the end of config.mak in the toplevel directory. You might try to run make V=1 to better see which commands actually get executed.


Yes, the problem is that SECTIONS.INC is not found, so sections.i is never generated.

This is the output from running make V=1:

Code: Select all

GEN ../common/sections.mak
../COMMON/SECTIONS.INC, # line 1: can't open source file ../COMMON/SECTIONS.INC

sed: can't read sections.i: file not found
make: *** [../common/sections.mak] Error 2
make: *** [all] Error 1
Jo Even

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

User avatar
troed
Atari God
Atari God
Posts: 1217
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby troed » Sun Mar 05, 2017 11:53 am

Replicated with Hatari on my Mac, just now. These are the steps I needed when starting completely from scratch:

1) Download the tos-archive from this thread, unpack as "tos" in your gemdos-root folder. Delete all GNUmakefile-files.
1.5) Open Makefile.common, find the line which redirects to NUL: and remove the redirect.
2) Download mupfel and mupfel-tools. Run the self-extracting mupfel tools archive so you get a bin-folder
3) Copy sed.ttp and mv.ttp from crashman's linked BIN-catalogue into your own mupfel-tools bin.
4) Boot Hatari. I used TOS 1.04. Map your root folder as GEMDOS drive.
5) Run mupfel.ttp
6) Type PATH="\bin;\tos\bin" - important, backslash, not slash
7) Type cd tos
8) Type make

... fast-forward in Hatari, this will take some time. Resulting TOS image tested working in Hatari.

Thanks @ThorstenOtto!!!

/Troed
Last edited by troed on Sun Mar 05, 2017 12:57 pm, edited 1 time in total.

ThorstenOtto
Captain Atari
Captain Atari
Posts: 178
Joined: Sun Aug 03, 2014 5:54 pm

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby ThorstenOtto » Sun Mar 05, 2017 12:15 pm

joska wrote:Those are affected. I never get as far as running any of the Alcyon components before the make process fails. On a TOS filesystem it fails at the very first line of the makefile. Changing the include statements in the makefile to use backslash fix that problem.


I have to check make again then. It was actually supposed to handle that. I could not use gmake because all version i could find require mint, otherwise they aren't able to execute anything.

[code]GEN ../common/sections.mak
../COMMON/SECTIONS.INC, # line 1: can't open source file ../COMMON/SECTIONS.INC

sed: can't read sections.i: file not found


Grmpf. Thats the (unmodified) preprocessor and sed, both don't translate / to \ in filename arguments. I try to fix that. I hate the day when some CPM ppl decided that \ as path separator is a good idea, that caused alread lots of grief do generations of msdos/atari users.

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sun Mar 05, 2017 12:24 pm

troed wrote:These are the steps I needed when starting completely from scratch:


I still get the exact same error. The only difference from your setup is that I'm using Linux, not a Mac. Or maybe a different Hatari/TOS? I'm using Hatari 1.9.0 and TOS 2.06.
Jo Even

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

User avatar
troed
Atari God
Atari God
Posts: 1217
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby troed » Sun Mar 05, 2017 12:33 pm

joska wrote:
troed wrote:These are the steps I needed when starting completely from scratch:


I still get the exact same error. The only difference from your setup is that I'm using Linux, not a Mac. Or maybe a different Hatari/TOS? I'm using Hatari 1.9.0 and TOS 2.06.


I'm on Hatari 2.0.0 (why aren't you? :)) and 1.04.

Continuing on my replication post (had to break for lunch):

The built TOS 3.06 DE is indeed an exact binary match to a 3.06 DE I just downloaded.

Also, building TOS 2.06 UK:

(don't forget make clean first ... )

Code: Select all

$make COUNTRY=uk TOSVERSION=206


... produces a binary identical image to a TOS 2.06 UK I just downloaded. So, replication succeeded.

This is absolutely fantastic. The next obvious step is for us as a community to make new TOS versions that support new hardware ... (byte swapped IDE, MonSTer etc .. )

/Troed
Last edited by troed on Sun Mar 05, 2017 1:13 pm, edited 4 times in total.

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sun Mar 05, 2017 12:39 pm

troed wrote:I'm on Hatari 2.0.0 (why aren't you? :))


Because I updated to 2.0.0 on my Windows machine and could never get it to recognise any sort of harddisk/harddisk emulation.

I will try 1.04 and see if it makes a difference.
Jo Even

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

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sun Mar 05, 2017 1:10 pm

joska wrote:I will try 1.04 and see if it makes a difference.


Did not make a difference. What made a difference was to copy the source tree to a FAT partition (still on emulated drive). So now I'm building 3.06 using Hatari 1.9.0 and TOS 2.06 on Linux :)

I did not copy sed.ttp and mv.ttp to mupfel's bin-folder, but to the bin-folder of the source archive. Then PATH was set to "\tos\bin" only. cd to \tos and then make. It did not work when any of the binaries was located on a Linux partition, everything has to be on a FAT fs.
Jo Even

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

User avatar
troed
Atari God
Atari God
Posts: 1217
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby troed » Sun Mar 05, 2017 1:16 pm

joska wrote:I did not copy sed.ttp and mv.ttp to mupfel's bin-folder, but to the bin-folder of the source archive. Then PATH was set to "\tos\bin" only. cd to \tos and then make. It did not work when any of the binaries was located on a Linux partition, everything has to be on a FAT fs.


Great you got it working! And yeah, an update to the archive with the NUL: redirect removed and sed/mv added would indeed make it even more straight forward :)

/Troed

User avatar
troed
Atari God
Atari God
Posts: 1217
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby troed » Sun Mar 05, 2017 1:28 pm

ThorstenOtto wrote:As mentioned above, the basis was one of the archives available since years on the net. While working on it, i had to create some new files, some of them are based on files from EmuTOS (thats why you might find their message in them).


How close are you legality-wise to be able to put this on, for example, Github? I haven't followed the discussions on Atari TOS, GEM etc having been put into the PD closely*. Having it on Github would be fantastic once we start to make new TOS versions for new hardware, to keep track of which developments goes where.

/Troed

*) Ah, I might've misread the comments on DR having released GEM as having had something to do with Atari's stuff as well. No Github then I guess ...

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

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby joska » Sun Mar 05, 2017 1:39 pm

troed wrote:The next obvious step is for us as a community to make new TOS versions that support new hardware ... (byte swapped IDE, MonSTer etc .. )


My motivation to get this working was to port the MonSTer support I added to EmuTOS to 2.06. However, not sure if I'd like to work with this ancient compiler...
Jo Even

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

ThorstenOtto
Captain Atari
Captain Atari
Posts: 178
Joined: Sun Aug 03, 2014 5:54 pm

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby ThorstenOtto » Sun Mar 05, 2017 1:55 pm

joska wrote:Did not make a difference.


That was to be expected. If at all, then it's the emulator who translates backslashes. TOS never did that before MiNT.

Troed wrote:And yeah, an update to the archive with the NUL: redirect removed and sed/mv added would indeed make it even more straight forward


I will see to that. Ideally, it should work on real hardware without too much hassle, but for now it's good to know that it works on Hatari at least.

How close are you legality-wise to be able to put this on, for example, Github?


To be honest, i have no idea. I'm not a lawyer. Personaly i think there should be no practical reason against that; the sources that i started with were publicitly released by Caldera long time ago, and the resulting binaries are also available for a long time. There are others though with different feelings.

Having it on Github would be fantastic once we start to make new TOS versions for new hardware, to keep track of which developments goes where.


If you want to add support for new hardware, it might make much more sense to add that support to EmuTOS (if not already there) and use that instead. Believe me, you don't want to do real development with such an old, buggy devkit. I really wonder how Atari ever managed to create TOS versions from this that more or less worked.

If you want to create a TOS version that is as close as possible to the original, with only small patches, that might be an option, though.

User avatar
troed
Atari God
Atari God
Posts: 1217
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby troed » Sun Mar 05, 2017 2:23 pm

ThorstenOtto wrote:If you want to add support for new hardware, it might make much more sense to add that support to EmuTOS (if not already there) and use that instead. Believe me, you don't want to do real development with such an old, buggy devkit. I really wonder how Atari ever managed to create TOS versions from this that more or less worked.

If you want to create a TOS version that is as close as possible to the original, with only small patches, that might be an option, though.


So this is an example of what I was thinking about - adding native TOS support for the Dallas ROM-passthrough RTC. Currently I have a bootsector that sets the TOS clock from the RTC but of course only works if I boot from that disk (or a drive with an AUTO-PRG version).

https://blog.troed.se/projects/dallas-r ... s-y2k-fix/

Oooh and a proper Y2K fix maybe ..

Of course all this could've been done by assembly-patching, but working off a source tree is vastly easier if more than a few persons want to make cumulative additions. Also, by staying close to native TOS (even keeping the version number, adding a minor-field someplace else) games/demos shouldn't break.

/Troed
Last edited by troed on Sun Mar 05, 2017 2:45 pm, edited 1 time in total.

ijor
Hardware Guru
Hardware Guru
Posts: 3161
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby ijor » Sun Mar 05, 2017 2:23 pm

ThorstenOtto wrote:To be honest, i have no idea. I'm not a lawyer. Personaly i think there should be no practical reason against that; the sources that i started with were publicitly released by Caldera long time ago, and the resulting binaries are also available for a long time. There are others though with different feelings.


Nobody will probably bother us. But just in case, I wouldn't put it in github.

I really wonder how Atari ever managed to create TOS versions from this that more or less worked.


I always hated Alycon tools even back at the day. Third party compilers were so much better.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 906
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: Help Compiling TOS 2.06/2.08/3.06 in any language

Postby Frank B » Sun Mar 05, 2017 3:05 pm

I wonder if we could get the source opened legally? The base for it has already been GPLed


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 2 guests