Help Compiling TOS 2.06/2.08/3.06 in any language

GFA, ASM, STOS, ...

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

penguin
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 107
Joined: Tue Dec 24, 2013 10:43 am

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

Postby penguin » Sun Mar 05, 2017 3:59 pm

Well, nobody asked Atari (or whoever bought the Atari rights) to open source TOS at the appropriate time. I doubt you'd get any reaction from Infogrames now.

So... the parts owned by Digital Research were legally open sourced, but whatever Atari added not. That's why the EmuTOS team took the DR sources as a base and continued from that point. Milan Computersystems has a licence to use the Falcon TOS and supported the FireBee project, so that the ACP can legally use it.

It's a pitty that the Milan TOS isn't open source, because the Milan developers already did the work translating the source from Alcyon to gcc and cleaning it up.
AtariUpToDate - Atari ST/TT/Falcon software database and version tracker: http://www.atariuptodate.de
st-computer magazine - http://st-computer.atariuptodate.de/

joska
Hardware Guru
Hardware Guru
Posts: 3574
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 4:07 pm

ThorstenOtto wrote:I only used GCC during development to (cross-compile) on the host, because that was much faster than switching to the emulator first every time, and because the error messages are better. In fact, the output from GCC won't produce anything usable.


What would it take to get gcc to produce something usable from these sources?
Jo Even

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

ThorstenOtto
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
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 4:21 pm

joska wrote:What would it take to get gcc to produce something usable from these sources?


A careful look at all those assembler sources, and in contrast to the EMuTOS project, there are quite a lot of them (almost all of BIOS and VDI). The major problem here are differences in the scratch registers: alcyon trashes d2/a2, while gcc assumes them to be preserved.

Nimrod
Atariator
Atariator
Posts: 24
Joined: Fri Jul 01, 2016 5:21 pm

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

Postby Nimrod » Sun Mar 05, 2017 7:43 pm

Would anyone object if I sent an email to the CEO of Atari asking for TOS to be open sourced?

ijor
Hardware Guru
Hardware Guru
Posts: 3028
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 8:41 pm

Nimrod wrote:Would anyone object if I sent an email to the CEO of Atari asking for TOS to be open sourced?


I don't know. It is quite a dangerous gamble. There are more chances for getting a bad result than for getting a good one. And a bad result isn't just a "NO". It could be much worse.

Atari just emerged from bankruptcy. They need all the money they can get. A petition like that might make them wonder if they couldn't get some money from licensing their "classic" IP. They could go after all the repositories related to retro computing.

At the very least, I wouldn't do something like that without thinking it carefully, consulting with people more familiar with the corp situation and the people managing the company now.

Nimrod
Atariator
Atariator
Posts: 24
Joined: Fri Jul 01, 2016 5:21 pm

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

Postby Nimrod » Sun Mar 05, 2017 10:15 pm

Considering Atari is focused on games and the Atari brand I believe (think/guess) it should not make much difference to them. This is a OS not a game. Retro computing may be really sexy but it's not a money maker. What could they expect to collect? 10k€? Peanuts! They would not recover their own costs.

Usually when asking for a handout it is a good idea to frame it as a win. In this case the win is goodwill, good PR and community support for any future hardware(?) development to support "retro" gaming. Very, very iffy I admit. The company is almost "virtual". 10 employees... probably very few people who are real techies, guessing 5 IP lawyers etc. So any contact must be really dumbed down... aka presented to lawyers.

Any improvements to TOS 2.06, such as new features introduced via EmuTOS could potentially be beneficial to other Atari IP. Assuming Atari has any IP that can benefit... I would assume the hardware IP is something they would not like to share? How many games are actual Atari games?

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2233
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

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

Postby lp » Sun Mar 05, 2017 10:24 pm

The roms are spread all over the net as it is, and enough internal documents and leaked source code at my site to turn some heads. However, it goes completely unnoticed for years. If they wanted to cash in on TOS they would of done so already. My 2 cents. ;)

