Chapter 3 Computer Software - PowerPoint PPT Presentation

1 / 63
About This Presentation
Title:

Chapter 3 Computer Software

Description:

3.3 Resource Sharing. 3.4 File Systems. Assessments: Exercise 3. 3. Yun ... calls on a helper program when it needs to play a sound file or video clip. ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 64
Provided by: zy3
Category:

less

Transcript and Presenter's Notes

Title: Chapter 3 Computer Software


1
Chapter 3 Computer Software
  • ---- Operating System

2
Chapter 3 Computer Software
  • Readings
  • 3.1 Software Structure
  • 3.2 Device Management and Configuration
  • 3.3 Resource Sharing
  • 3.4 File Systems
  • Assessments
  • Exercise 3

3
  • ?????????????,??????????????,?????????????????????
    ?????
  • ?????????????????????????????????????????
  • ???????WINDOWS????? Windows 98? Windows 2000?
    Windows xp?
  • - OS????,??

4
3.1 Software Structure
  • 3.1.1 Layers of Software
  • Layers and Process Management
  • Software systems are composed of multiple layers
  • One example sign a credit card slip to pay for
    dinner at a restaurant a meal
  • the meal was actually composed of several
    courses. That is a layer of detail the waiter
    needs to keep track of in order to know what
    dishes to bring, and in what order. For instance
    the first course was salad.

5
  • The details of salad preparation were handled by
    another layer, the kitchen
  • where do croutons actually come from?
  • Where do flour come from?
  • Where do wheat come from?
  • When you pay for your dinner, you are paying
    (indirectly) about one thousandth of a cent to
    that farmer for the wheat in your croutons. And,
    you are paying several thousand other people who
    contributed to your meal in various ways.

6
  • Fortunately, you do not have to pay all those
    people directly! You make one payment for "a
    meal," and the details are sorted out in the
    layers below.
  • By organizing the production process into layers
    that are relatively independent, the entire
    system can be kept manageable, and great
    efficiencies can be achieved. In computer
    science, the principles underlying these benefits
    are called encapsulation and abstraction.

7
  • Encapsulation and Abstraction (?????)
  • Encapsulation means that each layer needs only a
    limited amount of knowledge to do its job, and
    none of the other layers has access to that
    information. The farmer does not know what the
    wheat will be used for. The bakery does not know
    how the wheat was harvested.

8
  • In the software world, encapsulation means that
    your word processing program does not need to
    know how to control disk drives in order to be
    able to open and save files there are layers of
    software below it that handle those details.
  • if a layer were fully encapsulated it would be
    unable to communicate with the layers above and
    below. In order for there to be some exchange of
    information, but not too much, the designer of a
    layer specifies an abstraction that the layer
    promises to support. (??????????)

9
  • The bakery supports an abstraction called a
    "crouton order," whereby a customer can submit an
    order for X pounds of croutons and the bakery
    will respond by producing the croutons and
    delivering them. The details of how crouton is
    produced are hidden from the customer.
  • in computer science terminology(??) we say the
    information is encapsulated

10
abstraction
  • even if a customer knew that there were two
    ovens(??) to produce the croutons, they could not
    specify(??) which oven they wanted to be used to
    produce their order, because there is no place on
    the order form to indicate that. In computer
    science terms, we say that the crouton ordering
    abstraction does not support oven choice.

11
  • The existence of well-defined abstractions at
    each layer means that one implementation can be
    replaced by another with no effect on the layers
    above and below.
  • On your computer, it is possible to have multiple
    implementations of a software component and
    switch from one to another.

12
  • For example, your Web browser calls on a helper
    program when it needs to play a sound file or
    video clip. There are several programs that can
    perform this function. All you have to do is tell
    your browser which player to use. This isolation
    of functionality means that if a new, improved
    player becomes available, you can switch to that
    one you do not have to get a completely new
    browser.

13
  • Layers of Software
  • Hardware ,is the lowest level of the computer
    the physical components from which it is
    constructed. Details have discussed in unit 2.

14
  • The BIOS( Basic Input/Output System), is the most
    fundamental level of software. It deals directly
    with the signals that control each hardware
    component. Much of its work is performed when the
    computer is first turned on.
  • Device drivers are the helper programs the
    operating system uses to communicate with a
    specific model of device. The advantage the
    operating system vendor does not have to be
    responsible for supporting every device ever
    invented, or that might be invented in the
    future.

