home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
misc
/
tornado
/
easy001
/
5
< prev
next >
Wrap
Text File
|
1995-07-23
|
3KB
|
53 lines
Crash protection
-=-=-=-=-=-=-=-=
From the moment a tornado app declares itself to be that, either by being
started as a subtask or by calling Tornado_Initialise, it comes under the
protective wing of Tornado. From now on, there are very few ways tornado apps
can lock up the machine.
Tornado monitors all filing system operations done by the task, and closes
any files that are still open when an app terminates (unless vetoed by a
service call or wimp service message broadcast). Also, it installs handlers
to deal with Undefined instructions, Prefetch aborts, Data aborts, Address
exceptions, Branch through zeros, CAO exiting errors, normal errors and when
OS_Exit is called.
For Undefined instructions, Prefetch aborts, Data aborts, Address
exceptions, Branch through zeros and CAO exiting errors, polling is halted
on that task and a window is displayed telling the user that this fatal error
has occurred, and what should be done about it. The user also has the option
to save out any files currently loaded into that app, or to save them into a
temporary space and restart the app, which will then reload in those files,
or to ignore the error and continue (in which case you'll get the usual error
box, and lose your files).
For normal errors, usually the task has its own error handler installed to
deal with these errors, but it may request that this operation be automated.
Again, the format of the error box is much the same, in which normal
operation is normally halted of that app, but multitasking continues
unabated.
For OS_Exit being called before Tornado_Closedown, tornado cleans up,
again by asking the user about any unsaved files etc. etc.
For tasks being preempted, eg; subtasks, if the task goes into a never-ending
loop, and if the messages waiting for it exceeds a certain value, a message
pops up to the user indicating that it is most likely that the task has
crashed, and does the user wish to terminate the task.
For tasks not being preempted ie; polling normally; should they suddenly
stop polling without indicating they are about to do so by sending a message
(NOTE: this hasn't been finalised yet) via Wimp_SendMessage to the main
Tornado task, and it agreeing that it is okay, failure to poll after 1 second
since gaining control will cause control to be forcibly removed and the user
asked if he/she wants the task terminated. Note however that Tornado may
start preemption on that task requesting that it may begin single-tasking
processing without its knowledge (at user discretion), and store all the
polling codes normally returned and then pass those codes through
Tornado_Poll back to the app when it indicates that it has finished
processing by sending another wimp message.
This leaves only a few ways left of locking up the machine, ie; the ones
which would usually cause a full reset to get out of them. Due to the
structure of RISC-OS, it's _very_ difficult to get around these, but I'm sure
you'll agree that the proposals above with certainly help no end.
Hmm - did I leave anything out? Don't think so ...