Author Topic: What happens when a calculator crashes...  (Read 18390 times)

0 Members and 1 Guest are viewing this topic.

SirCmpwn

  • Guest
Re: What happens when a calculator crashes...
« Reply #15 on: March 24, 2011, 10:12:30 pm »
When something goes wrong, such as execution on a restricted page, what actually happens?

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: What happens when a calculator crashes...
« Reply #16 on: March 24, 2011, 10:15:46 pm »
When something goes wrong, such as execution on a restricted page, what actually happens?
I'm not exactly sure.  My best guess would be that it simply jumps to $4000 on page 7F.  You could try it, I highly doubt it will brick your calc.

SirCmpwn

  • Guest
Re: What happens when a calculator crashes...
« Reply #17 on: March 24, 2011, 10:17:57 pm »
I'm just curious, for error handling in KnightOS.  I'm pretty sure that is what happens.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: What happens when a calculator crashes...
« Reply #18 on: March 24, 2011, 10:22:26 pm »
Well, to my knowledge, your code starts executing at $0000 or $0056 (after the boot code jumps to it)
« Last Edit: March 24, 2011, 10:22:37 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: What happens when a calculator crashes...
« Reply #19 on: March 24, 2011, 10:27:39 pm »
There's this tutorial that someone wrote on how to deal with crashes. I can't remember where it is, but it was really sophisticated, and went into everything from running out of batteries to using Calcsys. Could someone please post that link?

That was ClrHome methinks
Now I'm starting to get curious as well...
I'm kind of speculating here, but I'll guess the OS detects something wrong, goes "uh oh", resets the RAM, sets some flag to say "RAM cleared" on reboot and to finish turns off the calc.
idk really tho :P
« Last Edit: March 24, 2011, 10:28:11 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: What happens when a calculator crashes...
« Reply #20 on: March 24, 2011, 10:35:10 pm »
The OS typically doesn't detect something. It literally crashes. ;)
Any unclean start-up will cause the RAM reset sequence.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: What happens when a calculator crashes...
« Reply #21 on: March 24, 2011, 10:38:23 pm »
I don't know much more (much less the super techincal details of all of this) but I know that some people do know. One such person is Benjamin Moody, the person who made The Impossible Game and TI-Boy SE. His app, zStart, can run on RAM clear, which means that all of your defaults are automatically restored after a crash. It works because part of the OS is modified to call that code.
Actually, thepenguin77, aka Brian Coventry made the Impossible Game and zStart.
FloppusMaximus, aka Benjamin Moody made Mimas.
And calc84maniac, aka Brendan Fletcher made TI-Boy SE
« Last Edit: March 24, 2011, 10:38:43 pm by squidgetx »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: What happens when a calculator crashes...
« Reply #22 on: March 24, 2011, 10:43:29 pm »
Now the question is why so many people who are insane at Assembly, including Ben Ryves and those previously mentioned, all have names starting with the letter "B."
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: What happens when a calculator crashes...
« Reply #23 on: March 24, 2011, 10:44:15 pm »
In an asm program the OS is only present when you run a bcall or an interrupt is toggled. When you try to execute code from a bad page, a hardware exception is enabled that resets the cpu. I believe there is a pin on the z80 that triggers a reset when it is set by an external device.

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 jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: What happens when a calculator crashes...
« Reply #24 on: March 24, 2011, 10:44:57 pm »
Now the question is why so many people who are insane at Assembly, including Ben Ryves and those previously mentioned, all have names starting with the letter "B."
* King Graphmastur was smart and names his calculator bert (No seriously, it's in sharpie on the tape)

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: What happens when a calculator crashes...
« Reply #25 on: March 24, 2011, 11:24:09 pm »
What happens during a crash? The CPU executes instructions that don't make sense. For example, it places garbage on the stack, jumps into the middle of a routine, and then tries to return. The top entry on the stack is garbage, so it jumps to a random location in memory. If the location is in the 0C000h+ range, the hardware simply resets the CPU. If the top location is 0000h, it reboots. Often, the CPU will start executing data as code, placing the CPU into a random state. It might start overwriting RAM with garbage. Either way, the CPU eventually finds its way into the 0C000h range and resets, or hits the reboot code itself. If the CPU doesn't, you might get a freeze.
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: What happens when a calculator crashes...
« Reply #26 on: March 24, 2011, 11:34:18 pm »
So the actual crash itself is just hardware, then? The hardware causes a reset when PC is C000h (unless it is in the other memory map mode)?

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: What happens when a calculator crashes...
« Reply #27 on: March 25, 2011, 10:41:18 am »
Now the question is why so many people who are insane at Assembly, including Ben Ryves and those previously mentioned, all have names starting with the letter "B."

And Brandon Wilson ... what the? O.o

What happens during a crash? The CPU executes instructions that don't make sense. For example, it places garbage on the stack, jumps into the middle of a routine, and then tries to return. The top entry on the stack is garbage, so it jumps to a random location in memory. If the location is in the 0C000h+ range, the hardware simply resets the CPU. If the top location is 0000h, it reboots. Often, the CPU will start executing data as code, placing the CPU into a random state. It might start overwriting RAM with garbage. Either way, the CPU eventually finds its way into the 0C000h range and resets, or hits the reboot code itself. If the CPU doesn't, you might get a freeze.

Ohh, so that's why it has the $C000+ protection? All crashes must find their way into the fourth bank, or the calc freezes? I guess the 8811-byte limit does have some use after all.

There's this tutorial that someone wrote on how to deal with crashes. I can't remember where it is, but it was really sophisticated, and went into everything from running out of batteries to using Calcsys. Could someone please post that link?

That was ClrHome methinks

I don't think it's too useful for this topic, but in case anyone's wondering, it's here (or here or here or here ;D).
« Last Edit: March 25, 2011, 10:48:59 am by Deep Thought »




SirCmpwn

  • Guest
Re: What happens when a calculator crashes...
« Reply #28 on: March 25, 2011, 01:46:23 pm »
Naw, the $C000+ limit is for money-sucking purposes.  It used to cost money to make apps, and that was the only way to execute more code.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: What happens when a calculator crashes...
« Reply #29 on: March 25, 2011, 02:58:55 pm »
Naw, the $C000+ limit is for money-sucking purposes.  It used to cost money to make apps, and that was the only way to execute more code.
Lol, funny.  I still like the idea about having a flag that gets reset when a ram clear happens to test for ram clears.  Although two things:
1) Should this be moved to KOS, or left here as it's not necessarily KOS related.
2) Does this happen if you jump to C000h+?