Write up on MS Dos Gaming History (revision 2)

Literature Review


History of DOS Games
DOS (an abbreviation of Disk Operating System “Disk Operating System” or “Operating System Disk”) is a family of operating systems for personal computers (PC). Created for computers of the IBM PC family, they used the 16-bit Intel 8086 and 8088 processors, being the first popular operating system for this platform. It had a command-line interface in text mode or alphanumeric, via its shell, command.com. Probably the most popular of its variants is the belonging to the family MS-DOS, Microsoft, supplied with a good part of the computers compatible with the IBM PC, in particular, those of the family of Intel, as a separate operating system or native, up to version 6.22, often attached to a version of the graphical interface of 16-bit Windows, such as 3.1 x.
Inversions native Microsoft Windows based on NT (and this in turn in OS/2 2.X) (see Windows NT, 2000, 2003, XP or Vista or Windows 7) MS-DOS disappears as operating system (proper) and base environment, from which the computer and its essential processes were started and the windows graphical interface or working environment was run and loaded. Any vestige of the same is relegated, in such versions, to the existence of a simple shell, called System symbol, executed as an application using cmd.exe, from the realistic environment itself (now elevated to the system category).
This is not true for non-native Windows versions, which are MS-DOS-based, and are loaded from it. From 1.0 x to 3.1(1), 16-bit versions, Ms. Windows had the idea of a simple interface application or graphical environment, complementary to the shell itself, from which it was executed. It was from the 32-bit, new design, and higher power versions, based on Windows 95 and 98, that the MS-DOS began to be deliberately camouflaged by the windows graphic environment itself. During the boot process, it is giving way, by default, to its automatic execution, which caught the attention of the average user and attributed to the old system a more dependent and secondary role, becoming by many forgotten and unknown. Gradually abandoned by the software and hardware developers., starting with Microsoft itself (this option can be disabled by altering the BootGUI=1 entry by BootGUI=0, from the system file, now text, MSDOS. SYS). However, in such versions, Windows did not function autonomously, as an operating system. Several of the primary or essential functions of the system and their boot are still due to the 32-bit versions, to the different modules and system files that made up the modest frame of the DOS, requiring those a minimum of the underlying records of the DOS, in order to be run (such as IO.SYS, DRVSPACE. BIN, EMM386.EXE and HIMEM. SYS).
There are several versions of DOS:
MS-DOS, Microsoft, is the most well-known.
PC-DOS, IBM.
DR-DOS, from Digital Research, would then move to Novell (Novell DOS 7.0), then to Caldera and finally to DeviceLogics.
FreeDOS is the most recent, free license and open source. You can do the version for GNU/Linux and UNIX, of an emulator of MS-DOS under systems of this type.
With the appearance of the operating systems with graphical user interface (GUI), of the Windows type, especially those of 32 bits, of the Windows 95 type, the DOS has been relegated to the background, until being reduced to the mere shell of commands, and to the command lines (especially in type files .PIF and .BAT), as in Windows NT derivative systems.
History
The story of DOS games started in 1981 when a purchase was made, on the part of Microsoft, the operating system, QDOS (Quick and Dirty Operating System), that after receiving a few modifications, become the first version of the Microsoft operating system, called MS-DOS 1.0 (Microsoft Disk Operating System).
From here, there are a series of modifications to the operating system, until you get to version 7.1, from which MS-DOS ceases to exist as such and becomes an integrated part of the Microsoft Windows operating system.
MS-DOS chronology in all versions
In 1982, version 1.25 was released, and support for double-sided diskettes was added.
In 1983, the system began to have more functionality, with its version 2.0, which added support to IBM 10 MB hard drives, and the ability to read-write 5¼” floppy disks with a capacity of 360 Kb. In version 2.11 of the same year, new keyboard characters are added.
In 1984, Microsoft would release its MS-DOS 3.0 version, and that’s when support for 1.2 MB high-density disks and the possibility of installing a hard drive with a maximum of 32 MB is added. In the same year, support for Microsoft networks would be added to version 3.1.
Three years later, in 1987, version 3.3 is released with support for 3½” floppy disks, and it is allowed to use hard drives more significant than 32 MB.
In 1988, Microsoft released its version 4.0 and with it the support for extended memory specification (XMS) and the possibility to include hard drives up to 2 GB, it should be noted that this version was the biggest catastrophe carried out by the company because it was full of bugs, bugs, etc., which they fixed in 1989 with the release of version 4.01 that solved all these problems and failures.
In 1991, one of the most relevant developments in MS-DOS history is the transition from version 4.01 to version 5.0, in which DOS is already able to load programs into the high memory part of the system using the upper memory (from 640 Kb to 1024 Kb). In version 5.0, the basic programmer and the famous EDIT editor are added. We also added the utilities UNDELETE (recovery of deleted files), FDISK (partition management), and service to run programs designed for earlier versions of MS-DOS, called SERVER. At the end of 1992 was resolved a few problems with UNDELETE and CHKDSK on the 5.0 release.
In 1993, MS-DOS 6.0 appeared with many new features, among them the Doublespace utility that was responsible for compressing the disk and thus having more space available, also included a basic antivirus (MSAV), a DEFRAGMENTADOR (DEFRAG), a memory administrator (MEMMAKER) and some old utilities were suppressed, which by misusing them could destroy data, these utilities were JOIN and RECOVER, among others. In the same year, version 6.2, which adds safety to the loss of data Doublespace, and adds a new scanner, disk, SCANDISK, and solves problems with DISKCOPY and SmartDrive. In version 6.21, which appeared in 1993, Microsoft suppresses Doublespace and looks for a new alternative for this utility.
In 1994, the solution to the Doublespace problem appeared was the utility of the company Stac Electronics, Drive space, the one chosen to be included in version 6.22.
In 1995 Microsoft Windows 95 appeared, and with the appearance of the same, means to separate MS-DOS to a secondary plane.
The MS-DOS system, however, remains in 1995 a new version, 7.0, which correct a multitude of utilities and provides support for long names. Deleted services from the previous operating system can be found in the Windows 95 \other\oldmsdos CD directory.
In 1997 Windows 95 OSR2 appeared and with it a comprehensive revision of system DOS, adding support for FAT32 partitions. Since then, MS-DOS ceases to exist as an operating system.
DOS versions
Several companies developed versions of DOS, generally very similar to each other. PC-DOS and MS-DOS, for example, began to be virtually identical, although they ended up being very different. Versions most well-known are QDOS, PC-DOS, MS-DOS, and FreeDOS, among others.
With the GNU / Linux operating system, it is possible to run two copies under DOSEmu, a virtual machine native to GNU/Linux to run programs in real mode. There are many other emulators for different versions of UNIX, even for platforms other than the x86 processor architecture.
https://dosomegames.com/history-of-dos-games/