penguin
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 107
Joined: Tue Dec 24, 2013 10:43 am

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

Postby penguin » Sun Mar 05, 2017 11:28 pm

Nimrod wrote:Usually when asking for a handout it is a good idea to frame it as a win. In this case the win is goodwill, good PR and community support for any future hardware(?) development to support "retro" gaming. Very, very iffy I admit. The company is almost "virtual". 10 employees... probably very few people who are real techies, guessing 5 IP lawyers etc. So any contact must be really dumbed down... aka presented to lawyers.

Any improvements to TOS 2.06, such as new features introduced via EmuTOS could potentially be beneficial to other Atari IP. Assuming Atari has any IP that can benefit... I would assume the hardware IP is something they would not like to share? How many games are actual Atari games?


Don't try apply common sense to companies and their IP :wink: They already have partners for all their retro stuff and are not really keen on good PR - at least not from those who knew Atari as a computer company. Look at Atari's website - the ST is hardly acknowledged at all. Too many homebrew projects were shut down because they caught the attention of a company owning the IP - even if similar homebrew projects existed for years.

Infogrames owns most of the arcade titles made by Atari before the split, which are also the only Atari games used in those Flashback collections and consoles. Why would any (Emu)TOS feature be beneficial to them?

Now, if TOS would be released under the GPL, it would make more sense to use parts of the code to extend EmuTOS. EmuTOS has come a long way and it's getting closer to the feature set of TOS 2.0x.
AtariUpToDate - Atari ST/TT/Falcon software database and version tracker: http://www.atariuptodate.de
st-computer magazine - http://st-computer.atariuptodate.de/

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

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

Postby ijor » Mon Mar 06, 2017 12:47 am

lp wrote:However, it goes completely unnoticed for years. If they wanted to cash in on TOS they would of done so already. My 2 cents. ;)


May be yes, may be not. Current Atari AFAIK doesn't have any relation to previous Atari incarnations. So what happened for years is not relevant. And I agree with Penguin, you can't apply common sense here.

Possibly there aren't that much chances they will suddenly start sending "Cease & Desist" letters to retro sites. However, chances that they will accept to free TOS, are probably way much smaller. And to be honest, why specifically TOS? I'm not sure that's the most interesting Atari (non-game) IP for the retro community.

Btw, a legal curiosity. How do you GPL something that you don't have the sources? More than likely Atari doesn't have any sources. And chances that besides what we already have, the rest of the original Atari sources are probably lost for ever. So, I guess you can't GPL a binary, can you? May be you can GPL the disassemble output?

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2233
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

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

Postby lp » Mon Mar 06, 2017 1:14 am

I'm not applying any common sense to the company, it's just my observation that they have not actively stopped anyone from doing anything with TOS for 20 years.

User avatar
Arne
Captain Atari
Captain Atari
Posts: 397
Joined: Thu Nov 01, 2007 10:01 am

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

Postby Arne » Mon Mar 06, 2017 9:09 am

Is this a lawyer thread or is it more technically oriented? :roll:

I have almost succeeded in compiling the sources on a TT with plain TOS i.e. no Mint. Takes its time and the HDD LED isn't being switched off for more than some 100ms.
But at one point SH cancels when it does not find a tool named "NYI.TTP" (see Makefile.common line 13). On Hatari the same installation succeeds.

BTW: is there a RAM-Disk around that can allocate in the +10MB range?
Image

ThorstenOtto
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Sun Aug 03, 2014 5:54 pm

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

Postby ThorstenOtto » Mon Mar 06, 2017 9:47 am

Arne wrote:But at one point SH cancels when it does not find a tool named "NYI.TTP" (see Makefile.common line 13). On Hatari the same installation succeeds.


That usually happens if there is some temporary assembler file around from a previous make, most likely due to some previous crash. In that case there is a .c and a .s file of the same name available, in which case make uses its default builtin rules to compile the .s file using $(CC). The failed NYI should have removed that temporary file, if it doesn't you have to remove it yourself (but make sure that is really a temporary result from a compiled c-file). Make clean unfortunately does not help in this case, because on a case-insensitive filesystem removing *.s would be a disaster.

