HOME

TheInfoList



OR:

ANSI.SYS is a
device driver In the context of an operating system, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabli ...
in the
DOS DOS (, ) is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible syste ...
family of
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s that provides extra
console Console may refer to: Computing and video games * System console, a physical device to operate a computer ** Virtual console, a user interface for multiple computer consoles on one device ** Command-line interface, a method of interacting with ...
functions through
ANSI escape sequence 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 charac ...
s. It is partially based upon a subset of the
text terminal 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. Most early computers only had a front panel to input or display ...
control standard proposed by the
ANSI The American National Standards Institute (ANSI ) is a private nonprofit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organiz ...
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 , and to attempt to change this.


Usage

To use under DOS, a line is added to the (or under
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
based versions of
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
) file that reads: : DEVICE=''drive:''\''path''\ANSI.SYS ''options'' where ''drive:'' and ''path'' are the
drive letter In computer data storage, drive letter assignment is the process of assigning alphabetical identifiers to volumes. Unlike the concept of UNIX mount points, where volumes are named and located arbitrarily in a single hierarchical namespace, drive ...
and path to the directory in which the file is found, and ''options'' can be a number of optional switches to control the behaviour. may also be loaded into
upper memory In DOS memory management, the upper memory area (UMA) is the memory between the addresses of 640  KB and 1024 KB ( 0xA0000–0xFFFFF) in an IBM PC or compatible. IBM reserved the uppermost 384 KB of the 8088 CPU's 1024 KB addr ...
via /. * use extended keyboard BIOS functions ( INT 16h) rather than standard ones This made the F11 and F12 keys work. * force number of lines * adjust line scrolling to support screen readers * or set screensize * support redefinition of extended key codes independent of standard codes


Functionality

Using this driver, programs that write to the
standard output Standard may refer to: Symbols * Colours, standards and guidons, kinds of military signs * Standard (emblem), a type of a large symbol or emblem used for identification Norms, conventions or requirements * Standard (metrology), an object t ...
can write escape sequences to make use of the 16 text foreground colors and 8 background colors available in
VGA-compatible text mode VGA text mode was introduced in 1987 by IBM as part of the VGA standard for its IBM PS/2 computers. Its use on IBM PC compatibles was widespread through the 1990s and persists today for some applications on modern computers. The main features of ...
, make text blink, change the location of the cursor on the screen, and blank the screen. They could also change the video mode from standard 80×25
text mode Text mode is a computer display mode in which content is internally represented on a computer screen in terms of characters rather than individual pixels. Typically, the screen consists of a uniform rectangular grid of ''character cells'', ea ...
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 is very slow as it maps escape sequences to
BIOS In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is a type of firmware used to provide runtime services for operating systems and programs and to perform hardware initialization d ...
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 such as that interface directly with the
video memory Video random-access memory (VRAM) is dedicated computer memory used to store the pixels and other graphics data as a framebuffer to be rendered on a computer monitor. It often uses a different technology than other computer memory, in order to b ...
, in a similar way to most DOS programs that have a full-screen user interface. checked if this driver was in use, and changed the command to use an escape sequence instead of a BIOS call.


Keyboard remapping

An interesting (mis)feature of is the ability to remap any key on the
keyboard Keyboard may refer to: Text input * Keyboard, part of a typewriter * Computer keyboard ** Keyboard layout, the software control of computer keyboards and their mapping ** Keyboard technology, computer keyboard hardware and firmware Music * Mus ...
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. This was used to create simple
trojan Trojan or Trojans may refer to: * Of or from the ancient city of Troy * Trojan language, the language of the historical Trojans Arts and entertainment Music * '' Les Troyens'' ('The Trojans'), an opera by Berlioz, premiered part 1863, part 18 ...
s out of text files laced with nefarious keyboard remaps, known as "ANSI bombs". A number of products were released to protect users against this: * Many replacements for support a command line switch to disable the key remapping feature, f.e. the option (Secure) in Datalight ROM-DOS or NANSI.SYS of
FreeDOS FreeDOS (formerly PD-DOS) is a free software operating system for IBM PC compatible computers. It intends to provide a complete MS-DOS-compatible environment for running Legacy system, legacy software and supporting embedded systems. FreeDOS ca ...
. Other ANSI drivers like ANSIPLUS can be configured to disable the redefinition of keys as well. * Some replacements were deliberately designed never to support the keyboard remapping functions. * PKWARE produced a
terminate-and-stay-resident program A terminate-and-stay-resident program (commonly TSR) is a computer program running under DOS that uses a system call to return control to DOS as though it has finished, but remains in computer memory so it can be reactivated later. This techni ...
, PKSFANSI (PK Safe ANSI), which filters out keyboard remapping escape codes as they are written to the standard output. This has the advantage that the user can load some useful remappings from a text file and then run PKSFANSI to prevent further, possibly malicious remappings.


