Technical information

© Jean Louis-Guérin V1.2a September 2014 Page 16 / 69
Technically, the limits are as follows: there are 80 blocks in the system's “OS pool” two blocks are
used per active folder. An “active” folder is one which is the root directory of the device it's on, or which
has open files, or which is somebody's current directory, or which has an “active” child (subdirectory).
Yes, this is a recursive definition. Remember that each process has a current directory on every
logical device, but also remember that one folder only takes up two blocks, no matter how many
reasons its “active.”
In addition, one block is used per open file, and 1/4 block is used per memory chunk (allocated or free)
in the system memory.
When files are closed, memory chunks are freed, and when processes terminate, blocks are treed
back into the OS pool.
The TOS 1.4 and above has the following improvement over previous ROMs: the old definition of
“active” was “seen” getting a list of the files in a directory caused all the folders there to take up blocks
in the pool. In addition, blocks were never freed in the pool. Also, once parts of the pool had been
used for managing Malloc memory chunks, they were unavailable for managing folders, and vice
versa. All these restrictions are lifted.
It is still possible to run out of OS pool, of course. The program FOLDR100.PRG was released by Atari
and is part of the HDX (hard disk utilities) distribution. It adds memory to the OS pool, and it still works,
adding memory to the new kind of pool, too. Placing this program in your AUTO folder causes 200
more blocks to be added to the OS pool, which is room for 100 more folders (remember, only active
folders take up room) or 800 more memory chunks, or any combination.
The name FOLDR100.PRG can be changed: the three digits in the name are interpreted as the
number of “folders” you want to add at two blocks each. So FOLDRO5O.PRG would add only 100
blocks, while FOLDR200.PRG would add 400. No matter where the program is started from, it looks
for itself in the \AUTO\ folder of the boot device to determine how many blocks to add.
It is to be stressed that this program usually will not be necessary. Only if you have an inordinate
number and depth of folders, open files, etc. will you run out of pool, because it is so much more
efficiently managed than before.
In the unlikely event that you do run out of pool, the following message will appear on your screen:
*** OUT OF INTERNAL MEMORY:
*** USE FOLDR100.PRG TO GET MORE
*** SYSTEM HALTED ***
This message appears in English regardless of the country you are in.
It is regrettable but true that there is nothing you can do at this point but hit the reset button or use the
keyboard reset combination (CTRL-ALT-DELETE). Remember what you were doing when this
happened: were you trying to create a directory that was 50 levels deep in the hierarchy? Were you
opening the tenth different file in the tenth different subdirectory? If you really want to be able to do
whatever you were stopped from doing, use FOLDR100.PRG (or increase the 100” if you're already
using it).
Note: the system call Malloc will never cause a panic: it will just return 0, meaning it couldn't satisfy the
request. When this happens, however, your program has stretched the limits of the system, because
that means there is not even 1/4 of one block available for the memory manager. At this point a well-
designed program will detect the condition (out of memory) and terminate, freeing up enough blocks to
be useful.
3.7 TOS Version Specific Limitations
The information presented here comes from the Towns' Little Guide to Revisions - Version 1.0 written
by John Townsend from Atari Corporation
3.7.1 ROM TOS 1.0 - 520ST and 1040ST
The original TOS shipped with 520ST and 1040ST computers. This version is relatively slow and has
a lot of problems with disk I/O. You should try to avoid using hard disks with this version.
Utilities: FOLDRXXX.PRG