home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / t / tornado / QandA / Gerph1 next >
Encoding:
Text File  |  1995-06-26  |  18.0 KB  |  323 lines

  1. "  • BackSave gives an error "Internal error: abort on instruction fetch at
  2.    &00009DD0" which I assume is from the interrupt routine not removing
  3.    quickly enough when the program exits, but I'm only guessing. "
  4.  
  5. More likely it's RO3. I've always said it's a bit screwed up. They added in
  6. all sorts of weird variences from the calls, and so now things like the
  7. contents of R3 matter when in RO2 they don't and thus RO3 dies horribly. TBH
  8. it really pisses me off that Acorn did that.
  9.  
  10. "    Neat idea, but think of the amount of Wimp_TransferBlocks you need to do
  11.    to complete it… "
  12.  
  13. Nope, I'm going to cheat. The BackSave program will load the code into a file
  14. in tfs:. And then the program will be fed that file, and since tfs: operates
  15. mostly out of RMA it'll be very quick to load, so the Wimp won't get paused.
  16.  
  17. "    Or alternatively, you could physically re-map memory so that when you
  18. load the file it is loaded into the right place. "
  19.  
  20. Very very dodgy. If you have tried playing around with the memory map, you'll
  21. know it's very easy to make the Wimp have a baby. Best leave it alone if
  22. possible IMHO.
  23.  
  24. "    Alternatively, as the task is going to be suspended during the period of
  25.    the load it would be easier (as we are already intercepting the
  26.    Wimp_Poll's) to use the Poll, Null code to perform the load ever second. "
  27.  
  28. I could implement a Tornado equivalent of OS_File, which forces USR
  29. mode before the SWI code executes. Or maybe make all apps use a system of:
  30.  
  31. User selects Save. Task calls Tornado_Save,params and Tornado saves the file
  32. into tfs:. Task returns to normal polling, thinking all is done. The Tornado
  33. module task can then do all the hard work of saving.
  34.  
  35. Or instead of saving it to disc, maybe into another app, say Zap. Anything is
  36. possible by using this method, which is why tfs: is so important.
  37.  
  38. "  • FSsource bombed out with FS_Func 15 not supported by TFS, but otherwise,
  39.    I see that it should work, and probably does on RO2. That happens for
  40.    cataloguing, the load ([Int*) doesn't work due to FS_Func 14 not
  41.    supported, but code 10 - Save block as typed file worked fine. "
  42.  
  43. Bloody RO3! Func 15 is used normally by the filer to display filer windows.
  44. It's proper name is 'Read directory names and info' and func 14 is the same
  45. except it only reads directory names. I can't understand why RO3 is
  46. interfering here, as tfs: does its own matching of wildcards, as the RO2
  47. PRM's says it should.
  48.    Anyway, I want to redo tfs: entirely. I think I may have fucked up the
  49. data structures too much (talk about spaghetti!).
  50.  
  51. "    Garbage looks good, but there's something up with the way it does it
  52. that
  53.    I can't put my finger on. It's a simple technique, but I think it will
  54.    fall down if you have a heap which is :
  55.     a) allocated 12
  56.     b) free 4096
  57.     c) allocated 12
  58.     d) allocated 4100
  59.    Because on the first pass it will only be able to move c to b, and then on
  60.    the second pass it will need 4100 extra bytes to be able to move d and as
  61.    it hasn't got it lower down the stack that block will be fixed. If the
  62.    stack has 10000 bytes allocated to it, then the largest block which can be
  63.    allocated is 4096, but the free space is 5876. I'm not sure of a more
  64.    efficient method, but it occurs to me that moving large blocks of memory
  65.    should be reduced, so you should move the smallest blocks first and then the
  66.    larger ones. No that's wrong, then you get the same problem. Erm, I'm not
  67.    sure, Heap allocation wasn't one of my strong points - hence why I've
  68.    always used the RMA instead of Wimp_Slot for variable sized datablocks
  69.    (naughty). Hmm, I'd love to hear about how you are going to do it as I'm
  70.    not so sure myself.
  71.    PROCfreeblk - missed out R0 again. Seems to work ok. Now to test FNgrabage.
  72.    Looks ok, but I'm not sure that Showheap works correctly - that could just
  73.    be me though. "
  74.  
  75. I agree, but using better methods is far more time-consuming, and when you'll
  76. have auto-compression after every heap op, it'll have to be quick. I've
  77. revised the heap garbaging, and fixed a major bug, and if you run HeapExt for
  78. quite a while you'll see fragmentation is pretty minimal. And for Basic, the
  79. heap op's are bloody fast - imagine it in assembler!
  80.    I believe there might be a problem under RO3.5 - Acorn have changed the
  81. OS_Heap format, and no doubt will go for some stupid relocatable
  82. implementation like WimpExt uses (which really is crap). WimpExt is also on
  83. the disc.
  84.  
  85. "  • GBPB document Guidline 5b - Good idea about not pausing Wimp, but
  86.    sometimes it is necessary to load an app as quickly as possible - ie load
  87.    diary whilst on phone, am I free, damn I wish I'd set that time as "
  88.  
  89. In the end, the task doing all this preemption, multitasking loading etc.
  90. will be written to do this, but Tornado has master control ie; it can really
  91. single-task load it and the task will never know. The structure of the SWI's
  92. will reflect this, and every Tornado task has an !Options (very Mac like,
  93. but the difference will be that this options can be edited with Zap freely
  94. and easily, rather than having to load a specialist app like on the Mac.
  95. Mind you, the Tornado app manager will do it too with far less fiddling),
  96. which contains standard Tornado options (like, multitask this or that?) as
  97. well as app-specific ones. Ultimately, the Tornado application manager,
  98. running from the Tornado module task, will allow very quick and simple
  99. altering of this. Your phone rings, you hit Ctrl-Alt-f12, up pops the Tornado
  100. app manager window, a few quick clicks later and the Database app loads in
  101. single-taskingly. Anyway, if you write your GBPB i/o in assembly, and do it
  102. well, you can load an app almost as fast as OS_File can. For example, in a
  103. past app of mine called Flow, it compressed data on the fly and wrote it to a
  104. file a byte at a time in mode 13. The file is saved at the full 20k/sec that
  105. the floppy drive can offer.
  106.  
  107. "    longer... I agree with Tornado_StartPreemption, and use a basic version
  108.    of it in my ReadMail application for the utilities which were originally
  109.    single tasking. It that way my ‘multiple-processes’ can be carried out
  110.    concurrently. But I will say that doing this really does slow down the
  111.    single tasking program. "
  112.  
  113. I have the preemption code, which allows an app to be preempted constantly if
  114. it so wishes. Problem is it isn't very efficient (null ret codes always have
  115. to be returned). That's enclosed. It isn't tested, but I wrote it one night
  116. after a lot of alcohol, so suffice it to say it probably will. :-)
  117.    Next option I have is a TAOS-like method of starting up remote processes.
  118. You've already read about that, but there's no reason all the processes can't
  119. run as Wimp tasks.
  120.    Final option is for the process to be written to work in bits, and Tornado
  121. can have it called. Not perfect.
  122.    Problem is that languages like Basic won't support multiple threading,
  123. like say the main polling loop calls Tornado_Poll, and Tornado_Poll then
  124. returns out of a Tornado_Poll in another part of the code. Do this and Basic
  125. crashes, as it's expecting the second SWI to exist before the first is even
  126. called and exited. C will work, as will assembler, but Basic won't. This
  127. limits things quite a bit, and adds a lot more onto the programmer than is
  128. really necessary.
  129.  
  130. "    Hang on, if you use top for input, bottom for output (like packdir) and
  131.    both for non-multitasking then what happens if non-multitasking program
  132.    does a lot of input and output (eg packdir). Better to use LED 3 which is
  133.    unspecified in Acorns Hourglass but useable if you get DoggySoft's
  134.    HourMake program (it's PD, I would send it but it's quite big)
  135.    The hourglass standard sounds good though - like the PC when it's
  136.    downloading data in a web viewer, at least those I've seen. "
  137.  
  138. For a start, it's dangerous for any program to do alot of input followed by
  139. output, with say like byte quantities from the opposite sides of the same
  140. file. Can very badly corrupt the data, as you'd find out when weeding
  141. messageareas in some of my modes. Dunno why, it's badly written IRQ code in
  142. FileSwitch/FileCore I think, and I think the problem doesn't happen if you're
  143. using fast media (not a floppy). But that besides, I agree. I dunno about the
  144. hourglass shapes (I'm not a great designer), but what I do know is I want to
  145. implement changing pointers, where the different things you can do are
  146. represented with the mouse pointer changing every 25cs. And while the mouse
  147. is moving, the arrow shape stays mostly but changes to the ptr(s) for 2
  148. frames say. This way, we can legitimately do a few less obvious options, and
  149. they won't get missed. Plus, the user knows what will happen if say he/she
  150. clicks on a reply button. Handy. And rather intuitive I think.
  151.  
  152. "    Hmm. I'm not sure I like the way that Tornado tasks have the same style
  153.    of code used for their configuration as Tornado tasks. Better to have a
  154.    central configuration program for Tornado specific settings and to have a
  155.    menu option to configure Tornado. This then initiates an external edit of
  156.    the configuration file stored in that application to alter the settings. "
  157.  
  158. What was planned was a standard general Tornado options window, common to all
  159. Tornado apps. This window is automatically drawn by Tornado, handled by
  160. Tornado etc. and is a pane in the task's option window. This allows
  161. individual task general Tornado option setting, and Tornado app manager can
  162. allow global options to be set, or enforced as the case may be.
  163.  
  164. "      flags bits : 0 Set if active immediately
  165.                   1 Required to kill current tasks to set options "
  166.  
  167. Ooo, not good! No Tornado task should have to quit to reset options. But if
  168. it were absolutely necessary (unlikely IMHO), the task pops up a dialogue,
  169. and reruns itself, keeping the original app intact. When the new app has
  170. loaded, it knows from an option set in its environ. string that an option has
  171. been reset (or the original app sends the new app a message), and requests
  172. the files. The files are RAM-transferred, and if everything's fine the old
  173. app terminates nicely. If the new app couldn't load in, then the original
  174. task remains with options unchanged for the parts which couldn't be.
  175.  
  176. "  • External Edit spec is available at Arcade as ExtEdit1 (I think) and is
  177.    moderated by Jason Williams in New Zealand. Alex Hayward understands it
  178.    better than I do because he's used it in his OLR and I've only just
  179.    started programming using it.
  180.    External Edit might be useful in implementing your remote process of files
  181.    protocol - just a thought :-) "
  182.  
  183. External edit dies horribly on RO2 :-). However, in the case of an OLR, OLE
  184. would be used instead. And unfortunately, for remote processes I think would
  185. need their own protocol, or things would get messy. Nice thought though!
  186.  
  187. "  • Would some sort of special protection for Tornado tasks be possible so
  188.    that if they died they could never lock the machine up ? "
  189.  
  190. Is done. Tornado hooks into Address exception etc. and catches any such
  191. errors while Tornado_Poll is being used. Problem is reiterative loops which
  192. never end. I reckon a method of hacking out of these using something like
  193. Windows version wouldn't be too difficult. Polling would return, except the
  194. offending task wouldn't be polled. This is so easy I personally can't
  195. understand why Acorn haven't done it yet.
  196.    Mind you, there are just some things that can't be helped. If a task went
  197. out of its way to corrupt memory, there would be little to be done. But
  198. Tornado will also hook into things like OS_Find, closing any open files if
  199. necessary. All will be done to try and tidy up properly.
  200.  
  201. "  • Virtual single tasking programs ? A single tasking program could ask
  202.    Tornado to either open a sprite window for it's output (VMode style), or
  203.    the task could be interrupted with Alt-Tab and the desktop switched back
  204.    in, the task having been delinked and paged on to disc so that the memory
  205.    remains useable. I have begun work on this be have hit upon a problem with
  206.    the Wimp_Polls subsequently crashing. I think it's a mode problem. Once I
  207.    sort it out I'll tell you. "
  208.  
  209. This isn't really too difficult. Another (eventual) Tornado general option is
  210. to intercept all non-multitasking programs starting up, and sticking them in
  211. a window, and being preempted. You will need to intercept a lot of SWI's
  212. using a rewriting of &08 (eg; OS_ReadModeVariable etc.), and not pointing VDU
  213. output into a sprite unless a write into the sprite is done (changing vdu
  214. output is slow). Also, you could intercept and change the screen memory base
  215. address, and this would allow a lot of games to work too.
  216.    As for switching the desktop back in during a game say: much the same
  217. IMHO, simply having the Wimp multi-task while the game runs (by preempting
  218. the game and during the polls switching output into a sprite ie; the wimp's
  219. output gets redirected into a sprite instead of the usually preempted task).
  220. Again, replacing most of the OS :-) would help a lot there, but really it's a
  221. lot of work for little gain. Few people have enough memory to run multiple
  222. copies of most games at once in windows and/or with the desktop. And worse
  223. still, as memory increases, so will games demands.
  224.    Even without them being games, most programs are single-tasking for a
  225. reason.
  226.    Good luck though!
  227.  
  228.  
  229. "   ND> God, we _do_ think alike! I had the very same idea, and I've done
  230.   ND> a protocol too. Mind you, could I see yours too? Mine's a bit more
  231.   ND> outrageous, like most of Tornado, and no doubt just as impossible
  232.   ND> to write, but hell, one's gotta aim high.
  233.  
  234. I don't think that mine is quite as extravagent as yours, and I wrote it
  235. before I knew about ExtEdit protocol. The idea was that you could link
  236. documents between packages which didn't specifically know what they were
  237. linking to, eg Almanac. Hang on, I'll have to extract it from my Word
  238. document…
  239.  
  240. --8<--------
  241.         Simple specification for linkages between entries within files
  242.         ==============================================================
  243.                Linking individual file entries within other files "
  244.  
  245. Hmm, interesting. Not quite my idea. Here's what I want:
  246.  
  247. I figure that if all Tornado tasks support OLE, what's to support hotlinking
  248. too? For example, in Impression, we have an empty frame (this is assuming
  249. that Impression were a Tornado app), and we have a graphing package and
  250. spreadsheet also loaded in.
  251.  
  252. We open a new spreadsheet. We then save this as a hotlinked file into the
  253. graphing package (by simply dragging it say while holding down Ctrl or
  254. something). Then we save the results of the graphing package (also as a
  255. hotlinked file) into the frame in Impression.
  256.  
  257. Now we alter the spreadsheet. The graphing package picks it up, redoes its
  258. graph, and impression then picks up the altered graph and redisplays it. All
  259. this happens without polling stopping, so possibly if the spreadsheet were
  260. big and were to take a long time to recalculate, the graph in impression
  261. would be updated dynamically.
  262.  
  263. This is again unbelieveably easy to do. All files, and files contained within
  264. files are kept in tfs: by Tornado (has to). So, Tornado altering a file or
  265. subfile and then informing the task is possible. This opens a huge range of
  266. possibilities for OLE and hotlinking.
  267.  
  268. <Mmmm, I'm just eating some homemade Irish chocolate. Cost a fortune, but
  269. mmmm is it nice!>
  270.  
  271. Ok, let's take it further. Imagine a graph listing the occurences of 'peter'
  272. in the name entry of your databases (ie; your phone books). A custom written
  273. task asks Tornado to fill in the address for all people called 'Peter' (this
  274. is supported so, say if you were writing a letter you could ask Tornado to
  275. pull the address for some name from within the word processor *[1] ) and
  276. passes any results to the spreadsheet, as each relevent cell in the
  277. spreadsheet is individually hotlinked to a file within the custom app (ok, so
  278. the custom app would have a lot of files!). Then the spreadsheet recalculates
  279. as it receives new data, the graph redraws, and impression updates its graph.
  280. This would be extremely productive, although admittedly it's a pretty stupid
  281. example (hardly useful eh?).
  282.  
  283. *[1]: The way Tornado searches for a database entry (ie; the address for a
  284. name) by looking through all available media for all Tornado apps which do
  285. databases (how does it know? =!Options) if such a database app isn't loaded
  286. yet. Then the app is used to examine all the files on available media for
  287. database files, these are loaded in, and a list is made of entries with
  288. 'Peter' in. This would normally be put in a dialogue window, and the user
  289. allowed to choose their entry(s), but here it's all passed to a custom app.
  290.  
  291. My point is that, although this type of sophistication won't be available in
  292. release 1-4 of Tornado, the building blocks /should/ be laid to allow it to
  293. be done pretty easily later. By the time release six/seven comes out, Tornado
  294. tasks will be so far ahead of their rivals _nothing_ will compare. And best
  295. of all, the amount of effort required of the programmer will be about the
  296. same for writing the current style of app.
  297.  
  298. First things first though (I use the above to try and keep the enthusiasim up
  299. and not let myself slip), _we_ need to do an awful lot of work. That is, if
  300. you're game for it.
  301.  
  302. Also, I'll remind you, that if this succeeds as it could, it may well become
  303. that we'll be looked to for bug-fixes improvements etc. that normally would
  304. be levied on Acorn. I mean, Tornado will have become such a _huge_ part of
  305. the OS that a lot of people will be breathing down our backs. A problem, but
  306. one I'm looking forward to :-)
  307.  
  308. Also, finish this, and you now have something v. nice to put on your CV. I
  309. got my exam results yesterday: four B's, four C's. No Cambridge for me!
  310.  
  311. I have another bloke called Paul Corke also wanting to do something. Me being
  312. a person not wanting to disencourage anyone, I'll send him something that
  313. should stir his blood too.
  314.  
  315. I read up on TAOS a few days, and was rather horribly surprised how much had
  316. already been developed. Tornado has many TAOS qualities, and I'd like to see
  317. how TAOS copes in real life, in real situations. Despite what Acorn might
  318. think, IMHO TAOS really needs more than four processors as they'll soon find
  319. out when they finish that RPC replacement prototype. I think 16 should be
  320. enough, and if there need to be more processes then double processes can be
  321. run by preemption on the one processor.
  322.  
  323.