68kMLA Classic Interface
This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.
| Click here to select a new forum. | | How does the .MPP driver work? | Posted by: cheesestraws on 2022-07-13 11:51:17 I'm confused by the structure of the .MPP driver. This is certainly the case for the one that came as far back as System 7.1, which is the earliest I've got on me.
Normally, you'd have a driver header that points to the different routines the driver provides, followed by the routines. That'd be nice and straightforward. That's not what you have here.
The DRVR code resource looks like it is two resources wedged into one. At the top, you have something that claims to be the ".MPP Stub":
 The MPP stub is a very short driver. Note that all the offsets in the header are pretty close together:
 And all of these routines appear to be basically noops: Open immediately returns a negative error code, Control and Status appear to jump directly to JIOCompletion, and prime just clears a flag. Nothing complicated here.
 After this appears to be a load of code for the LAP Manager:
 And this definitely is code, it's not just random data: there's definitely routines doing sensible things in there.
 But the question is: how on earth does control get down there?
I'm going to tag @Crutch in hopes of good ideas but anyone—please—have opinions! | Posted by: Crutch on 2022-07-13 12:25:04 That’s really weird. Total shot in the dark, there’s no way (for some reason) _Open is patched to check and see if it’s opening the MPP driver and if so …. do something special, like load the actual driver code from after the stub and open that? Maybe this was done so it could load different versions of MPP depending on the system environment?
Have you tried invoking _Open on MPP and stepping into the driver code that gets executed in Macsbug to see how you get there? (I am guessing you have) | Posted by: Crutch on 2022-07-14 09:59:57 Here’s a silly idea: replace every word after the stub code with A9FF A9FF A9FF A9FF …. (the _Debugger trap)
Restart. Then when you drop into the debugger, run a stack crawl to see who called you. | Posted by: cheesestraws on 2022-07-14 10:02:49 Oooooh, that's silly and I like it.
I haven't had a chance to do much macsbug spelunking yet. I only just got back to my actual hardware and it's too hot to turn any unnecessary computers on :-/ | | 1 |
|