15
  • Device drivers example The device driver for a
    hard drive knows how many tracks are on the drive
    and what commands to send to the drive to move
    the arm to a specific track and then read or
    write data.
  • The device manufacturer supplies the driver, and
    as long as the driver follows the established
    conventions for communicating with the operating
    system, the device should be usable.

16
  • The kernel is the heart of the operating system
    and performs the functions that are most
    crucial(????) for keeping everything running. It
    manages memory, decides which task to run next,
    and handles the various types of interrupts(??)
    that can occur. The kernel must stay resident in
    RAM at all times, and because of its special
    nature, it must run without some of the
    protection mechanisms that guard against faulty
    instructions or illegal memory accesses.
    Therefore, it is kept as small as possible.

17
  • The remaining layer of the operating system is
    much larger than the kernel. It implements all
    the other functions the operating system is
    expected to perform. Example file system -
    managing the folders and files on a disk. It
    communicates with the kernel when it needs to
    perform basic actions, such as initiating a data
    transfer operation to a peripheral.

18
API
  • The application program interface (API), is the
    layer where user programs (applications)
    communicate with the operating system. (API call
    )

19
API
  • Example suppose a Web browser application
    decides it needs more memory in order to display
    a large image file. The OS is responsible for
    keeping track of which programs are using which
    chunks of memory at any given time. This
    information is encapsulated within the OS the
    application does not know anything about how the
    information is organized. It does not have to.
    The OS defines an abstraction for managing memory
    (API call). All the application developer has to
    know is which API call to use to ask for more. If
    a new version of the OS comes along that uses a
    different way to keep track of memory, the
    application program will continue to work just
    fine as long as the API call stays the same.

20
  • Run-time libraries are collections of software
    routines that application programs rely on.
  • Example you write an application in the C
    language to open a file and read some data from
    it, you will use two built-in functions called
    fopen and fscanf. These functions are fetched
    from a library of I/O routines called stdio that
    can be used by any C program. They will make the
    appropriate API calls to get the OS to do what
    you need. The nice thing about the stdio
    abstraction is that your program is not dependent
    on a specific set of API calls, so you can run it
    on any machine that has a C compiler and an
    implementation of the C runtime library.

21
  • The application layer is where you will find the
    routines that do the actual work the application
    was created for.
  • The user interface layer is responsible for
    communication between the application and the
    user. It is typically a GUI (graphical user
    interface) composed of buttons and pull-down
    menus.
  • Scripts or macros are routines that many
    applications allow users to create from the
    application's set of built-in commands. Scripts
    and macros allow users to automate sequences of
    actions they perform frequently.

22
  • The computer industry today relies on specialists
    in each of the levels listed above. Some people
    make their living writing BIOS software, while
    others concentrate on improving GUI technology.
    But, the greatest number of programmers is found
    at the application level, because people want to
    use computers for so many different tasks.

23
3.1 Software Structure
  • 3.1.2 The BIOS Life at the Bottom
  • The Role of the BIOS
  • the lowest level of software on the machine
  • it initializes the hardware when the computer is
    first turned on
  • it loads the operating system
  • it provides basic support for devices such as the
    keyboard, mouse, and serial ports
  • it is only visible when you first power on the
    computer, before the operating system takes
    control

24
  • The BIOS resides in a ROM chip on the
    motherboard. During the power-on sequence, the
    processor automatically starts executing
    instructions from the ROM. Since ROM is slower
    than RAM, the BIOS on most systems immediately
    copies itself from ROM into RAM. Then it tells
    the processor to fetch all further instructions
    from the RAM version.

25
  • Another special type of memory used by the BIOS
    is CMOS memory. A small amount of CMOS memory,
    often as little as 64 bytes, is included on the
    motherboard to store BIOS parameter settings that
    control the operation of the hardware, and it
    uses very little power.
  • If you purchase faster DRAM chips for your main
    memory, you can change the BIOS settings to tell
    the memory bus controller to take advantage of
    the higher DRAM speed.

