|THE TT. NOT YOUR AVERAGE-LOOKING COMPUTER, IT HAS ONE BUILT-IN
DOUBLE-SIDED DRIVE AND A SOCKET TO "DOCK" A HARD DRIVE EASILY
TT TOS SECRETS
The Adventures of a Curious Insomniac
with a Machine-Language Monitor
BY DONALD MAPLES
Atari's new 68030-based TT is the big brother of the familiar STs and Megas and, like its forerunners, uses TOS as its operating system. But TOS for the TT differs substantially from the TOS we've all come to love--and hate. Donald Maples, a Dusseldorf-based programmer and writer, recently spent some time poking around in the TT's new TOS 030. Whether you're a programmer or user, you'll enjoy this exclusive first look at Atari's latest and best yet version of TOS.
Well, I just couldn't resist the pp-pun. Even if it's not that good, TT TOS is!
The TT was unveiled at the Third Atari Show here in Dusseldorf, West Germany in August 1989 and shown again at London's PCW Show the following month. I attended both shows and was able to spend some time with a TT--and a machine-language monitor. What I found shows that Atari has put a lot of man-hours into upgrading and fixing TOS. And they've left room for upgrades, a positive step for the future.
Let's begin with a review of the TT's specs. (Editor's Note: Many of the TT's specifications were detailed in the December 1989 issue of START.) The heart of the new TT is a Motorola 68030 running at 16 MHz. This means that nominally a TT is twice as fast as your plain-vanilla ST. But in real life, it's actually a bit faster, due both to the fact that the 68030 is itself more efficient than the 68000 (it has two 256-byte caches within the processor itself) and to the TT's new operating system, TOS 030. Also, the TT has a socket for a math coprocessor, which can be either a 68881 or 68882.
The machine comes with two megabytes of RAM standard, but can be expanded to four or eight megabytes internally with one-megabit DRAMs. If four-megabit DRAMs are used, the total internal memory can go up to an amazing 26 megabytes!
In terms of sound, the TT has the same Yamaha sound chip found in the ST, but also contains custom sound circuitry to generate 8-bit PCM (pulse code modulated) stereo. Because of this, there are two new stereo phono jacks on the back panel. The sound system also contains hardware filters to prevent aliasing and other digital distortions. The TT monitors probably will not have speakers, but there is a built-in speaker in the TT case itself.
Other new ports on the TT are an extra serial port, a regular SCSI port for storage peripherals and a new network connector. The industry standard SCSI port is a welcome addition because it enables connection of inexpensive hard drives now available for PCs. Owners of Atari drives can still use the DMA port that's existed since the first ST.
The new TOS 030 has grown to 256KB--and moves! The new TOS ROMs now live at $E00000, rather than at $FC0000. The 256KB image is then "ghosted" (appears again) at $E40000. This implies an easy extension (from the hardware point of view) to the 512KB operating system, as all it needs is the decoding of the extra address line. Furthermore, there are no registers in the way as was previously the case.
In addition to the regular ST low, medium and high resolutions there are now three new video-display modes. Atari insists on calling them 640x480, 1280x960 and 320x480. But in real terms, they should be called TT medium, TT high and TT low, respectively.
The TT low-resolution mode has a 320x480 pixel screen with 256 colors on screen from a palette of 4,096 colors. The TT medium-resolution mode has a 640x480 pixel screen but this time with "only" 16 colors from 4,096. And the TT high-resolution mode (analogous to the ST high) has a monochrome screen but with a resolution of 1280x860 pixels.
All of the resolutions (with the exception of the TT high resolution) can be displayed on Atari's new color monitor. To view the new high resolution monochrome mode, a separate monitor will be required. This has not been demonstrated publicly as of this writing.
One thing that may have sounded a bit odd in the last paragraph is that the old ST high resolution can now be seen in color! Yes, it's true--because of the new hardware, the old ST high resolution can now be displayed on the TT color monitor! This means that the TT's high-resolution colors aren't limited to black and white, but can be any two colors from the new TT palette. So anyone wanting a green--or amber-on-black monitor can do so and still have the ST's high resolution!
This not only gives hardware scrolling, but also means that the screen address no longer needs to be on a $100-byte boundary.
The resolution register now contains more than just the resolution information and it has also moved:
$FF8262--W, resolution and screen mode registers
The first byte-sized register at the above address contains the the resolution in the three low bits (as opposed to two on the ST) to enable encoding of the new screen modes, which are as follows: (Figure 9)
Speaking of colors, there are quite a few changes in the way the colors are handled on the TT. First of all, the color palette has been relocated and has grown to accommodate all of the new colors.
$FF8400--256 W, color palette
The RGB (red, green and blue) color components now range from 0-15, since each can now be set to one of 16 intensities for a total of 16x16x16 colors, or 4,096. But that's not all, the colors bits have also been "scrambled."
On the ST the three low bits of each RGB component specified one of the eight possible intensities. It would therefore seem logical to have the next bit to the left extend this to 16. But for some reason, this is not the case. The three low bits have been shifted left and the new bit inserted in position 0, making the hardware and software color numbers different, which in turn means that color numbers must now be converted! Why Atari did it this way I haven't a clue.
Software color number: R3-R2-R1-R0 G3-G2-G1-G0 B3-B2-B1-B0 converts into Hardware color number: R2-R1-R0-R3 G2-G1-G0-B3 B2-B1-B0-B3
Compatibility and look and Feel
On the software side, TOS 030 is similar to TOS 1.4 (Rainbow TOS), now available as a ROM upgrade. A scaled-down version of TOS 030 will also power the new STE computer, but there it's called TOS 1.6.
Atari claims upward software compatibility, but I have had some strange experiences. A well behaved GEM program I've just finished writing had problems with LineA line drawing. On the other hand, a machine language monitor which does all sorts of rude things (i.e., bypasses legal calls) runs line. I have also seen at least one other major program with problems. To be fair, it's likely that this is not the final version of the TT operating system. Browsing through code I have come across some, shall we say, unusual segments. I expect that by the time the TT hits the streets, which is rumored to be in the first quarter of 1990, all of that will be sorted out.
The TOS did grow to 256KB, but more than 32KB at the top of this memory is unused. The address range from $E262DC to $E3FFFF is still virgin ROM territory, i.e., all locations contain $FFFFs and are thus ready for expansion. One nice thing would be to have GDOS in the ROMs. I personally am no great lover of GEM, but I must admit it's very handy when used in moderation. However, one thing worse that GEM is half-a-GEM--and that's exactly what we have now. So, Atari, if you're listening, please add GDOS to the ROMs!
From the user's point of view, there are a few changes to the overall operation of the Desktop. First is a cosmetic change in the Desktop Info under Desk, as shown in Figure 1. Like Rainbow TOS, it now contains the Atari symbol with cycling rainbow colors (which we couldn't show on paper!).
ST low (320x200)
ST med (640x200)
ST high (640x400)
TT med (640x480)
TT high (1280x96)
TT low (320x480)
Another cosmetic--but more useful--change is that color 0, i.e., the screen around the desktop is not white but black! This is also the case for any programs run from the AUTO folder. They will now default to inverse video with white characters on a black background. Furthermore, this occurs in all programs run from the AUTO folder, regardless of the resolution. In the past, if an AUTO program changed the resolution, for example from low to medium, the character color could be yellow-on-white, making the whole thing unreadable. Now, TOS will automatically swap the necessary color registers to maintain white characters on a black background, regardless of the resolution. An added bonus is that "white on black" is easier on both the monitor (less burn-in) and the eyes (less fatigue). The only other difference in the appearance is the addition of the CACHE item under the Option menu, as shown in Figure 2. This has to do with the 68030 processor. To maintain compatibility with older programs, the cache can be turned off, primarily because the cache keeps up to 256 bytes of instructions within the processor itself. This speeds up program execution (no need for the relatively slow main memory access), but can cause problems in some self-modifying programs.
The new Set Preferences dialog box, shown in Figure 3, has been extended to handle the new screen resolutions. Three new buttons have been added below the Low, Medium and High buttons to select the three new video modes.
Still More That's New
The screen updates and window drawings are faster overall, not only because of the raw speed of the 68030 but also because of the new TOS. This now includes a software disk cache which reduces disk access from older TOS versions.
One addition available only to TT high resolution users is a new font. There are now a total of four default fonts with the new one using a 16x32 matrix for character definition. Alas, this can only be seen on a high-resolution monochrome monitor.
Although there are still two items in the File menu for Copy and Format, they both invoke the same dialog box shown in Figure 4. You can now click on Format, format a disk and then without exiting this dialog box, you can perform a disk copy.
Disks formatted under TOS 030 are fully read/write compatible with MS-DOS.
The actual copy process, whether file copy or disk copy, is much improved. Not only is it faster, but it reduces the number of disk swaps, a very irritating aspect of the old TOS. In addition to Copy File, you can now move a file, as shown in Figure 5. This can only be done from the Desktop by holding down [Control] while dragging the file(s) with the mouse.
Another very useful feature is the ability to rename folders, as shown in Figure 6. The same dialog box is used to change a file name, but with the attribute changes disabled.
The last of the small but positive changes is in the Install Disk Drive item. In the past this defaulted to Cancel, which caused a lot of irritation. Now the default is Install, which makes much more sense.
Finally, the InstallApplication item now looks a bit different, as shown in Figure 7. The dialog box contains two new buttons, Normal and Auto. The Normal button works as before--it lets you install applications as before. For example, if you installed STWRITER.PRG with a filename extender of .TXT, whenever you double-clicked on a .TXT file, the word processor would run and load the selected file automatically.
The AUTO option is much more interesting. One significant complaint about TOS from the start was its inability to run GEM programs from the AUTO folder. Now you can--with some limitations. The way this works is by saving the information about the GEM program in the DESKTOP.INF file with the new Z line with the following layout: Z 01 [path][program]. The next time you turn on the computer, GEM will look at the DESKTOP.INF file and, if the above line is found, it will run that program automatically. Note: only one program can be run in this manner and that any document specification will be ignored.
The additional parameter immediately after the Z indicates whether the program requires GEM libraries.
Z 00--run a non-GEM program automatically (TOS or TTP) Z 01--run a GEM program automatically (PRG or APP)
The file-selector box has been improved also and it now contains drive buttons, as shown in Figure 8. Each drive connected to the machine at boot-up appears as a separate button, including hard-disk partitions and RAM disks. The file templates can now be specified on the template line below the directory line. This template line will accept * and ? wildcard characters in templates and then show only the requested files.
Another handy feature is the ability to perform a warm reboot by pressing the [Control][Alternate][Delete] keys simultaneously. This is equivalent to pressing the reset button (unlike RESTART from the Summer 1988 issue of START, which performs a cold boot with the same key combination). Pressing the reset button has now been made much more difficult to do accidentally; it's now recessed.
Snooping into the ROMs
So much for the look and feel. As to the actual ROM routines, the main changes have to do with the new screen modes. The whole operating system appears much neater. All of the tables and a major portion of the data and constants are now at the end of the OS. Even the GEM portion, still written in C, looks much better. However, the C compiler is still the same. If you do not like C syntax and find it difficult to follow (C is the world's first write-only language), the resulting object code is even worse. But for us opinionated assembler programmers, anything not in assembler is sloppy and inefficient.
So in true hacker fashion, let's turn to a few things discovered while snooping around with a machine-language monitor. (And just for the record, a true hacker is a programmer who writes neat code and believes in sharing the knowledge, not a criminal who writes damaging viruses and destroys other people's work.)
The BIOS routines largely remain the same, but the XBIOS has been extended. There are now 96 XBIOS routines, rather than the former 39. However, there are only 11 truly new routines. The remaining routines are dummies and are there for future expansion only. The 11 new routines are as follows:
XBIOS 41: get/set drive seek rate.
New $2(A7)--W, new seek rate (where $FFFF just gets old rate)
$0(A7)--W, drive number (0 = A, B = 1 )
Old: D0--W, old drive seek rate (always returned)
Using this routine, the disk seek-rate can be interrogated and changed. This is a very useful routine painfully missing from the earlier TOS versions.
XBIOS 64: get/set blitter configuration. New $0(A7)--W,flag:
$FFFF = get current blitter configuration
$0001 = set blitter to hardware
$0000 = set blitter to software
Old: D0--W, old blitter configuration (always returned)
This routine was already present in the Mega TOS and is well documented.
XBIOS 66: DMA/SCSI communication.
New $A(A7)--W, DMA/SCSI device number
$6(A7)--L, buffer address
The details on this routine are not available but it appears that it enables access to the DMA without having to resort to custom-written routines as required in the past.
XBIOS 80: set screen mode/resolution and reinitialize screen (LINE-A, variables, fonts, etc)
New $0(A7)--W, new screen mode (including resolution)
Old: D0--W, old screen mode
This function enables the complete change of resolution. Unlike the current resolution change routine, this routine will also initialize all of the relevant GEM variables to enable the use of GEM in this new resolution without having to reboot the system.
XBIOS 81: get current screen mode and resolution.
Old: D0--W, current screen mode and resolution
The new resolution modes on the TT require the use of the new registers at $FF8262. This location contains two byte-sized registers. The first contains the resolution in the low three bits plus some extra information in bits 4 and 7. This byte is followed by an additional register. The routine here returns both values.
XBIOS 82: get/set screen mode only (keep current resolution).
New $0(A7)--W, new screen more in low nybble
Old: D0--W, old screen mode (low nybble of screen mode word)
This routine enables interrogation and changing of the second byte mentioned above.
XBIOS 83: get/set color in color register.
New. $2(A7)--W, new color value (where $FFFF just gets old color
$0(A7)--W, color register number
Old: D0--W, old color value for given register.
This routine enables the changing and interrogating of individual colors in the new color registers at $FF8400.
XBIOS 84: set range of colors from palette.
New $4(A7)--L, palette address (table of consecutive colors)
$2(A7)--W, number of registers to change
$0(A7)--W, number of color register to start with
This routine enables the changing of a number of color registers. The range can be as little as one or as many as all 256 colors. The only restriction is that the colors must be in sequence. If the range goes beyond the end of the registers, the routine will automatically stop when the end is reached.
XBIOS 85: get range of colors into palette.
New. $4(A7)--L, palette address (colors are returned here)
$2(A7)--W, number of consecutive colors to return
$0(A7)--W, number of color register to start with
This routine is the exact opposite of the previous call. It loads the palette in memory with color values found in a range of color registers.
XBIOS 86: get/set bit 4 of resolution register.
New. $0(A7)--W, flag
negative--return current value of bit 4
zero--clear bit 4
positive--set bit 4
Old: D0--W, flag:
0--bit 4 was clear
1--bit 4 was set
And what does this bit 4 mean? I'm not sure yet.
XBIOS 87: get/set bit 7 of resolution register.
negative = return current value of bit 7
zero = clear bit 7
positive = set bit 7
Old: D0--W, flag:
0--bit 7 was clear
1--bit 7 was set
As for the meaning of bit 7, please refer to the previous routine.
In terms of GEMDOS, I observed only one difference, namely the function $4B, chain program has an additional mode 6, but as of now it's still not clear what the function of this new mode is. It does seem similar to mode 5 which is "create base page."
Documented Low-Memory Variables
Finally, the documented variables in low memory have been expanded. These are the variables whose address will not change in the future. Here is a selection of some interesting new additions:
The XBIOS input/output routines are now accessed using four jump tables starting at $51E. Each jump table is eight entries long, but only six are actually used. The remaining two are for future expansion. The device assignments remain the same:
0--PRT: centronics interface
1--AUX: RS-232 interface
2--CON: keyboard and screen
4--IKBD, keyboard professor interface
5--screen output, ignoring control codes
The jump tables are in the following order:
$051E--8L, BCONSTAT vectors, get devise input status
$053E--8L, CONIN vectors, input character from device
$055E--8L, BCOSTAT vectors, get device output
$057E--8L, CONOUT vectors, output character to devise
The new monitors are not planned to have a built-in speaker and because of this the keyboard click/bell sound currently available may not be heard. However, the address of the bell-sound routine can be found at $5AC. This lets the user wedge in a new sound routine. In theory, you could have each key click send a command down the MIDI ports to your favorite synthesizer and cause serious sonic disturbances ...
Finally, location $59E contains the 68030 processor flag.
$59E--W, when 0, 68000 processor
when not 0, 68030 processor
And that concludes my initial snooping in and around Atari's new TT and its new operating system, TOS 030. For a programmer, both are welcome additions to the Atari line. In turn, that means that programmers will produce better programs which benefits everyone around. But the TT is not limited to existing software. In addition to TOS and GEM, the new TT will also run UNIX System V with X-Windows. This actually appears to be the main thrust of the new computer; it was conceived as an inexpensive UNIX station with downward ST compatibility.
I hope this article has shed some light on this new exciting computer. If you have any additional comments or suggestions, please feel free to contact me in care of START Magazine.
Donald Maples is a programmer and writer who lives in West Germany. This is his first article for START.