MS-DOS: "Just Say No!" (OS/2: "The Nightmare Continues...") history -- a billion dollar lottery win for Bill Gates MS-DOS only runs on Intel 8088 and x86 architectures produced by Microsoft and Bill Gates for IBM's first PC, an 8088 with 64KB of memory and a 160 KB floppy disk MS-DOS design limited programs to 640KB of the 8088 1MB address space (rest was ROM and VRAM) PC architecture had no hardware memory protection, meaning user programs could "take over" the hardware, e.g. change interrupt vectors BIOS ROM contains terminal and disk device drivers MS-DOS designed as a single user system (no uid's) MS-DOS has used only the higher speed of the x86 chips (not the user/kernel mode, not the protection rings, not the multitasking, not the 16MB of memory) IBM and Microsoft fought big battle over OS/2; Microsoft abandoned it for Windows and Windows-NT versions, Fig 8-1 version 6 of MS-DOS out after textbook was published overview user interface, command format, Fig 8-2 shell no background processes drive e.g. A: is part of file path names shell expands wildcard * and ? for internal commands but does not for external commands replace *.c *.old is not "nearly impossible" in UNIX, viz. using csh foreach i (*.c) mv $i $i:r.old end fundamental concepts processes parent and child cannot run in parallel (command interpreter waits for commands to finish) first 256 bytes of a process are Program Segment Prefix containing program size, file descriptor table, cntl-C handler address, pointer to parent PSP child inherits open files and file positions terminate-and-stay-resident programs, what a concept! (Fig 8-5) when a process exits, do not reclaim its memory the process can install some of its own interrupt handlers before exiting when "hotkey" is struck, code inside the dead process is executed memory management, 8088 memory architecture registers in 8088, Fig 8-6 segment registers CS, DS, SS, ES hold 16-bit addresses programs have 4 64KB segments segment registers are shifted left 4 bits before being added to program addresses or pointer registers, giving a 20-bit memory address, Fig 8-7(a) high memory, upper memory, extended memory, expanded memory, what could be next? (Fig 8-7(b)) conventional memory: 0KB -> 640KB upper memory area: 640KB -> 1MB (ROM, VRAM) high memory area: 1MB -> 1MB+(64KB-16B) (recognized by 286, MS-DOS can be put here) extended memory: 1MB+(64KB-16B) -> 16MB (RAM disks and buffer cache) memory models, Fig 8-8 manual software overlays, Fig 8-9 bank switching (expanded memory) used on 8088, Fig 8-10 (answer to #9, p. 142 on top p. 339) memory management techniques summary, Fig 8-11 file system, Fig 8-12 input/output character special files con, com1, lpt1, nul cooked and raw modes stdin, stdout, stderr user installable device drivers, Fig 8-13 system calls, Fig 8-14 process management, no separate fork and exec memory management files and directories input and output implementation: BIOS, kernel, command interpreter BIOS supplied by manufacturer and contains device drivers kernel handles machine-independent process management, memory management, file system, system call interface, traps to BIOS after booting, memory looks like Fig 8-15 processes, PSP's are chained by backward pointer to parent (no process table) memory management, search arenas for free one big enough, Fig 8-16 file system hard disk layout, Fig 8-18 p. 352 boot stuff doesn't differentiate between primary and secondary boot sectors; see p. 347-348 for more clues FAT layout, Fig 8-19 directory entry layout, Fig 8-20 (hard links are not possible) input/output character special and block special files driver layout, Fig 8-21