Computer Programming (CS101) Lecture-04

Slides:



Advertisements
Similar presentations
Higher Computing Computer Systems S. McCrossan Higher Grade Computing Studies 7. Systems Software 1 System Software This software is used to provide the.
Advertisements

Maninder Kaur OPERATING SYSTEM Maninder Kaur 11 Oct 2010.
Introduction CSCI 444/544 Operating Systems Fall 2008.
CS 345 Computer System Overview
Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering
Lecture 1: History of Operating System
A. Frank - P. Weisberg Operating Systems Evolution of Operating Systems.
Compilers and Interpreters. What's the difference? Computer programs are compiled or interpreted. Languages like Assembly Language, C, C++, Fortran, Pascal.
Systems Software Operating Systems.
OPERATING SYSTEMS Prof. Sujata Rao Lesson 3. Agenda 1. What is an operating system? 2. How have operating systems evolved? 3. Functions of Operating System.
part I, , Part I Introduction to Operating Systems First Semester, Year 2000 Wannarat Suntiamorntut Department of Computer Engineering,
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
Introduction Operating Systems. No. 2 Contents Definition of an Operating System (OS) Role of an Operating System History of Operating Systems Classification.
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
 What is OS? What is OS?  What OS does? What OS does?  Structure of Operating System: Structure of Operating System:  Evolution of OS Evolution of.
Operating Systems.
 Introduction to Operating System Introduction to Operating System  Types Of An Operating System Types Of An Operating System  Single User Single User.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 1 Introduction Read:
HERY H AZWIR Computer Software. Computer Software Outline Software and Programming Languages  Software  Programming  Programming language development.
Introduction to Interactive Media Interactive Media Tools: Software.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
OPERATING SYSTEMS UNIT – I R.SOUJANYA IT Dept. UNIT I Computer System and Operating System Overview Chapter 1: IntroductionIntroduction Overview of Computer.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
Application Software System Software.
CIS250 OPERATING SYSTEMS Chapter One Introduction.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Operating Systems.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
L ECTURE -6 Topics: Introduction to Operating system. Functions of an Operating system. Classification of Operating systems.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 0: Historical Overview.
1 OPERATING SYSTEMS. 2 CONTENTS 1.What is an Operating System? 2.OS Functions 3.OS Services 4.Structure of OS 5.Evolution of OS.
Introduction to Operating Systems
Introduction to Computers
Topic 2: Hardware and Software
Applied Operating System Concepts
Introduction to Computers
Operating System & Application Software
Operating Systems & System Software
Operating System Overview
Operating System Review
2. OPERATING SYSTEM 2.1 Operating System Function
Operating System.
Lecture 1: Introduction to JAVA
Evolution of Operating Systems
Computer Software.
Chapter 2: System Structures
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
THE OPERATION SYSTEM The need for an operating system
Course: Introduction to Computers
Introduction to Operating System (OS)
Contents Todays Topic: Introduction to Computer Software We will learn
Chapter 1: Introduction
Quick Introduction to OS
Chapter 1: Introduction
Operating System Review
Operating System Concepts
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Operating Systems: History
Software - Operating Systems
Operating System Introduction
Process Management -Compiled for CSIT
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering
Operating System Overview
Process Management -Compiled for CSIT
Operating System Concepts
Lecture Topics: 11/1 Hand back midterms
An Introduction to Operating Systems
Presentation transcript:

Computer Programming (CS101) Lecture-04 Asst Prof. Rizwan Khan Department of Computer & Engineering rizwan.khan@abesit.in

Compilers and Interpreters

What's the difference? Computer programs are compiled or interpreted. Languages like Assembly Language, C, C++, Fortran, Pascal were almost always compiled into machine code. Languages like Basic,VbScript and JavaScript were usually interpreted. So what is the difference between a compiled program and an Interpreted one? Compute Programming 11/15/2018

Compiling To write a program takes these steps: 1.Edit the Program 2.Compile the program into Machine code files. 3.Link the Machine code files into a runnable program (also known as an exe). 4.Debug or Run the Program With some languages like Turbo Pascal and Delphi steps 2 and 3 are combined Compute Programming 11/15/2018

