Don't call the ATalk driver's attention vector routine for DSI connections.

It is hard-coded to work with session numbers 1-8, and it may trash memory when passed higher session numbers. This was causing crashes after disconnecting in some cases.

This patch just bypasses the attention vector routine completely for DSI sessions (it's still called for sessions 1-8, i.e. ASP sessions). This should be OK, because its only real function was to display alerts about the connection being closed.
This commit is contained in:
Stephen Heumann 2017-04-24 23:16:40 -05:00
parent a38e2f716a
commit 9ea3f1d2fb
3 changed files with 48 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#include "installcmds.h"
#include "aspinterface.h"
#include "asmglue.h"
#include "cmdproc.h"
const char bootInfoString[] = "AFPBridge v1.0b1";
LongWord version = 0x01006001; /* in rVersion format */
@ -69,6 +70,7 @@ int main(void) {
FSTInfoRecGS fstInfoRec;
NotifyProcRecGS addNotifyProcRec;
VersionMessageRec versionMessageRec;
PFIHooksRec pfiHooksRec;
/*
* Check for presence of AppleShare FST. We error out and unload
@ -137,6 +139,21 @@ int main(void) {
oldSoftReset = *SoftResetPtr;
*SoftResetPtr = ((LongWord)&resetRoutine << 8) | JML;
/*
* Install our own attention vector that bypasses the one in the
* ATalk driver in problematic cases (for session number > 8).
*/
pfiHooksRec.async = 0;
pfiHooksRec.command = pfiHooksCommand;
pfiHooksRec.hookFlag = 0; /* get GS/OS hooks */
_CALLAT(&pfiHooksRec);
if (pfiHooksRec.result == 0) {
jmlOldAttentionVec = (pfiHooksRec.attentionVector << 8) | JML;
pfiHooksRec.attentionVector = (LongWord)&attentionVec;
pfiHooksRec.hookFlag = pfiHooksSetHooks; /* set GS/OS hooks */
_CALLAT(&pfiHooksRec);
}
return;
error:

View File

@ -1,6 +1,8 @@
case on
mcopy cmdproc.macros
SESSION_NUM_START gequ $F8
RamGoComp gequ $E1100C
RamForbid gequ $E11018
RamPermit gequ $E1101C
@ -128,3 +130,29 @@ skip jsl RamPermit
plb
rtl
end
* Replacement attention vector to be called from PFI.
* This calls the previous attention vector (from the ATalk driver) for ASP
* sessions (numbered 1-8), but not for the higher-numbered DSI sessions.
* This is needed because ATalk's attention vector is hard-coded for session
* numbers 1-8 only and trashes memory when called with higher numbers.
attentionVec start
phd
phy
phx
tsc
tcd
lda [1]
plx
ply
pld
and #$00FF
cmp #SESSION_NUM_START
bge skip
jmlOldAttentionVec entry
jml attentionVec ;to be changed to old attention vec
skip clc
rtl
end

View File

@ -13,4 +13,7 @@ void pfiListSessions2CmdProc(void);
extern LongWord jslOldPFIListSessions2;
void CallCompletionRoutine(void *);
extern void attentionVec(void);
extern LongWord jmlOldAttentionVec;
#endif