delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/04/05:40:53

Message-Id: <200008040940.FAA09604@delorie.com>
Date: Fri, 04 Aug 2000 12:43:52 +0200
To: dh210008 AT Exchange DOT AtlantaGA DOT NCR DOT com
X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
CC: "djgpp AT delorie DOT com"
<0339D548AB08D31182040000F8BCBAF9074B1B9B AT Exchange DOT AtlantaGA DOT NCR DOT com>
(dh210008 AT Exchange DOT AtlantaGA DOT NCR DOT com)
Subject: Re: fgets Max Chars
References: <0339D548AB08D31182040000F8BCBAF9074B1B9B AT exchange DOT atlantaga DOT ncr DOT com>
Reply-To: djgpp AT delorie DOT com

> From: "Hunt, David" <dh210008 AT Exchange DOT AtlantaGA DOT NCR DOT com>
> Date: Thu, 3 Aug 2000 16:37:08 -0400 
> 
> To answer your question more directly, the BIOS of your machine limits the
> number of input characters for string input to 128.  It is the BIOS that
> buffers the input and passes that kbd input to stdio.

This is not true.  The BIOS buffer is only 16-byte long, and as long
as the program is inside the DOS read call, every character typed will
be read by DOS.  So the BIOS buffer will not overflow, and no beeps
from the BIOS will follow.

The slightly modified program I posted proves this point: when termios
is activated, the program reads the console via BIOS functions
directly, bypassing DOS.  Since the problem disappears then, I think
BIOS is not the culprit here.

The 128-byte limitation seems to be inside DOS console device driver.
The device driver apparently needs to buffer characters of a single
line to support the limited editing (with F2 and F3 keys, etc.) it
offers in the so-called ``cooked mode''.  If you switch the CON device
to raw mode (e.g., by calling `setmode', or issuing function 44h of
Int 21h directly), this problem disappears.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019