Machine code files are self-contained modules of machine code that require linking together to build the final program. The reason for having separate machine code files is efficiency; compilers only have to recompile source code that have changed. The machine code files from the unchanged modules are reused. This is known as Making the application. If you wish to recompile and rebuild all source code then that is known as a Build. Compute Programming 11/15/2018

Linking is a technically complicated process where all the function calls between different modules are hooked together, memory locations are allocated for variables and all the code is laid out in memory, then written to disk as a complete program. This is often a slower step than compiling as all the machine code files must be read into memory and linked together. Compute Programming 11/15/2018

Interpreting The steps to run a program via an interpreter are : 1. Edit the Program 2. Debug or Run the Program 3. This is a far faster process and it helps novice programmers edit and test their code quicker than using a compiler. The disadvantage is that interpreted programs run much slower than compiled programs. As much as 5-10 times slower as every line of code has to be re-read, then re-processed. Compute Programming 11/15/2018

What is a Compiler? A compiler is a program that translates human readable source code into computer executable machine code. To do this successfully the human readable code must comply with the syntax rules of whichever programming language it is written in. The compiler is only a program and cannot fix your programs for you. If you make a mistake, you have to correct the syntax or it won't compile. What happens When You Compile Code?: A compiler's complexity depends on the syntax of the language and how much abstraction that programming language provides. A C compiler is much simpler than C++ Compiler or a C# Compiler. Compute Programming 11/15/2018

Compilers: The Big picture Source code Compiler Assembly code Assembler Object code (machine code) Linker Fully-resolved object code (machine code) Loader Executable image Compute Programming 11/15/2018

An introduction to Operating Systems 11/15/2018 Compute Programming

What is an Operating System? An Operating system is a software that controls a computer. This is not the same as the applications that you create - those are usually only run when you want them. An OS runs almost as soon as the computer is turned on. Windows is an Operating System, as is Linux and the Apple Mac OS X. Compute Programming 11/15/2018

- Each PC motherboard manufacturer writes a Switching On -When a computer is powered up, the CPU starts running immediately. But what does it run? On most PCs, whether Linux, Windows or Mac, there is a boot program stored permanently in the ROM of the PC. Booting Up - Each PC motherboard manufacturer writes a boot program for their motherboard. - This boot program is not an Operating System (OS), it is there to load the OS. Its first job is the Power On Start-Up Test (aka POST). This is a system test, first checking the memory and flagging any errors. It will stop the system if something is wrong. Next it resets and initializes any devices plugged into the PC. This should result in the OS being loaded from whichever device has been configured as the boot device, be it Flash RAM, CD-Rom or hard disk. Having successfully loaded the OS, the boot program hands over control and the OS takes charge. Compute Programming 11/15/2018

Managing the computer The job of an OS is to manage all the resources in a computer. When user input is received from mouse and keyboard it has to be handled in a timely fashion. When you create or copy a file, the OS takes care of it all behind the scenes. It may store a file in a hundred different places on disk but it keeps you well away from that level of detail. You'll just see one file entry in a directory listing. An OS is just a very complex collection of programs and nowadays takes hundreds or thousands of man hours to develop. We've come along way since Dos 6.22 which fitted on a 720 Kb floppy and Vista promises to be very large- 9 or 10 Gigabytes Compute Programming 11/15/2018

Protection and Security Modern CPUs have all sorts of tricks built into their hardware - for example CPUs only permit trusted programs to run with access to all of the hardware facilities. This provides extra safety. In Ring 0 protection on Intel/AMD CPUs, the code at the heart of the OS, usually called the Kernel code, is protected against corruption or overwriting by non Kernel applications - the kind you and I write. Nowadays it is rare for a user written program to crash a computer. The CPU will stop any attempt to overwrite Kernel Code Compute Programming 11/15/2018

Also, the CPU has several privileged instructions that can only be run by Kernel Code. This enhances the robustness of the OS and reduces the number of fatal crashes, such as the infamous Windows Blue Screen of death. The language C was developed to write Operating Systems code and it is still popular in this role mainly for Linux and Unix systems. The Kernel part of Linux is written in C. The operating system is arguably the most important piece of software on your PC. Compute Programming 11/15/2018

