(no title)
mark_round | 2 years ago
> LZX had supplanted LHA already by 1994.
True, but LHA always felt like more of the standard and tools were readily available and present on most systems. Sort of like how Bzip2/XZ and so on are technically far superior, yet a gzipped tarball is still the universal standard on Unix systems. A quick glance through AmiNet shows the majority of packages there are still using LHA as standard. Even stuff targetting a "modern" Amiga tends to use LHA - grepping the Os4Depot full package list shows:
grep -c '.lha' FULLINDEX.readme
4110
grep -c '.lzx' FULLINDEX.readme
37
> For all practical accounts of programming the CPU it's a 32-bit machineTrue. I'll update the article to include that - I guess I'm really thinking of things like the 68020 processor (and CD32 which proudly proclaimed "32-BIT" in big letters on the case :)
> You're in no way locked to program for AmigaOS in C.
Also true. From what I can see, calling & opening the libraries from Assembly is remarkably similar to e.g. C, but from browsing the leaked OS source (not that I'd ever advocate for that sort of thing ;) ) it was all originally in C. I wanted to dive in and get a better understanding of the code as it was originally written hence my experiments targeting C. Plus, I knew enough C from my old University days to get up to speed in a short enough timespan. With no memory protection, crashing my Amiga because I forgot to free some DOS object or other was a common occurrence - if I was attempting this in Assembly, I'd probably still be working on a basic proof-of-concept! Although I really admire the skills of those developers who did choose that language to write system utilities, not to mention the magic of the demo-scene. It's just a bit beyond my abilities/time constraints at the moment!
vidarh|2 years ago
EDIT: To those unfamiliar, which I'm guessing is most people here, BPTR's are regular pointers shifted two bits down... BSTR's are BPTR's to a BCPL string, more commonly known as a "Pascal string" (single byte length as the first byte).
The reasoning for this is language simplicity (too much... I hate it, to be clear):
What in C would be array[index] is famously pretty much syntactic sugar for *(array + index). In BCPL it's !(array+index) or array!index. But whereas C is typed enough that C knows that (array + index) requires scaling index to the size of the elements of the array, BCPL is type-less. So if "index" is 1, array + index will add 1 to the address even if "array" holds 32 bit values.
Since every value is typically the size of a pointer (otherwise the typeless goes straight out the window), on M68k the elements are 4 bytes.
So to make (array + index) work, pointers needs to be left-shifted two bits. Then you can right-shift them two bits for any operations explicitly treating them as pointers (like "!")...
And then everyone having to ever interface with your code from any other language will hate you for all time.
amiga386|2 years ago
AmigaDOS in AmigaOS 1.x was a port/adaption of TRIPOS [0] to 68000 by MetaComCo. This was because the intended disk OS/API, "CAOS", was nowhere near ready for the Amiga's 1985 launch. [1]
It's the conventions of TRIPOS that commands go in "c" / "C:", libraries go in "l" / "L:" and scripts go in "s" / "S:", which is why these directories and standard assigns are on Amiga disks... but AmigaDOS "libraries" are limited to filesystem handlers, real Amiga libraries are found in the "libs" / "LIBS:" directory.
Even the standard filesystem was from TRIPOS. It had 488 bytes of data and 24 bytes of metadata per 512-byte disk block!
There was a lot of wailing and gnashing of teeth trying to use AmigaDOS 1.x. Charlie Heath and others started the AmigaDOS Replacement Project (ARP, retroactively renamed "AmigaDOS Resource Project" to not sound so nasty) which rewrote all the standard C: commands in assembler and C, using a common arp.library, which also added one of the earliest "standard" filesystem requesters. [2]
Commodore took this onboard.
Commodore created FastFileSystem (FFS) to replace the retroactively-named "Old Filesystem" (OFS) in time for AmigaOS 1.3. FFS removed _all_ per-diskblock metadata and let you lay down contiguous runs of 512-byte blocks!
Commodore rewrote AmigaDOS and its commands in C and assembler for AmigaOS 2.0, retaining BCPL only where absolutely needed to keep filesystem handlers working. They also added a new asl.library with a standardized filesystem requester.
In short, ARP was completely successful in getting Commodore to ditch BCPL AmigaDOS for one written in C.
[0] https://en.wikipedia.org/wiki/TRIPOS
[1] https://web.archive.org/web/20190420095854/http://www.thule....
[2] http://aminet.net/package/misc/antiq/ARP_13