Thomas wrote:
OpenDevice does not even know of an IORequest. It just loads the code into memory and then calls its open vector. Everything else is done by the device itself.
Ok, this this raises alot of questions I didnt properly think about before, I would really like to have this made clear to me.
There are Devices and there are Handlers.
Handlers (usually) operate a level above the devices and implement the DOS device abstraction.
Devices, are a level beneath the handlers. They implement the raw communication with the physical devices, and only figure as a backend to handlers that that need the service of a a device (driver).
Some handlers (non-filesystem-like ones) like nil.handler zero.handler (an maybe con.handler, I wouldnt know) etc obviously do not need a device (driver).
A second type of handlers (filesystem-like ones) like ram.handler, pipefs.handler etc would not (should not, but there is ramdisk.device! ) either need a device driver.
A third type of handlers (real filesystems) obvioulsy would need the devices to perform the raw IO.
So here I am, trying to fit some pieces of the the puzzle together to have a more clear view of how the system operates and what I'd need to perform to do what i'd want to do,
I know I could hack myself to some answers and read the source for others, the latter I'll avoid for now since some of the sources of minor components are very unclean to say the least.
First and foremost, OpenDevice loads, say, afs.handler, then you say it calls its open vector ? what does this "open" do ? obviously the handler is loaded already, I assume it "opens" the IORequest ?! or rather, the eventual low level device name, in io_Union.io_OpenDevice.io_DeviceName (read below paragraph) it would need if it was a real filesystem ?
What about the unit I send to OpenDevice() ? does it get passed along with IOrequest ? that is, does the handlers "open" routine take the unit and itself place it into fsRequest->io_Union.io_OpenDevice.io_Unit ? this would be useless as the union would be overwritten,
What about fsRequest->io_Union.io_OpenDevice.io_DeviceName ? this simply cannot contain the name I pass to OpenDevice(), what would be the point ?
So, the only conclusion I make for now is that the members of io_Union.io_OpenDevice, if filled, will instruct the handlers "open" routine to load and use io_Union.io_OpenDevice.io_DeviceName as its raw device driver backend with io_Union.io_OpenDevice.io_Unit as the unit.
Am I making somewhat correct assumptions or am I drunk ?