Anda di halaman 1dari 3

August 2010 Bachelor of Computer Application (BCA) Semester 4 BC0051 System Software

(Assignment Set 2 (60 Marks)

1. Explain the basic functions of loader. Ans: An operating system utility that copies programs from a storage device to main memory, where

they can be executed. In addition to copying a program into main memory, the loader can also replace virtual addresses with physical addresses. Most loaders are transparent, i.e., you cannot directly execute them, but the operating system uses them when necessary. A binary object file is either an executable file that runs on a particular machine or a file containing object code that needs to be linked. The object code (or executable code) is generated by a compiler or a by an assembler. Fig. 6.0 shows the object code generation process.

Object Code Generation An object file program has the following environment characteristics (attributes): 1. The machine architecture that it runs on, 2. Its operating system, 3. And the Binary File Format (BFF) its structure. Throughout this thesis, when referring to a binary object file, its attributes are specified with the triplet (Machine, OS, BFF); for example (x86, DOS, EXE) describes the environment where a binary program runs on the Intel x86 machine under the DOS operating system and has the EXE file format. 2. What is binding ? explain static binding. Ans: A binding is the association of an attribute of a program entity with a value. Binding time is the time at which a binding is performed. Thus the type attribute of variable var is bound to type, when its declaration is processed. The size attribute of type is bound to a value sometime prior to this binding. We are interested in the following binding times: 1. Language definition time of L 2. Language implementation time of L 3. Compilation time of P 4. Execution init time of proc 5. Execution time of proc. where L is a programming language, P is a program written in L and proc is a procedure in P. Note that language implementation time is the time when a language translator is designed. The preceding list of binding times is not exhaustive; other binding times can be defined, viz. binding at the linking time of P. The language definition of L specifies binding times for the attributes of various entities of a programs written in L. Static Binding : A static binding is a binding performed before the execution of a program begins

3. What is real-time operating system? Explain in brief. Ans: A Real Time Operating System (RTOS) is an operating system that guarantees a certain capability within a specified time constraint. For example, an operating system might be designed to ensure that a certain object was available for a robot on an assembly line. In what is usually called a "hard" real-time operating system, if the calculation could not be performed for making the object available at the designated time, the operating system would terminate with a failure. In a "soft" real-time operating system, the assembly line would continue to function but the production output might be lower as objects failed to appear at their designated time, causing the robot to be temporarily unproductive. Some real-time operating systems are created for a special application and others are more general purpose. Real Time Application A real time application is an application, which requires a timely response from the computer system to prevent failure. 4. What is process ? Differentiate between a process and program ? Ans: Process is a program which is in execution or A process is the unit of work in a system. The process has been given many definitions for instance A program in Execution. An asynchronous activity. The animated sprit of a procedure in execution. The entity to which processors are assigned. The dispatchable unit. A process is an instance or invocation of a program - you can have for example two processes running the same program at the same time e.g. you can have a calculator program open twice, this is two processes but only one program. Some programs connect to and issue instructions to an existing process if one exists. Firefox is one example of such a program (when running under linux at least). A process is a program in execution. It is an active entity whereas a program is an active entity. It is a set of instructions. 5. Explain various types of errors in detail. Ans: Types of errors are as follows : 1) Reporting Errors The manner in which a compiler reports errors can greatly affect how pleasant and economical it is to use its language on a given machine. Good error diagnostics should posses a number of properties: The messages should pinpoint the errors in terms of the original source program, rather than in terms of some internal representation that is totally mysterious to the user. The error messages should be tasteful and understandable by the user (e.g., missing right parenthesis in line 5 rather than a cryptic error code such as OH17.) The messages should be specific and should localize the problem (e.g., ZAP not declared in procedure BLAH, rather than missing declaration). The messages should not be redundant. If a variable ZAP is undeclared, that should be said once, not every time ZAP appears in the program. 2) Sources of Error It is difficult to give a precise classification scheme for programming errors. One way to classify errors is according to how they are introduced. If we look at the entire process of designing and implementing a program, we see that errors can arise at every stage of the process. At the very onset, the design specifications for the program may be inconsistent or faulty. The algorithms used to meet the design may be inadequate or incorrect (algorithmic errors). The programmer may introduce errors in implementing the algorithms, either by introducing logical errors or by using the programming language constructs improperly (Coding errors).

Keypunching or transcription errors can occur when the program is typed onto cards or into a file. The program may exceed a compiler or machine limit not implied by the definition of the programming language. For example, an array may be declared with too many dimensions to fit in the symbol table, or an array may be too large to be allocated space at run time. Finally, although it should not happen, a compiler can insert errors as it translates the source program into an object program (compiler errors). From the point of view of the compiler writer, it is convenient to classify errors as being either syntactic or semantic. We define a syntactic error to be an error detectable by the lexical or syntactic phase of the compiler. Other errors detectable by the compiler are termed semantic errors. 3) Syntactic Errors Here are a few common examples of syntactic errors: i) Missing right parenthesis (Deletion Error) MIN(A, 2 * (3 + B) ii) Extraneous comma (Insertion error) DO 10, I = 1, 100 iii) Colon in place of semicolon (Replacement error) I=1: J=2; iv) Misspelled Keyword : (Transposition error) F: PORCEDURE OPTIONS (MAIN) v) Extra blank (Insertion error) /* COMMENT * / 4) Semantic Errors Semantic errors can be detected both at compile time and at run time. The most common semantic errors that can be detected at compile time are errors of declaration and scope. Typical examples are undeclared or multiply-declared identifiers. Leaving out the declaration of one identifier can spawn a multiplicity of undeclared identifier error messages unless some provision is made to enter a special error flag for that identifier in the symbol table. Type incompatibilities between operators and operands, and between formal and actual parameters are another common source of semantic errors that can be detected in many languages at compile time. The amount of type checking that can be done, however, depends on the language at hand. 5) Dynamic Errors In some languages certain kinds of errors can only be detected at run time. For example, languages such as APL and SNOBOL have several types, and the type of a name can change at run time. Some type checking for languages such as these must therefore be postponed to run time. Another common kind of error detection usually done at run time, if at all, is range checking for certain values, particularly array subscripts and case statement selectors. A subscript out of range could cause an arbitrary memory location to be overwritten. An arbitrary value in a case statement (or computed goto) could cause a jump to an unknown memory location 6. Write a note on process management. Ans: Multiprogramming systems explicitly allow multiple processes to exist at any given time, where only one is using the CPU at any given moment, while the remaining processes are performing I/O or are waiting. The process manager is of the four major parts of the operating system. It implements the process abstraction. It does this by creating a model for the way the process uses CPU and any system resources. Much of the complexity of the operating system stems from the need for multiple processes to share the hardware at the same time. As a conseuence of this goal, the process manager implements CPU sharing (called scheduling), process synchronization mechanisms, and a deadlock strategy. In addition, the process manager implements part of the operating systems protection and security.

Anda mungkin juga menyukai