Jump to content
IGNORED

GCC for the TI


insomnia

Recommended Posts

Nice! But you say it /crashes/ in Classic99? Or just doesn't sound right?

 

Classic99's speech implementation is unable to halt the CPU - if you want it to work in Classic99 you can't just blitz data at the speech synth, you have to monitor the buffer control bits and feed it only when it's low. I know why it doesn't work and the fix is complex, but coming.

 

But if it is actually /crashing/, that I want to know about.

 

Link to comment
Share on other sites

5 hours ago, chue said:

This is all good stuff but maybe should be in its own thread? Try to keep this thread about issues with the compiler - this thread is huge as is.

Agree and sorry. Questioning the one came to the other and there seemed no other suitable C thread to ask the inititial question in. Made seperate topic (or if a mod reads this, please move whole chain)

 

Edited by xahmol
Link to comment
Share on other sites

When I coded the fix to stop crashing classic99 by overrunning the speech fifo, I still had compiler usability issues... I had to force the function to never be inlined, so that in the context of the say_data function it would actually perform a call. The optimizer leaves the status check in during the compilation of the routine I used to read status. But if it inlined that into a greater function, it decided the __asm__ had no side effects and removed it. I probably needed to make sure the __asm__ produced an output to a gcc register.

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...
29 minutes ago, Elia Spallanzani fdt said:

ack! i have windows 7, at best.

All the more reason to update to Windows 10 ?It is really unsafe to still use Win7 and be online anyway. Win7 is the new Windows eXPired…..

And Windows 10 is actually much faster on both my 2009 as 2011 PC than Win7 was.

 

Of course there are alternatives getting this to work with Cygwin, Docker and using a VM as well, but no experience with that combined with GCC for TI, so you have to delve in the rest of the thread for that.

Edited by xahmol
Link to comment
Share on other sites

All the more reason to update to Windows 10 [emoji6]It is really unsafe to still use Win7 and be online anyway. Win7 is the new Windows eXPired…..
And Windows 10 is actually much faster on both my 2009 as 2011 PC than Win7 was.
 
Of course there are alternatives getting this to work with Cygwin, Docker and using a VM as well, but no experience with that combined with GCC for TI, so you have to delve in the rest of the thread for that.
Last I checked you can do the upgrade for free still

Sent from my LM-V600 using Tapatalk

Link to comment
Share on other sites

ooooookey, i was sure it wouldn't work but i installed cigwin (on win7, 32 bit) and followed the procedure given in this post: https://atariage.com/forums/topic/164295-gcc-for-the-ti/ ? do = findComment & comment = 2485813

Eventually I get the error ciggmp_3.dll is missing.

 

From setup I installed ciggmp devel and the others you see in the screenshot.

What am I doing wrong?

install.jpg

 

nodll.png

Edited by Elia Spallanzani fdt
Link to comment
Share on other sites

21 hours ago, Elia Spallanzani fdt said:

From setup I installed ciggmp devel and the others you see in the screenshot.

What am I doing wrong?

 

It's been years since I used cygwin, because the whole cygwin project has been rather eclipsed by the developers of the mingw32/msys2 project, but if I remember, cygwin doesn't always put the directory of its DLLs into the current path.

 

Have you searched you cygwin directories for the missing cyggmp-3.dll?

 

If you can find it, then copy it into the same directory as your tms9900-gcc.exe file.

 

 

Like you, I still use Win7, and I just tried building tms9900-gcc with msys2, but it failed with some errors.

 

This is because every new version of the GCC compiler finds more and more warnings/errors in the older binutils and gcc sources, and the old build scripts fail unless the old source is fixed, or the build scripts are modified.  I am having exactly the same problems compiling older versions of GCC with the new GCC 10 compiler on both Windows (msys2) and Linux. ?

  • Like 4
Link to comment
Share on other sites

Thank you!

A small step for the Elia Spallanzani Foundation, an even smaller one for humanity!

I downloaded cyggmp-3.dll and copied it to the cygwin/bin folder and now the "make" command as expected produced 2 files: rush_our.ea5.bin "
and "rush_hour.c.bin.

 

Now the question is: how do I install the additional patches?

  • Like 1
Link to comment
Share on other sites

35 minutes ago, Elia Spallanzani fdt said:

I followed the instructions from

 

 

so i installed TI99-GCC-1.5.zip .

 

However, patches 1.6, 1.7, 1.8 and 1.9 were attached in the first post of the thread.

Do you have to install them all, one after the other? Or just 1.9?

And how do you install them under 32-bit cigwin?

 

