IT2204: Systems Administration I 8. The Operating System and Booting.

Slides:



Advertisements
Similar presentations
Lesson 4 0x Operating Systems.
Advertisements

Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Booting and Shutting Down the UNIX Operating System Arcadio A. Sincero Jr. 6/6/2001 CMSC 691X, Section 6080.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Linux+ Guide to Linux Certification, Second Edition
Booting And Shutting Down. Bootstrapping  Bootstrapping is standard term for “starting up a computer”  During bootstrapping the kernel is loaded into.
Chapter 2 Booting and Shutting Down Kim Grempler (Sections 2.0 to 2.3) Leon Dague (Sections 2.4 to 2.7)
Operating-System Structures
Discovering Computers Fundamentals, Third Edition CGS 1000 Introduction to Computers and Technology Fall 2006.
Chapter One The Essence of UNIX.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Operating Systems: Software in the Background
1 Web Server Administration Chapter 3 Installing the Server.
Operating Systems BTEC IT Practitioners.
System Startup and Shutdown
Xuan Guo Chapter 1 What is UNIX? Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003 Original Notes.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
Operating Systems.
Installing software on personal computer
LECTURE 14 Operating Systems and Utility Programs
SOFTWARE.
Week 6 Operating Systems.
Lesson 4 Computer Software
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Operating Systems Operating System
Operating Systems What do you have left on your computer after you strip away all of the games and application programs you bought and installed? Name.
Linux+ Guide to Linux Certification, Third Edition
© Paradigm Publishing Inc. 4-1 Chapter 4 System Software.
Chapter 8 Operating Systems and Utility Programs
CompTIA Linux+ Certification
Linux+ Guide to Linux Certification Chapter Three Linux Installation and Usage.
IT Essentials: PC Hardware and Software 1 Chapter 7 Windows NT/2000/XP Operating Systems.
Booting and boot levels
Chapter 4: What is an operating system?. What is an operating system? A program or collection of programs that coordinate computer usage among users and.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Chapter 4 System Software.
Operating System. Architecture of Computer System Hardware Operating System (OS) Programming Language (e.g. PASCAL) Application Programs (e.g. WORD, EXCEL)
 Introduction to Operating System Introduction to Operating System  Types Of An Operating System Types Of An Operating System  Single User Single User.
Operating Systems  A collection of programs that  Coordinates computer usage among users  Manages computer resources  Handle Common Tasks.
Computer and Information Science Computer Software Computer Software Chapter 1.2.
University of Management & Technology 1 Operating Systems & Utility Programs.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
Chapter 8: Operating Systems and Utility Programs Catherine Gifford Dan Falgares.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Linux Administration. Pre-Install Different distributions –Redhat, Caldera, mandrake, SuSE, FreeBSD Redhat Server Install –Check HCL –Significant issues.
Page 1 Printing & Terminal Services Lecture 8 Hassan Shuja 11/16/2004.
© Paradigm Publishing, Inc. 4-1 Chapter 4 System Software Chapter 4 System Software.
CSC190 Introduction to Computing Operating Systems and Utility Programs.
Copyright © Curt Hill Operating Systems An Introductory Overview.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
Computer Operating Systems And Software applications.
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
OPERATING SYSTEM REVIEW. System Software The programs that control and maintain the operation of the computer and its devices The two parts of system.
Operating Systems (Credit to: Rick Graziani of Cabrillo College)
Operating Systems Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
CT101: Computing Systems Introduction to Operating Systems.
Linux Introduction Linux was developed in the early 1990’s by Linus Torvald computer science student at the University of Helsinki Linux is distributed.
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.
Guide to Linux Installation and Administration, 2e
Operating System Review
Chapter 2: System Structures
Operating System Review
SUSE Linux Enterprise Desktop Administration
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.
Presentation transcript:

IT2204: Systems Administration I 8. The Operating System and Booting

2 Software

3 Application software: Programs for performing a specific task –Word processing, spreadsheets, gaming, web page design, graphic design System software: –Operating software: Software that controls the overall operation of the computer –Utility software: Software that extends or customizes the capabilities of the operating system Formatting compress/decompress data network communications

