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:
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:
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?
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?