BTW: is there a RAM-Disk around that can allocate in the +10MB range?


I'm quite sure there is, but i deliberately choose not to use a ramdisk for the temporary files. First off, it would be to system dependent to figure out its path, might be $TMP, $TEMP or $TMPDIR, depending on the shell). Then you might again get into trouble with / vs \ issues in the pathnames. And most importantly: most of the tools don't support ARGV for passing arguments, so the command line is restricted to 126 characters.

User avatar
Arne
Captain Atari
Captain Atari
Posts: 397
Joined: Thu Nov 01, 2007 10:01 am

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

Postby Arne » Mon Mar 06, 2017 9:53 am

ThorstenOtto wrote:That usually happens if there is some temporary assembler file around from a previous make, most likely due to some previous crash.

That might be the case as I did not catch every '/' to switch it to '\'. So the make process aborted at some point.
So ".s" are temporary and ".S" are permanent (original Atari)?
How about switching from '.s' to '.asm'? Would this be a viable option or does it need Alcyon compiler changes?

ThorstenOtto wrote:I'm quite sure there is, but i deliberately choose not to use a ramdisk for the temporary files.

How about copying Gemini/Mupfel and the TOS folder completely into TT-RAM (i.e. RAM-Disk) with Kobold? Should be pretty fast.
Image

ThorstenOtto
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Sun Aug 03, 2014 5:54 pm

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

Postby ThorstenOtto » Mon Mar 06, 2017 10:09 am

Arne wrote:So ".s" are temporary and ".S" are permanent (original Atari)?


Yes. It's the same naming convention as on unix, since the .S files are preprocessed. Unfortunately you can't distinguish them on a FAT filesystem.

How about switching from '.s' to '.asm'? Would this be a viable option or does it need Alcyon compiler changes?


I currently can't remember exactly where, but at least one of the tools insisted in having a .s suffix on assembler files.

User avatar
Arne
Captain Atari
Captain Atari
Posts: 397
Joined: Thu Nov 01, 2007 10:01 am

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

Postby Arne » Mon Mar 06, 2017 6:40 pm

Code: Select all

CC gemfmalt.c
 1.    gemfmalt.s.
     1 Total clr's removed
     0 Total clr's (w/stk mod) removed
     0 Total moves's removed
     0 Total moves (w/stk mod) removed
     2 Total move immeditates removed
     0 Total move immed.(w/stk mod) removed
     0 Total redundant bra's removed
    10 Total pea's used (4 bytes)
     9 Total pea's used (w/stk mod) (2 or 4 bytes)
     8 Total adda.l's improved (2 bytes)
NYI -S -f  gemfmlib.c
sh: NYI: File not found
make: *** [gemfmlib.s] Error 127
make: 'gemfmlib.s' removed.
make: *** [all] Error 1

So this is the latest error I get on my TT. The last file (gemfmalt.c) has not left any '.s' behind. gemfmlib.c does exist in \aes folder.
Any idea where to look into detail?
Image

User avatar
dhedberg
Atari Super Hero
Atari Super Hero
Posts: 533
Joined: Mon Aug 30, 2010 8:36 am
Contact:

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

Postby dhedberg » Mon Mar 06, 2017 9:11 pm

Fantastic work Thorsten Otto. Any chances of also recreating/recompiling TOS 4.04?
Daniel, New Beat - http://newbeat.atari.org

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2233
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

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

Postby lp » Mon Mar 06, 2017 10:17 pm

dhedberg wrote:Fantastic work Thorsten Otto. Any chances of also recreating/recompiling TOS 4.04?


That might be possible with the newly leaked bios/xbios/gemdos layers that were missing from earlier TOS4 archives. :wink:

ThorstenOtto
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Sun Aug 03, 2014 5:54 pm

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

Postby ThorstenOtto » Tue Mar 07, 2017 5:35 am

Arne wrote:

Code: Select all

