[comp.sys.ibm.pc] device driver i/o

chapman@fornax.UUCP (04/23/87)

;

I have two questions:

1. Is there any way to stop DOS from saying EOF when a character
   device recieves a ctrl/z ? I have tried opening files in
   binary mode (in MS C 3.0) but the problem still occurs.
   The device in question sends arbitrary bit patterns.

2. Is there any way to get DOS to send/recieve more than one
   character at a time to character device drivers?  I know
   the DOS function call lets you specify n (>=1) characters
   but the device driver then gets called n times to process
   one character at a time.  This is stupid. I see the reason
   for some circumstances but there ought to be a way to turn
   it off so the driver can process large chunks of data per
   invokation.

Thanks for any help,

			john

*** REPLACE THIS LINE WITH YOUR MESSAGE ***
-- 
{watmath,seismo,uw-beaver}!ubc-vision!fornax!sfulccr!chapman
                   or  ...!ubc-vision!sfucmpt!chapman

sam@sppy00.UUCP (04/24/87)

In article <265@fornax.uucp> chapman@fornax.uucp (John Chapman) writes:
>;
>
>I have two questions:
>
>1. Is there any way to stop DOS from saying EOF when a character
>   device recieves a ctrl/z ? I have tried opening files in
>   binary mode (in MS C 3.0) but the problem still occurs.
>   The device in question sends arbitrary bit patterns.
>
>2. Is there any way to get DOS to send/recieve more than one
>   character at a time to character device drivers?  I know
>   the DOS function call lets you specify n (>=1) characters
>   but the device driver then gets called n times to process
>   one character at a time.  This is stupid. I see the reason
>   for some circumstances but there ought to be a way to turn
>   it off so the driver can process large chunks of data per
>   invokation.
>
>Thanks for any help,
>
>			john
>

The answer to the second question is to place the driver in
raw mode. This is done with DOS ioctl function 44 hex. I don't know 
what the answer to the first problem is. If you find out please
post it. 

Below is a crude example of how to place the console driver in raw
mode. Block type transfer between DOS and the driver is not all that
you get with raw mode. Check the DOS Tech. Ref. for other changes. 

- cut -

/* program to switch console device into/out of raw mode	*/
/* Microsoft C */

#include <dos.h>
#include <stdio.h>
#include <string.h>

main(argc, argv)
int argc;
char *argv[];
{

    union REGS regs;
    regs.x.ax = 0x4400;
    regs.x.bx = 1;
    intdos( &regs, &regs );
    regs.h.dh = 0;

    if (argc > 1) { 
      if (strcmpi( "ON", argv[1] ))
        regs.h.dl &= 0xDF;
      else 
        regs.h.dl |= 0x20;
     }
    else 
      regs.h.dl ^= 0x20;

    regs.x.ax = 0x4401;
    intdos( &regs, &regs );

}

>-- 
>{watmath,seismo,uw-beaver}!ubc-vision!fornax!sfulccr!chapman
>                   or  ...!ubc-vision!sfucmpt!chapman

honzo@4gl.UUCP (Honzo Svasek) (04/25/87)

in article <265@fornax.uucp>, chapman@fornax.uucp (John Chapman) says:
> 
> [complains about com driver not being efficient]

The "original" com port device driver is not very good. You should get
hold of a proper com port driver. There are several PD versions around.

If you can't find one nearby, let me know & I'll mail you one. If I get
enough MeToo's, I'll post one in this newsgroup.
-- 
I_I(           _                        	UUCP: ..mcvax!honzo@4gl
I I ) Honzo Svasek @ 4GL Consultants b.v.	FIDO:  Honzo Svasek @ 500/333