Click here to load reader

Operating systems

  • View

  • Download

Embed Size (px)


KSOU BCA books

Text of Operating systems

  • 1.E-528-529, sector-7,Dwarka, New delhi-110075(Nr. Ramphal chowk and Sector 9 metro station)Ph. 011-47350606,(M) 7838010301-04 www.eduproz.inEducate Anytime...Anywhere..."Greetings For The Day"About EduprozWe, at EduProz, started our voyage with a dream of making higher education available for everyone. Sinceits inception, EduProz has been working as a stepping-stone for the students coming from variedbackgrounds. The best part is the classroom for distance learning or correspondence courses for bothmanagement (MBA and BBA) and Information Technology (MCA and BCA) streams are free of cost. Experienced faculty-members, a state-of-the-art infrastructure and a congenial environment for learning -are the few things that we offer to our students. Our panel of industrial experts, coming from variousindustrial domains, lead students not only to secure good marks in examination, but also to get an edge overothers in their professional lives. Our study materials are sufficient to keep students abreast of the presentnuances of the industry. In addition, we give importance to regular tests and sessions to evaluate ourstudents progress. Students can attend regular classes of distance learning MBA, BBA, MCA and BCA courses at EduProzwithout paying anything extra. Our centrally air-conditioned classrooms, well-maintained library and well-equipped laboratory facilities provide a comfortable environment for learning.Honing specific skills is inevitable to get success in an interview. Keeping this in mind, EduProz has a careercounselling and career development cell where we help student to prepare for interviews. Our dedicatedplacement cell has been helping students to land in their dream jobs on completion of the course.EduProz is strategically located in Dwarka, West Delhi (walking distance from Dwarka Sector 9 MetroStation and 4-minutes drive from the national highway); students can easily come to our centre fromanywhere Delhi and neighbouring Gurgaon, Haryana and avail of a quality-oriented education facility atapparently no extra cost.Why Choose Edu Proz for distance learning?Edu Proz provides class room facilities free of cost.In EduProz Class room teaching is conducted through experienced faculty.Class rooms are spacious fully air-conditioned ensuring comfortable ambience.Course free is not wearily expensive.Placement assistance and student counseling facilities.Edu Proz unlike several other distance learning courses strives to help and motivate pupils to get

