A short story on the V50 DOS
Library By Colin. J. Wenzel
From the very beginning, AmigaDOS has always been
the orphaned child in the Amiga operating system.
In the early days, the addition of the TRIPOS
kernel as the basis for the Amiga Disk Operating System (DOS)
was not the first choice, but circumstances being what they
were, we finished up with TRIPOS, written in a language called
BCPL.
BCPL was a predecessor to modern C language and
whether they realized it at the time or not, C was eventually
to become the pseudo standard language for the entire Amiga
Operating system and various components, as well as being a
favored language for writing a vast number of
applications.
Of course, at the time, nearly all of the OS
components were written in MC68000 Assembly Language, this of
course, was not a great problem in those days as most
programmers in the early Amiga history were brought up using
assembly code, myself being one of them, besides, there was no
roadmap to move the OS to any other processor at the time and
the need for speed was of primary consideration, portability
was not.
But times change, and soon some parts of the Amiga
operating system were added during subsequent releases and
some parts were rewritten in C. However, the larger part of
the OS was still in MC68000 assembly code, also, the legacy of
BCPL TRIPOS stayed with us to this day, in the DOS library,
and also in part, in the File System.
Since the day Commodore imploded, and a parade of
owners and false starts basically condemned the Amiga to
suffer from over a decade of abandonment, as far as operating
system updates go, and support for the newer features that
were desperately needed during this time.
Now, with a roadmap to follow once again, the
Amiga OS is on the move to try and make up some ground for all
those missing years of development.
However, as time has moved on, and the old 68000
CPU now in the realms of total obsolescence, and the hardware
that supported the Amiga OS all those years, now unable to be
considered in any way satisfactory for today's computing
needs, the necessity to move the OS to new hardware base has
become considerably urgent.
This is where OS4.0 comes in.
Not only do
we need to catch up, but to do this the Amiga OS has to be
"unhitched" from the old hardware base to do it, but obstacles
being what they are, nothing is ever as easy as it seems, and
this "unhitching" is also complicated by the fact that the
vast majority of the OS source code was still written in
MC68000 assembly code, which is CPU specific and in no way
portable with any other sort of modern day
microprocessors.
So, the first steps required that the larger parts
of the OS had to be completely re-written in C.
Over the years, various parts of the OS had been
updated and rewritten either completely, or at least in part,
into C language, but due to the ancient origin of the DOS
library, and the importance it has with application
compatibility, it had remained in more or less the same state
as it was from the end of the Commodore era, although, near
the end, there were substantial features added and serious
attempts to remove parts of the early TRIPOS
layer.
Unfortunately, it never completely happened, and
even with the last OS update, the early BCPL TRIPOS kernel
still remained active & functional, but hidden underneath
the higher layer that we are all familiar with and use every
day.
To accomplish the goal of having a portable
version of dos.library, the ancient TRIPOS kernel remnants had
to go, mainly due to the way it was written and worked, it was
unable to be duplicated in modern C language, it also required
an environment that was substantially undocumented and now
rarely used in any application software anyway.
So, the first job was to "unhook" the modern layer
from the TRIPOS remains. This was not as easy as first
expected and took me nearly 9 months to chip away at the hooks
and ties that the modern layer had into it.
At each stage, something broke somewhere, be it in
some of the handlers, or any number of other system components
that took advantage of the old environment and/or side
effects, a lot of these being things that would have never
shown up even if you were looking for them. Trouble only
appeared up when they had the rug pulled out from under them,
even a lot of the C: commands still had many old TRIPOS code
dependencies.
Thankfully, we have a great team of coders on this
OS4 project, and as these dependencies were uncovered, they
were soon fixed or rewritten in extremely short order, one by
one.
Soon, all the old BCPL TRIPOS kernel dependant
code was gone, and in the early morning of 07-December-2002,
at 3am Queensland, Australia time, (just incase you really
want to know exactly.) I booted up the first (TRIPOS free)
Version 50 of dos.library, all the way to workbench.
Over the next few months or so, all the remaining
assembly code "bits" were rewritten into C language.
At least in some way, nearly every programmer on
the OS4 team has contributed to the new dos.library, be it by
fixing other components affected by the changes, or, be it in
dos.library itself, or even just ensuring application
compatibility, by providing test cases.
Some outstanding work has been achieved by a
number of contributors, many of whom I want to thank
personally, because without their help, I doubt that I could
have accomplished the task all on my own, at least not within
several years, and, I don't need another day job.
Also, I don't want to forget to mention all our
beta testers who are continuing to this day to uncover the odd
bug or provide a lot of input into ways of improving the
overall package, from a users perspective.
Here is a list of contributions from other
programmers who supplied ready-made replacements for the V50
dos.library:
Completely new replacement pattern matching routines.
Completely new LoadSeg implementation.
Completely new ReadArgs implementation.
And many more new functions that are too numerous to
mention here.
Also, the work on dos.library has not stopped at just
porting it to C, but it has also undergone some much needed
repairs and enhancements that have been required for many
years, here is a (brief) list of new and enhanced features of
the new V50 dos.library:
The 255 bytes DOS "pathname" limits are now virtually
gone.
Many old bugs concerning NULL pointer passing are now
fixed.
Many more datestamp and time conversion functions are
now available.
New handler mounting routines are now built into
dos.library.
New address and segment tracking functions are now
internal.
Many more "task callable" DOS functions are now
available.
Enhanced error trapping and reporting for errant
applications.
Multi-Assign support for pattern matching functions.
Built in support for PPC and other future formats.
During this development period, dos.library was
being compiled with SASC compiler, but to port it to PPC, the
GCC compiler needs to be used, and as of the start of May
2003, all the code was changed to work with GCC, and it
functions rather nicely now.
All this work has been quite a chore, but I'm sure
you will appreciate the effort that has gone into, not only
dos.library, but all the other system components, and I'm sure
you'll get to hear from some of the other programmers in depth
regarding the work on their own modules, in the weeks to
come.
So, to finish this article, and just for the
dedicated readers here on CAM, I thought it might be nice to
give all of you some memorabilia that no-one outside of the
operating system programmers have probably never seen before.
From V50 onwards, this has been consigned to the archive,
forever.
The following text is from the original header in
the old assembly language source code file from V40 DOS,
named: "doslib.asm"