levo

Fundamentals of Computer Systems

Translators and the Role of the Operating System

  • 2 things to know
  • Paper 2

Overview

Recall questions on the functions of an assembler, a compiler and an interpreter, and on how an operating system shields users from the hardware.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Evaluation

What is the benefit to a programmer of the operating system hiding hardware complexity?

Process

Explain how an operating system allocates input and output devices among competing processes.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    Give the function of an assembler in one sentence.

    Model answer

    An assembler translates a program written in assembly language into machine code, generally converting each mnemonic instruction into one machine code instruction.

  2. 2

    Give the function of a compiler in one sentence.

    Model answer

    A compiler translates a complete high-level language program into machine code (or an intermediate code) in one operation before it is run, producing a separate file that can then be executed on its own.

  3. 3

    Give the function of an interpreter in one sentence.

    Model answer

    An interpreter analyses and executes a high-level language program one statement at a time, translating and carrying out each statement as it is reached, without producing a separate executable file.

  4. 4

    Explain what is meant by saying that an operating system shields programs and users from the physical detail of the machine.

    Model answer

    It means the awkward physical detail of the machine is dealt with once, by the operating system, so that every program above it sees a tidy and uniform machine instead. A program appending a line to a file issues a single request to save data; it never concerns itself with which tracks and sectors are free, what command codes this particular drive controller expects, how large a buffer to allocate, or what to do when the drive raises an interrupt to say it has finished. Replace the hard disk with a solid-state drive and the program is untouched, because only the operating system ever knew the difference. Without that layer, every application would have to be rewritten for every combination of hardware it might meet.

  5. 5

    Give three examples of hardware complexity that an operating system hides from an application programmer.

    Model answer

    The physical layout of secondary storage: the programmer sees named files in folders, not tracks, sectors and block addresses. The differences between devices: the same print or save instruction works with any make of printer or disk because the operating system uses the appropriate driver. The physical position of a program in memory: the programmer uses addresses within their own program and the operating system maps them to real locations. Also hidden are interrupt handling, buffering between fast and slow devices, and the detail of network protocols.

  6. 6

    What is the benefit to a programmer of the operating system hiding hardware complexity?

    Model answer

    The programmer can write shorter, simpler programs and concentrate on the user's problem instead of the machine. The same program will run on many different physical configurations without change, which makes software portable. It also prevents mistakes: low-level device control is easy to get wrong, and doing it once inside the operating system is safer than doing it in every application.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Fundamentals of Programming
Fundamentals of Data Structures
Fundamentals of Algorithms
Theory of Computation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A driver is .
softwarehardwarestorage

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AThe integer 5 is 0101.
B0.75 is 1/2 + 1/4.
CThe fraction bits are 1100.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

Head means the first single element of a non-empty list.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Fundamentals of Computer Systems, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.