26
POST
  • When power is applied to the system and the BIOS
    begins to execute, the BIOS initiates the POST
    (Power-On Self Test) sequence
  • First, it enables the video card (you will see
    the screen flash) and displays some basic
    information like the type of video card
    installed, the name of the BIOS manufacturer, and
    the BIOS version number
  • It then determines the amount of DRAM installed
    in the system, and it may perform a memory test.

27
POST
  • Then, after determining what expansion cards and
    adapters(???) are present, the BIOS initializes
    those cards and adapters.
  • At the conclusion of the POST sequence, the BIOS
    displays system configuration information, such
    as the type of processor installed, cache memory
    information, the types of each of the disk drives
    it found, the addresses of any serial and
    parallel ports, and a list of other expansion
    cards it detected.

28
  • After POST, BIOS is to load the OS. the BIOS has
    to know just enough about disk drives to be able
    to read in one chunk of data, called the Master
    Boot Record, or MBR. By convention, this is the
    first sector of the first track of the disk. The
    MBR program then loads in the OS and starts it
    running.
  • On a system with multiple disk drives, the BIOS
    follows a search order to find an operating
    system to load.

29
  • Changing BIOS Settings
  • To change BIOS settings, you must enter the BIOS
    setup program during the boot sequence, by
    pressing a specified key or key combination, such
    as F2 or ALTCTRLESC or Del.

30
3.1 Software Structure
  • 3.1.3 Process(??) Control
  • One job of the OS is to keep track of all the
    processes that are currently trying to execute,
    assuring that each gets a chance to execute
    reasonably often.
  • A process is an instance of a running program. It
    includes a set of memory pages, a set of open
    file descriptors (if the process does any I/O), a
    process ID, and several other things.

31
  • Each process can be in one of several states
    running, runnable, or blocked. Only one process
    per CPU can actually be running at a time,
    although any number can be runnable
  • The kernel maintains a list of every process in
    the system. And maintains a queue (also called
    the run queue), or waiting list of runnable
    processes .
  • Using the Windows NT/2000/XP Task Manager, you
    can examine processes that are running, the
    number of threads a process has, system
    performance, and page faults.

32
3.2 Device Management and Configuration
  • Another one of the operating system's functions
    is to manage the various I/O devices installed on
    the computer. Control of the hardware at this
    level requires interaction between the kernel,
    the device drivers, and the BIOS.

33
3.2.1 Interrupt Handling
  • One of the important jobs of the kernel is to
    handle interrupts.
  • An interrupt is a signal to the processor that
    some event has occurred that requires immediate
    attention.
  • The kernel figures out what caused the interrupt
    and makes an appropriate response. It must act
    very quickly. In order to avoid losing
    information when the next interrupt arrives, it
    must handle each interrupt in less than a
    thousandth of a second.

34
  • IRQ
  • Interrupt Priority and Nested Interrupts Traps
    and Faults
  • A trap is an event similar to an interrupt,
    except that instead of being triggered(??) by an
    external signal, traps are triggered by the
    execution of processor instructions. An example
    is a division-by-zero operation.
  • A third type of event you should know about is
    called a fault. A fault occurs when the hardware
    is asked to do something it cannot do, such as
    access a nonexistent memory location.

35
  • 3.2.2 Hardware Attributes
  • Installing Drivers
  • Each device must have a corresponding driver in
    the operating system. Each operating system
    specifies an interface that a device driver must
    utilize.
  • This means that for any particular device, it
    must have a corresponding driver for the
    operating system where it is intended to be used
    in order to be functional.
  • Drivers are supplied either with the operating
    system's distribution files, or individually from
    the manufacturer of the hardware device.

36
  • Changing a Driver's Configuration
  • A driver is designed to operate in a particular
    fashion, but it may also include a number of
    operations to customize its functions for a
    particular user or system environment.
  • Features to be modified include those that match
    some particular hardware or system requirement
    (such as the transfer speed of a modem, how much
    data to buffer, what protocols should be used,
    etc.), and those that are user-oriented (screen's
    resolution???, wallpaper, a left-handed mouse,
    etc.).

37
  • 3.2.3 Lab 3-B Using the Windows Interface
  • How to access some of the Windows device
    management capabilities
  • My Computer - Properties
  • 3.2.4 Lab 3-D Installing and uninstalling
    software