When we talk about “DOS Games” we speak about games produced for PC running a Microsoft system prior to Windows. The first “PC” was the IBM PC introduced in 1981. This means that the PC we know today did not exist during the 1st generation of consoles. However, the IBM PC could play games written for mainframe computers in portable programming languages that existed before the PC was born. Zork was written in Z-code in 1977, Lunar Lander was ported to BASIC in 1973 and Star Trek is dated back to 1971.

Incidentally most games for MS-DOS in 1981-1983 were ports from other systems like TRS-80, Apple II and Commodore 64 and and those who were DOS-Specific were often published by IBM themselves like Arithmetic Games Set 1 and 2 that might have been the first games written and published directly for DOS in mind.

While the IBM PC could display graphics, graphics was barely used in the first batch of PC games that instead relied on text, unless they used very rudimentary line-based 3d-polygons without color or textures. Even the first action-games, such as Snipes, used letters instead of pixels, both for the character and enemies. The trend of games lagging behind on graphics will stay through most of the early DOS history and its rooted in the fact that the raw processing power and memory limited what the PC could do.

The second generation of video game consoles brought rudimentary colors and interchangeable software. The IBM PC coexisted the final years of the most iconic of the 2nd generation consoles; the Atari 2600. This was also the same era where games like Pac-Man, Space Invaders and Donkey Kong could be played in the Arcades.

The earliest games with graphics appeared around 1982, with Paratrooper, Flight Simulator 1.0 and Decathlon. It took until 83-84 for CGA graphics to be common. CGA is identified by a distinct 4-color palette. The lack of color made gaming on the PC inferior to contemporary platforms like the Commodore 64, the ZX Spectrum and Amstrad CPC. Even if other alternatives became available earlier on, the majority of all DOS games kept using CGA until 1987.

Harddrives and memory capacity was limited too. To save space, many of the first games were booted from large wobbly 5-inch floppy disks, called “PC booters”. With few standards the games in this era were pioneers, often hardcoded or custom made. This make them difficult to run even on authentic PC’s. One issue were that they were programmed to run as fast as the processor can handle, meaning that when processors became faster the games became too fast to be played until modern emulation came in. Sound and music was often non-existant or used the “PC speaker” . A rudimentary device that could produce simple bleeps and blops.

What is Hercules?
The Hercules Graphics Card was released in 1982 and offered high resolution (720×348) monochrome graphics. For awhile it was standard on monochrome IBM computers. This card was rarely a primary choice for games, but mentioned here as a curiosity.
1983 marks the video game crash, a time in which home computers took over the gaming market. While the new IBM XT was a more powerful machine, with an updated 286 processor, it was also expensive. The IBM PCjr was announced in 1984 to compete with Commodore 64 and Apple II, but it also met competition with the “PC Compatible” Tandy 1000 by Tandy Corporation. The Tandy 1000 marked the first step towards IBM losing their hold of PC as a platform, leading to PC becoming an “unowned” computer.

What is Composite CGA?
During this era we saw the earliest introduction of 16 colors on PC. When using CGA on some old TV’s, the signal was imperfect, which caused a color smearing that was later turned into an asset. Done right it was possible to use this smearing to produce new colors, offering an early 16-color mode known as “Composite CGA”. 1983 marks the video game crash, a time in which home computers took over the gaming market. While the new IBM XT was a more powerful machine, with an updated 286 processor, it was also expensive. The IBM PCjr was announced in 1984 to compete with Commodore 64 and Apple II, but it also met competition with the “PC Compatible” Tandy 1000 by Tandy Corporation. The Tandy 1000 marked the first step towards IBM losing their hold of PC as a platform, leading to PC becoming an “unowned” computer.

What is Composite CGA?
During this era we saw the earliest introduction of 16 colors on PC. When using CGA on some old TV’s, the signal was imperfect, which caused a color smearing that was later turned into an asset. Done right it was possible to use this smearing to produce new colors, offering an early 16-color mode known as “Composite CGA”.

