Universal OS 1.01 for TI 89 and TI92 Plus
Copyright (C) 2000. All rights reserved.

To test Universal OS 1.00, I had VTI with all the ROM et two
calculators : a HW1 1.01 et a HW2 1.05. It perfecly worked so I deduced
it works on HW2 2.03. Unfortunately, it doesn't : there's a black bar.
I correct my doc specifying that Universal OS works on :
- all HW1
- HW2 only with ROM 1.05

I) Introduction

Universal OS is a kernel 'fully' (see the 'Features' section) compatible
with DoorsOS II 0.92. You can archive any library and run any program
greater than 8 kb on ROM 2.xx directly. Grayscale works on HW1 and HW2,
if the program uses graphlib, gray4lib or gray7lib (try Super Mario
Quest 1.0.3).

Universal OS isn't finished : there are still a few restrictions left
but a new version should be released quickly.

Contents :
- install : to install and uninstall
- kernel : the kernel (necessary only for the installation)
- phoenix : non buggy phoenix (see the 'Known problems' section)

Universal OS is a freeware. The distribution of Universal OS is
encouraged, as long as all the files are kept together, and unmodified
from the form in which they were originally released.

II) Installing and using Universal OS

Launch install. Now you may run any assembly program.
This install program is the only one which can uninstall correctly.

NOTES :	- kernel must be unarchived and in the same folder as install.
	- You can exit the current assembly program at any time,
          pressing ESC+ON.
	- Use this program at you own risk. I can't be held responsible
	  for any damage done to your calculator. 
	- DON'T INSTALL DoorsOS after installing Universal OS.
	- DON'T UNINSTALL Universal OS with Doors\unsinstal.
        - Universal OS doesn't automatically replace an old kernel for
	  reasons of security.

III) Features

- Shift-ON does nothing : use a kbdprgm program.
- Libraries must be in the main folder.
- Don't recovers any memory left unfreed by a program :
  personnaly, I don't see how to know if a handle must be freed or not.
  Besides, the algorithm used by DoorsOS isn't perfect.
- the reloc functions aren't supported : for example, prosit won't work.
  (I think it's the only one)
- the userlib::exec function doesn't support zipped programs : it is the
  only difference with the DoorsOS II 0.92 libraries.

- You can turn off the calculator at any time, pressing 2nd+ON.
- util, userlib, gray4lib, gray7lib (except on HW2), graphlib and
  linelib have been reprogrammed and integrated to Universal OS.

IV) Notes for programmers

These remarks also concern programmers who use DoorsOS.

* The exit point :

Imagine this case : A library A use a library B in its exit point and 
B use A in its exit point. If A or B needs an information it had deleted
there is a bug, however sophisticated the Anti Crash protection is.
Then don't use libraries in your exit point.

* Compatibility

In order that the problems with new ROM versions don't appear anymore,
avoid constants use preferably RAM CALLS and librairies, THEN ROM CALLS.
Indeed, TI has changed a few ROM CALLS on ROM 2.xx : for example,
_ROM_CALL_15C doesn't points to EM_blockErase but to a keyboard
variable (I hope it's the only change).
Don't use LCD_MEM if the program is in grayscale ! Use the exported
variables.

Be sure that the program is compatible with TI 89 and TI92 Plus.
This is especially concern the keyboard.

* the DoorsOS.h header file :

There is an error in DoorsOS.h :
GETKEY_CODE	equ	doorsos::MaxHandles+$1e
must be replaced by :
GETKEY_CODE	equ	doorsos::kb_globals+$1e

Don't use :
- doorsos::EM_blockErase	equ	_ROM_CALL_15c
- APD_INIT	equ	LCD_MEM+$F10
  APD_TIMER	equ	LCD_MEM+$F14
  APD_FLAG	equ	LCD_MEM+$F42
  but the userlib::get_APD and userlib::get_ADP functions.
- doorsos::ER_throw macro
   dc.w $A000+\1
   endm
  for security, even if I improved the Anti Crash protection so that it
  exits more cleanly.

* the ROM functions :

Consider that all the ROM functions destroy D0-D2/A0-A1 :
this explains why Falldown and Tetris don't save names on ROM 2.xx.
So be careful with the WriteStr and WriteStrA macros.

* Universal OS uninstallation

$48.w : handle of the memory block containing the kernel
BUT DON'T FREE IT to uninstall Universal OS because it changes some
vectors.
USE install.

VI) Known problems

This kernel use the supervisor stack and saves some informations in it.
But some buggy programs write there : with the other kernels, this isn't
a problem because they don't save anything there but with Universal OS,
the calculator may crash.
examples : - sometimes, db92 don't manage well the ssp : it exits with
             a ssp higher than the initial ssp. The calculator shouldn't
             crash.
           - when phoenix 89 clears the screen, it clears also the top
             of the supervisor stack. The calculator crash after exiting
             all programs and the batteries must be removed for a time
             before reset.

Because the kernel don't recovers any memory left unfreed by a program,
you shouldn't use as92.

To improve the anti-crash protection, Universal OS makes a copy of any
launched program except if it's a archived program because tios, the
util::exec and userlib::exec functions makes one.
However, the method used to know if tios made one don't work on ROM
2.xx : Universal OS should make one in all cases, sometimes useless.

VI) Planned Features

- a version for HW2 2.03 : I've got some ideas.
- libraries in any folder
- support the reloc functions
- find a better method to know if tios made a copy of an archived
  assembly program
- prevent the graphical functions from writing out of the selected plane
  if the coordinates are bad and report the bug using a message.
- finish the userlib::exec function so that it can launch zipped
  programs

VII) History

03/01/2000:
- Universal OS 1.01 released.
- Fixed bugs in :
  - doorsos::kb_globals (_RAM_CALL_010)
  - util::clr_scr
  - userlib::lockcalc
  - checksum of phoenix

02/01/2000:
- Universal OS 1.00 released.

VIII) How to contact me

You can e-mail me at: <Julien.Muchembled@netcourrier.com>

Please report any and all bugs you find using kernel : don't forget to
give a precise description of what you did and what happened.