Design DOS




1 design

1.1 boot sequence
1.2 file system

1.2.1 drive naming scheme
1.2.2 reserved device names


1.3 memory management
1.4 dos under os/2 , windows





design

all ms-dos-type operating systems run on machines intel x86 or compatible cpus, ibm pc , compatibles. machine-dependent versions of ms-dos produced many non-ibm-compatible x86-based machines, variations relabelling of microsoft distribution under manufacturer s name, versions designed work non-ibm-pc-compatible hardware. long application programs used dos apis instead of direct hardware access, thereby run on non-ibm-pc compatible machines. in 1985, digital research had version of concurrent dos 68k use on motorola 68000 cpus, , original freedos kernel dos-c derived dos/nt, motorola cpus, in 1990s. while these systems resembled dos architecture, applications not binary compatible due incompatible instruction sets of these non-x86-cpus. however, applications written in high-level languages ported easily.


dos single-user, single-tasking operating system basic kernel functions non-reentrant: 1 program @ time can use them , dos has no functionality allow more 1 program execute @ time. dos kernel provides various functions programs (an application program interface), character i/o, file management, memory management, program loading , termination.


dos default provides primitive ability shell scripting, via batch files (with filename extension .bat). these text files can created in text editor. executed in same fashion compiled programs, , run each line of batch file command. batch files can make use of several internal commands, such goto , conditional statements. gosub , simple arithmetic supported dr dos command.com third-party shells 4dos; however, no real form of programming enabled.


the operating system offers application programming interface allows development of character-based applications, not accessing of hardware, such graphics cards, printers, or mice. required programmers access hardware directly, resulting in each application having own set of device drivers each hardware peripheral. hardware manufacturers release specifications ensure device drivers popular applications available.


boot sequence

the bootstrap loader on pc-compatible computers (mbr or boot sector) located @ track zero, first sector on disk. rom bios load sector memory @ address 0000h:7c00h, , typically check signature 55h aah @ offset +1feh. if sector not considered valid, rom bios try next physical disk in row, otherwise jump load address registers set up.
if loaded boot sector happens master boot record (mbr), found on partitioned media, relocate 0000h:0600h in memory, otherwise step skipped. mbr code scan partition table, located within sector, active partition (modern mbrs check if bit 7 set @ offset +1beh+10h*n, whereas old mbrs check value of 80h), and, if found, load first sector of corresponding partition, holds volume boot record (vbr) of volume, memory @ 0000h:7c00h in similar fashion had been loaded rom bios itself. mbr pass execution loaded portion registers set up.
the sector content loaded @ 0000h:7c00h constitutes vbr now. vbrs operating system specific , cannot exchanged between different dos versions in general, exact behaviour differs between different dos versions. in old versions of dos such dos 1.x, vbr load whole io.sys/ibmbio.com file memory @ 0000h:0600h. work, these sectors had stored in consecutive order on disk sys. in later issues, locate , store contents of first 2 entries in root directory @ 0000h:0500h , if happen reflect correct boot files recorded in vbr, vbr load first 3 consecutive sectors of io.sys/ibmbio.com file memory @ 0070h:0000h. vbr has take care preserve contents of disk parameter table (dpt). finally, passes control loaded portion jumping entry point registers set (with considerable differences between different dos versions).
in modern dos versions, vbr has loaded first 3 sectors of io.sys/ibmbio.com file memory, loaded portion contains boot loader, load remainder of memory, using root directory information stored @ 0000h:0500h. versions, file contents still need stored in consecutive order on disk. in older versions of dos, still loaded whole, step skipped.
the dos system initialization code initial builtin device drivers , load dos kernel, located in msdos.sys on ms-dos systems, memory well. in windows 9x, dos system initialization code , builtin device drivers , dos kernel combined single io.sys file while msdos.sys used text configuration file.
the config.sys file read parse configuration parameters. shell variable specifies location of shell defaults command.com.
the shell loaded , executed.
the startup batch file autoexec.bat run shell.

