Operating Systems


Transient vs Resident


Resident portion: must be in memory at all times when the computer is on.

Transient portion: only works when you're talking to the OS.

For example, command.com interprets the commands you type. It must be transient (it only works when you type the commands).

On the other hand, msdos.sys and mio.sys are hidden files. They are responsible for I/O and reading from disks. They are resident (always running).

 

Architecture


Upon startup, the resident portion of memory is loaded from zero (0) up. It writes a number in a memory location to tell you how much memory you have. The transient portion is loaded from 256 down. You can work in the free space between the resident and the transient programs. When you run a program, the resident program finds it on disk and loads it over the transient portion down. When the program exits, it tells the resident portion to reload the transient program. As a result of this setup, any DOS program is limited to 640K (conventional memory). This also applied to Win3.1 programs because it is just a DOS shell. Neither Unix nor Win95 are bound by 640K because they are not DOS based (even though they run over it).

Apple was able to talk to 64K but wanted to talk to 128K. So it used Bank Switching. They installed memory in the extended memory (above 1M) and pages in conventional memory. Depending on which cycle of the clock it is, a certain piece of information from extended memory is pushed into the pages. The memory above 1M that's given virtual addresses using bank switches is called extended memory, run by an EMM (Extended Memory Manager). They are not physically addressable by the CPU, and are good to use when running DOS programs. Windows3.1 includes an EMM.

Windows95 uses a flat architecture and does not rely on DOS, so the CPU can talk to all memory software drivers. All drivers are loaded at bootup (before Win95) and are operating system independent. So, they must run in the lower conventional memory area but don't know what system will be used. These are called Real Mode Drivers. The OS can relocated the drivers to make more room in conventional memory. Notice that there was extra space between the 640K and 1M because IBM set up the space for two monitor drivers. This is in high memory. If you have a driver that fits exactly in that space, you can put it in the high memory and the OS can free up the high memory when needed.

 

Interrupts


An interrupt is the ability of a processor to react to events that occur at unscheduled intervals. There are two types of interrupts, a software interrupt and a hardware interrupt.

Software interrupt/polling: the CPU is constantly looking to see if something needs attention (checks 18 times per second). It stores information, handles the clock, retrieves information etc. If another interrupt comes and it's more urgent, it puts away the first job and works on the second job. When the second job is done, it goes back to the first job. This is managed with an Interrupt Stack - when a new interrupt comes, you push the stack and pop the stack when you're finished. Too many jobs may cause stack overflow.

Hardware interrupt: there's a pin on the CPU that informs the CPU that a device wants its attention. There is a 16-bit interrupt register and each bit represents a different interrupt. When a device wants the CPU's attention, it sets its flag on so the CPU knows who's asking.

 

Processing Modes


Multitasking: multiple tasks, one CPU

Multiprocessing: multiple tasks, multiple CPUs

With parallel processing with multitasking, It appears that the CPUs are working at the same time. With multiprocessing, the CPUs are actually working at the same time. WindowsNT and Unix are multi user, multitasking Operating systems Window95 and Window3.1 are single user, multitasking Operating systems DOS is a single user, single tasking Operating System

Real Mode: when dealing with a single program on a single processor, only one thing is happening at a time. When a program makes a call to a memory location, the CPU goes to the exact memory location (the address is a real address). In real mode, it's the job of the software to manage the storage.

Protected Mode (80286): The CPU manages a memory table map. It does not give the actual addresses. A program runs in a specific area of memory and when it asks the CPU for memory, the CPU decides where that program's memory location should be. This is faster because you're working with the CPU and it's safer because the CPU will not allow two programs to access the same location (which can crash the system)

 

How the CPU Handles Requests


Time slicing: Every user is given a small fraction of time in a round robin fashion. Each individual program is given a fixed set of time and if it needs more time, the system gets messed up. There's no prioritizing.

Cooperative multitasking: (Win3.1) This assumes a fixed amount of time and you can get more time if you need it. If another program needs it, they can get the time and stop the other program. The Operating is in charge of allocating time (both in real and protected more, because those modes only deal with managing memory, not time)

