Author Topic: HYBRID (8X+)  (Read 37281 times)

0 Members and 3 Guests are viewing this topic.

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: HYBRID (8X+)
« Reply #15 on: September 15, 2014, 05:35:31 am »
Ah ok but if it's a shell rather than a full OS, how will it be possible to access the entire 128 KB of RAM even from the TI-OS? Or will it just be restricted to games/programs running from inside the shell? In both cases you would have to make sure that no compatibility issues occur with programs that uses extra RAM, like TI-Boy SE.
When you run the app, all the TI-OS RAM data is backed up in the archive (stuff in pages 0, 1, and 2|3).
Then, page 1 in mapped in bank A, page 2 in B, and page 0 in C).
As far as i know, those pages are not used for permanent storage, except by the TI-OS.
By default, hybrid will not touch the other pages.
But, hybrid-compatible programs will still be free to use them if they need to (for temporary or permanent storage).
So bascially, like on the regular TI-OS environement, the program creator is responsible for compatibility conflicts (but also the user if he hasn't checked the program readme).
I initially had the idea to be able to use some other pages for program execution using a custom page swapping method, in order to be able to run 64K programs.
But i don't know if that will be possible (depending on how the project goes), but again, the user is free to decide to run such programs or not.

UPDATE
> re-coded a few routines : flasherase / flashwrite / flashcopy
> still working on sector defragmenting (once done, i can finally code the RAM backup part)
« Last Edit: September 15, 2014, 05:49:43 am by the_mad_joob »

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: HYBRID (8X+)
« Reply #16 on: September 15, 2014, 07:54:24 am »
This sounds really great! I wrote a reply a week ago but i guess it didn't get sent (China's GFW). Having all that RAM available would be great, i really don't like writing apps so having a huge space available for execution (and not having to mess with page swapping) sounds amazing :D

What's left to be done before it's ready to actually run/load programs?

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: HYBRID (8X+)
« Reply #17 on: September 15, 2014, 08:14:51 am »
Yeah, looks like that reply got lost somewhere in the wordwide flow.
Anyway, thx a lot for your interest =]

What's left to do ? Well, let me see...
For the system to be operational, i need :
> finish the RAM backup section
> define which system RAM locations will be available to the user, move the data in the system RAM, and add the equates in hybrid.inc
> same thing for system rountines (a little reformating required for some of them, cause they are currently executed from the app)
> define the location and available size of the hardware stack
> code the kernel (should include the command line interface, program loading/return code, and hybrid exiting)
> code the RAM restore section (should be way easier than the backup, but it will include a VAT update which should be a bit hardcore)
I probably forget a few things...
« Last Edit: September 15, 2014, 08:30:15 am by the_mad_joob »

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: HYBRID (8X+)
« Reply #18 on: September 15, 2014, 08:50:44 am »
Ah, so that's quite a bit left to do then :P I thought the main bulk of it had already been done. What sort of things do you have planned for the CLI? I figured it was essentially a shell so all you'd really need to do would be to run programs. A CLI sounds a lot more complicated to write than a GUI :P

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: HYBRID (8X+)
« Reply #19 on: September 15, 2014, 09:34:48 am »
Quite a lot to do, indeed...

Well, the CLI will be quite minimalist.
There won't be many features, just the essentials.
Mainly because i think the most important things should be done by the programs themselves (at least on a calculator).
Every command that you enter will cause the kernel to search the archive space for an appvar with that name, check if it contains hybrid-compatible executable data, verify the size, load the stuff @ $4000, and jump to it.
The commands history will scroll down, but there won't be any way to scroll it up (i want to avoid wasting some precious RAM, yeah, that's an excuse XD ).
But still, i intend to reserve 112 bytes for some kind of txtshadow, for when you exit a program.
You will be able to enter lower and uppercase letters, numbers, and that's all (following the appvars name formatting).
The input line length will probably be restricted to 1 line.
As you can see in one of the previous screenshots, the char @ (15,0) will be reserved for busy state, as well as current type mode.
The only available special key combinations will be [ENTER], [CLEAR] (clears the current line, or the whole window if the line is empty), and [2ND]+[MODE] (back to TI-OS).
After that, and due to how it works, special commands could simply be added by making tiny programs that you normally run (a bit like in .COM files in our good old DOS).
I had some projects about handling special programs, a bit like batchs, but i need to code a proper text editor first (not for tomorow).
« Last Edit: September 15, 2014, 09:47:26 am by the_mad_joob »

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: HYBRID (8X+)
« Reply #20 on: September 16, 2014, 08:27:02 am »
So basically typing "ls" will just run an AppVar named ls? I honestly think a GUI that scans all hybrid-compatible AppVars/programs ion-style would be easier, but i dunno. The CLI sounds nice though and is probably what a lot of people do anyway with so many programs on their calculators. I'm curious what sort of "special commands" you could have or that it'd be worth having. Can you pass arguments to them?

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: HYBRID (8X+)
« Reply #21 on: September 16, 2014, 01:09:13 pm »
Don't worry, a CLI won't represent much trouble (i easily "see" the algorithm in my mind).
About arguments, that was just an old idea, in the middle of a many.
That would imply handling specific headers, and such new formatting could be annoying for the developper, which will already have to adapt to hybrid basic rules.
Instead, i could, later on, create a program that automatically handles data input/output such as parameters, file names, etc...
I will probably go for that solution, cause i'm sure parameters will complicate the CLI way too much for me XD
But i must say a batch system (without params, just to automate the run of multiple programs) sounds really appealing to me =P

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: HYBRID (8X+)
« Reply #22 on: September 17, 2014, 08:26:10 am »
The batch system sounds essentially like NoShell, where you could just run programs straight from the homescreen. That would be nice, as would having autocompletion (perhaps pressing right would autocomplete the program) :D