What is Tandy?
King’s Quest was among the first games to use the low resolution 16-color PCjr Tandy mode, a mode iconic for its very large pixels. By reducing the amount of pixels on screen (160×200), the PC’s could produce 16-color games at reasonable speed. Adventure games like King’s Quest could not be ran on most other systems at the time due to their high memory requirement, making King’s Quest one of the first “defining” games for DOS and still quite fun to play.
DOS Memory Management
Throughout the DOS era, one of the most challenging and frustrating things was making sure applications and games had the right memory configuration. The problem stemmed from limitations in the original IBM PC’s architecture, where it was thought no PC would ever require more than 640 KB of RAM!
Indeed, the Intel 8088 and 8086 CPUs could only physically access up to 1 MB of memory via their 20 address lines. With the arrival of the 80286 CPU, up to 16 MB could be addressed, but in order to retain full backward-compatibility with the original IBM PC, memory allocation was still limited to the first 640 KB – this was referred to as Conventional Memory or Base Memory.
Upper Memory
In the original IBM PC architecture the area of memory between 640 KB and 1 MB was called Upper Memory. This was supposed to be reserved for a combination of video screen memory, video BIOS memory, option ROMs for certain devices, and Cassette BASIC. In reality, a lot of this 384 KB upper memory area (UMA) was unused.
From MS-DOS 5.0, launched in June 1991, device drivers and TSRs could be loaded into unused locations within the 384 KB of UMA via the loading of EMM386.EXE (a device driver that opened up access to the UMA). This helped keep conventional memory free for running programs. These locations were called Upper Memory Blocks (UMBs).
Extended Memory and the High Memory Area
All memory above 1 MB was referred to generically as Extended Memory. Within this, a small 64 KB area just above the 1 MB mark is called the High Memory Area (HMA).
Again from MS-DOS 5.0, a new device driver was provided called HIMEM.SYS which would allow parts of the operating system to be loaded into the HMA. This meant that up to 46 KB of conventional memory could be freed up for programs instead of storing part of the operating system.
On 80286-based systems and above, CPUs would need to be put into what was called “Protected” mode in order to access this Extended Memory. The default mode on startup for 286 and higher processors was called “Real” mode, which was essentially the same as the only mode the 8088 and 8086 CPUs could run in.


Expanded Memory
Due to the fact that no 100% IBM PC-compatible DOS software could support the 286’s Protected mode, there was an opportunity for some other mechanism to be created in order to provide access to memory above 1 MB.
The solution was to have the ability to move a “window” of accessible memory around the extended memory space in what was known as bank switching. By swapping out chunks of the extended memory area (everything above 1 MB) into a 64 KB region of the UMA, the full amount of extended memory could be accessed, just one chunk at a time. This method of accessing more memory grew and eventually became a standard known as LIM EMS (Lotus/Intel/Microsoft Expanded Memory Specification), named after the consortium of companies that worked on and ratified the specification.
It was at this point where Extended Memory got the label XMS, and Expanded Memory got the label EMS to help differentiate between the two. Both access memory above the 1 MB mark, but do so in different ways.
In order to make use of EMS, DOS 4.01 (released in 1989) came bundled with an Expanded Memory Manager called EMM386.SYS. In 1991 a more flexible version called EMM386.EXE was released with DOS 5.0. EMM386 made use of a mode found in 80386 CPUs and above: “Virtual 8086” mode.
https://dosdays.co.uk/topics/dos_memory.php
Section II: Programming in the MS-DOS Environment
Part A Structure of MS-DOS

An operating system is a set of interrelated supervisory programs that
manage and control computer processing. In general, an operating
system provides

■ Storage management
■ Processing management
■ Security
■ Human interface

Existing operating systems for microcomputers fall into three major
categories: ROM monitors, traditional operating systems, and operating
environments. The general characteristics of the three categories are
listed in Table 1-1.


Table 1-1. Characteristics of the Three Major Types of
Operating Systems.

╓┌──────────────────────────┌─────────────┌─────────────┌────────────────────╖
Traditional
ROM Operating Operating
Monitor System Environment
──────────────────────────────────────────────────────────────────
Complexity Low Medium High
Built on Hardware BIOS Operating system
Delivered on ROM Disk Disk
Programs on ROM Disk Disk
Peripheral support Physical Logical Logical
Disk access Sector File system File system
Example PC ROM BIOS MS-DOS Microsoft Windows

A ROM monitor is the simplest type of operating system. It is designed
for a particular hardware configuration and provides a program with
basic–and often direct–access to peripherals attached to the
computer. Programs coupled with a ROM monitor are often used for
dedicated applications such as controlling a microwave oven or
controlling the engine of a car.

A traditional microcomputer operating system is built on top of a ROM
monitor, or BIOS (basic input/output system), and provides additional
features such as a file system and logical access to peripherals.
(Logical access to peripherals allows applications to run in a
hardware-independent manner.) A traditional operating system also
stores programs in files on peripheral storage devices and, on
request, loads them into memory for execution. MS-DOS is a traditional
operating system.

An operating environment is built on top of a traditional operating
system. The operating environment provides additional services, such
as common menu and forms support, that simplify program operation and
make the user interface more consistent. Microsoft Windows is an
operating environment.

MS-DOS System Components

The Microsoft Disk Operating System, MS-DOS, is a traditional

microcomputer operating system that consists of five major components:

■  The operating-system loader

■  The MS-DOS BIOS

■  The MS-DOS kernel

■  The user interface (shell)

■  Support programs

Each of these is introduced briefly in the following pages. See

PROGRAMMING IN THE MS-DOS ENVIRONMENT: STRUCTURE OF MS-DOS: The

Components of MS-DOS.

The operating-system loader

The operating-system loader brings the operating system from the

startup disk into RAM.

The complete loading process, called bootstrapping, is often complex,