38
3.3 Resource Sharing
  • the OSs mechanism for resource sharing.
  • The computer system not only shares many of its
    internal resources, such as the processor, but
    also its external resources, such as the hard
    disk drive.

39
3.3.1 Virtual Memory
  • Managing Memory
  • Some of main memory is reserved for the operating
    system, but most of it is available for user
    programs.
  • Each of users programs (running a Web browser,
    an editor, and a computer game etc.) needs a
    certain amount of memory, but none of them needs
    access to all the memory. The kernel allocates
    some memory to each program and keeps track of
    what program is using what.

40
  • Modern operating systems such as Linux and
    Windows provide virtual memory, to increase
    program flexibility.
  • In older operating systems like MS-DOS worked,
    all programs ran in the same real address space,
    since there was no virtual address space
  • you (or the compiler) must calculate the address
    for every instruction and every piece of data.
  • suppose everyone else writes their programs the
    same way, so you cannot run two programs that
    occupy the same memory addresses at the same time
    since as soon as you load the second one, it will
    overwrite the first.

41
  • This scheme allows the computer to load multiple
    programs in memory at once, in whatever portion
    of memory is available at the time.
  • it is simple to implement and does not require
    any changes to the hardware.
  • the memory allocated to the program must be
    contiguous(???)
  • Suppose the user is running a half a dozen small
    programs at the same time. After some of these
    programs have exited, programs 1, 3, and 6 are
    left running. Now the user wants to run a big
    application, but unfortunately, there may now be
    nowhere to put it, even though the total number
    of noncontiguous free blocks of memory may be
    more than adequate.

42
  • the size of a running program is limited to the
    amount of physical memory installed on the
    machine, minus whatever the operating system has
    reserved for itself.
  • But, large programs do not normally use all their
    memory at once. A program with a large address
    space may only need to access a few thousand
    instructions and a few thousand bytes of data at
    a time. It would be more efficient to allocate
    only a little bit of RAM at a time to such a
    program and to keep the rest of its address space
    somewhere else, such as on disk. This is what
    virtual memory allows us to do.

43
  • Virtual Memory
  • In a virtual memory system, every program runs in
    its own private address space.
  • There is no need for any relocation when the
    program is loaded into memory.
  • A virtual address space can be larger or smaller
    than the processor's physical memory.
  • virtual memory requires hardware support.

44
3.3.2 File and Printer Sharing
  • Files and printers are resources of the computer
    that are shared in a networking environment,
    allowing many users to access one drive, file, or
    printer remotely.
  • Files may be shared between applications or need
    to be kept private
  • the operating system defines a set of permissions
    for a file or directory, also called Access
    Control Lists (ACLs),
  • Read access , Write access , Execute access

45
3.4 File Systems
  • A file system is an abstraction for organizing
    data on mass storage media such as hard drives,
    floppy disks, and optical disks. The file systems
    are managed by the operating system of a
    computer.

46
(No Transcript)
47
Drives
  • Folders are housed in the computer drive.
  • One way to access the drives is by
    double-clicking on the icon named "My Computer"
    on your Desktop. you will see that each drive is
    labeled by an icon that indicates the type of
    medium the drive uses. Clicking a drive's icon
    will take you to the root directory of that drive.

48
Shortcuts
  • A shortcut is an alternate way to reach a file.
    Microsoft's term for a symbolic link, stored as a
    file with extension ".lnk".
  • A shortcut does not actually hold any data. It
    has a shortcut property that specifies the path
    to the file where the data can be found. This
    file is called the target of the shortcut. A
    shortcut only refers to its target it is not a
    copy of the target.
  • To create a shortcut
  • right-click the icon for the file or folder that
    is to be the target
  • select Create Shortcut from the pop-up menu).
  • Note that you cannot create a shortcut to
    another shortcut.

49
(No Transcript)
50
3.4.2 File Allocation Table (FAT) and NT File
System
  • Clusters and File Allocation Tables Disks are
    divided into tracks and sectors.

51
  • Sectors hold a fixed number of bytes, typically
    512 bytes. One or more sectors are allocated to
    store a file. If the file contains only a line or
    two of text, it will fit into a fraction of one
    sector. In that case, the remainder of the sector
    is left unused.
  • Because sectors are small, modern computer
    systems group them into clusters and read or
    write an entire cluster at a time.
  • A cluster is the smallest amount of space any
    file can occupy on a disk. A cluster contains 4,
    8, 16, 32, or 64 adjacent sectors (the number
    must be a power of 2).

