MS-DOS 6.22 Standard Input and Output Buffer Sizes

MS-DOS 6.22 does not feature a single configuration setting to directly adjust the internal buffer sizes for standard input (stdin) and standard output (stdout). Instead, standard stream buffering is governed at the application level through runtime libraries, while the operating system relies on the BUFFERS directive in CONFIG.SYS for disk sector caching, temporary pipe storage on disk, and utility-specific options like DOSKEY for interactive input command history.

Application-Level Control of Standard I/O Buffering

In MS-DOS 6.22, the operating system treats standard input and standard output as character devices—traditionally bound to the console (CON). MS-DOS itself reads and writes to these streams either character-by-character or in arbitrary byte blocks specified by the running program via DOS interrupt calls (INT 21h, functions 01h, 02h, 0Ah, 3Fh, and 40h).

Because the operating system does not maintain a configurable system-wide byte buffer for stdin or stdout, stream buffer sizing is delegated to the compiler's runtime library. For example, in C or C++ programs compiled for MS-DOS, standard I/O stream buffers default to a block size defined by the compiler (commonly 512 bytes via BUFSIZ), and developers must alter this behavior using programmatic functions such as setvbuf() or setbuf().

The Role of BUFFERS in CONFIG.SYS

The closest system-level directive related to I/O buffering is the BUFFERS command placed inside CONFIG.SYS:

BUFFERS=n,m
  • n (Primary Buffers): Specifies the number of disk buffers allocated by DOS, ranging from 1 to 99 (typically defaulting between 15 and 30 depending on system RAM). Each buffer holds 512 bytes of data read from or written to disk sectors.
  • m (Secondary Cache Buffers): Specifies secondary read-ahead buffers, ranging from 1 to 8.

While BUFFERS does not adjust the memory buffer for standard input or output directed to the console, it directly impacts stdin and stdout whenever standard streams are redirected to files on disk using redirection operators (< and >).

Piped I/O and Disk Buffers

MS-DOS 6.22 does not support in-memory FIFO pipes. When standard output is piped into standard input using the pipe operator (|):

DIR | MORE

MS-DOS creates a temporary file on the storage drive designated by the TEMP or TMP environment variable. The efficiency and read/write performance of this piped data transfer are directly controlled by the BUFFERS parameter in CONFIG.SYS, as data is written to and read from the disk subsystem rather than held in a dedicated system memory pipe buffer.

Keyboard Input Buffering

For interactive command-line standard input, the BIOS supplies a default circular hardware buffer limited to 16 keystrokes. MS-DOS 6.22 does not provide a native CONFIG.SYS switch to expand this hardware buffer. However, the command-line editing buffer for standard user input can be increased using the DOSKEY utility:

DOSKEY /BUFSIZE=size

The /BUFSIZE switch sets the memory buffer (in bytes) allocated for storing command-line input and history, with a default size of 512 bytes.