Image Map Image Map
Page 4 of 5 FirstFirst 12345 LastLast
Results 31 to 40 of 45

Thread: How does a DOS SYS driver enable a file system / drive?

  1. #31
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    34,908
    Blog Entries
    18

    Default

    The nice thing about RL compression is that you can compute checksums on the uncompressed data and the compressed data at the same time you're looping through the data doing compression-at least in assembly language. I'm not sure how that translates to C, however--I think it'd be a pretty good backend optimizer to recognize the potential for a SCASB instruction.

  2. #32

    Default

    I've found some compression that I'm using on another project that seems fast enough, but there is always that trade off of whether it actually improves things or is just one more task to do that slows them down.

    I've been reading what I can find (apparently Undocumented DOS 2nd edition has a lot on this, but I don't have it) about dos redirection and found a discussion about redir.exe. I am assuming this is a Microsoft TSR to do redirection to their networking from what I have read. I also found some source code for a thing called phantom which is an example from the undocumented DOS book. I've looked through the DOSPDOS code you posted up too Chuck. Also VMSMOUNT. I have a few questions:

    #1 - Essentially you hook vector 0x2F and look for requests that are yours to deal with, right?
    #2 - Is this interface essentially forwarding a DOS file API type request such as open file, find first, etc?
    #3 - Is there a binary API going on here where you get the request and have to prepare a response that is correct such as returning a pointer to memory you prepared?
    #4 - Wouldn't this demand that you handle the filesystem in the TSR (or what it might communicate with)? How does phantom create a XMS ram drive - does it have an embedded filesystem? I don't see it in the source which puzzles me.
    #5 - How do you unload a TSR? I've seen various methods and I know about the function that exits without releasing memory, but then when you load a second instance and it somehow communicates or gets values from the first instance, is there a DOS function that releases the current memory + the memory that was not released before? I don't see it anywhere, in phantom, it just does a return 0.
    #6 - parallel port complete talks about EPP doing a transfer for every bus cycle, but how can this be done if you have to check the timeout flag between writing? Combining that with the non standard method of not knowing how to clear the flag (which apparently if you don't clear it, it will stop communication). You might have to read it twice, or write a 1 to the bit, or write a 0 to the bit. You would think after having to do all that you could have just done the handshaking yourself on a non EPP port. Any thoughts on this?

  3. #33
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    34,908
    Blog Entries
    18

    Default

    I'll take your questions in reverse order.

    #6. EPP has the capability to do DMA transfers, which is what the timing note is talking about. You still deadman-time the transfer, but DMA handles the transfer itself.
    #5. To unload a TSR, you restore any "hooked' interrupts and use the DOS Deallocate memory call. Usually, this is done from outside the TSR.
    #4. Generally, yes--however see below. However, note that network redirector file APIs are very different from conventional DOS file system APIs.
    #3,2,1: Interrupt 0x2f is a catch-all known as the "multiplex interrupt". Note the very long list of users and services. Originally, this started off as a way of communicating with the background PRINT process, but after DOS 3, pretty much ballooned into a general-purpose animal, used by many internal processes.

    There are two ways that 2fh is used; as a way for a program to make a "special" request not handled by INT 21h (e.g. is Windows running?; Enter/exit critical section...). The other way is to insert a service to process an INT 2fh call that either MSDOS or another program may make. This second way involves "chaining" the interrupt, examining register contents, to see if the request might pertain to your service. If not, you pass the request on. There are many of these and you have to be careful that your register conventions don't collide with another service that may be installed.

    Before the 2fh multiplex mechanism, interrupt 21h servicing had a string of no-ops in the servicing code that could be "patched" by network code. It was clumsy and not well-documented.

    A good read on this is Randall Hyde's "Art of Assembly" chapter here. I'll volunteer that not knowing x86 assembly makes the whole process more difficult.

  4. #34

    Default

    yeah I know a guy who defined 21h as a constant called dosint since it was used for so many different DOS API functions

  5. #35
    Join Date
    Jun 2017
    Location
    Cornwall / United Kingdom
    Posts
    24

    Default

    I'm not sure if you've read this about the phantom driver?
    http://www.os2museum.com/wp/phantom-3-0/

  6. #36

    Default

    Thanks bob22, I found that last night and was looking through it. Any thoughts on me not finding filesystem code in it? How does it provide a redirector style interface without providing some sort of filesystem in the XMS memory. I tried to see how it was "formatting" the XMS, but didn't find that either. Unless, it somehow uses DOS's FAT16 support, but then wouldn't be be a block driver and not a redirector driver?

  7. #37

    Default

    Quote Originally Posted by Chuck(G) View Post
    #6. EPP has the capability to do DMA transfers, which is what the timing note is talking about. You still deadman-time the transfer, but DMA handles the transfer itself.
    Does EPP support DMA? Or just ECP?

    Quote Originally Posted by Chuck(G) View Post
    #5. To unload a TSR, you restore any "hooked' interrupts and use the DOS Deallocate memory call. Usually, this is done from outside the TSR.
    That is what I was missing - I've seen plenty of examples of using a function called keep to keep a program resident, but none about the DOS/function call to essentially undo that.

    Quote Originally Posted by Chuck(G) View Post
    #4. Generally, yes--however see below. However, note that network redirector file APIs are very different from conventional DOS file system APIs.
    Too bad they just did not do a pass through of DOS file function calls, but maybe there is a good reason that would not work. Is this API documented somewhere? I've got another forum member saying they have the undocumented dos 2nd edition book they can let go, but are there other sources?

    Quote Originally Posted by Chuck(G) View Post
    #3,2,1: Interrupt 0x2f is a catch-all known as the "multiplex interrupt". Note the very long list of users and services. Originally, this started off as a way of communicating with the background PRINT process, but after DOS 3, pretty much ballooned into a general-purpose animal, used by many internal processes.
    No wonder vmsmount was scrutinizing whether the call for distinctly for it or not.

    Quote Originally Posted by Chuck(G) View Post
    A good read on this is Randall Hyde's "Art of Assembly" chapter here. I'll volunteer that not knowing x86 assembly makes the whole process more difficult.
    I can make it through well documented code, it is one of those it is easier for me to read it than to write it type of things. I'd like to write the TSR mostly in C using the built-in assembler when necessary for necessity or performance.

  8. #38
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    34,908
    Blog Entries
    18

    Default

    Well, go back to my pdos code; it's mostly C, with some assembly support in order to (a) eliminate any DOS system calls that might be made by the runtime which would corrupt the system stack or (b) remove extraneous cruft not used by the redirector. The remainder is translating a file system with 256 byte sectors containing forward- and back-links (i.e. there's no FAT) to DOS parlance.

    Two things to pay attention to are (1) the DOS swap area and (2) the system file table (SFT). Redirection often involves translating from whatever the native source might be, whether it's a CD-ROM or Unix network files.

    "Undocumented DOS" by Schulman, Brown and Maxey (1994 edition) is a good source for a lot of this information.

  9. #39
    Join Date
    Jun 2017
    Location
    Cornwall / United Kingdom
    Posts
    24

    Default

    So the redirector API is mostly documented in RBIL see http://www.ctyme.com/intr/int-2f.htm AX=11xx. Ralph Brown was a contributor to the Undocumented DOS book. From what I see in it allocates a chunk of memory via XMS, then uses it as a FAT filesystem, see set_up_xms_disk() function in phantom.c. There are other fat access functions create_dir_entry(), read_data() etc.

  10. #40
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    34,908
    Blog Entries
    18

    Default

    Also, here are the source and compiled executables from an old 1996 DDJ article by Kyle York on building a serial network redirector:

    https://app.box.com/s/d5adl9w983x6f62n60l3c6prwbc176wf

    These may be closer to what you need.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •