1 / 35

CPS120: Introduction to Computer Science

Explore memory management, process control, CPU scheduling, and Unix operating system functions in this comprehensive guide. Learn about partition memory management, paged memory management, and more.

Download Presentation

CPS120: Introduction to Computer Science

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPS120: Introduction to Computer Science Operating Systems Nell Dale • John Lewis

  2. Operating System • An operating system manages resources, and these resources are often shared in one way or another among programs that want to use them

  3. Resource Management • Multiprogramming is the technique of keeping multiple programs in main memory at the same time; these programs compete for access to the CPU so that they can execute • Memory management: keeps track of what programs are in memory and where in memory they reside

  4. Batch Processing In early systems, human operators would organize jobs into batches

  5. Timesharing • A timesharing system allows multiple users to interact with a computer at the same time • Multiprogramming allowed multiple processes to be active at once, which gave rise to the ability for programmers to interact with the computer system directly, while still sharing its resources • In a timesharing system, each user has his or her own virtual machine, in which all system resources are (in effect) available for use

  6. Memory Management • Operating systems must employ techniques to: • Track where and how a program resides in memory • Convert logical program addresses into actual memory addresses

  7. Partition Memory Management • When using fixed partitions, main memory is divided into a particular number of partitions • When using dynamic partitions, the partitions are created to fit the need of the programs

  8. Partition Memory Management • At any point in time memory is divided into a set of partitions, some empty and some allocated to programs • Base register: a register that holds the beginning address of the current partition • Bounds register: a register that holds the length of the current partition Address resolution in partition memory management

  9. Paged Memory Management • Paged memory technique: main memory is divided into small fixed-size blocks of storage called frames. • A process is divided into pages that we assume are the same size as a frame • The operating system maintains a separate page-map table (PMT) for each process in memory

  10. Paged Memory Management • To produce a physical address, you first look up the page in the PMT to find the frame number in which it is stored • Then multiply the frame number by the frame size and add the offset to get the physical address A paged memory management approach

  11. Process Management • The Process States The process life cycle

  12. The Process Control Block • The operating system must manage a large amount of data for each active process • Usually that data is stored in a data structure called a process control block (PCB) • Each state is represented by a list of PCBs, one for each process in that state

  13. CPU Scheduling • The act of determining which process in the ready state should be moved to the running state • That is, decide which process should be given over to the CPU

  14. CPU Scheduling • Nonpreemptive scheduling: occurs when the currently executing process gives up the CPU voluntarily • Preemptive scheduling: occurs when the operating system decides to favor another process, preempting the currently executing process • Turnaround time for a process: amount of time between the time a process arrives in the ready state to the time it exits the running state for the last time

  15. Unix • The operating system is the piece of software that controls the computer and its resources. An operating system keeps track of users, filenames and their location, and manages the computer's memory. • Other operating system functions include the allocation and monitoring of all devices and scheduling users' programs and tasks. • Also, the operating system provides an interface to the user so that the user can write programs, run programs and access various computer resources.

  16. Shell • Part of the unix operating system, the shell program, performs the user interface; it takes your typed request (command) and decides what operation to perform. The commands are short, but powerful.

  17. Search for Telnet • At RUN in the START box, type telnet cidermill.wccnet.org

  18. open cidermill.wccnet.org • Type this at the prompt >

  19. Logon • Login • Password • Change password • passwd

  20. date • Type this command at the bash prompt > to find out the system time and date

  21. pwd • Finds current directory

  22. echo $PATH • Finds the current path that the computer uses to search for files

  23. ls -la • Lists the files that you have in your current directory with details of their creation and details on the associated permissions.

  24. ls *.cpp • Lists all files with a suffix of cpp • I.e. those that contain C++ code

  25. cp myprog.cpp newprog.cpp • Copies and existing file to a new file name in the existing directory

  26. ls myprog*.* • Lists all files that start with myprog and have a period in their name • This eliminates any directories

  27. pwd • Relists the contents of the working directory

  28. mkdir programs • Creates a new DIRECTORY within the current working directory

  29. cd /home/faculty/pmillis/programs • Changes the current directory to the directory we created in the previous command

  30. pwd • Lists the name of the current directory. We will now be in the directory created ls • Lists the name of the current directory. We will now be in the directory created • Will be empty

  31. lpstat • Shows the status of the system printer

  32. rm myprog.cpp • Removes the program we created (delete)

  33. rmdir programs • Removes (deletes) the directory we created

  34. ls -la • Lists the contents of the working directory to ensure that we have properly deleted our library and file

  35. exit • Gets us out of UNIX

More Related