52
  • For each cluster that is part of a file, the FAT
    entry gives the number of the next cluster for
    that file. In this way, the clusters that make up
    a file are chained together, so if you know the
    address in the FAT of the first cluster of a
    file, you can find all the others by following
    the chain. The FAT entry for the last cluster in
    the chain contains a special marker to indicate
    that it is the end of the chain.

53
  • FAT16the FAT used 16 bits (two bytes) per entry,
    which allowed for a total of 216 or 65,536
    clusters. 512 (29) bytes per sector 64 (26)
    sectors per cluster 216 clusters in a FAT 16
    partition 231 bytes 2GB
  • FAT32Windows 9x/2000/XP support a FAT32 file
    system. 32 bits (4 bytes) are used per entry, but
    the first 4 bits are reserved. smaller clusters
    can be used instead of larger FAT16 clusters.
    This leads to more efficient space allocation on
    the FAT32 drive

54
  • NT File System In NTFS, the cluster size is
    variable depending on the size of the logical
    drives. The cluster size is automatically
    determined by the NTFS Format utility, thereby,
    providing a level of flexibility. This
    flexibility is not available in FAT16 or FAT32.
    These features enable more efficient allocation
    of disk space.

55
NTFS versus FAT

56
Exercise 3
  • Question 1. Preemptive Multitasking
  • In this section you will use a Timestamp program
    and a graphical interface to examine how
    preemptive processing works.
  • Before executing the program, answer the
    following questions in the context of an
    operating system
  • a. What is a process?
  • b. What does a process include?
  • c. Name the possible states that a process can be
    in.
  • d. What is a thread?
  • e. Why are threads useful?

57
Exercise 3
  • Question 2. Virtual Memory
  • In this section, you will use a program
    demonstrating how virtual memory is used.
  • a. How does virtual memory work using a page
    table?
  • b. What is the primary purpose of virtual memory?
  • c. List three advantages of using virtual memory
    when executing a program.

58
Exercise 3
  • Question 3. Troubleshooting
  • Below are various problem scenarios. Select the
    most likely cause(s) for the problem from the
    Causes list.
  • CausesA. Component not plugged inB. Application
    software errorC. Operating system errorD. Low
    RAME. Slow processorF. CMOS battery failureG.
    Motherboard failureH. Hard disk failureI. BIOS
    ROM failureJ. Appropriate component driver not
    installed properly

59
Exercise 3
  • Problemsa. Program not respondingCauses
  • b. Screen froze after successfully
    bootingCauses
  • c. Programs running slowlyCauses
  • d. Peripheral device not working (mouse,
    keyboard, printer)Causes

60
Exercise 3
  • e. All necessary computer system components are
    plugged in, but the system does not bootCauses
  • f. The computer is being booted, and an error
    message indicates that the hard drive cannot be
    found.Causes
  • g. If low memory is a cause of the system running
    slowly, what can you do as a user to speed up the
    system?

61
Exercise 3
  • Question 4. File Directories
  • In this question, you are given a zip file, which
    contains some folders and files. You will unzip
    the given file, manipulate the files and folders,
    zip the resulting file structure and submit it,
    along with answers to the questions in this
    exercise.
  • First, download and save SSD2 File System.zip
    onto your Desktop. Then unzip the file.

62
Exercise 3
  • a. What is the absolute path of the file named
    test.txt in SSD2 File System folder?
  • b. How many parent directories does test.txt
    have?
  • c. Create a shortcut of test.txt and place it in
    the same directory. Rename the shortcut MyTest.
    Copy and paste a screenshot showing the file
    property of MyTest.

63
Exercise 3
  • d. Examine the file property of test.txt. Explain
    why the values for Size and Size on disk are
    different. What is the term for the difference
    between the two sizes?
  • e. Opening MyTest or test.txt both result in the
    display of the file. Explain the difference
    between MyTest and test.txt.
  • f. What are the different file extensions in
    folder Temp1?
  • g. List the most recently modified item in SSD2
    File System folder.
Write a Comment
User Comments (0)
About PowerShow.com