Occurrence

appeared in MS-DOS 2.0, the first version of the operating system supporting device drivers. 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 IBM PC DOS (an acronym for IBM Personal Computer Disk Operating System),Formally known as "The IBM Personal Computer DOS" from versions 1.0 through 3.30, as reported in those versions' respective COMMAND.COM outputs also known as PC DOS or IBM ...
and
DR-DOS DR-DOS is a disk operating system for IBM PC compatibles, originally developed by Gary A. Kildall's Digital Research, Inc. and derived from Concurrent PC DOS 6.0, which was an advanced successor of CP/M-86. Upon its introduction in 198 ...
. was required to run some software that used its cursor and color control functions. It could also be used to enable elaborate color codes in the prompt. These uses were overshadowed by the use of in BBSes; ANSI escape sequences were used to enable BBSes to send text graphics more elaborate than
ASCII art ASCII art is a graphic design technique that uses computers for presentation and consists of pictures pieced together from the 95 printable (from a total of 128) character (computing), characters defined by the ASCII Standard from 1963 and ASCI ...
, and to control the cursor in ways that were used in a number of
online game An online game is a video game that is either partially or primarily played through the Internet or any other computer network available. Online games are ubiquitous on modern gaming platforms, including PCs, consoles and mobile devices, a ...
s and similar features. Most versions of Windows did not support
ANSI escape codes 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 charac ...
in any useful way (it could be used by MSDOS emulation in some versions). In
Windows 10 Windows 10 is a major release of Microsoft's Windows NT operating system. The successor to Windows 8.1, it was Software release cycle#Release to manufacturing (RTM), released to manufacturing on July 15, 2015, and later to retail on July 2 ...
support for similar escape sequences was built into the
Win32 console Windows Console is a GUI application for running console applications in Windows. Windows Console is used for running text-based programs such as operating system shells (e.g. Command Prompt and PowerShell), utilities (e.g. Far Manager) an ...
(the text terminal window), but must be activated using the
Windows API The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs can acces ...
function by setting the flag.


Features

CSI (
Control Sequence Introducer 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 char ...
) is a placeholder for the common two-byte escape lead-in sequence "" (that is, ). The ANSI standard also defines an alternative single-byte CSI code , which is not supported by ANSI.SYS (this code instead drew a cent sign from
CP437 Code page 437 (CCSID 437) is the character set of the original IBM PC (personal computer). It is also known as CP437, OEM-US, OEM 437, PC-8, or MS-DOS Latin US. The set includes all printable ASCII characters as well as some accented letters (dia ...
). Standard DOS drivers support only the following sub-set of ANSI escape sequences: There are also some escape sequences specific to the implementation of . They are not generally supported by ANSI consoles in other operating systems. In some DOS implementations, video modes above 7 are not documented. Under
Multiuser DOS Multiuser DOS is a real-time multi-user multi-tasking operating system for IBM PC-compatible microcomputers. An evolution of the older Concurrent CP/M-86, Concurrent DOS and Concurrent DOS 386 operating systems, it was originally developed by ...
, the only valid argument in conjunction with PCTERM is 7.


See also

*
ANSI escape sequence 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 charac ...


Notes


References


External links

* * {{cite web , url=http://www.ansilove.org , title=A set of tools for converting ANSi/BiN/ADF/iDF/TUNDRA/XBiN files into PNG images , author-first=Frederic , author-last=Cambus , date=2017-04-19 , access-date=2017-09-11 , url-status=live , archive-url=https://web.archive.org/web/20170911084034/https://www.ansilove.org/ , archive-date=2017-09-11 DOS drivers DOS files DOS technology