Title: DOS Memory in a Windows World
1DOS Memory in a Windows World
2Hexadecimal
- 8086 has a 20-wire address bus.
- These wires may or may not have voltage on them.
- A wire with voltage is represented by a 1 and a
wire with no voltage is represented by a 0. - Each combination of charged and uncharged wires
represents one memory location. - Each memory location should be 8-bits long.
- Hexadecimal (Hex) is a shorthand description of
the state of wires of the 8086 address bus.
3Hexadecimal
- Memory space vs. Memory
- RAM and ROM chips are used to store bytes of code
at certain memory locations. - Memory addresses are not physical locations.
- Two sequential memory addresses may not be
physically next to each other.
4The DOS Memory Map
Full address map for an 8086 CPU.
5Assigning Addresses
- The concept of allowing RAM as well as other
devices to share the same memory space is called
Memory Mapped I/O - Addresses ranging from 00000 to 9FFFF are
dedicated for RAM to run programs - Chips other than RAM use the remaining addresses
ranging from A0000 to FFFFF
6Conventional Memory
- Conventional area
- The area from 0 to 640 KB is called the
conventional memory. - It contains all the memory addresses set aside
for the RAM to run programs. - It has 655,360 memory locations.
7Reserved Memory
- Reserved area
- It is a complex compilation of different ROMs and
RAMs that use memory
8Conventional Reserved Memory
9System BIOS
- The system BIOS is the most important device in
the reserved area, and is located in memory
locations from F0000 to FFFFF.
10Video Memory Addresses
11Optional ROMs
12Video Card ROM
- Every computer carries an optional ROM for the
video card, so the first segment in the Optional
ROMS area is already assigned
13640K Limit
- 640K became the standard for several years
- Programs became more complex and needed more
memory, but you could no longer just add memory
chips once you reached the 640K limit
14Expanded Memory
- The expanded memory specification (EMS) provides
a way of adding more memory to the computer
without exceeding the 1 MB limit. - Expanded memory was originally an expansion card
full of RAM chips. - The chips on the card are electronically divided
into 16 KB chunks called pages.
15Expanded Memory
- A card consists of 4 to 512 pages.
- Each page is labeled electronically with the page
number. - A device driver and an application is required to
access this card of RAM chips.
16Expanded Memory
- The device driver, also known as the EMM.SYS,
electronically readdresses the chips on the
expanded memory board. - The EMS page frame is a 64 KB unused area, in the
reserved area, created by combining the memory
cards first four 16 KB pages and addresses.
17LIM 3.2 Standard Expanded Memory
- EMS is the domain of DOS programs.
- It enables programs to use large amounts of data
without breaking the 640 KB barrier. - The first 4 16 KB pages are loaded into RAM.
- When other data was needed memory was swapped
- Data could be kept in expanded memory but
programs still ran in conventional memory
LIM Lotus, Intel, Microsoft
18Shadowing
- Shadowing is the process of copying the BIOS
routine from the ROM to the RAM at the same
address, and accessing the routine from the RAM. - This provides a much faster response from the
BIOS routine. - Shadowing can be enabled through the CMOS setup.
- It is safe and easy.
19A20 Wire
- 8086 used a 20-bit address bus created by using
two 16-bit registers (CS and IP). - The CPU placed a value in CS and one in IP
- The CPU then shifted the CS value to the left 4
bits and then added the value to the IP value to
create a 20-bit address (e.g. 124C changed to
124C0,then add to 0AE8 12FA8) - Why? For backward compatibility.
- What if CSFFFF and IPFFFF? Then CSIP10FFEF,
or 6 digits. 6 hex digits 6x424 bits. A
24-wire bus would be neededjust what the 286
processor had. - But to make the 286 100 compatible with the
8086, Microsoft masked off the 21st wire (the A20
wire)
20The High Memory Area
- The high memory area (HMA) is a tiny memory area
available only to 286 or higher processors. - The RAM chip must populate addresses above FFFFF
to use this area (the first 64KB of extended
memory)
21Extended Memory
- All memory above 1 MB is called extended memory
(XMS). - DOS cannot directly use XMS.
- DOS extenders are programs that exceed DOS
capabilities in order to access XMS. - Limulators are programs that electronically make
XMS act like EMS. - Why buy a 700 EMS card when a 40 limulation
program could turn XMS into EMS? Hence, EMS cards
became obsolete!
22Extended Memory
- The HIMEM.SYS device driver provides a standard
method for using the extended memory. - Himem.sys was written by Microsoft to provide a
consistent way of accessing extended memory - The DOSHIGH option moves most of the COMMAND.COM
files from the conventional memory into the HMA. - Upper memory blocks (UMBs) are unused memory
addresses in the reserved area.
23Reducing Conventional Memory Use
- The goal of DOS memory management is to reduce
the amount of conventional memory used by
applications other than the current running
application. - Adding device drivers to CONFIG.SYS and TSRs to
AUTOEXEC.BAT takes up conventional memory. - Moving the device drivers and TSRs to the HMA and
UMBs can reduce conventional memory usage.
24UMB Gateways/Memory Managers
- The UMB gateway is used for loading device
drivers and TSRs into the UMB, freeing
conventional memory. - EMM386.EXE is a UMB gateway that comes with every
version of DOS and Windows. - The UMB gateway is more popularly known as the
memory manager since it needs to inspect the
reserved area to stay clear of ROMs, video RAM,
and EMS page frames in the upper memory area.
25UMB Gateways/Memory Managers
- Memory managers only prepare the UMB for device
drivers and programs. - Loading is carried out by special commands that
are recognized by the memory manager. - The DEVICEHIGH command in CONFIG.SYS and
LOADHIGH command in AUTOEXEC.BAT are used for
loading device drivers and programs into the UMB.
26Limulation
- Limulators are programs that access XMS memory
and convert it to EMS memory. - EMM386.EXE is DOSs built-in limulator.
- Just add the following lines to config.sys
- Devicec\dos\himem.sys
- Devicec\dos\emm386.exe
- If you use devicec\dos\emm386.exe 1024, you
will limit the amount of XMS memory turned into
EMS memory - Or use devicec\dos\emm386.exe RAM to allow
emm386 to dynamically allocate EMS or XMS - Changing memory on the fly is called DOS
Protected Mode Interface (DPMI) - Or use devicec\dos\emm386.exe NOEMS to load
high but not limulate
27Loading High
- The DOSUMB command needs to be specified in
CONFIG.SYS for loading high. - EMM386 enables loading high as well as
limulating. - DOSHIGH loads part of DOS high
- You may combine as DOSHIGH,UMB
28Typical Startup Configurations
- Config.sys
- Devicec\dos\himem.sys
- Devicec\dos\emm386.exe RAM
- DOSHIGH,UMB
- Devicehighc\cdrom\oakcdrom.sys /DMSCD001
- Autoexec.bat
- _at_echo off
- Prompt pg
- smartdrv
- LH c\mouse\mouse.com
- LH c\dos\mscdex.exe /DMSCD001
29The MEM Command
- Command-line program used by DOS for checking
upper memory. - Shows the amount of conventional and UMB space
used and available. - /C and /P switches
30Mem /C
31Virtual Machine MS-DOS Mode
- The most common method of running a DOS
application in Windows is via a DOS virtual
machine, sometimes called running in a DOS box - AltEnter to run full screen
- The MS-DOS mode is a special mode supported by
Windows 9x to run DOS programs that cannot run in
a virtual machine. - Create the config.sys and autoexec.bat files you
need - Reboot in MS-DOS mode
32Virtual Machine
- The program information file (PIF) is a file
created by Windows in the event of any changes
being made to the settings in the DOS
applications properties.
33General Tab
34Program Tab
Makes the program think that it started in this
directory.
Used to start other programs that this program
may need.
35Font Tab
36Memory Tab
You almost never need to edit anything on this
screen. The protected box prevents Windows from
moving any memory to the swap file.
37Screen Tab
Saves the windows position and restores it the
next time you start the program.
Windows video driver will emulate the trivial
video calls used in DOS programs. Reserves the
entire video area for the DOS application.
38Misc Tab
Idle sensitivity will more quickly reduce the
timeslice given to the DOS app when not in
use. Exclusive mode permits mouse to function
only in DOS app. Fast pasting should be
unchecked if you loose characters when pasting
39Problematic DOS Programs
- Some DOS programs require special drivers or
TSRs, necessitating the need for a unique
CONFIG.SYS or AUTOEXEC.BAT for that program. - Windows 9x uses the MS-DOS mode, whereas Windows
2000 provides a method to create a unique
CONFIG.SYS and AUTOEXEC.BAT.
40Windows 2000s Method
- Advanced button on the Program tab brings up this
screen where you can customize the config.sys and
autoexec.bat file for the DOS program.
A nice way to slow down the computer for DOS
games.
41Windows 9x Method
- Some DOS program require direct access to
hardware and cannot run in Windows 2000 - Advanced button in the Program tab allows Windows
to suggest MS-DOS mode if the program tries to
access hardware directly at startup.
42(No Transcript)