4 Operating System Software Operating System (OS) – Software that controls the overall operation of a computer

5 What is an operating system (OS)? Operating System Software Software which manages the overall operation of the computer system including: hardware (CPU, RAM, I/O) security system interface application interface

6 What is an operating system (OS)?

7 The User’s View

8

9 What “is” an operating system? Software files (programs) which are stored on the hard disk kernel with the internal programs external programs Supporting Data Files

10 The kernel The operating system software file (program) which is copied into RAM, usually from the hard disk drive, during the boot-up. The kernel remains in RAM while the computer is on and is in charge of the overall operation of the computer system. The kernel contains the “internal programs” for the most often used operations like copying files. –kmem (Linux) –command.exe (Microsoft)

11 Kernel Kernel – The internal part of the operating system. –Those software components that perform the basic functions required by the computer. File management Memory management (RAM) Security

12

13 The functions of an operating system 1. Manages and Interacts with Computer Hardware 2. Provides and Manages System Security 3. Provides the System Interface 4. Provides the Interface for Application Software

14 1. Manages and Interacts with Computer Hardware Manages the CPU - What software programs the CPU works on and when Manages RAM - What is stored in RAM and where it is stored - Virtual memory - OS will send message when RAM is full

15 1. Manages and Interacts with Computer Hardware (continued) Provides the interface for storage devices and manages how data is stored on those devices - in charge of formatting disks - creates sectors and clusters - sends message when disk is full or there is some other problem with writing data to the disk - virtual memory - CD-ROM, DVD-ROM - Flash drive

16 1. Manages and Interacts with Computer Hardware (continued) Provides the Interface for Input and Output Devices –keyboard, mouse, printer, –device drivers = software programs which allow the hardware device to be used by the operating system and by application software

17 Processes Scheduler – Maintains a record of the processes. –Adds new processes when launched. –Removes old processes when completed. –Uses a process table. Process Table – Information about each process including: –Main memory cells (RAM) –Priority –Running or waiting (input from user or saving to disk)

18 Viewing processes with Microsoft Windows Task Bar – Right-click, Task Manager Ending a process – Killing the process

19 Processes Dispatcher - Oversees the execution of each process by the CPU. –Gives each process a time slice of CPU time. –Changes between processes.

20 Server (Multiuser) Operating Systems Found on mainframes, minicomputers and PCs server = a computer which processes information (CPU and RAM), stores information (hard disk), and/or provides access to peripheral devices (printers) for multiple users – –Web –Gaming

21 Examples of Server Operating Systems MAC OS X Server Windows Server

22 Advantages/Disadvantages of Server Operating Systems Advantages Central location for the installation and administration of all software and data More cost effective - less expensive than multiple computers (PCs, Macs) Disadvantages Single source for possible problems Loss of individual user control of their own software, data, and peripherals

23 Virtual Memory Virtual Memory (VM) = the ability of the CPU and the operating system software to use the hard disk drive as additional RAM when needed (safety net) Good – no longer get “insufficient memory” error Bad - performance is very slow when accessing VM Solution = more RAM

24 Virtual Memory

25 Virtual Memory

26 2. Provides and Manages System Security Single-user Operating Systems minimal security user has full authority Server Operating Systems login and password capability protection of user’s data stored on the server’s central hard disk drives protection and security for software programs

27 3. Provides the System Interface System Interface or shell = the interface between the user and the computer Command Line Interface (CLI) Linux, UNIX, DOS, older OS’s Graphical User Interface (GUI)

28 Command Line Interface DOS, UNIX, others

29 DOS plus Windows 3.1

30 Windows 95

31 Windows XP

32 Macintosh

33 Mac OS X

34 UNIX with X-Windows

35 Microsoft Windows 8

36 4. Provides the Interface for Application Software Operating systems are software Operating systems are designed and developed for a specific CPU or “family of CPUs” –Macintosh OS: Motorola 680xx, PowerPC Gx, Intel –DOS: Intel CPUs –Windows 9x and XP: Intel 80386, 80486, and Pentium CPUs –Linux: Intel CPUs –MS NT & 2000: Intel CPUs

