The Great Symbian

Anything under the sun goes here!

Showing posts with label OS2. Show all posts
Showing posts with label OS2. Show all posts

Computer programs must be in main memory (also called random-access memory or RAM) to be executed. Main memory is the only large storage area(millions to billions of bytes) that the processor can access directly. It is implemented in a semiconductor technology called dynamic random-access memory (DRAM), which forms an array of memory words. Each word has its own address. Interaction is achieved through a sequence of load or store instructions to specific memory addresses. The load instruction moves the content of a register to main memory. Aside from explicit loads and stores, the CPU automatically loads instructions from main memory for execution.

Direct Memory Access (DMA) Structure
• Used for high-speed I/O devices able to transmit information at close to memory speeds.
• Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention.
• Only one interrupt is generated per block, rather than the one interrupt per byte.




• When executing in kernel mode, the operating system has unrestricted access to both kernel and user’s memory.


• The load instructions for the base and limit registers are privileged instructions.






<--DUAL MODE OPERATION -->




• Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly.


• Provides hardware support to differentiate between at least two modes of operations.


1. User mode – execution done on behalf of a user.


2. Kernel mode (also monitor mode, supervisor mode or system mode) – execution done on behalf of operating system.




• Mode bit added to computer hardware to indicate the current mode: kernel (0) or user (1).• When an interrupt or fault occurs hardware switches to kernel mode.




• Privileged instructions can be issued only in kernel mode.


<--I/O PROTECTION-->


• All I/O instructions are privileged instructions.

• Given the I/O instructions are privileged, how does the user program perform I/O?



• System call


– the method used by a process to request action by the operating system.

– Usually takes the form of a trap to a specific location in the interrupt vector.

– Control passes through the interrupt vector to a service routine in the OS, and the mode bit is set to kernel mode.

– The kernel verifies that the parameters are correct and legal, executes the request, and returns control to the instruction following the system call.


<--Use of a System Call to Perform an I/O-->


• Must ensure that a user program could never gain control of the computer in kernel mode. Otherwise, undesirable actions can be done e.g. a user program that, as part of its execution, stores a new address in the interrupt vector.

<--MEMORY PROTECTION-->

• Must provide memory protection at least for the interrupt vectorand the interrupt service routines.

• In order to have memory protection, add two registers that determine the range of legal addresses a program may access:

– Base Register – holds the smallest legal physical memory address.

– Limit Register – contains the size of the range

• Memory outside the defined range is protected.

<--CPU PROTECTION-->

• Timer

– interrupts computer after specified period to ensure operating system maintains control.

– Timer is decremented every clock tick.

– When timer reaches the value 0, an interrupt occurs.

• Timer commonly used to implement time sharing.

• Time also used to compute the current time.

• Load-timer is a privileged instruction.

• Storage systems organized in hierarchy.
– Speed
– Cost
– Size
– Volatility



<--STORAGE HEIRARCHY(MEMORY HEIRARCHY)-->





Click here to see full image size


• Caching – copying information into faster storage system; main memory can be viewed as a cache for secondary storage.

–improve performance where a large access-time or transfer-rate disparity exists between two components) Memory caching: add cache (faster and smaller memory) between CPU and main memory

--> When need some data, check if it’s in cache

-->If yes, use the data from cache

--> If not, use data from main memory and put a copy in cache

– Disk caching: main memory can be viewed as a cache for disks

<--Cache Coherency and Consistency-->
• Cache coherency in multiprocessor systems
- Each CPU has a local cache
- A copy of X may exist in several caches --> must make sure that an update of X in one cache is immediately reflected in all other caches where X resides
- Hardware problem
• Cache consistency in distributed systems
- A master copy of the file resides at the server machine
- Copies of the same file scattered in caches of different client machines
- Must keep the cached copies consistent with the master file
- OS problem

