Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!ur-tut!ur-cvsvax!srs!dan From: dan@srs.UUCP (Dan Kegel) Newsgroups: comp.sys.ibm.pc Subject: Raw Mode and how to set it (Was: need help with DOS and COM1) Message-ID: <115@srs.UUCP> Date: Tue, 3-Feb-87 10:09:06 EST Article-I.D.: srs.115 Posted: Tue Feb 3 10:09:06 1987 Date-Received: Sat, 7-Feb-87 04:08:19 EST References: <3281@hplabs.hplabs.UUCP> <1342@kontron.UUCP> Organization: S.R. Systems, Rochester NY Lines: 42 > > The question is, "WHAT MS-DOS FUNCTION CALL DID COPY MAKE TO CAUSE THE FILE > > TO PRINT?" It sounds like the handle must be placed in raw mode, or > > something synonymous. Unfortunately, I do not know how to do this, and > > the programmer's manual for MS-DOS is not too helpful. Any help would > > be appreciated. COPY /b probably uses DOS function 40h to do the reads and writes. At the end of this article is a shell archive of a Microsoft C file containing the routine SetHandleRaw(handle), which should answer your other question. When using raw mode, you may notice a speed increase when writing blocks of data; this is because DOS passes I/O requests straight to the device driver in raw mode, with very little overhead. The difference is most noticable with CON: and NANSI.SYS (plug, plug). By the way, in older versions of Aztec C, it might help to avoid using the colon in the device name when opening the file. I think there is also something called 'raw mode' in Aztec's I/O library; this should also be set, but it has nothing to do with the DOS raw mode described above. Also by the way, here's what the manual says about raw mode: IOCTL Data (Function 44H, Codes 0 and 1) Function 44H, Codes 0 and 1 either gets or sets the data MS-DOS uses to control the device. AL must contain 0 to get the data or 1 to set it. BX must contain the handle. If AL is 1, DH must contain 0. The device data word is specified or returned in DX. If bit 7 of the data is 1, the handle refers to a device and the other bits have the following meanings: ... Bit 5: 1=Don't check for control chars. 0=Check for control chars. ... The control characters referred to in the description of bit 5 are ^C, ^P, ^S, and ^Z. To read these characters as data, rather than having them interpreted as control characters, bit 5 must be set. If bit 7 of the data is 0, the handle refers to a file and the other bits mean: Bit 6: 0=the file has been written. Bits 0-5: Driver number (0=A, 1=B...) - Daniel Kegel (...rochester!srs!dan)