Atari ST TOS mods/improving by PP in 2018,2019
Overview 
 
 
I went in some serious mods, maybe rather improvements,  of TOS versions 1.04 and 1.62 . Why those versions ? Some asked why not TOS 2.06 .
There are multiple reasons for that:
TOS 2.06 can not work in ST machines without extra HW logic added, so not possible with simple EPROM replacement.
Earlier versions are more compatible with older SW, than 2.06 . They use less RAM.
TOS 1.04 and 1.62 are practically same, from same time period. Difference is mostly in extra STE HW support, + couple things, will be explained lower.
And nicest thing is that you can combine AES, Desktop part of 2.06 with GEMDOS part of 1.04, 1.62 - that gives best result:
good compatibility and comfort of 2.06 Desktop.  Btw. opposite - Desktop of 1.04 or 1.62 can not combine with GEMDOS of 2.06, not without serious rewrites. But who would want it - really no sense.

I planned some improvements in TOS for long time - like FAT improvement, Virtual Floppy. Some came just during work on it - when I seen things which can be solved better.
I did diverse ones. Some are simple, some were really lot of work.

Most important is that all it did not increase ROM code size, despite added features. Contrary - code size is now lower, without removing anything, what gives space for some new features, patches.
Despite TOS is coded in big part in C (not really efficient ancient C) I did everything in assembler. Using optimizations in Devpac3 was able to lower binary size for some 7 KB . And of course, all what is added is pure assembler, so lower space usage that if it was done in C.

Here I need to add something (date is Dec. 07 2018):  I was accused by man who published C sources of TOS 2.06 and 3.06 (which he just put together, using some leaked German TOS 2-3.xx sources, as I know) that I used his work, uncredited.
What a shallow man ! I did not mod 2.06 - I use it's Desktop part unchanged. I don't need sources of 2.06 for that - and I proved it in forum.8bitchip.info .   Doing this in C is simply not possible - TOS 1.04 space is 192 KB, and that means that no enough space for all extra stuff I added, if it was coded in C . And yes, it was damn hard to improve FAT16 in disassembled S listing - because it is really not easy to follow C compiler generated binary (in asm mnemonic form). That self took 2 months. Including very intensive testings.
***

List of changes, done so far :
But first important note. From some inertion, people calls this usually 'patch' . No, this is not patch, and not performed as usual patch - adding some new code in binary .  That is just not possible, and would be not so efficient. Because there is no space for many patches, new functions in TOS 1.04 . First thing what needed to do was optimization of binary (resulting) code, make it shorter. And it was possible with some extra work. So, I used Devpac3 assembler optimizations, mostly absolute address short form, if possible - that self gave some 6 KB extra space (shorter code). And other things like packing of RSCs .
New functions are integrated as part of TOS, and no links, jumps to them.
After making some changes in src., need to assemble some new combination of settings, assembling of complete TOS is necessary.  But it takes not much time in Steem on fast PC, since can make it run some 20x faster than on regular ST .

1.  Better FAT16 filesystem - in English: real BigDOS compatible hard disk partition support, what can handle DOS FAT16 partitions up to 1GB, with even less RAM usage of driver SW than for TOS or DOS/TOS compatible partitions. That was hardest update. Took some 2 months.
  After some hesitation I went into fixing problem of max 14 hard disk partitions (logical drives) supported - C: - P:  .
That took some days too, and code in TOS is really not consistent about it. Anyway, it is now fixed, so can have 30 partitions.
C-Z (24) and 6 more, what will have little strange drive 'letters' . With Desktop of 2.06 it is not problem to place such drive icon on Desktop.
partAfterZ.png
No, it's not capital C, it's logical drive #26 - what comes after Z:   .


2. Fixing crash with displaying very long file sizes in txt view.  AES part fix  - done for 1.04 and 1.62 .

3. TOS code optimisation:
    With optimisations GEMDOS part is shorter some 4 KB,  AES part is shorter about 2 KB.  So, 6 KB less so far.
   This part is extremely important - shorter code gives space for more add-ons, for more combinations.

4.   Reorganized section order:  Originally some GEMDOS and AES parts are not in normal order, from unknown reason. I put them in order, what makes changes easier.

5.  Optimising 2 RSC - for AES and Desktop, and DESKTOP.INF usage:

  Version A:  pack all 3 together, depack in RAM when needed.
  It saves 10 KB space in ROM .

  Version B:  static parts unpacked in ROM, in RAM goes only
  what changes. And that is packed too.
  6.3 KB saved in ROM, 6 KB less RAM usage .
 This was hard part too.

 So, ROM code can be shorter 16 KB (v A), or 12 KB (v B) (calculating with other saves from above too), but there is 6 KB  more free RAM with B. As said, making it shorter is a must in case of 1.04 .

6. Long stackframe CPU support for TOS 1.04 - not part of regular 'i' version.
 For accelerators with 68020/30 on STs .
  Universal code, so works with 68000 too.
  Needs however AES without line-F, so I used AES from 1.62 - which is longer  some 8 KB.
  Still, over 4KB free. And 6KB more free RAM.

7. Virtual Floppy and Raw Image system
  This could be most useful feature, especially for people with broken floppy drives, bad floppy disks. Of course, only for owners of some mass storage. Now Flash card based ones are most popular.
  Since everything is stored on mass storage, it doesn't need extra RAM. Virtual floppy can be of very large size - like 30 MB, so can place there content of many floppies.
  Gaming support: it can run even games, basically what works with Floppy Image Runner, will work with this too. However, here is support for image changes 'on fly', and Raw Image Access feature, what makes possible running even those hard disk adapted games, but with only 512KB in machine, saves from games can work too . And all it even faster.

8. New Desktop icons
  Drive, Folder, Trash, Doc, Exec/Runnable

 picolr.png
 If you don't like them, it is not mandatory :-)  Design suggestions welcome.

9. Autoboot for IDE hard disks (rather CF cards now)
Standard IDE adapter support, and on request autoboot for ACSI-CF adapter

12. Some useful info after reset - TOS version, boot stage, TOS v. shown in Desktop Info (instead useless 'all rights'
And there will be possibility to change refresh rate too.
bootFlow1.png
Atari logo , TOS v. , then main parts of boot sequence.
Here was no anything of it active, so it is printed in order, without something between (except little time passed, not really
visible on picture :-)  ) .

11. Extra settings possible during boot:
 
50/60 Hz refresh rate, disable AUTO run. Switch black and white colors.
Most interesting is environment setting, like with boot managers, just without need to install and bother with them:
When pressing some of keys 1-9 right after logo appears, it will not load AUTO run PRG file(s), DESKTOP.INF and ACCessories from their regular locations (AUTO dir and ROOT of boot partition). but from special directory BT, what must be in ROOT of C partition (works from floppy too, but there is not so useful), and in it can have 9 subdirectories 1-9, in which need to place files what want to be automatically loaded during boot and AES start, res. change.
So, for instance if place  SOME.PRG (for auto run), DESKTOP.INF and SOME.ACC in  BT\3\  - it will activate them when pressing key 3 after logo appears.  With it, very easy to start with desired resident SW, Desktop layout, ACCessories. If nothing is pressed, it will load from usual locations.  Desktop save will go too in proper subdirectory. AUTO run and ACC needs to be copied in proper folder.

12. IKBD chip RTC fix
It's years span is only 20 years in reg. TOS, while counter is in range 0-99. So, with fix can work up to year 2079 (start year is 1980).


13. Additional TOS header with extra info block
Extra info block is necessary for Raw Image Access, but I will add there flags for which improvements are present in concrete version, and some addresses.


14. Saving G
EM SW states and quick restore of them:
Something better than hybernate. May save state of computer, running GEM program by key combination press, practically in any moment (except disk operation periods) . And later can restore that state with key comb. press in couple seconds.
Time depends from RAM amount in machine and disk speed. Of course, only for hard disks, Flash card. Time may be under 1 sec with 512 KB RAM, and about 3-6 secs with 4 MB RAM (stays not for slow Satandisk).
10 diverse states can be saved in 10 slots by holding down left shift+Ctrl and pressing 1-9 or 0. Restore by holding down left shift+Ctrl and pressing F1-F10 .
This will work only with SW what uses TOS functions for peripheral access and other things. And GEM SW is mostly such.
This, and Virtual Floppy must use very low level mass storage access (normal filesystem is not good for), so there is special driver in ROM TOS. And it is for specific adapter - so basic ACSI (Internal  MSTE adapter, old ACSI-SCSI adapters ...), ICD extended ACSI (UltraSatan, better ICD adapters  ...), IDE adapters. May be for some custom adapers too in future.
And that low level driver may serve for regular hard disk driver - then can autoboot it even faster, with very low RAM usage (combined with improved FAT16).

Short demo of state saves and restore:



15. TV test pic runnable at boot - for setting proper pic. size, position, contrast, brightness ...


16. Integrated hard disk driver, for ACSI, ICD extended ACSI for now

17. Integrated partitioner,
for ACSI, ICD extended ACSI for now

Main versions planned for distribution:

1.04i - TOS 1.04 with improved FAT16 (1) and Virtual Floppy (8) + other mods. For ST, Mega ST machines.

1.62i - TOS 1.62 with improved FAT16 (1) and Virtual Floppy (8) + other mods. For STE, may work on Mega STEs too.

2.14i - TOS 1.04i with Desktop of 2.06 . May be with (1) too and other changes. For ST, Mega ST (needs extra ROM logic), Mega STE . Because size it goes always in address range $E00000-$E3FFFF  .

2.16i - TOS 1.62i with Desktop of 2.06 . May be with (1) too and other changes. For STE, Mega STE .

Then:

1.43 - TOS 1.04 for accelerators with 68020/30 CPU. May be with (1) too and other changes. For ST, Mega ST .

Diverse combinations are possible. Language:  for start, only UK versions are done. It is easy to change them to US versions. Other languages may be problem, especially in case of 1.43 .  Will I deal with it depends from interest. This is really very time consuming.

Availability:  right now I can ship 1.04i, 1.62i, 2.14i, 2.16i .   UK,US, De versions.

Prices:  will depend from prices of available EPROM chips, needed count - usually 2 chips, but for older ST will need 6 chips. Shipping costs. From size of EPROMS :

Very important: switchable TOS v.:
I recommend to everyone to go on switchable, multi TOS solution. Capacities of EPROMs are such, that can fit 4 diverse TOS versions in 2 chips, or even more.  Or 2 TOS versions in 6x 27C512 (only ST, Mega ST) .
So, can have for instance: org 2.06, 1.62i, 2.16i , + some with mixed features ... - for Mega STE, STE .  Or 1.04i, 2.14i, 2.06 + mixed for ST machines.
That will ensure best SW compatibility and option to use much better Desktop of 2.06 .




    PP,  Jan 2018.- Oct.  2019.