Sie sind auf Seite 1von 5

Assemblers Assemblers need to translate assembly instructions and pseudo-instructions into machine instructions Convert decimal numbers, etc.

tc. specified by programmer into binary Typically, assemblers make two passes over the assembly file First pass: reads each line and records labels in a symbol table Second pass: use info in symbol table to produce actual machine code for each line Assembler is the step comes in between a source code and .exe file.the steps are like this Source code-Preprocessor-->compiler(Assemble code)-->Assembler(Object Code)-->Libraries linking->executable files created. "The assembler creates object code. Linker Tool that merges the object files produced by separate compilation or assembly and creates an executable file Three tasks Searches the program to find library routines used by program, e.g. printf(), math routines, Determines the memory locations that code from each module will

occupy and relocates its instructions by adjusting absolute references Resolves references among files Loader Part of the OS that brings an executable file residing on disk into memory and starts it running Steps Read executable files header to determine the size of text and data segments Create a new address space for the program Copies instructions and data into address space Copies arguments passed to the program on the stack Initializes the machine registers including the stack ptr Jumps to a startup routine that copies the programs arguments from the stack to registers and calls the programs main routine spooling Acronym for simultaneous peripheral operations on-line, spooling refers to putting jobs in a buffer, a special area in memory or on a disk where a device can access them when it is ready. Spooling is useful because devices access data at different rates. The buffer provides a waiting station where

data can rest while the slower device catches up. The most common spooling application is print spooling. In print spooling, documents are loaded into a buffer (usually an area on a disk), and then the printer pulls them off the buffer at its own rate. Because the documents are in a buffer where they can be accessed by the printer, you can perform other operations on the computer while the printing takes place in the background. Spooling also lets you place a number of print jobs on a queue instead of waiting for each one to finish before specifying the next one.

temporarily stopped running to let another process run. Terminated state: The process has finished execution.

Process Control Block A process in an operating system is represented by a data structure known as a process control block (PCB) or process descriptor. The PCB contains important information about the specific process including

New State: The process being created. Running State: A process is said to be running if it has the CPU, that is, process actually using the CPU at that particular instant. Blocked (or waiting) State: A process is said to be blocked if it is waiting for some event to happen such that as an I/O completion before it can proceed. Note that a process is unable to run until some external event happens. Ready State: A process is said to be ready if it use a CPU if one were available. A ready state process is runable but

The current state of the process i.e., whether it is ready, running, waiting, or whatever. Unique identification of the process in order to track "which is which" information. A pointer to parent process. Similarly, a pointer to child process (if it exists). The priority of process (a part of CPU scheduling information). Pointers to locate memory of processes. A register save area. The processor it is running on.

The PCB is a certain store that allows the operating systems to locate key information about a process. Thus, the PCB is the data structure that defines a process to the operating systems. Context Switching n Stopping one process and starting

another is called a context switch l When the OS stops a process, it stores the hardware registers (PC, SP, etc.) and any other state information in that process PCB l When OS is ready to execute a waiting process, it loads the hardware registers (PC, SP, etc.) with the values stored in the new process PCB, and restores any other state information l Performing a context switch is a relatively expensive operation n However, time-sharing systems may do 1001000 context switches a second n Why so often? n Why not more often? Schedulers n Long-term scheduler (job scheduler) l Selects job from spooled jobs, and loads it into memory l Executes infrequently, maybe only when process leaves system l Controls degree of multiprogramming n Goal: good mix of CPU-bound and I/Obound processes

l Doesnt really exist on most modern timesharing systems n Medium-term scheduler l On time-sharing systems, does some of what long-term scheduler used to do l May swap processes out of memory temporarily l May suspend and resume processes l Goal: balance load for better throughput Short-term scheduler (CPU scheduler) l Executes frequently, about one hundred times per second (every 10ms) l Runs whenever: n Process is created or terminated n Process switches from running to blocked n Interrupt occurs l Selects process from those that are ready to execute, allocates CPU to that process l Goals: n Minimize response time (e.g., program execution, character to screen) n Minimize variance of average response time predictability may be important n Maximize throughput Minimize overhead (OS overhead, context

switching, etc.) Efficient use of resources n Fairness share CPU in an equitable fashion Time-sharing is the sharing of a computing resource among many users by means of multiprogramming and multitasking. By allowing a large number of users to interact concurrently with a single computer, time-sharing dramatically lowered the cost of providing computing capability, made it possible for individuals and organizations to use a computer without owning one, and promoted the interactive use of computers and the development of new interactive applications. Refers to buffering:as reading and writing data from hdd takes long time.so to improve the speed for data processing the data next required by processor is stored is cache memory or cpu register.for e.g. to cut certain line from text file to copy into another file.cut data get stored in to buffer (cpu register) to get back stored into another file. In computing, a buffer is a region of memory used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device (such as a keyboard) or just before it is

sent to an output device (such as a printer). However, a buffer may be used when moving data between processes within a computer. This is comparable to buffers in telecommunication. Buffers can be implemented in either hardware or software, but the vast majority of buffers are implemented in software. Buffers are typically used when there is a difference between the rate at which data is received and the rate at which it can be processed, or in the case that these rates are variable, for example in a printer spooler. Multitasking and multiprocessing are closely related terms that are easily confused. Multitasking is an operating-system technique for sharing a single processor among multiple threads of execution. Multiprocessing refers to computers with more than one processor. A multiprocessing computer can execute multiple threads simultaneously, one thread for each processor in the computer. A multitasking operating system only appears to execute multiple threads at the same time; a multiprocessing operating system actually does so. A thread is a single sequence stream within in a process.

User-Level Threads User-level threads implement in user-level libraries, rather than via systems calls, so thread switching does not need to call operating system and to cause interrupt to the kernel. In fact, the kernel knows nothing about user-level threads and manages them as if they were single-threaded processes. Kernel-Level Threads In this method, the kernel knows about and manages the threads. No runtime system is needed in this case. Instead of thread table in each process, the kernel has a thread table that keeps track of all threads in the system. In addition, the kernel also maintains the traditional process table to keep track of processes. Operating Systems kernel provides system call to create and manage threads.

Das könnte Ihnen auch gefallen