2. high grades thus ensuring that they are well placed in life. Students are groomed and prepared to face interview boards. Mock tests, unit tests and examinations are held to evaluate progress. Special care is taken in the personality development department."HAVE A GOOD DAY"Karnataka State Open University(KSOU) was established on 1st June 1996 with the assent of H.E. Governor ofKarnatakaas a full fledged University in the academic year 1996 vide GovernmentnotificationNo/EDI/UOV/dated 12th February 1996 (Karnataka State Open UniversityAct 1992).The act was promulgated with the object to incorporate an Open University at theState level for the introduction and promotion of Open University and DistanceEducation systems in theeducation pattern of the State and the country for the Co-ordination anddetermination of standard of such systems. Keeping in view the educationalneeds of our country, in general, and state in particular the policies andprogrammes have been geared to cater to the needy.Karnataka State Open University is a UGC recognised University of DistanceEducation Council (DEC), New Delhi, regular member of the Association ofIndian Universities (AIU), Delhi, permanent member of Association ofCommonwealth Universities (ACU), London, UK, Asian Association of OpenUniversities (AAOU), Beijing, China, and also has association withCommonwealth of Learning (COL).Karnataka State Open University is situated at the NorthWestern end of theManasagangotri campus, Mysore. The campus, which is about 5 kms, from thecity centre, has a serene atmosphere ideally suited for academic pursuits. TheUniversity houses at present the Administrative Office, Academic Block, LectureHalls, a well-equipped Library, Guest HouseCottages, a Moderate Canteen, Girls Hostel and a few cottages providing limitedaccommodation to students coming to Mysore for attending the ContactProgrammes or Term-end examinations. 3. Unit 1: Overview of the Operating Systems: This unit covers introduction, evolution of OS. And also covers the OS components andits services.Introduction to Operating SystemsPrograms, Code files, Processes and Threads A sequence of instructions telling the computer what to do is called a program. The user normally uses a text editor to write their program in a high level language, such as Pascal, C, Java, etc. Alternatively, they may write it in assembly language. Assembly language is a computer language whose statements have an almost one to one correspondence to the instructions understood by the CPU of the computer. It provides a way of specifying in precise detail what machine code the assembler should create. A compiler is used to translate a high level language program into assembly language or machine code, and an assembler is used to translate an assembly language program into machine code. A linker is used to combine relocatable object files (code files corresponding to incomplete portions of a program) into executable code files (complete code files, for which the addresses have been resolved for all global functions and variables). The text for a program written in a high level language or assembly language is normally saved in a source file on disk. Machine code for a program is normally saved in a code file on disk. The machine code is loaded into the virtual memory for a process, when the process attempts to execute the program. The notion of a program is becoming more complex nowadays, because of shared libraries. In the old days, the user code for a process was all in one file. However, with GUI libraries becoming so large, this is no longer possible. Library code is now stored in memory that is shared by all processes that use it. Perhaps it is best to use the term program for the machine code stored in or derived from a single code file. Code files contain more than just machine code. On UNIX, a code file starts with a header, containing information on the position and size of the code (text), initialised data, and uninitialised data segments of the code file. The header also contains other information, such as the initial value to give the program counter (the entry point) and global pointer register. The data for the code and initialised data segments then follows. 4. As well the above information, code files can contain a symbol table a tableindicating the names of all functions and global variables, and the virtualaddresses they correspond to. The symbol table is used by the linker, when itcombines several relocatable object files into a single executable code file, toresolve references to functions in shared libraries. The symbol table is also usedfor debugging. The structure of UNIX code files on the Alpha is very complex,due to the use of shared libraries. When a user types in the name of a command in the UNIX shell, this results in thecreation of what is called a process. On any large computer, especially one withmore than one person using it at the same time, there are normally manyprocesses executing at any given time. Under UNIX, every time a user types in acommand, they create a separate process. If several users execute the samecommand, then each one creates a different process. The Macintosh is a littledifferent from UNIX. If the user double clicks on several data files for anapplication, only one process is created, and this process manages all the datafiles.A process is the virtual memory, and information on open files, and otheroperating system resources, shared by its threads of execution, all executing in thesame virtual memory.The threads in a process execute not only the code from a user program. They canalso execute the shared library code, operating system kernel code, and (on theAlpha) what is called PALcode.A process is created to execute a command. The code file for the command isused to initialise the virtual memory containing the user code and globalvariables. The user stack for the initial thread is cleared, and the parameters to thecommand are passed as parameters to the main function of the program. Files areopened corresponding to the standard input and output (keyboard and screen,unless file redirection is used).When a process is created, it is created with a single thread of execution.Conventional processes never have more than a single thread of execution, butmulti-threaded processes are now becoming common place. We often speak abouta program executing, or a process executing a program, when we really mean athread within the process executes the program.In UNIX, a new process executing a new program is created by the fork() systemcall (which creates an almost identical copy of an existing process, executing thesame program), followed by the exec() system call (which replaces the programbeing executed by the new program). 5. In the Java programming language, a new process executing a new program iscreated by the exec() method in the Runtime class. The Java exec() is probablyimplemented as a combination of the UNIX fork() and exec() system calls. A thread is an instance of execution (the entity that executes). All the threads thatmake up a process share access to the same user program, virtual memory, openfiles, and other operating system resources. Each thread has its own programcounter, general purpose registers, and user and kernel stack. The programcounter and general purpose registers for a thread are stored in the CPU when thethread is executing, and saved away in memory when it is not executing.Th

Search related