37 4. Provides the Interface for Application Software (continued) Application software is developed for an operating system MS Word for Windows XP Windows XP Intel CPU MS Word for the Macintosh Macintosh OS X Gx CPU or Intel CPU

38 Compatibility Question Will software developed for one operating system work on another? Will MS Word for Macintosh run on a PC with Windows XP? Answer No (unless there is special emulation software or hardware). The software must be developed separately for each operating system. Much of this is beginning to change with MAC using the Intel CPU.

39 Order of Development 1. The CPU 2. Other Hardware Components 3. Operating System Software 4. Application Software

40 History of Operating Systems 1940’s – 1950’s Each program (job) required significant preparation of equipment. –Mounting tapes –Loading punch cards Computer Operator – Person who operated the computer. –Mount tapes –Load punch cards –Take printouts off of printer Batch processing – The execution of jobs by collecting them in a single batch, the executing them without further interaction with the user.

41 History of Operating Systems Job queue – Jobs residing in mass storage (hard disk drives, tape) waiting for execution. –FIFO (First-In, First-Out) –Job Priorities and scheduling Job Control Language (JCL) – Set of instructions explaining the steps of a particular job. –Operating system sent these to the printer –Computer Operator follows the instructions

42 History of Operating Systems Disadvantage to Batch Processing – No interaction with the user. Fine for software that does not need user interaction: –Payroll systems (creating checks) –Reporting systems Does not work well for other types of software: –Word processing –Reservation systems –Gaming

43 History of Operating Systems Newer Operating Systems Used remote terminals and interactive processing –Computer must be fast enough to coordinate with the needs of the user. Real-time processing - Computer must execute tasks under a deadline. Time sharing – Provides service to multiple users at the same time. –Multiprogramming - Time divided into intervals. Multitasking – One user executing numerous tasks (programs) simultaneously

44 Today’s Operating Systems Today’s CPUs (multiprocessors) –Multiple processors –Load balancing Dynamically allocating tasks to the various processors so that all processors are used efficiently. –Scaling Breaking tasks into a number of subtasks equal to the number of processors available. –The Network (Internet) Becoming a single network-wide operating system rather than a network of individual operating systems.

45

Booting

Bootstraping i.e. starting a computer  System is particularly vulnerable at this stage – System initialization is a major security problem in today’s Operating systems. It is also easy for a user to change Bios settings or drop at the shell and issue commands that may be hazardous to a machine. 47

Bootstraping  Steps in boot process – Loading and initialization of kernel – Device detection and configuration – Creation of spontaneous system processes – Operator intervention (manual boot only) – Execution of system startup scripts – Multiuser operation 48

Bootstraping  Kernel initialization – Kernel loaded into memory and executed – 2-stage loading process small boot program read into memory to enable kernel loading (outside domain of Unix) kernel runs tests to determine memory availability □ kernels run in a fixed amount of memory and know what to reserve for internal storage and I/O buffers. 49

Bootstraping  Device detection and configuration – Kernel performs HW check, initializing each device it finds. – Devices connected after boot time may not be accessible to Unix processes until a reboot is done. – Drivers used to get more device info If not found, will disable hardware If hardware is added, must reboot, to be accessible 50

Bootstraping  “Spontaneous” system process creation (done in user space- portion of RAM where your processes run) Spontaneous because it is not created using normal Unix fork mechanism. fork creates copy of the original process, with new ID, that is identical to the parent Kernel role in bootstrap ends after spontaneous process creation. Basic operations e.g. login and linux daemons are taken care of by init 51 –ATT: varies  sched - process 0;  init - process 1;  various memory handlers – BSD has 3 processes Swapper - process 0; init - process1; pagedaemon - process 2

Bootstraping  Operator intervention (manual boot only) – init notified via command-line flag from kernel – init creates shell and waits for it to terminate ( or exit) before continuing on with rest of startup procedure Always in bourne shell (e.g., sh) and runs as root with root partition mounted Available programs located in /bin, /sbin, /etc, and maybe /usr; Daemons normally not available in single-user mode fsck ( file system consistency check is a system utility that checks consistency of and repairs file systems) must be run by hand.