Structure of Operating System: Application Programs System Programs Software (Operating System) HARDWARE (Contd…) Compute Programming 11/15/2018

Evolution of OS (contd..): Major Phases Technical Innovations Operating Systems Open Shop The idea of OS IBM 701 open shop (1954) Batch Processing Tape batching, First-in, first-out scheduling. BKS system (1961) Multi- programming Processor multiplexing, Indivisible operations, Demand paging, Input/output spooling, Priority scheduling, Remote job entry Atlas supervisor (1961), Exec II system (1966) (Contd…) Compute Programming 11/15/2018

Evolution of OS (contd..): Timesharing Simultaneous user interaction, On-line file systems Multics file system (1965), Unix (1974) Concurrent Programming Hierarchical systems, Extensible kernels, Parallel programming concepts, Secure parallel languages RC 4000 system (1969), 13 Venus system (1972), 14 Boss 2 system (1975). Personal Computing Graphic user interfaces OS 6 (1972) Pilot system (1980) Distributed Systems Remote servers WFS file server (1979) Unix United RPC (1982) 24 Amoeba system (1990) 11/15/2018 Compute Programming

Batch Processing: In Batch processing same type of jobs batch (BATCH- a set of jobs with similar needs) together and execute at a time. The OS was simple, its major task was to transfer control from one job to the next. The job was submitted to the computer operator in form of punch cards. At some later time the output appeared. The OS was always resident in memory. (Ref. Fig. next slide) Common Input devices were card readers and tape drives. Compute Programming 11/15/2018

Batch Processing (Contd…): Common output devices were line printers, tape drives, and card punches. Users did not interact directly with the computer systems, but he prepared a job (comprising of the program, the data, & some control information). OS User program area Compute Programming 11/15/2018

Multiprogramming: Multiprogramming is a technique to execute number of programs simultaneously by a single processor. In Multiprogramming, number of processes reside in main memory at a time. The OS picks and begins to executes one of the jobs in the main memory. If any I/O wait happened in a process, then CPU switches from that job to another job. Hence CPU in not idle at any time. Compute Programming 11/15/2018

Multiprogramming (Contd…): OS Job 1 Job 2 Job 3 Job 4 Job 5 Figure dipicts the layout of multiprogramming system. The main memory consists of 5 jobs at a time, the CPU executes one by one. Advantages: Efficient memory utilization Throughput increases CPU is never idle, so performance increases. 11/15/2018 Compute Programming

Time Sharing Systems: Time sharing, or multitasking, is a logical extension of multiprogramming. Multiple jobs are executed by switching the CPU between them. In this, the CPU time is shared by different processes, so it is called as “Time sharing Systems”. Time slice is defined by the OS, for sharing CPU time between processes. Examples: Multics, Unix, etc., Compute Programming 11/15/2018

Operating Systems functions: The main functions of operating systems are: Program creation Program execution Input/Output operations Error detection Resource allocation Accounting protection Compute Programming 11/15/2018

Types of OS: Single User Systems Multi User Systems Operating System can also be classified as,- Single User Systems Multi User Systems Compute Programming 11/15/2018

Single User Systems: Provides a platform for only one user at a time. They are popularly associated with Desk Top operating system which run on standalone systems where no user accounts are required. Example: DOS Compute Programming 11/15/2018

Multi-User Systems: Provides regulated access for a number of users by maintaining a database of known users. Refers to computer systems that support two or more simultaneous users. Another term for multi-user is time sharing. Ex: All mainframes and  are multi-user systems. Example: Unix Compute Programming 11/15/2018

What is editor Sometimes called text editor, a program that enables you to create and edittext files. There are many different types of editors, but they all fall into two general categories: line editors: A primitive form of editor that requires you to specify a specific line of text before you can make changes to it. screen -oriented editors: Also called full-screen editors, these editors enable you to modify any text that appears on the display screen by moving the cursor to the desired location. Compute Programming 11/15/2018

Assignment-04 1.What is difference between Complier and Interpreter? Explain in detail. 2.What is operating system? 3.What are different types of OS? Explain in brief. 4. List the services of operating system. Compute Programming 11/15/2018