ANSI.SYS is a device driver in the DOS family of operating systems that provides extra console functions through ANSI escape sequences. It is partially based upon a subset of the text terminal control standard proposed by the ANSI X3L2 Technical Committee on Codes and Character Sets (the "X3 Committee").
As it was not installed by default, and was notoriously slow, little software took advantage of it and instead resorted to directly manipulating the IBM PC hardware. A number of third-party alternatives that ran at reasonable speed were created, such as ANSI.COM, [1] NANSI.SYS [2] and ANSIPLUS.EXE [3] to attempt to change this.[ third-party source needed ]
To use ANSI.SYS under DOS, a line is added to the CONFIG.SYS (or CONFIG.NT under Windows NT based versions of Windows) file that reads:
where drive: and path are the drive letter and path to the directory in which the file ANSI.SYS is found, and options can be a number of optional switches to control the behaviour. ANSI.SYS may also be loaded into upper memory via DEVICEHIGH / HIDEVICE .
Using this driver, programs that write to the standard output can make use of the 16 text foreground colors and 8 background colors available in VGA-compatible text mode, make text blink, change the location of the cursor on the screen, and blank the screen. It also allows for the changing of the video mode from standard 80×25 text mode to a number of different graphics modes (for example, 320×200 graphics mode with text drawn as pixels, though ANSI.SYS is not able to turn individual pixels on and off).
The standard ANSI.SYS is relatively slow as it maps escape sequences to BIOS calls (which managed to be designed so that two calls were needed to put a character on the screen and move the cursor right). Several companies made third-party replacements that interface directly with the video memory, in a similar way to most DOS programs that have a full-screen user interface.
By default, the internal DOS command CLS works by directly calling the corresponding BIOS function to clear the screen, thereby prominently violating the hardware abstraction model. [5]
An interesting feature of ANSI.SYS is the ability to remap any key on the keyboard in order to perform shortcuts or macros for complex instructions. Using special escape sequences, the user can define any keystroke that has a character-code mapping to simulate an arbitrary sequence of such keystrokes. [6] This feature was also used to create simple trojans out of text files laced with nefarious keyboard remaps, known as "ANSI bombs". A number of products were released to protect users against this:
ANSI.SYS appeared in MS-DOS 2.0, the first version of the operating system supporting device drivers. [11] It was supported by all following versions of MS-DOS. It is also present in many non-Microsoft DOS systems, e.g. IBM PC DOS and DR-DOS. [12]
ANSI.SYS was required to run some software that used its cursor and color control functions. [12] It could also be used to enable elaborate color codes in the COMMAND.COM prompt. These uses were overshadowed by the use of ANSI.SYS in BBSes; ANSI escape sequences were used to enable BBSes to send text graphics more elaborate than ASCII art, and to control the cursor in ways that were used in a number of online games and similar features.
Most versions of Windows did not support ANSI escape codes in any useful way (it could be used by MSDOS emulation in some versions). In Windows 10 support for similar escape sequences was built into the Win32 console (the text terminal window), but must be activated using the Windows API function SetConsoleMode
by setting the ENABLE_VIRTUAL_TERMINAL_PROCESSING
flag. [13]
CSI (Control Sequence Introducer) is a placeholder for the common two-byte escape lead-in sequence "ESC [" (that is, 0x1B 0x5B). [12] The ANSI standard also defines an alternative single-byte CSI code 0x9B, which is not supported by ANSI.SYS (this code instead drew a cent sign ⟨¢⟩ from CP437).
Standard DOS ANSI.SYS drivers support only the following sub-set of ANSI escape sequences: [12]
Sequence | Effect |
---|---|
ESC [r A | Cursor up (CUU) |
ESC [r B | Cursor down (CUD) |
ESC [c C | Cursor forward (CUF) |
ESC [c D | Cursor back (CUB) |
ESC [r;c f | Horizontal and vertical position (HVP) |
ESC [r;c H | Cursor position (CUP) |
ESC [n J | Erase display (ED) (n=0, 2 or n=0, 1, 2) [nb 1] |
ESC [n K | Erase in line (EL) (n=0 or n=0, 1, 2) [nb 1] |
ESC [n m | Select graphic rendition (SGR) (n=0..47) |
ESC [ 6 n | Device status report (DSR) requests cursor position, returned as cursor position report (CPR): ESC [r;c R |
ESC [ s | Save cursor position (SCP) |
ESC [ u | Restore cursor position (RCP) |
There are also some escape sequences specific to the implementation of ANSI.SYS. They are not generally supported by ANSI consoles in other operating systems.
Sequence | Effect |
---|---|
ESC [n h ESC [ ?n h ESC [ =n h ESC [ >n h [nb 2] | Set screen mode (SM) [nb 2] |
ESC [n l ESC [ ?n l ESC [ =n l ESC [ >n l [nb 2] | Reset screen mode (RM) [nb 2] |
ESC [n q | Enable (n=1) or disable (n=0) /X support [nb 3] |
ESC [ L | Insert line (IL) [nb 4] |
ESC [ M | Delete line (DL) [nb 4] |
ESC $ ) 1 | Switch keyboard input mode to Korean (Hangul) [nb 5] |
ESC ( 2 | Switch keyboard input mode to English [nb 5] |
ESC [ + | Enable console output [nb 6] |
ESC [ - | Disable console output [nb 6] |
ESC [a;b;... p | Set key re-definement (SKR/KR) |
Mode | Description | Mode | Description |
---|---|---|---|
0 | 40 × 25 monochrome | 1 | 40 × 25 color |
2 | 80 × 25 monochrome | 3 | 80 × 25 color |
4 | 320 × 200 color | 5 | 320 × 200 monochrome |
6 | 640 × 200 monochrome | ||
7 | Wrap at end of line [nb 7] | ||
13 | 320 x 200 color (graphics) | 14 | 640 x 200 color (16-color graphics) |
15 | 640 x 350 monochrome (2-color graphics) | 16 | 640 x 350 color (16-color graphics) |
17 | 640 x 480 monochrome (2-color graphics) | 18 | 640 x 480 color (16-color graphics) |
19 | 320 x 200 color (256-color graphics) | ||
114 | 640 x 480 color (16-color graphics) [nb 8] | 115 | 640 x 475 color (16-color graphics) [nb 8] |
In some DOS implementations, video modes above 7 are not documented. Under Multiuser DOS, the only valid argument in conjunction with PCTERM is 7.
Scroll Lock is a lock key on most IBM-compatible computer keyboards.
ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video text terminals and terminal emulators. Certain sequences of bytes, most starting with an ASCII escape character and a bracket character, are embedded into text. The terminal interprets these sequences as commands, rather than text to display verbatim.
COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot, hence being responsible for setting up the system by running the AUTOEXEC.BAT configuration file, and being the ancestor of all processes.
A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal and predated the use of a computer screen by decades.
An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.
In DOS memory management, conventional memory, also called base memory, is the first 640 kilobytes of the memory on IBM PC or compatible systems. It is the read-write memory directly addressable by the processor for use by the operating system and application programs. As memory prices rapidly declined, this design decision became a limitation in the use of large memory capacities until the introduction of operating systems and processors that made it irrelevant.
In computing, text-based user interfaces (TUI), is a retronym describing a type of user interface (UI) common as an early form of human–computer interaction, before the advent of bitmapped displays and modern conventional graphical user interfaces (GUIs). Like modern GUIs, they can use the entire screen area and may accept mouse and other inputs. They may also use color and often structure the display using box-drawing characters such as ┌ and ╣. The modern context of use is usually a terminal emulator.
CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS during boot. CONFIG.SYS was introduced with DOS 2.0.
AUTOEXEC.BAT
is a system file that was originally on DOS-type operating systems. It is a plain-text batch file in the root directory of the boot device. The name of the file is an abbreviation of "automatic execution", which describes its function in automatically executing commands on system startup; the filename was coined in response to the 8.3 filename limitations of the FAT file system family.
Windows Console is the infrastructure for console applications in Microsoft Windows. An instance of a Windows Console has a screen buffer and an input buffer. It allows console apps to run inside a window or in hardware text mode. The user can switch between the two using the Alt+↵ Enter key combination. The text mode is unavailable in Windows Vista and later. Starting with Windows 10, however, a native full-screen mode is available.
DOS/V is a Japanese computing initiative starting in 1990 to allow DOS on IBM PC compatibles with VGA cards to handle double-byte (DBCS) Japanese text via software alone. It was initially developed from PC DOS by IBM for its PS/55 machines, but IBM gave the driver source code to Microsoft, who then licensed a DOS/V-compatible version of MS-DOS to other companies. Kanji fonts and other locale information are stored on the hard disk rather than on special chips as in the preceding AX architecture. As with AX, its great value for the Japanese computing industry is in allowing compatibility with foreign software. This had not been possible under NEC's proprietary PC-98 system, which was the market leader before DOS/V emerged. DOS/V stands for "Disk Operating System/VGA". In Japan, IBM compatible PCs became popular along with DOS/V, so they are often referred to as "DOS/V machine" or "DOS/V pasocom" even though DOS/V operating systems are no longer common.
EMM386 is the expanded memory manager of Microsoft's MS-DOS, IBM's PC DOS, Digital Research's DR-DOS, and Datalight's ROM-DOS which is used to create expanded memory using extended memory on Intel 80386 CPUs. There also is an EMM386.EXE available in FreeDOS.
On computer keyboards, the Esc keyEsc is a key used to generate the escape character. The escape character, when sent from the keyboard to a computer, often is interpreted by software as "stop", and when sent from the computer to an external device marks the beginning of an escape sequence to specify operating modes or characteristics generally.
In computing, tree
is a recursive directory listing command or program that produces a depth-indented listing of files. Originating in PC- and MS-DOS, it is found in Digital Research FlexOS, IBM/Toshiba 4690 OS, PTS-DOS, FreeDOS, IBM OS/2, Microsoft Windows, and ReactOS. A version for Unix and Unix-like systems is also available.
.sys is a filename extension used in MS-DOS applications and Microsoft Windows operating systems. They are system files that contain device drivers or hardware configurations for the system.
DOS is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of Microsoft's MS-DOS and a rebranded version, IBM PC DOS, both of which were introduced in 1981. Later compatible systems from other manufacturers include DR-DOS (1988), ROM-DOS (1989), PTS-DOS (1993), and FreeDOS (1998). MS-DOS dominated the IBM PC compatible market between 1981 and 1995.
The Linux console is a system console internal to the Linux kernel. A system console is the device which receives all kernel messages and warnings and which allows logins in single user mode. The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user. The user typically enters text with a computer keyboard and reads the output text on a computer monitor. The Linux kernel supports virtual consoles – consoles that are logically separate, but which access the same physical keyboard and display. The Linux console are implemented by the VT subsystem of the Linux kernel, and do not rely on any user space software. This is in contrast to a terminal emulator, which is a user space process that emulates a terminal, and is typically used in a graphical display environment.
Control-Alt-Delete is a computer keyboard command on IBM PC compatible computers, invoked by pressing the Delete key while holding the Control and Alt keys: Ctrl+Alt+Delete. The function of the key combination differs depending on the context but it generally interrupts or facilitates interrupting a function. For instance, in pre-boot environment or in MS-DOS, Windows 3.0 and earlier versions of Windows or OS/2, the key combination reboots the computer. Starting with Windows 95, the key combination invokes a task manager or security related component that facilitates ending a Windows session or killing a frozen application.
{{cite book}}
: |work=
ignored (help) (NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.)