Pre-emptive multitasking: Every job runs, but when a certain job needs more time, it takes it from all the other programs until it's finished.

Virtual 8086 mode(IBM mainframes): For every person who wants to use a machine, the Operating System sets up a virtual machine (memory, printer, monitor etc.). The OS simulates the virtual machine configured for each user. IF you crash your machine or your program needs to take a lot of time, it does not affect the other machines. Each task has its own CPU. The CPU manages the time (Win95 uses this idea). It uses RAM (physical memory) and disk swapping (logical memory - the CPU acts as if it has more RAM than it actually does). Four layers/rings are created. The lower the ring, the more access it has to the CPU. Ring 0 can get to the actual CPU. Rings 1-2 (operating system) allows inter-virtual machine communication Ring 3 (software programs) have no access, completely virtual machines A deadlock occurs when two programs both need the hard disk and can't communicate with each other. If two programs want to make changes on the same memory location, there will be a problem.

RISC vs CISC


CISC: complex instruction set computers (and, or, add, sub, mult, div instructions)

RISC: reduced instruction set computers (and, or instructions)

Microcode- programs or instructions that are implemented in hardware. There is a bug when the microcode is incorrect. Firmware is software that has been implemented in hardware. In CISC, the philosophy of the CPU is to put more things in the microcode. There are 300+ basic instructions (usually 10% of the instructions are used 90% of the time) RISC computers only have the 10% most frequently used instructions. This makes things runs much faster.

 

Arithmetic Logic Unit


ALU: The 8088, 80286, and 80386 did integer arithmetic. The compiler had to translate real numbers for you. To do real number arithmetic, you could buy 8087, 80287, and 80387 coprocessors (floating computation chips). This made arithmetic faster than a simulation. The 80486DX has an 80487 built into it. Intel also makes the 80486SX (80486 without a floating point processor) and sells it at a lower price. If an 80486SX needs floating point computation, one can buy an 80487 chip which was just the 80486DX (and disabled the 80486SX chip). Intel caused all this confusion to make more money.

 

DOS, Windows 3.1, Windows 95


DOS can only run one program at a time and is text oriented. A DOS shell runs over DOS which is GUI oriented - desktop metaphor begins. DOS can fool you into thinking that more than one program is running at a time but it's only giving attention to one program at a time. Windows3.1 is a DOS shell with GUI. It uses multitasking.

Windows 95 loads on top of most of DOS. It allows you to run many programs at a time. DOS can run in Windows 95 like any other application. In this OS, Windows 95 is not a DOS shell and is completely detached from DOS. When you're in MS-DOS mode, Win95 is not unloaded from memory, a part of Win95 is running under DOS.

Windows NT does away with DOS completely.

Advantages of Windows:

1. GUI

2. Multitasking

3. Memory management is handles by windows directly.

4. Application Device independence. (The word processor writes to Windows and Windows provides the device drivers. The programmer does not have to write code for every printer)

5. Consistent user interface (makes things easier to use)

6. Interprocess Communication. One program communicates with another program directly.



The LAN Operating System


The LAN operating system is several pieces of software, a part of which resides in each LAN component's of RAM. In a peer-to-peer LAN, all PCs are equals. Any PC can be a client to another PC or any PC can share its resources with its peers. Peer-to -peer LANs are easy to install and maintain. They are usually used when you have small number of PCs involved. (2 to 20) One popular per-to-peer operating system is Microsoft's Windows for Workgroups. In LANs with dedicated servers, the controlling software resides in the file server's RAM. An example of a popular LAN operating systems is Novell's Netware.

LANs and groupware provide the foundation for workgroup computing. Groupware- is software whose applications used to benefit a group of people. Workgroup computing includes any application that involves groups of people linked by a computer network. Workgroup computing applications include: E-mail, Calendar and scheduling,electronic conferencing, etc.

 

Back to Menu