Schrijver
| Disk error handling
|
etxmato msx friend Berichten: 14 | Geplaatst: 19 December 2005, 10:24   |
Hello,
I need some more help with disk handling. I had some problems before with differences between diskkernel 1.x and 2.x which Arjen helped me with. But now it also looks like these versions handle disk error handling different.
Basically I wrote some SW years ago that changed the disk error routing on address F323 to a user defined routine. At the same time I assumed that address F1E6 referred to the abort routine address for some reason in 1.x version this is 0x0000.
So my routine referenced from F323 (indirectly) just does some slot switching checks error code and returns '2' in register C. Which I think indicates 'abort'
After this I expect the 'abort' routine to be called at F1E6 where my abort routine at 0x0000 (or other user defined address) is called which again does some slot switching and continues my program.
However this does not work in diskkernel 2.x, and also 2.x has some other routine defined at F1E6.
Anyone any idea what my mistake is? Am I allowed to use F323 and/or F1E6 for user defined routines, and if not how do I 'catch' disk errors like disk offline etc.
Cheers, Marcel.
|
|
msd msx professional Berichten: 612 | Geplaatst: 19 December 2005, 10:29   |
For diskkernel 2.x there are bdos calls to set disk error handle functions. I can send you an example of it.
|
|
etxmato msx friend Berichten: 14 | Geplaatst: 19 December 2005, 12:39   |
That would be excellent!
I assume this is routine 64, right? I tried something with that the other day but it didn't work as I expected so an example might help me out.
If you sent it already, could you maybe sent it again? as I have been having trouble receiving emails since Saturday. I just updated my MRC account to temporary refer to my hotmail address; which always works....
Also does anyone know what the 'official' check is to see which diskkernel is being used? I would like to keep backward compatibility to 1.x.
Cheers, Marcel.
|
|
msd msx professional Berichten: 612 | Geplaatst: 19 December 2005, 14:12   |
First I should know your e-mail addres  . And I'm at work now, so can't sent it from here. I will also send you a dos2 check routine |
|
ro msx guru Berichten: 2329 | Geplaatst: 19 December 2005, 14:16   |
why not post it here? or is the source to long for that...
|
|
msd msx professional Berichten: 612 | Geplaatst: 19 December 2005, 19:17   |
In total it's kinda long, but the most importend part is this:
InitDiskErrorHandler:
LD DE,DiskErrorHandler
BdosCall _DEFER
LD DE,AbortHandler
BdosCall _DEFAB
RET
|
|
zeilemaker54 msx lover Berichten: 97 | Geplaatst: 20 December 2005, 08:22   |
|
|
etxmato msx friend Berichten: 14 | Geplaatst: 20 December 2005, 09:59   |
Thanks for your comments and references!
Problem I have is that I want to handle disk errors when a program is called from BASIC. i.e. my SW is stored in ROM and started by the basic 'call' statement. I made this stuff almost 20 years ago.....
Now according to the dos2 documentation (like referenced above) routine 63 (_DEFAB) can not be called via disk call F37D. So anyone any idea how to catch the abort call instead?
|
|
msd msx professional Berichten: 612 | Geplaatst: 20 December 2005, 10:00   |
Does is have to be rom? I mean can't you convert it to a com file?
|
|
etxmato msx friend Berichten: 14 | Geplaatst: 20 December 2005, 10:13   |
I think it is impossible to convert to a com file, SW was basically written straight into assembler code into memory (i.e. linked to memory locations). Also depending on extra RAM which was placed on the cartridge...... it is also swiching slots and subslots all over the place..... again 20 years ago, now I know better......
|
|
msd msx professional Berichten: 612 | Geplaatst: 20 December 2005, 10:16   |
What kind of software was this?
|
|
etxmato msx friend Berichten: 14 | Geplaatst: 20 December 2005, 10:28   |
It is a home made assembler system, allowing writing assembler code direct into memory and allowing to dissassemble direct from memory. I always thought very handy to write quick/short assembler code. I can sent you a copy tonight if you are interested. It now runs on openMSX (except doesn't work fully with IDE harddisk support, due to the problems above; you also need the latest CVS compiled openMSX as the current 0.5.2 release lacks some needed functionality).
|
|
msd msx professional Berichten: 612 | Geplaatst: 20 December 2005, 14:26   |
I don't use openMSX.  |
|
zeilemaker54 msx lover Berichten: 97 | Geplaatst: 20 December 2005, 16:39   |
Quote:
| Thanks for your comments and references!
Problem I have is that I want to handle disk errors when a program is called from BASIC. i.e. my SW is stored in ROM and started by the basic 'call' statement. I made this stuff almost 20 years ago.....
Now according to the dos2 documentation (like referenced above) routine 63 (_DEFAB) can not be called via disk call F37D. So anyone any idea how to catch the abort call instead?
|
True, but you need routine 64 (_DEFER) to define your own diskerror handler. It is never mentioned that this function can not be used in a DiskBasic environment. |
|
etxmato msx friend Berichten: 14 | Geplaatst: 20 December 2005, 16:53   |
Ok, but what is then not clear to me is how does the dos2 feature give back execution to my SW. As I designed this was: in the error routine I mark whic error occured and in the abort routine I print the error and continue the program. Maybe this is wrong?
Does dos2 return as normal from a call to F37D when an error like disk offline has occured? And if so how is this indicated?
|
|
|
|
|