Bootstraping  Execution of system startup script – The location, content, and organization of shell (e.g., sh) scripts vary from system to system – BSD: kept in /etc and names begin with rc – ATT: kept in /etc/init.d with links made to other directories such as /etc/rc0.d, /etc/rc1.d… 53

Bootstraping  Execution of system startup script – Examples of tasks performed in initialization scripts Set computer name Set time zone Perform fsck disk check Mount system’s disks Remove files from /tmp Configure network interfaces Start up daemons and network services Turn on accounting and quotas 54

Bootstrap failure  When system boot fails: – HW problems – Defective/ faulty boot blocks – Damaged file systems – Improperly configured kernel – Startup script errors 55

Bootstraping  Multiuser Operation – To complete boot process and allow user access, init produces getty process on each workstation. The getty (get teletype) process manages terminals (physical or virtual), runs the login program to authenticate the user. – BSD: init has only two states: single-user and multi-user – ATT: init has one single-user and several multi-user “run levels” to determine which system resources are enabled 56

Bootstrap failure  HW problems – Are all devices powered? – Are all cables firmly connected? – Check faulty lights – Turn off everything for approximately 10sec – Perform stand-alone diagnostics  Defective boot blocks – If firmware is bad, no boot. – Try booting from distribution media. 57

Bootstrap failure  Damaged filesystems – Soft – scrambled info – Hard – head crash  Improperly configured kernel – Make arrangements for booting an old kernel in case of problems.  Startup script errors – Sometimes only the editor ed is available, unless you mount /usr – Hopefully, something on the screen will help you know what is causing the problem and you fix it 58

Multiple Booting on PCs  Many OSs (Operating Systems) run on PCs hence the possibility of booting several different OSs on a PC. – A boot loader is needed to recognize the different OSs.  Each disk partition can have its own boot loader, however there is only one Master Boot Record 59

Boot Loaders  Linux boot loaders -GRUB – GRand Unified Bootloader -LILO – LInux Loader GRUB is superior to LILO in a multibooting situation □ supports larger file systems. □ has a fully interactive CLI. □ supports more file systems including DOS FAT (File Allocation Table), BSD FFS (File System Snapshot) and Linux file systems. □ If the configuration file is not configured properly, GRUB will revert to a CLI rather than rendering system unbootable. □ supports booting from network  Windows boot loader – NTLDR (Win NT loader) 60

Boot Loaders  GRUB multiboot configuration – Example grub.conf file –default=0 –timeout=10 –splashimage=(hd1,2)/grub/splash.xpm.gz –password --md5 $1$opeVt0$Y.br.18LyAasRsGdSKLYlp1 –title Red Hat Linux password --md5 $1$0peVt0$Y.br.18LyAasRsGdSKLYlp1 root (hd1,2) kernel /vmlinuz ro root=LABEL=/ initrd /initrd img –title Windows XP password --md5 $1$0peVt0$Y.br.18LyAasRsGdSKLYlp1 rootnoverify (hd0,0) chainloader +1 61

Boot Loaders  grub.conf parameters – default: signals to GRUB which image to boot from by default after the timeout period. If not specified, grub boots the first image specified in the file. – timeout: number of seconds the boot prompt waits before automatically loading the default OS – splashimage: location of image to be used as the background for the GRUB GUI. – password: specifies MD5-encrypted password used to gain access to GRUB's interactive boot options. – title: identifies the specific OS that will be booted from at the user interface at runtime. Unlike with LILO, you can include spaces in this name. – password: set in the same way as the password above. Do not set this password to the root password if you are planning on sharing this machine with other users. 62

Boot Loaders  grub.conf parameters – root: tells GRUB where the OS file system actually lives. NB: GRUB references the media in a different way from LILO. Grub references this disk as (hd1,2), again the third partition of the second disk (disk 0 being the first disk, partition 0 being the first partition). – kernel: vmlinuz-X.X.XX-XX is the name of the default boot kernel image within your root directory. – initrd: initrd-X.X.XX-XX.img is the name of the default initrd file within your root directory. – rootnoverify option tells GRUB to not try to vary the root of the OS. This saves load errors if the file system is not a supported by GRUB. – chainloader +1 tells GRUB to use a chain loader to load this OS, which is required for loading Windows 63