the dos system files loaded boot sector must contiguous , first 2 directory entries. such, removing , adding file render media unbootable. is, however, possible replace shell @ will, method can used start execution of dedicated applications faster. limitation not apply version of dr dos, system files can located anywhere in root directory , not need contiguous. therefore, system files can copied disk provided boot sector dr dos compatible already.


in pc dos , dr dos 5.0 , above, dos system files named ibmbio.com instead of io.sys , ibmdos.com instead of msdos.sys. older versions of dr dos used drbios.sys , drbdos.sys instead.


starting ms-dos 7.0 binary system files io.sys , msdos.sys combined single file io.sys whilst msdos.sys became configuration file similar config.sys , autoexec.bat. if msdos.sys bootgui directive set 0, boot process stop command processor (typically command.com) loaded, instead of executing win.com automatically.


file system

dos uses filesystem supports 8.3 filenames: 8 characters filename , 3 characters extension. starting dos 2 hierarchical directories supported. each directory name 8.3 format maximum directory path length 64 characters due internal current directory structure (cds) tables dos maintains. including drive name, maximum length of qualified filename dos supports 80 characters using format drive:\path\filename.ext followed null byte.


dos uses file allocation table (fat) filesystem. fat12 supported 4078 clusters per drive. dos 3.0 added support fat16 used 16-bit allocation entries , supported 65518 clusters per drive. dos 3.31 added support fat16b removed 32 mb drive limit , support 2 gb. ms-dos 7.1 (the dos component of windows 9x) added support fat32 used 32-bit allocation entries , support hard drives 137 gb , beyond.


starting dos 3.1, file redirector support added dos. used support networking later used support cd-rom drives mscdex. ibm pc dos 4.0 had preliminary installable file system (ifs) support unused , removed in dos 5.0.


drive naming scheme

in dos, drives referred identifying letters. standard practice reserve , b floppy drives. on systems 1 floppy drive dos assigns both letters drive, prompting user swap disks programs alternate access between them. facilitates copying floppy floppy or having program run 1 floppy while accessing data on another. hard drives assigned letters c , d . dos support 1 active partition per drive. support more hard drives became available, developed first assigning drive letter each drive s active primary partition, making second pass on drives allocate letters logical drives in extended partition, third pass give other non-active primary partitions names (where such additional partitions existed , contained dos-supported file system). lastly, dos allocates letters optical disc drives, ram disks, , other hardware. letter assignments occur in order drivers loaded, drivers can instruct dos assign different letter; drivers network drives, example, typically assign letters nearer end of alphabet.


because dos applications use these drive letters directly (unlike /dev directory in unix-like systems), can disrupted adding new hardware needs drive letter. example addition of new hard drive having primary partition pre-existing hard drive contains logical drives in extended partitions; new drive assigned letter assigned 1 of extended partition logical drives. moreover, adding new hard drive having logical drives in extended partition still disrupt letters of ram disks , optical drives. problem persisted through microsoft s dos-based 9x versions of windows until replaced versions based on nt line, preserves letters of existing drives until user changes them. under dos, problem can worked around defining subst drive , installing dos program logical drive. assignment of drive changed in batch job whenever application starts. under versions of concurrent dos, under multiuser dos, system manager , real/32, reserved drive letter l: automatically assigned corresponding load drive whenever application starts.


reserved device names

there reserved device names in dos cannot used filenames regardless of extension occupied built-in character devices. these restrictions affect several windows versions, in cases causing crashes , security vulnerabilities.


the reserved names are: con (for console), aux (for auxiliary), prn (for printer) , lst (for lister), introduced 86-dos 0.74. 86-dos 1.10 , pc dos 1.0 added nul. except lst continued supported in versions of ms-dos, pc dos , dr-dos ever since. lst available in oem versions of ms-dos 1.25, whereas other oem versions of ms-dos 1.25 used lpt1 (first line printer) , com1 (first serial communication device) instead, introduced pc dos. in addition lpt1 , lpt2 com1 com3, hewlett-packard s ms-dos 2.11 hp portable plus supported lst alias lpt2 , 82164a alias com2; supported plt plotters. otherwise, com2, lpt2, lpt3 , clock$ (still named clock in issues of ms-dos 2.11) clock device introduced dos 2.0, , com3 , com4 added dos 3.3. multitasking ms-dos 4 supported keybd$ , screen$. dr dos 5.0 , higher , multiuser dos support $idle$ device dynamic idle detection saving power , improve multitasking. lpt4 optional built-in driver fourth line printer supported in versions of dr-dos since 7.02. config$ constitutes real mode pnp manager in ms-dos 7.0-8.0.