I can't wait to see what this turns out to be :)

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: HYBRID (8X+)
« Reply #23 on: September 20, 2014, 01:39:18 pm »
2 new routines, used by the kernel, but which will also be available to the developper who wishes to use the system CLI for input/output, for simple interactions with the user :
hybdispchr : displays a character at the current cursor location (scrolling handled). That one will actually be called every time you type something.
hybdispstr : same thing but for strings (wrapping+scrolling handled).
I will code hybnextline and hybclr tonight (easy), and the output part of the CLI will pretty much be ready.
More to come...

EDIT :
Alright, the output part is now done (so far : hybclr, hybclrin, hybnextline, hybdispchr, hybdispstr).
Despite those routines are initially for output, some are also designed to make the main input code easier (especially hybclrin & hybdispchr).
During the coding, i also had to decide which pointers i'll use.
Only 3 will be needed : the cursor (only one value), the start of the current input, and the end of it.
I made things so that the programmer should not need to adjust them.
The system is currently using a 144 bytes text shadow (128 + 16 spaces only used for scrolling).
« Last Edit: September 21, 2014, 01:48:09 am by the_mad_joob »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: HYBRID (8X+)
« Reply #24 on: September 22, 2014, 01:54:27 pm »
Will the utility have routines to make it easier to use sound inside games and perhaps Calcnet stuff?

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: HYBRID (8X+)
« Reply #25 on: September 23, 2014, 04:53:49 am »
Will the utility have routines to make it easier to use sound inside games and perhaps Calcnet stuff?

Well, i don't intend to implement such routines in the early release, but that would sound great in the future, if it's possible =]

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: HYBRID (8X+)
« Reply #26 on: September 24, 2014, 07:11:53 am »
I'm currently reformating some routines, again, but that definitely needs to be done now, while i still understand my own code XD
It's a bit of a headache, since i have to make them compatible both for the app and for the user.
I've decided to follow some kind of a scheme.
Reading ROM will always be performed in bank A, and writing in bank B.
That means i will have to run my defrag code from bank C during the app execution, which promises to be kinda tricky, since i don't want to touch any RAM not used by the system.
Indeed, that code will be too large to fit in the stack area, so i will probably do the following :
1) Backup the 1536 bytes used by mathprint (page 2 or 3 depending on calc) into savesscreen & appbackupscreen (appears to fit just right).
2) Map page 2|3 into bank C and use those 1536 bytes for my code, a bit of data, and a reallocated stack.
3) Restore stuff when done.
That will save many complicated page swaps and should definitely speed up the defrag job.
Let's try that...
« Last Edit: September 24, 2014, 07:14:26 am by the_mad_joob »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: HYBRID (8X+)
« Reply #27 on: September 26, 2014, 12:33:32 am »
Just make sure to not accidentally overwrite part of the Flash, especially the certificate or OS :P

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 346
  • Rating: +47/-0
    • View Profile
Re: HYBRID (8X+)
« Reply #28 on: September 26, 2014, 11:57:18 am »
He he, of course.
My flash routines can only write to archive space =P
My LCD routines are safe too, in case the user inputs bad values potentially leading to test mode (lcd bleading).

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: HYBRID (8X+)
« Reply #29 on: September 30, 2014, 11:55:47 am »
Ah right, although I would say test mode is safer than erasing both the certificate and OS simultaneously. :P At least with test mode you just need to remove a battery fast enough and not trigger test mode too often in a short period of time.