and multiple loaders may be involved. (The term bootstrapping came

about because each level pulls up the next part of the system, like

pulling up on a pair of bootstraps.) For example, in most standard

MS-DOS-based microcomputer implementations,  the ROM loader, which is

the first program the microcomputer executes when it is turned on or

restarted, reads the disk bootstrap loader from the first (boot)

sector of the startup disk and executes it. The disk bootstrap loader,

in turn, reads the main portions of MS-DOS–MSDOS.SYS and IO.SYS

(IBMDOS.COM and IBMBIO.COM with PC-DOS)–from conventional disk files

into memory. The special module SYSINIT within MSDOS.SYS then

initializes MS-DOS’s tables and buffers and discards itself. See

PROGRAMMING IN THE MS-DOS ENVIRONMENT: STRUCTURE OF MS-DOS: MS-DOS

Storage Devices.

(The term loader is also used to refer to the portion of the operating

system that brings application programs into memory for execution.

This loader is different from the ROM loader and the operating-system

loader.)

The MS-DOS BIOS

The MS-DOS BIOS, loaded from the file IO.SYS during system

initialization, is the layer of the operating system that sits between

the operating-system kernel and the hardware. An application performs

input and output by making requests to the operating-system kernel,

which, in turn, calls the MS-DOS BIOS routines that access the

hardware directly. See SYSTEM CALLS. This division of function allows

application programs to be written in a hardware-independent manner.

The MS-DOS BIOS consists of some initialization code and a collection

of device drivers. (A device driver is a specialized program that

provides support for a specific device such as a display or serial

port.) The device drivers are responsible for hardware access and for

the interrupt support that allows the associated devices to signal the

microprocessor that they need service.

The device drivers contained in the file IO.SYS, which are always

loaded during system initialization, are sometimes referred to as the

resident drivers. With MS-DOS versions 2.0 and later, additional

device drivers, called installable drivers, can optionally be loaded

during system initialization as a result of DEVICE directives in the

system’s configuration file.

The MS-DOS kernel

The services provided to application programs by the MS-DOS kernel

include

■  Process control

■  Memory management

■  Peripheral support

■  A file system

The MS-DOS kernel is loaded from the file MSDOS.SYS during system

initialization.

https://www.pcjs.org/documents/books/mspl13/msdos/encyclopedia/section2/c

Conclusion
The MS DOS scalability based on it’s Technical Requirements and Primitive Instructional Sets 86 Assembly was quite impressive in Gaming until 1998 when PlayStation had become dominate in the Gaming Market. Focus point is the Memory Management , again look at the Memory Management it was very impressive for PC Gaming.
Memory management
Because the amount of memory a program needs varies from program to
program, the traditional operating system ordinarily provides memory-
management functions. Memory requirements can also vary during program
execution, and memory management is especially necessary when two or
more programs are present in memory at the same time.

MS-DOS memory management is based on a pool of variable-size memory
blocks. The two basic memory-management actions are to allocate a
block from the pool and to return an allocated block to the pool.
MS-DOS allocates program space from the pool when the program is
loaded; programs themselves can allocate additional memory from the
pool. Many programs perform their own memory management by using a
local memory pool, or heap–an additional memory block allocated from
the operating system that the application program itself divides into
blocks for use by its various routines.

Because the amount of memory a program needs varies from program to
program, the traditional operating system ordinarily provides memory-
management functions. Memory requirements can also vary during program
execution, and memory management is especially necessary when two or
more programs are present in memory at the same time.

Significance of the Study

 Advanced MS-DOS Programming

 is written for the experienced C or

    assembly-language programmer. It provides all the information you need to

    write robust, high-performance applications under the MS-DOS operating

    system. Because I believe that working, well-documented programs are

    unbeatable learning tools, I have included detailed programming examples

    throughout──including complete utility programs that you can adapt to your

    own needs.

────────────────────────────────────────────────────────────────────────────