NYI -S -f  gemfmlib.c
sh: NYI: File not found
make: *** [gemfmlib.s] Error 127
make: 'gemfmlib.s' removed.
make: *** [all] Error 1

So this is the latest error I get on my TT. The last file (gemfmalt.c) has not left any '.s' behind. gemfmlib.c does exist in \aes folder.
Any idea where to look into detail?


If you look at the messages you will see that it was gemfmlib.s that what left behind, and that make removed it. I think just restarting make should work. You can also try to run "make clean". Just make sure to use the same settings every time in case you specify a TOSVERSION or a COUNTRY on the command line. If that still fails, you might try to run

rm `echo *.c | sed -e 's/\.c/\.s/g'`

That should remove all .s files which also have a .c file.

User avatar
Arne
Captain Atari
Captain Atari
Posts: 397
Joined: Thu Nov 01, 2007 10:01 am

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

Postby Arne » Tue Mar 07, 2017 5:51 am

ThorstenOtto wrote:If that still fails, you might try to run

rm `echo *.c | sed -e 's/\.c/\.s/g'`

That should remove all .s files which also have a .c file.


Thanks. Will try that in the evening.
Image

ThorstenOtto
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Sun Aug 03, 2014 5:54 pm

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

Postby ThorstenOtto » Tue Mar 07, 2017 6:01 am

dhedberg wrote:Fantastic work Thorsten Otto. Any chances of also recreating/recompiling TOS 4.04?


I already looked into that, but stopped when i found out that apparently some of the sources of 4.04 where compiled by Lattice C rather than Alcyon. And i have no idea which version they used. There are also quite a lot compiler-switches which have an influence on the generated code, so it might be difficult to figure out which one to use to really get the same result. Especially since the generated code from Lattice sometimes really looks strange, which makes reconstructing the C-code from an assembler listing really hard.

Also, the only LC version i could find is 5.60 which is from '93. I doubt that this is the one that was used by Atari.

It might be not so hard to put the remaining parts together, most of it is already in the archive, just currently not used. But it is unlikely that it will produce the exact same result, which is a key to verify that you didn't mess up anything.

SteveBagley
Captain Atari
Captain Atari
Posts: 154
Joined: Mon Jan 21, 2013 9:31 am

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

Postby SteveBagley » Tue Mar 07, 2017 11:29 am

ThorstenOtto wrote:I already looked into that, but stopped when i found out that apparently some of the sources of 4.04 where compiled by Lattice C rather than Alcyon. And i have no idea which version they used. There are also quite a lot compiler-switches which have an influence on the generated code, so it might be difficult to figure out which one to use to really get the same result. Especially since the generated code from Lattice sometimes really looks strange, which makes reconstructing the C-code from an assembler listing really hard.


There's definitely archives floating about that have the Lattice C make files used for parts of TOS404 that include some of the compiler switches, e.g. for the VDI…

Code: Select all

# Flags for lc.ttp
#
# -w    16-bit ints
# -b0   full 32-bit addressing
# -bn   unknown
# -r0   subroutine calls will use absolute 32-bit relocated address
# -d    Just enables debug info from line number/offset table
# -v    disable stack checking
# -rs   standard stack params
# -z2   generate DRI format objects
# -cf   force prototype checking
# NOTE: 3 files do not like the optimizer: deskdisk.c gemfslib.c deskfile.c

CMODEL  = -w -b0 -bn -r0 -v -rs -m3 -z2 -cf #-O
CFLAGS  = $(DEFINES) $(CMODEL) 


Also the paths in the file suggest that Lattice C 5 was used with the Atari linker.

Steve

User avatar
Arne
Captain Atari
Captain Atari
Posts: 397
Joined: Thu Nov 01, 2007 10:01 am

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

Postby Arne » Wed Mar 08, 2017 9:01 am

Little progress...

At varous places I get these "file-not-found" errors. But it continues compiling...
ALCYON-Error01.gif


