Monday, February 7, 2022

At least cross compiling for the Amiga 500 is easier than the 16 bit DOS mode PC stuff

I wanted to hack on Amigaterm (https://aminet.net/package/comm/term/amigaterm) a bit, but I found out that someone already had done that (https://aminet.net/package/comm/term/amigaterm_enh). They fixed some bugs and added speeds above 9600 baud - 19200 works fine on the Amiga 500, and 38400 works fine on the Amiga 1200.

But I wanted to add a couple more things - play with what Amiga calls "serial hardware flow control" (which is .. not quite what you expect...) and fix up xmodem receive to allow it to truncate data at a particular file size. Without the truncation option the written file is a multiple of the xmodem block size (128 bytes) which results in binaries you can't actually run.

Anyway.

There's a very nicely put together build framework targeting m68k Amiga at https://github.com/bebbo/amiga-gcc . I haven't built it yet on FreeBSD - just Ubuntu Linux and MacOS/X. Then I wanted to get amigaterm to compile for workbench 1.3 as that's what is on my Amiga 500. It turns out that's quite easy - you just need to use the right command line option (-mcrt=nix13), but you need to be sure that you're not trying to use library versions and functions that are later than what 1.3 supports.

This did trip me up - there's a ChangeFileSize() in later OS versions (4.0 I think?) that isn't in 1.3, but there is SetFileSize() in 1.3 (library version 36). I ended up opting for just not writing out the data instead of writing it out and truncating.

Now that this is working I think I'll go and see if using 128 byte receive data buffers when receiving xmodem packets works better than byte at a time. I need to go and understand how they handled timeouts so I don't end up waiting forever for data to show up. That may end up speeding up receive transfers a little.

What I'd really like to do is bring over or write very small zmodem receive library to really speed things up to make it less painful to transfer the 880 kilobyte disk images (ADF). That'll make bootstrapping things less painful in the future.

Next up is fixobj. The source for that is on the fish-010 disk so I modified it to compile here. It's hard-coded to search the last 128 bytes for the end of an executable binary, which matches the normal 128 byte xmodem block size.

Finally, I've put them both in github here - https://github.com/erikarn/amiga-code .

No comments:

Post a Comment