Genealogy of MS-DOS

    In only seven years, MS-DOS has evolved from a simple program loader into

    a sophisticated, stable operating system for personal computers that are

    based on the Intel 8086 family of microprocessors (Figure 1-1). MS-DOS

    supports networking, graphical user interfaces, and storage devices of

    every description; it serves as the platform for thousands of application

    programs; and it has over 10 million licensed users──dwarfing the combined

    user bases of all of its competitors.

    The progenitor of MS-DOS was an operating system called 86-DOS, which was

    written by Tim Paterson for Seattle Computer Products in mid-1980. At that

    time, Digital Research’s CP/M-80 was the operating system most commonly

    used on microcomputers based on the Intel 8080 and Zilog Z-80

    microprocessors, and a wide range of application software (word

    processors, database managers, and so forth) was available for use with

    CP/M-80.

    To ease the process of porting 8-bit CP/M-80 applications into the new

    16-bit environment, 86-DOS was originally designed to mimic CP/M-80 in

    both available functions and style of operation. Consequently, the

    structures of 86-DOS’s file control blocks, program segment prefixes, and

    executable files were nearly identical to those of CP/M-80. Existing

    CP/M-80 programs could be converted mechanically (by processing their

    source-code files through a special translator program) and, after

    conversion, would run under 86-DOS either immediately or with very little

    hand editing.

    Because 86-DOS was marketed as a proprietary operating system for Seattle

    Computer Products’ line of S-100 bus, 8086-based microcomputers, it made

    very little impact on the microcomputer world in general. Other vendors of

    8086-based microcomputers were understandably reluctant to adopt a

    competitor’s operating system and continued to wait impatiently for the

    release of Digital Research’s CP/M-86.

    In October 1980, IBM approached the major microcomputer-software houses in

    search of an operating system for the new line of personal computers it

    was designing. Microsoft had no operating system of its own to offer

    (other than a stand-alone version of Microsoft BASIC) but paid a fee to

    Seattle Computer Products for the right to sell Paterson’s 86-DOS. (At

    that time, Seattle Computer Products received a license to use and sell

    Microsoft’s languages and all 8086 versions of Microsoft’s operating

    system.) In July 1981, Microsoft purchased all rights to 86-DOS, made

    substantial alterations to it, and renamed it MS-DOS. When the first IBM

    PC was released in the fall of 1981, IBM offered MS-DOS (referred to as

    PC-DOS 1.0) as its primary operating system.

    IBM also selected Digital Research’s CP/M-86 and Softech’s P-system as

    alternative operating systems for the PC. However, they were both very

    slow to appear at IBM PC dealers and suffered the additional disadvantages

    of higher prices and lack of available programming languages. IBM threw

    its considerable weight behind PC-DOS by releasing all the IBM-logo PC

    application software and development tools to run under it. Consequently,

    most third-party software developers targeted their products for PC-DOS

    from the start, and CP/M-86 and P-system never became significant factors

    in the IBM PC─compatible market.

    In spite of some superficial similarities to its ancestor CP/M-80, MS-DOS

    version 1.0 contained a number of improvements over CP/M-80, including the

    following:

    ■  An improved disk-directory structure that included information about a

        file’s attributes (such as whether it was a system or a hidden file),

        its exact size in bytes, and the date that the file was created or last

        modified

    ■  A superior disk-space allocation and management method, allowing

        extremely fast sequential or random record access and program loading

    ■  An expanded set of operating-system services, including

        hardware-independent function calls to set or read the date and time, a

        filename parser, multiple-block record I/O, and variable record sizes

    ■  An AUTOEXEC.BAT batch file to perform a user-defined series of commands

        when the system was started or reset

    IBM was the only major computer manufacturer (sometimes referred to as

    OEM, for original equipment manufacturer) to ship MS-DOS version 1.0 (as

    PC-DOS 1.0) with its products. MS-DOS version 1.25 (equivalent to IBM

    PC-DOS 1.1) was released in June 1982 to fix a number of bugs and also to

    support double-sided disks and improved hardware independence in the DOS

    kernel. This version was shipped by several vendors besides IBM, including

    Texas Instruments, COMPAQ, and Columbia, who all entered the personal

    computer market early. Due to rapid decreases in the prices of RAM and

    fixed disks, MS-DOS version 1 is no longer in common use.

    MS-DOS version 2.0 (equivalent to PC-DOS 2.0) was first released in March

    1983. It was, in retrospect, a new operating system (though great care was

    taken to maintain compatibility with MS-DOS version 1). It contained many

    significant innovations and enhanced features, including those listed on

    the following page.

    ■  Support for both larger-capacity floppy disks and hard disks

    ■  Many UNIX/XENIX-like features, including a hierarchical file structure,

        file handles, I/O redirection, pipes, and filters

    ■  Background printing (print spooling)

    ■  Volume labels, plus additional file attributes

    ■  Installable device drivers

    ■  A user-customizable system-configuration file that controlled the

        loading of additional device drivers, the number of system disk

        buffers, and so forth

    ■  Maintenance of environment blocks that could be used to pass

        information between programs

    ■  An optional ANSI display driver that allowed programs to position the

        cursor and control display characteristics in a hardware-independent

        manner

    ■  Support for the dynamic allocation, modification, and release of memory

        by application programs

    ■  Support for customized user command interpreters (shells)

    ■  System tables to assist application software in modifying its currency,

        time, and date formats (known as international support)

    MS-DOS version 2.11 was subsequently released to improve international

    support (table-driven currency symbols, date formats, decimal-point

    symbols, currency separators, and so forth), to add support for 16-bit

    Kanji characters throughout, and to fix a few minor bugs. Version 2.11

    rapidly became the base version shipped for 8086/8088-based personal

    computers by every major OEM, including Hewlett-Packard, Wang, Digital

    Equipment Corporation, Texas Instruments, COMPAQ, and Tandy.

    MS-DOS version 2.25, released in October 1985, was distributed in the Far

    East but was never shipped by OEMs in the United States and Europe. In

    this version, the international support for Japanese and Korean character

    sets was extended even further, additional bugs were repaired, and many of

    the system utilities were made compatible with MS-DOS version 3.0.

    MS-DOS version 3.0 was introduced by IBM in August 1984 with the release

    of the 80286-based PC/AT machines. It represented another major rewrite of

    the entire operating system and included the important new features listed

    on the following page.

    ■  Direct control of the print spooler by application software

    ■  Further expansion of international support for currency formats

    ■  Extended error reporting, including a code that suggests a recovery

        strategy to the application program

    ■  Support for file and record locking and sharing

    ■  Support for larger fixed disks

    MS-DOS version 3.1, which was released in November 1984, added support for

    the sharing of files and printers across a network. Beginning with version

    3.1, a new operating-system module called the redirector intercepts an

    application program’s requests for I/O and filters out the requests that

    are directed to network devices, passing these requests to another machine

    for processing.

    Since version 3.1, the changes to MS-DOS have been evolutionary rather

    than revolutionary. Version 3.2, which appeared in 1986, generalized the

    definition of device drivers so that new media types (such as 3.5-inch

    floppy disks) could be supported more easily. Version 3.3 was released in

    1987, concurrently with the new IBM line of PS/2 personal computers, and

    drastically expanded MS-DOS’s multilanguage support for keyboard mappings,

    printer character sets, and display fonts. Version 4.0, delivered in 1988,

    was enhanced with a visual shell as well as support for very large file

    systems.

    While MS-DOS has been evolving, Microsoft has also put intense efforts

    into the areas of user interfaces and multitasking operating systems.

    Microsoft Windows, first shipped in 1985, provides a multitasking,

    graphical user “desktop” for MS-DOS systems. Windows has won widespread

    support among developers of complex graphics applications such as desktop

    publishing and computer-aided design because it allows their programs to

    take full advantage of whatever output devices are available without

    introducing any hardware dependence.

    Microsoft Operating System/2 (MS OS/2), released in 1987, represents a new

    standard for application developers: a protected-mode, multitasking,

    virtual-memory system specifically designed for applications requiring

    high-performance graphics, networking, and interprocess communications.

    Although MS OS/2 is a new product and is not a derivative of MS-DOS, its

    user interface and file system are compatible with MS-DOS and Microsoft

    Windows, and it offers the ability to run one real-mode (MS-DOS)

    application alongside MS OS/2 protected-mode applications. This

    compatibility allows users to move between the MS-DOS and OS/2

    environments with a minimum of difficulty.

    ┌─────────────┐

    │ MS-DOS 1.0  │ 1981: First operating system on IBM PC

    │ PC-DOS 1.0  │

    └──────┬──────┘

            │

    ┌──────▼──────┐

    │ MS-DOS 1.25 │ Double-sided disk support and bug fixes added:

    │ PC-DOS 1.1  │ widely distributed by OEMs other than IBM

    └──────┬──────┘

            │

    ┌──────▼──────┐ 1983: Introduced with IBM PC/XT;

    │ MS-DOS 2.0  │ support for UNIX/XENIX-like hierarchical

    │ PC-DOS 2.0  │ file structure and hard disks added

    └──────┬──────┘

            ├──────────────────────────────────────┐

    ┌──────▼──────┐                        ┌──────▼──────┐

    │ MS-DOS 2.01 │ 2.0 with international │ PC-DOS 2.1  │ Introduced with PCjr

    └──────┬──────┘ support                └─────────────┘ 2.0 with bug fixes

            │

    ┌──────▼──────┐

    │ MS-DOS 2.11 │ 2.01 with bug fixes

    └──────┬──────┘

            ├──────────────────────────────────────┐

    ┌──────▼──────┐ 1984: Introduced with  ┌──────▼──────┐ 1985: Far East OEMs;

    │ MS-DOS 3.0  │ PC/AT; support for     │ MS-DOS 2.25 │ support for extended

    │ PC-DOS 3.0  │ 1.2 MB floppy disk,    └─────────────┘ character sets

    └──────┬──────┘ larger hard disk added

            │

    ┌──────▼──────┐

    │ MS-DOS 3.1  │ Support for Microsoft  ┌─────────────┐ 1985: Graphical

    │ PC-DOS 3.1  │ Networks added         │   Windows   │ user interface

    └──────┬──────┘                        │     1.0     │ for MS-DOS

            │                               └──────┬──────┘

    ┌──────▼──────┐                               │

    │ MS-DOS 3.2  │ 1986: Support for 3.5-        │

    │ PC-DOS 3.2  │ inch disks added              │

    └──────┬──────┘                               │

            │                               ┌──────▼──────┐ 1987: Compatibility

    ┌──────▼──────┐ 1987: Introduced with  │   Windows   │ with OS/2

    │ MS-DOS 3.3  │ IBM PS/2; generalized  │     2.0     │ Presentation Manager

    │ PC-DOS 3.3  │ code-page (font)       └─────────────┘

    └──────┬──────┘ support

            │

    ┌──────▼──────┐ 1988: Support for

    │ MS-DOS 4.0  │ logical volumes larger

    │ PC-DOS 4.0  │ than 32 MB; visual shell

    └─────────────┘

    Figure 1-1.  The evolution of MS-DOS.

    What does the future hold for MS-DOS? Only the long-range planning teams

    at Microsoft and IBM know for sure. But it seems safe to assume that

    MS-DOS, with its relatively small memory requirements, adaptability to

    diverse hardware configurations, and enormous base of users, will remain

    important to programmers and software publishers for years to come.

