Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Thanks to KermPhD for the name.

I'm trying to develop an OS for the 84+ CE and am working on an installer.

So far, I understand that to deal with flash and ports, I need privileged access. To get privileged access, you need to access a port, which needs privilege itself. From what I understand, I need to enter Z80 mode, which bypasses these privileges and lets you access ports. Currently, I'm trying to bypass these privileges by setting the port to FFFFFF (which sets the last byte of privileged code to the end of theoretical memory). For some reason, it causes the system to reset, as if it wasn't running in z80 mode.

main.c

Code:

/* Keep these headers */
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tice.h>

/* Put function prototypes here */
void printText(const char *text, uint8_t x, uint8_t y);
void printTextSmall(const char *text, uint8_t xpos, uint8_t ypos);

typedef void (*syscall)(void);

void main(void) {
  doPrivilege();

  while (!os_GetCSC());
}


asm/main.asm

Code:

.def _doPrivilege

_doPrivilege:
   assume adl = 1
   ld a, $D1
   ld mb, a
   call.is bypass and $FFFF
   ret

bypass:
   assume adl = 0
   ld a, $FF
   out0 ($1D), a
   out0 ($1E), a
   out0 ($1F), a
   ret.l


Thanks!
One question, how would your OS work? They introduced some sort of check to validate the OS.
The OS interrupt handler is programmed to cause a reset if MB ≠ $D0. Note that it also forces RSMIX.
So, I solved many of those problems above and I've figured it all out.

OS validation only happens during transfer. So if I edit a TI Connect OS file, it won't work because it isn't encrypted/checksummed properly. The same idea applies with Apps. This technique involves running a program to install an OS. Because there is no check on the device side, it is only necessary to erase the flash and then copy the OS to its place. The bootloader only looks for a specific boot signature and boot table and will then boot normally. This same concept applies to Apps in that you can install an app from a program (see MateoC's app-inc and Cesium)
Are you sure? On boot code 5.3.1 when I try to run prgmFREEOS and the OS tries to install, it gives me a validation error.
Oh yeah. TI introduced limitations starting with that boot code revision. Knowing TI, it's probably possible to bypass.
Are you sure? I don't think it is... Well, if they one can make apps for the CE, they could probably make an OS.
I think the bootcode validation only validates up to the start of the User Archive, where the apps are. TI OS doesn't do any checks for Apps I suppose.
Well, perhaps if you can make an alternate OS for the CE, I would like to try it out, provided t works on the 5.3.1 bootcode.


EDIT: This looks great! You should put this on Github or somewhere so the community could help you.
I could probably create a limited version that wouldn't work when RESET. It's still better than nothing. That said, I will continue to research this newer bootcode and ask anyone who may have a solution to please report it Smile
seems better than nothing, i don't reset my calc...
Yeah, i can only see a RESET being useful in the situation of an unstable/alpha OS. Otherwise, no need for it.
  
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 GMT - 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