But performing the makefile in \glue it crashes.
Seems like the '\' get deleted. I thought that they may get interpreted as escape-sequences and replaced the '\' with '\\' but the errors still is the same.
ALCYON-Error02.gif


I think that this part of the Makefile in \glue is affected:

Code: Select all

(...)
glue.de: $(MKGLUE) ..\aes\rsc\$(TOSVERSION)\gemde.rsc ..\desk\rsc\$(TOSVERSION)\deskde.rsc ..\desk\rsc\$(TOSVERSION)\deskde.inf
   $(AM_V_GEN)$(MKGLUE) de $(TOSVERSION)
(...)
You do not have the required permissions to view the files attached to this post.
Image

ThorstenOtto
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Sun Aug 03, 2014 5:54 pm

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

Postby ThorstenOtto » Wed Mar 08, 2017 11:29 am

Arne wrote:Little progress...

At varous places I get these "file-not-found" errors. But it continues compiling...


It might help to remove aes.o from what is built by the "all" target, i.e. in the makefile change

Code: Select all

all: $(top_srcdir)/common/config.h aes.a aes.o

to

Code: Select all

all: $(top_srcdir)/common/config.h aes.a


aes.o was only used by me while working on the sources, and is a linked version of the aes that i could compare to the rom without having the other parts ready. It is not used in the final build. Similar in other directories, should there be problems too.


Seems like the '\' get deleted. I thought that they may get interpreted as escape-sequences and replaced the '\' with '\\' but the errors still is the same.

glue.de: $(MKGLUE) ..\aes\rsc\$(TOSVERSION)\gemde.rsc ..\desk\rsc\$(TOSVERSION)\deskde.rsc ..\desk\rsc\$(TOSVERSION)\deskde.inf



Thats probably because you changed the / to \ there. And yes, \ should be used for escapes, thats why i use / in pathnames usually.

You should try to change that back, at least in the dependencies of glue/Makefile.

User avatar
Arne
Captain Atari
Captain Atari
Posts: 397
Joined: Thu Nov 01, 2007 10:01 am

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

Postby Arne » Fri Mar 10, 2017 6:51 pm

The last error was not makefile related. I just replaced the '/' with '\' in those sprintf() calls in newglue.c.
I should have replaced them with '\\' in the first place. :-/

I had some tries yesterday evening but unfortunately the build process still cancels with this error message:
IMG_0680.JPG


So I had some more (isolated) tries. I did:

Code: Select all

cd glue
make clean
cd ..\tools
make clean
make

This built the three TTPs with there associated .O.
Now I did:

Code: Select all

cd ..\glue
make

It built STARTUP.O but canceled with the same error and MKBININC.TTP was deleted. :-O
But I can't find a RM command in GLUE\MAKEFILE that kills this TTP.
For some strange reason this does not happen in Hatari.
You do not have the required permissions to view the files attached to this post.
Image

ThorstenOtto
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Sun Aug 03, 2014 5:54 pm

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

Postby ThorstenOtto » Fri Mar 10, 2017 10:32 pm

Arne wrote:But I can't find a RM command in GLUE\MAKEFILE that kills this TTP.
For some strange reason this does not happen in Hatari.


Sometimes make removes the target if some intermediate command failed. So there is not always an explicit rm command in the Makefile. Its also indicicated by:

Code: Select all

make: '..\tools\mkbininc.ttp' removed.


Whats a bit strange though that there are no rules in the Makefile of the glue directory to build mkbininc, so that should not happen. What also looks strange is:

Code: Select all

NYI -f ..\tools\mkbininc.c -o ..\tools\mkbininc.ttp


This looks like make is trying to recompile the ttp, although it is in some other directory.

If the ttps are build correctly in the tools directory, you might want to remove the dependency in the glue directory, ie. change

Code: Select all

tosrsc$(COUNTRY).c: $(MKBININC) glue.$(COUNTRY)

to

Code: Select all

tosrsc$(COUNTRY).c: glue.$(COUNTRY)


Eventually, this might then also be neccessary for the dependencies to $(MKGLUE) and $(MKROM)


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 4 guests