Boot Loaders  LILO multiboot configuration – Example lilo.conf file –boot=/dev/hda –map=/boot/map –install=/boot/boot.b –prompt –timeout=100 –compact –default=Linux –image=/boot/vmlinuz label=Linux root=/dev/hdb3 read-only password=linux –other=/dev/hda label=WindowsXP 64

Boot Loaders  lilo.conf parameters – boot: tells LILO where to install the boot loader. – map: points to the map file used by LILO internally during bootup. – install: is one of the files used internally by LILO during the boot process. This holds both the primary and secondary parts of the boot loader. A segment of this boot.b file is written to the MBR (the primary part of the boot loader), which then points to the map and subsequently points to the secondary boot loader. – prompt: tells LILO to use the user interface (two selections -- Linux and WindowsXP for this example). If not specified, LILO boots into the default OS with no user interaction and no waiting. – timeout: is the number of tenths of a second that the boot prompt will wait before automatically loading the default OS, in this case Linux. If prompt is not specified, this parameter is ignored. 65

Boot Loaders  lilo.conf parameters – compact: option magically makes the boot process quicker by merging adjacent disk read requests into a single request. – default: tells LILO which image to boot from by default, such as after the timeout period. This relates to a label of one of the images in the lilo.conf file. If not specified LILO will boot the first image in the file. – image: specifies Linux version available to boot into. – label: identifies the different OS to boot from at the user interface at runtime. In addition, this label is used for specifying the default OS to boot from. – root: tells LILO where the OS file system actually lives. In our example, it is /dev/hdb3, which is the third partition of the second disk. – read-only: tells LILO to perform the initial boot to the file system read only. Once the OS is fully booted, it is mounted read-write. 66

Boot Loaders  lilo.conf parameters – password: option allows a password to be set for the specific OS one is booting into. In the example this password is held in the lilo.conf file as readable text, so is easily accessible for all to read. – other: acts like a combination of the image and root options, but for OSs other than Linux. In this example, it tells LILO where to find the Windows OS, which resides on the first disk in the first partition. This will usually be the case if Windows was installed first, then Linux. – label: is the same as all other label options. 67

Booting into single user mode  This is a good way to change system configuration or perform maintenance tasks without affecting or being troubled by other users (only the administrator uses the machine and a few system tasks)  It comes in handy when working on a broken system 68

Startup scripts  Runlevels in Red Hat, Suse and all other members of Red Hat family: – 0 - Halt, init 0 is similar to shutdown -h now – 1 - Single user, runs just /etc/rc.d/rc.sysinit. Does not run /etc/rc.d/rc – 2 - Multiuser, with networking (sshd, syslogd, Sendmail, no firewall), but without NFS (Network File System) (The same as 3, if you don't have networking) 69

Startup scripts  Runlevels in Red Hat, Suse and all other members of Red Hat family: – 3 - Full multi-user (firewall, rpc (remote procedure call), nfs, ntpd (network time protocol daemon)). Console logins only (no X11). – 4 - Not used/undefined – 5 - Full multi-user, with additional network services ( httpd(http daemon), vsftpd (very secure ftp deamon)), X11 and display manager as well as console logins – 6 - Reboot 70

Startup Scripts  At each runlevel, init invokes /etc/rc.d/rc with the new runlevel as an argument.e.g. – /etc/rc.d/rc 5, init runs the /etc/rc.d/rc script (or command) with the parameter of 5 whenever runlevel 5 is entered. init then waits until this command completes before doing anything else.  Scripts used by init when starting the system, changing runlevels, or shutting down are typically stored in the /etc/init.d or /etc/rc.d directory.  A series of symbolic links in the rcn.d directories, one directory for each runlevel n, control whether a script is started when entering a runlevel or stopped when leaving it.

Rebooting and Shutting Down  Reboot if necessary  Reboot to make new configuration work  Ways of rebooting – Turn of power (not good!) – Shutdown – Halt & reboot – Send init a TERM signal – Using telinit to change init's run level – Use poweroff command to tell system to turn off power 72

Q & A ** Read Chapter 14 (The boot process) from the Ubuntu Unleashed book