• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

How does the .MPP driver work?

cheesestraws

Well-known member
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":

Screenshot 2022-07-13 at 19.39.48.png
The MPP stub is a very short driver. Note that all the offsets in the header are pretty close together:

Screenshot 2022-07-13 at 19.41.44.png
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.

Screenshot 2022-07-13 at 19.42.26.png
After this appears to be a load of code for the LAP Manager:

Screenshot 2022-07-13 at 19.46.53.png
And this definitely is code, it's not just random data: there's definitely routines doing sensible things in there.

Screenshot 2022-07-13 at 19.50.14.png
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!
 

Crutch

Well-known member
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)
 

Crutch

Well-known member
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.
 

cheesestraws

Well-known member
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 :-/
 
Top