The patches are source patches... so you don't 'install' them, you apply them to the source before building... The Ubuntu instructions I shared a while back should cover getting to the latest patch level of the gcc source you want to build.  I wrote it down so I don't remember anymore... but It seems to me, nobody ever has to apply the individual patches unless they are just incrementing from a previously installed gcc build. The start from zero approach included latest patches from Insomnia. There is an additional patch from another user here. This also can be applied first, before building. This is captured in the Ubuntu instructions. (Edit: Re-reading my instructions, the patches are accumulative, so patch 1.9 contains 1.0-1.8, etc... which is good, cause you want to get to 1.19)

 

(The Ubuntu instructions are here: https://atariage.com/forums/applications/core/interface/file/attachment.php?id=820048, in this thread as attachment tms9900gcc-Ubuntu-Installation-Guide.md, .md files can be viewed in notepad, I would think... IDK... )

 

Edited by jedimatt42
  • Like 2
Link to comment
Share on other sites

47 minutes ago, Elia Spallanzani fdt said:

However, patches 1.6, 1.7, 1.8 and 1.9 were attached in the first post of the thread.

Do you have to install them all, one after the other? Or just 1.9?

And how do you install them under 32-bit cigwin?

 

20 minutes ago, jedimatt42 said:

The patches are source patches... so you don't 'install' them, you apply them to the source before building...

 

Yes, the patches are source code patches to the original binutils and gcc source code. They aren't incremental, you just apply the latest patches to the original GNU source archives.

 

The instructions that you're following are from 2012 ... it looks like "gcc-installer.tgz" script was written some time after that.

 

"gcc-installer.tgz" expands into the "install.sh" shell script, which does all of the downloading/patching/build for you. I suggest that you try building the compiler using that script.

 

 

If your really want to do your own extract/patch/configure/build process, then I suggest that you follow jedimatt42's build instructions (which look as though they also do some patching to get things to build with the gcc10 compiler).

Edited by elmer
  • Like 2
Link to comment
Share on other sites

  • 4 months later...
1 hour ago, TheBF said:

Couple of (dumb) questions:

 

1. Does GCC for TI-99 generate E/A 3 compatible object code?

 

No.. the linker produces ELF binaries. But then there is a bespoke extraction tools for PROGRAM images, and cart... and gnu objcopy to extract binary segments. Someone could write something that transforms a binary into TI's E/A3 loader format...  I typically use objcopy and post-process the binary to create what I want. 

 

Quote

2. Can GCC generate a program smaller than 8K or is the runtime bigger than that?

 

 

There isn't a runtime. Or, it's craft your own. I think the examples from Insomnia bring startup code to initialize BSS segments, or for C++ code run the constructors of static scoped instances. And then launch into your program. But you have full control of that. for an EA5 the runtime is whatever piece of machine code is linked in at the launch/first address. For cartridges, you included a header that dictates where program entry begins. You can make single instruction programs if you like.

 

Along with no runtime, there is no stdio. No console. No heap. I've found certain code constructs implicitly expect certain functions to exist. Such as literal string assignment to a char array declaration will invoke memcpy. But we seem to have to provide our own memcpy ( if you use that sort of code ) - I suspect I'm overlooking something here, but we have control. I like that. 

 

Tursi's libti99 is a good place to start. It fills the void of having no runtime. Provides an implementation of memcpy, and real routines for getting IO done on the 4A. Generally each function is isolated in the .a archive so linking only includes the routines you use. 

 

examples of 'runtime' :

* my crazy cart: https://github.com/jedimatt42/fcmd/blob/master/b0_crt0.c

* libti99's testlib example: https://github.com/tursilion/libti99/blob/master/crt0_ea5.asm

 

For the longest time, I used no 'crt0' like substance, and just made sure my main function was linked first, and that I initialized any memory addresses to the state I needed them to be at, never assuming anything, and that worked quite well. I make my little Force Command executables with gcc, and no '_start' or anything, but instead follow a custom cartridge like model... where there is just a start address in a header on the file at a well known location. So after it loads I know where to BL to. When you write your own loader, you can do whatever you want.

 

 

  • Like 3
Link to comment
Share on other sites

1) No, it generates ELF format object files. It includes a tool to convert ELF to EA#5 image files or cart files.

2) There's no runtime beyond what you provide (at least in the build I have!). The crt0 (startup code) that I have is 60 bytes long. You could make it smaller if you didn't need initialized variables.

 

Here's a sample Hello World. I've included the listing and map file so you can see the memory layout. The total code size is 118 bytes.

 

HelloWorld.zip

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...