────────────────────────────────────────────────────────────────────────────

  MS-DOS in Operation

    It is unlikely that you will ever be called upon to configure the MS-DOS

    software for a new model of computer. Still, an acquaintance with the

    general structure of MS-DOS can often be very helpful in understanding the

    behavior of the system as a whole. In this chapter, we will discuss how

    MS-DOS is organized and how it is loaded into memory when the computer is

    turned on.

The Structure of MS-DOS

    MS-DOS is partitioned into several layers that serve to isolate the kernel

    logic of the operating system, and the user’s perception of the system,

    from the hardware it is running on. These layers are

    ■  The BIOS (Basic Input/Output System)

    ■  The DOS kernel

    ■  The command processor (shell)

    We’ll discuss the functions of each of these layers separately.

The BIOS Module

    The BIOS is specific to the individual computer system and is provided by

    the manufacturer of the system. It contains the default resident

    hardware-dependent drivers for the following devices:

    ■  Console display and keyboard (CON)

    ■  Line printer (PRN)

    ■  Auxiliary device (AUX)

    ■  Date and time (CLOCK$)

    ■  Boot disk device (block device)

    The MS-DOS kernel communicates with these device drivers through I/O

    request packets; the drivers then translate these requests into the proper

    commands for the various hardware controllers. In many MS-DOS systems,

    including the IBM PC, the most primitive parts of the hardware drivers are

    located in read-only memory (ROM) so that they can be used by stand-alone

    applications, diagnostics, and the system startup program.

    The terms resident and installable are used to distinguish between the

    drivers built into the BIOS and the drivers installed during system

    initialization by DEVICE commands in the CONFIG.SYS file

    The BIOS is read into random-access memory (RAM) during system

    initialization as part of a file named IO.SYS. (In PC-DOS, the file is

    called IBMBIO.COM.) This file is marked with the special attributes hidden

    and system.

