Hello,
I've been doing some thinking about KnightOS and other 3rd party OSes, and thought it would be a good idea to find a way to identify them uniquely. I propose that any 3rd party OS should use the first 8 bytes of page 00 the same way that I do - the first three bytes jump to the OS like normal, and the remainder are used for the metadata. Here's my code from KnightOS:

Code:
; $0000
   ; RST $00
   jp Boot
   ; Magic Number
   ; $0003
   .db "KK"
   ; $0005
   .db MajorVersion
   .db MinorVersion
   ; $0007
   ; Build Type
   ; Bits 0-2 determine model
   ; Bit 3 is set on DEBUG builds
   ; Bit 4 is set on USB models only
   ; Bit 5 is set on 15 MHz models only
   ; Bits 6-7 are unused
   #ifdef DEBUG
   
   #ifdef TI73
   .db %00001000
   #endif
   #ifdef TI83Plus
   .db %00001001
   #endif
   #ifdef TI83PlusSE
   .db %00101010
   #endif
   #ifdef TI84Plus
   .db %00111011
   #endif
   #ifdef TI84PlusSE
   .db %00111100
   #endif
   
   #else
   
   #ifdef TI73
   .db %00000000
   #endif
   #ifdef TI83Plus
   .db %00000001
   #endif
   #ifdef TI83PlusSE
   .db %00100010
   #endif
   #ifdef TI84Plus
   .db %00110011
   #endif
   #ifdef TI84PlusSE
   .db %00110100
   #endif
   
   #endif

The first two bytes are your magic numbers (something unique to your OS). In this case, "KK" is short for "Knight Kernel." GlassOS could use "Gl" for example. 0x0005 should then have the version of that OS. The version is stored in the 8xu file, but not on the calculator itself. Major, then minor, very simple. $0007 should finally have some information about the OS's intended audience. The explanation for that is here:

Code:
   ; Build Type
   ; Bits 0-2 determine model
   ; Bit 3 is set on DEBUG builds
   ; Bit 4 is set on USB models only
   ; Bit 5 is set on 15 MHz models only
   ; Bits 6-7 are unused

If anyone can think of something to do with bits 6 and 7, present your arguments. They could alternatively just be specific to that OS.
After this is $0008, which you should use for RST $08 like normal.

Thoughts?
The version actually is stored on the calculator itself. The OS header is stored at 7A:4000h, and the validation signature is stored at 7A:4100h. The boot code writes these during the OS receiving process, so you can guarantee it'll be there.

I would recommend instead throwing whatever you want into the OS header as unused fields. There are field-parsing routines built into the boot code that let you quickly get information out of there.
Oh, that makes sense. I'll leave this code in KnightOS (I have nothing to do with it), but I'll also add some stuff to the header.
TIOS has fields like on ROM 0, right?

GlassOS wouldn't put anything in that field as it doesn't care what hardware (it will, but for now, I only have it working on the ti84pse) it runs on. However, an OS name should work, and other simple things.

USB is a different story... it sends meta-data to the PC (the protocol, specifically).


Code:
struct
{
char *OS_name;
struct
{
byte major,minor;
} version;
// Bitfield?
byte flags;
} metadata;

at 0x06 would be

Code:
  .dw #_metadata ; pointer to metadata in ROM 0
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement