Author Topic: How do apps work?  (Read 12554 times)

0 Members and 1 Guest are viewing this topic.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
How do apps work?
« on: December 11, 2010, 08:18:38 pm »
Not exactly an asm question, but I figured I'd have the best audience in this board.

So my question is, how do apps run without using up user RAM? Are they copied to a page reserved for apps? And if so, at what location/address is that?

« Last Edit: December 11, 2010, 08:19:02 pm by squidgetx »

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: How do apps work?
« Reply #1 on: December 11, 2010, 10:19:58 pm »
Seems like a fine asm question to me.

Apps are stored in Flash, and execute from Flash, just like the OS.  Flash is divided into 16384-byte "pages"; any page can be mapped to the Z80 address space starting at 4000h, simply by writing the page number to port 6.  So basically, all the OS needs to do to run an app is to write the appropriate value to port 6, and jump to the start of the app's code.  The app is never copied into RAM - there's no free RAM you could use for that purpose.

In order for this to work, the app needs to be stored at the start of a page, which is why every app effectively takes up a multiple of 16k bytes.  Being stored in Flash also means the app can't modify itself (well, that and the fact that they need to be digitally signed.)

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: How do apps work?
« Reply #2 on: December 11, 2010, 10:21:28 pm »
Seems like a fine asm question to me.

Apps are stored in Flash, and execute from Flash, just like the OS.  Flash is divided into 16384-byte "pages"; any page can be mapped to the Z80 address space starting at 4000h, simply by writing the page number to port 6.  So basically, all the OS needs to do to run an app is to write the appropriate value to port 6, and jump to the start of the app's code.  The app is never copied into RAM - there's no free RAM you could use for that purpose.

In order for this to work, the app needs to be stored at the start of a page, which is why every app effectively takes up a multiple of 16k bytes.  Being stored in Flash also means the app can't modify itself (well, that and the fact that they need to be digitally signed.)
Wait, are they checked every time they are run for digital signatures?

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: How do apps work?
« Reply #3 on: December 11, 2010, 10:30:39 pm »
No, only when it's transferred to another calculator (it's checked at the receiving end, that is.)

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: How do apps work?
« Reply #4 on: March 24, 2011, 01:24:23 am »
Why does it have to be signed? (I've never understood the whole signing thing with apps)
There's something about Tuesday...


Pushpins 'n' stuff...


Offline mikehill2003

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 279
  • Rating: +13/-4
    • View Profile
Re: How do apps work?
« Reply #5 on: March 24, 2011, 01:32:13 am »
Why does it have to be signed? (I've never understood the whole signing thing with apps)

If they are signed (I have no idea if they are) it would be to control who could make programs.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: How do apps work?
« Reply #6 on: March 24, 2011, 01:39:34 am »
But if you used your own link protocol, could you send an app to another calculator without having to sign it correctly.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

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: How do apps work?
« Reply #7 on: March 24, 2011, 01:42:27 am »
Welcome to the forums ZippyDee!

I do not know why they are signed, but I suspect this is some protection TI added to their calcs to make it harder to distribute paid ones. However I have no clue why freeware apps still need to be signed.

Offline mikehill2003

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 279
  • Rating: +13/-4
    • View Profile
Re: How do apps work?
« Reply #8 on: March 24, 2011, 01:49:13 am »
But if you used your own link protocol, could you send an app to another calculator without having to sign it correctly.

Can you?

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: How do apps work?
« Reply #9 on: March 24, 2011, 01:53:03 am »
Wait I missed that post. That would be awesome if this was possible. O.O

The only problem is that such apps gets auto-deleted after being ran 16 times, though... (since the calc thinks they are trial apps). Take Axe Parser-generated apps, for example.
« Last Edit: March 24, 2011, 01:53:26 am by DJ_O »

Offline mikehill2003

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 279
  • Rating: +13/-4
    • View Profile
Re: How do apps work?
« Reply #10 on: March 24, 2011, 01:54:43 am »
Wait I missed that post. That would be awesome if this was possible. O.O

The only problem is that such apps gets auto-deleted after being ran 16 times, though... (since the calc thinks they are trial apps). Take Axe Parser-generated apps, for example.

Whoah! LAME

They couldn't make a better trial system then that?

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: How do apps work?
« Reply #11 on: March 24, 2011, 02:16:57 am »
Well... it's Texas Instruments we're talking about here, after all. :P

(Although if Casio tried to lock down the Prizm, then they failed even harder, since it got cracked a few weeks after its release)

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: How do apps work?
« Reply #12 on: March 24, 2011, 02:56:47 am »
Well... it's Texas Instruments we're talking about here, after all. :P

(Although if Casio tried to lock down the Prizm, then they failed even harder, since it got cracked a few weeks after its release)
A couple of weeks, I'm pretty sure we got our own apps on in under a week. In fact we were running apps before the announced release of the Prizm on January 15th.

I never knew that Axe apps were deleted after 16 runs ??? Probably because I've never ran one of my Axe apps more than 16 times before recompiling. but still it just sounds strange to see apps get deleted like that.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: How do apps work?
« Reply #13 on: March 24, 2011, 03:04:38 am »
Yeesh. So is it possible to sign an app on calc, or does it have to be done on a computer?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: How do apps work?
« Reply #14 on: March 24, 2011, 04:04:16 am »
Welcome to the forums ZippyDee!
Thanks :D

The only problem is that such apps gets auto-deleted after being ran 16 times, though... (since the calc thinks they are trial apps). Take Axe Parser-generated apps, for example.
Well then that answers the question of why they need to be signed, so I guess the only question left is
Yeesh. So is it possible to sign an app on calc, or does it have to be done on a computer?
There's something about Tuesday...


Pushpins 'n' stuff...