The DOS Kernel

    The DOS kernel implements MS-DOS as it is seen by application programs.

    The kernel is a proprietary program supplied by Microsoft Corporation and

    provides a collection of hardware-independent services called system

    functions. These functions include the following:

    ■  File and record management

    ■  Memory management

    ■  Character-device input/output

    ■  Spawning of other programs

    ■  Access to the real-time clock

    Programs can access system functions by loading registers with

    function-specific parameters and then transferring to the operating system

    by means of a software interrupt.

    The DOS kernel is read into memory during system initialization from the

    MSDOS.SYS file on the boot disk. (The file is called IBMDOS.COM in

    PC-DOS.) This file is marked with the attributes hidden and system.

The Command Processor

    The command processor, or shell, is the user’s interface to the operating

    system. It is responsible for parsing and carrying out user commands,

    including the loading and execution of other programs from a disk or other

    mass-storage device.

    The default shell that is provided with MS-DOS is found in a file called

    COMMAND.COM. Although COMMAND.COM prompts and responses constitute the

    ordinary user’s complete perception of MS-DOS, it is important to realize

    that COMMAND.COM is not the operating system, but simply a special class

    of program running under the control of MS-DOS.

    COMMAND.COM can be replaced with a shell of the programmer’s own design by

    simply adding a SHELL directive to the system-configuration file

    (CONFIG.SYS) on the system startup disk. The product COMMAND-PLUS from ESP

    Systems is an example of such an alternative shell.

    More about COMMAND.COM

    The default MS-DOS shell, COMMAND.COM, is divided into three parts:

    ■  A resident portion

    ■  An initialization section

    ■  A transient module

Preparing a new program to run under MS-DOS is an iterative process with

    four basic steps:

    ■  Use of a text editor to create or modify an ASCII source-code file

    ■  Use of an assembler or high-level-language compiler (such as the

        Microsoft Macro Assembler or the Microsoft C Optimizing Compiler) to

        translate the source file into relocatable object code

    ■  Use of a linker to transform the relocatable object code into an

        executable MS-DOS load module

    ■  Use of a debugger to methodically test and debug the program

    Additional utilities the MS-DOS software developer may find necessary or

    helpful include the following:

    ■  LIB, which creates and maintains object-module libraries

    ■  CREF, which generates a cross-reference listing

    ■  EXE2BIN, which converts .EXE files to .COM files

    ■  MAKE, which compares dates of files and carries out operations based on

        the result of the comparison

There are 2 different video modes: text mode and graphics mode. Most people start out programming in text mode (whether the  C/C++ compiler is running in DOS or Windows). The graphic modes I will cover will only run in DOS.