• Main Memory – only large storage media that the CPU can access directly.
• Secondary Storage – extension of main memory that provides large nonvolatile storage capacity.
• Magnetic Disks
– rigid metal or glass platters covered with magnetic recording material.
– Disk surface is logically divided into tracks, which are subdivided into sectors.
– The disk controller determines the logical interaction between the device and the computer.
-->>Moving Head Mechanism

• Magnetic Tapes

Magnetic tape is a medium for magnetic recording generally consisting of a thin magnetizable coating on a long and narrow strip of plastic. Nearly all recording tape is of this type, whether used for recording audio or video or for computer data storage. It was originally developed in Germany, based on the concept of magnetic wire recording. Devices that record and playback audio and video using magnetic tape are generally called tape recorders and video tape recorders respectively. A device that stores computer data on magnetic tape can be called a tape drive, a tape unit, or a streamer.
Magnetic tape revolutionized the broadcast and recording industries. In an age when all radio (and later television) was live, it allowed programming to be prerecorded. In a time when gramophone records were recorded in one take, it allowed recordings to be created in multiple stages and easily mixed and edited with a minimal loss in quality between generations. It is also one of the key enabling technologies in the development of modern computers. Magnetic tape allowed massive amounts of data to be stored in computers for long periods of time and rapidly accessed when needed.
Today, many other technologies exist that can perform the functions of magnetic tape. In many cases these technologies are replacing tape. Despite this, innovation in the technology continues and tape is still widely used.

Device-status table contains entry for each I/O deviceindicating its type, address, and state.


<--DEVICE STATUS TABLE-->

Click here to see full size of image

• Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly
• Provides hardware support to differentiate between at least two modes of operations.
1. User mode – execution done on behalf of a user.
2. Kernel mode (also monitor mode, supervisor mode or system mode) – execution done on behalf of operating system.

  • Interrupts and Traps. A great deal of the kernel consists of code that is invoked as the result of a interrupt or a trap.
  • While the words "interrupt" and "trap" are often used interchangeably in the context of operating systems, there is a distinct difference between the two.
  • An interrupt is a CPU event that is triggered by some external device.
  • A trap is a CPU event that is triggered by a program. Traps are sometimes called software interrupts. They can be deliberately triggered by a special instruction, or they may be triggered by an illegal instruction or an attempt to access a restricted resource.
    When an interrupt is triggered by an external device the hardware will save the the status of the currently executing process, switch to kernel mode, and enter a routine in the kernel.
  • This routine is a first level interrupt handler. It can either service the interrupt itself or wake up a process that has been waiting for the interrupt to occur.
    When the handler finishes it usually causes the CPU to resume the processes that was interrupted. However, the operating system may schedule another process instead.
    When an executing process requests a service from the kernel using a trap the process status information saved, the CPU is placed in kernel mode, and control passes to code in the kernel.
  • This kernel code is called the system service dispatcher. It examines parameters set before the trap was triggered, often information in specific CPU registers, to determine what action is required. Control then passes to the code that performs the desired action.
    When the service is finished, control is returned to either the process that triggered the trap or some other process.
  • Traps can also be triggered by a fault. In this case the usual action is to terminate the offending process. It is possible on some systems for applications to register handlers that will be evoked when certain conditions occur -- such as a division by zero.

1.) BOOTSTRAP PROGRAM
--> Code stored in ROM that is able to locate the kernel, load it into memory, and start its execution
--> In computing, booting is a bootstrapping process that starts operating systems when the user turns on a computer system.
Most computer systems can only execute code found in the memory (ROM or RAM); modern operating systems are mostly stored on hard disk drives, LiveCDs and USB flash drive. Just after a computer has been turned on, it doesn't have an operating system in memory. The computer's hardware alone cannot perform complicated actions of the operating system, such as loading a program from disk on its own; so a seemingly irresolvable paradox is created: to load the operating system into memory, one appears to need to have an operating system already installed.

FEEDS

Add to Google Reader or Homepage

Click2Sell

Buy

How To Learn Photoshop in Just 2 Hrs

Chatbox

Click Here

About this blog