aux typically defaults com1, , prn lpt1 (lst), these defaults can changed in versions of dos point other serial or parallel devices. plt reconfigurable well.


filenames ended colon (:) such nul: conventionally indicate device names, colon not part of name of built-in device drivers. colons not necessary typed in cases, example:



it still possible create files or directories using these reserved device names, such through direct editing of directory data structures in disk sectors. such naming, such starting file name space, has been used viruses or hacking programs obscure files users not know how access these locations.



memory management

dos designed intel 8086/8088 processor , therefore directly access maximum of 1 mb of ram. due pc architecture maximum of 640 kb (known conventional memory) available upper 384 kb reserved.


specifications developed allow access additional memory. first expanded memory specification (ems) allowed memory on add-on card accessed via 64 kb page frame in reserved upper memory area. 80386 , later systems use virtual 8086 mode (v86) mode memory manager emm386 create expanded memory extended memory without need of add-on card. second specification extended memory specification (xms) 80286 , later systems. provided way copy data , extended memory, access 65520-byte high memory area (hma) directly above first megabyte of memory , upper memory block (umb) area. xms support provided himem.sys or v86 mode memory manager qemm or 386max supported ems.


starting dos 5, dos directly take advantage of hma loading kernel code , disk buffers there via dos=high statement in config.sys. dos 5+ allowed use of available umbs via dos=umb statement in config.sys.


dos under os/2 , windows

the dos emulation in os/2 , windows runs in same way native applications do. can access of drives , services, , can use host s clipboard services. because drivers file systems , such forth reside in host system, dos emulation needs provide dos api translation layer converts dos calls os/2 or windows system calls. translation layer converts bios calls , virtualizes common i/o port accesses many dos programs commonly use.


in windows 3.1 , 9x, dos virtual machine provided winoldap. winoldap creates virtual machine based on program s pif file, , system state when windows loaded. dos graphics mode, both character , graphic, can captured , run in window. dos applications can use windows clipboard accessing published calls in winoldap, , 1 can paste text through winoldap graphics.


the emulated dos in os/2 , windows nt based upon dos 5. although there default configuration (config.sys , autoexec.bat), 1 can use alternate files on session-by-session basis. possible load drivers in these files access host system, although these typically third-party.


under os/2 2.x , later, dos emulation provided doskrnl. file represents combined ibmbio.com , ibmdos.com, system calls passed through os/2 windowing services. dos programs run in own environment, bulk of dos utilities provided bound dos / os2 applications in \os2 directory. os/2 can run windows 3.1 applications using modified copy of windows (win-os/2). modifications allow windows 3.1 programs run seamlessly on os/2 desktop, or 1 can start winos/2 desktop, similar starting windows dos.


os/2 allows dos drive a: , (vmdisk). real dos, ms-dos 6.22 or pc dos 5.00. 1 makes bootable floppy disk of dos, add number of drivers os/2, , creates special image. dos booted way has full access system, provides own drivers hardware. 1 can use such disk access cdrom drives there no os/2 driver.


in windows nt (2000, xp, vista, 7), dos emulation provided way of virtual dos machine (ntvdm). dos files reside in ntio.sys , ntbio.sys usual, run in virtual machine provided ntvdm. character input passed console session launched dos program. allows 1 use cli features such pipes , redirection between dos , windows nt. os/2 emulation in nt , 2000 similar, no virtual machine loaded: handled os2ss.exe , os2.exe.


64-bit versions of windows not support ntvdm , cannot run 16-bit dos applications directly; third-party emulators such dosbox can used run these programs.








Comments

Popular posts from this blog

Discography Ole Paus

Gaeta class Lerici-class minehunter

Driver.27s licenses used for identification purposes Driver's license