One good way to start off in graphics is to use BGI (Borland Graphics Interface). BGI runs in DOS and is limited to 16 colors (depending on what type of  monitor your using and how you initialized your graphics, most people use (S)VGA now days, but it has support for old ones like EGA and CGA. BGI graphics use the graphics.h library. There are many functions that allow you to draw lines, polygons, circles and so on. 

Visual Art & Design-How to Create a MS DOS Game

There is also another mode known as Mode 13h, which is faster than BGI and has a  screen resolution of 320×200 and allows 256 colors and 1 page for animation. Unlike BGI, mode 13h cannot use the graphics.h library (some functions work, but most don’t). But as long as you can plot a pixel, then you can use an algorithm to draw lines, circles, etc. It also helps if you know some ASM (assembly), to write fast, efficient code. Note that only C++ will recognize ASM.


Example Code

Here’s some code of how to get into mode 13h (you might have to use different syntax for the ASM functions).

#include <dos.h>

#include <stdlib.h>

#define SCREEN_WIDTH  (unsigned int)320

#define SCREEN_HEIGHT (unsigned int)200

void Plot_Pixel(int x, int y, unsigned char color);

void Set_Video_Mode(int mode);

unsigned char far *video_buffer = (char far *)0xA0000000L;

void Plot_Pixel(int x, int y, unsigned char color)

{

//This function plots a single pixel in the desired color.

//This is very quick because it uses binar shifting to

//accomplish the multiplications.

   video_buffer[((y<<8)+(y<<6))+x] = color;

}

void Set_Video_Mode(int mode)

{

// Use video interrupt 10h to set the video mode to the send value.

   union REGS inregs, outregs;

   inregs.h.ah = 0;

   inregs.h.al = (unsigned char)mode;

   int86(0x10, &inregs, &outregs);

}

void main(void)

{

   // Set the video mode to VGA.

   Set_Video_Mode(VGA256);

   Plot_Pixel(,,);

   // Reset the video mode back to its original text mode.

   Set_Video_Mode(TEXT_MODE);

}


If you are using mode 13h, the clrscr() function will look grey heres code to use “fill the screen”, which clears it: 

TechnicalReference

//by IKoulchin

#define screen_ram 0x0A000

// fills the screen in a color

void Fill_screen(int color)

{

asm{

mov AX,screen_ram

mov ES, AX

xor DI,DI

mov CX,32000;

mov AL, BYTE PTR color

mov AH,AL

rep stosw

}// end asm

}// end fillscreen

//by Lutrosis

#include <dos.h>

#include <stdlib.h>

#include <graphics.h>

#include <stdio.h>

#include <mem.h>

void init_graph()

{

  asm {

    mov AX, 0x0013

    int 0x10

  }

}

void close_graph()

{

  asm {

    mov AX, 0x0003

    int 0x10

  }

}

//Now the pixel-plotting code:

// define this somewhere in your file.

// address of the screen buffer

unsigned char far *video_buffer= (char far *)0xA0000000L;

//unsigned char far* video_buffer=0xA0000000;

// remember, this doesn’t clip, so don’t draw pixels off-screen

void put_pixel(int x,int y,unsigned char color) {

  video_buffer[y*320+x]=color;

}

// make sure these definitions are in your file somewhere

typedef struct {

  unsigned char red,green,blue;

} RGB_type;

typedef RGB_type palette_type[256];

// You’ll need this function too

void set_DAC(char DAC_num,RGB_type new_values)

{

  outportb(0x3c8,DAC_num);

  outportb(0x3c9,new_values.red);

  outportb(0x3c9,new_values.green);

  outportb(0x3c9,new_values.blue);

}

void load_pcx(char *filename,unsigned char far* the_buffer)

{

  FILE *fp;       // the file pointer used to open the PCX file

  int num_bytes,  // number of bytes in current RLE run

      index;      // loop variable

  long count;     // the total number of bytes decompressed

  unsigned char data; // the current pixel data

  palette_type palette;

  if ((fp = fopen(filename,”rb”))==NULL) {

    close_graph();

    printf(“\nPCX SYSTEM – Couldn’t find file: %s”,filename);

    exit(1);

  } // end if couldn’t find file

  for (index=0; index < 128; index++) {

    (char)getc(fp);

  } // end for index

  count=0;

  while(count <=64000) {

    data = (unsigned char)getc(fp);

    if (data >=192) {

      num_bytes = data-192;

      data  = (unsigned char)getc(fp);

      while(num_bytes–>0) {

            the_buffer[count++] = data;

      } // end while

    } // end if rle

    else {

      the_buffer[count++] = data;

    } // end else not rle

  } // end while

  fseek(fp,-768L,SEEK_END);

  for (index=0; index<256; index++) {

    palette[index].red   = (unsigned char)(getc(fp) >> 2);

    palette[index].green = (unsigned char)(getc(fp) >> 2);

    palette[index].blue  = (unsigned char)(getc(fp) >> 2);

  } // end for index

  fclose(fp);

  for (index=0; index<256; index++) {

    set_DAC(index,palette[index]);

  } // end for index

} // end PCX_Load

void main()

{

init_graph();

load_pcx(“a:\IMAGENAME.pcx”, video_buffer);

sleep(10);//delay 10 sec

close_graph();

}


Here’s code for a really fast plot pixel 

Graphics& Animation Software

//by Ready4Dis

unsigned char far *screen = (unsigned char far*)0xa0000000l;

#define put_pixel(x, y, col) screen[(y<<6)+(y<<8)+x] = col

//by ShogunTim

char *bmpdata;

int width,heigth,bpp;

bmpdata = bmpload(“test.bmp”, NULL, 0, NULL, &width,&heigth,&bpp);

char *bmpload(char *fname, FILE *fp, long startpos,

              unsigned char *pal, int *bmpwidth,

              int *bmpheigth, int *bpp)

{

long heigth, width=0, o, compress; short bits;

char *buffer;

int i, z;

char b;

int save=-1;

if (!fp){if (fname) {fp=fopen(fname, “rb”);} else {return NULL;}}

fseek(fp, startpos + 22, SEEK_SET); fread(&heigth, 1, 4, fp);

fseek(fp, startpos + 10, SEEK_SET); fread(&o, 1, 4, fp);

width = (filelength(fileno(fp)) – o) / heigth;

fseek(fp, startpos + 28, SEEK_SET); fread(&bits, 1, 2, fp);

fseek(fp, startpos + 30, SEEK_SET); fread(&compress, 1, 4, fp);

buffer = new char[width*(heigth+2)];

if (!buffer) return NULL;

/*snatch the palette. not needed for 16,24 or 32 bits*/

for (i=0; i<=1020; i+=4)

     {

      for (z=3; z>=1; z–)

       {

        fseek(fp, startpos + 54+i+z-1, SEEK_SET);

        fread(&b, 1, 1, fp);

        if (pal) {pal[++save]=b;}

        }

      }

/*read color data*/

char *tempb = buffer;

long y;

for (y=heigth-1; y>0; y–)

     {

      fseek(fp, startpos + o + (width * y)  -1, SEEK_SET);//find line

      fread(tempb, 1, width, fp);      //read entire line

      tempb+=width;

      }

if (bmpwidth) {*bmpwidth = (int)width/(bits/8);}

if (bmpheigth) {*bmpheigth = (int)heigth;}

if (bpp) {*bpp = (int)bits;}

return buffer;

}

References:

https://dosomegames.com/history-of-dos-games

https://dosdays.co.uk/topics/dos_memory.php

https://www.pcjs.org/documents/books/mspl13/msdos/encyclopedia/section2/c

Leave a Comment

Your email address will not be published. Required fields are marked *