Unit 1 - Preliminaries and Introduction to Computer Systems Flashcards

1
Q

What is a computer?

A

A computer is, conceptually at least, a very simple machine that can store information, and carry out sequences of simple instructions, specified in the form of a computer program. These programs operate on stored data and inputs (e.g. provided by a user) to give outputs. Programs are collectively known as software (as opposed to the hardware, i.e. the physical electronics making up the computer).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the abstract layers of a computer?

A

Users, Applications, Software & Hardware

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Von Nuemann model?

A

The von Neumann architecture—also known as the von Neumann model or Princeton architecture—is a computer architecture based on a 1945 description by the mathematician and physicist John von Neumann and others in the First Draft of a Report on the EDVAC. That document describes a design architecture for an electronic digital computer with these components:

  • A processing unit that contains an arithmetic logic unit and processor registers
  • A control unit that contains an instruction register and program counter
  • Memory that stores data and instructions
  • External mass storage
  • Input and output mechanisms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the CPU control unit?

A

The Control Unit (CU) is generally a sizable collection of complex digital circuitry interconnecting and directing the many execution units (i.e. ALU, data buffers, registers) contained within a CPU. The CU is normally the first CPU unit to accept from an externally stored computer program a single instruction (based on the CPU’s instruction set). The CU then decodes this individual instruction into several sequential steps (fetching addresses/data from registers/memory, managing execution ([i.e. data sent to the ALU or I/O]), and storing the resulting data back into registers/memory) that controls and coordinates the CPU’s inner works to properly manipulate the data. The design of these sequential steps is based on the needs of each instruction and can range in number of steps, the order of execution, and which units are enabled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are all modern ‘stored-progam’ computers based on?

A

Machine instructions manipulate data held in memory, and can,for example:

  • add two data items together;
  • test whether a data item is 0.

A computer stores a program and its associated data (x, y and result, for example) in memory. This is the basic idea behind the von Neumann architecture on which all modern (‘stored-program’) computers are based.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the program counter?

A

A computer must be able to keep track of the execution of a program. In particular at any time it must know:

  • which instruction is currently being executed;
  • which memory location is used to store the address of the next machine instruction to be executed.

This is achieved using a special memory location called the program counter. The contents of the program counter indicate the location of the next instruction to be executed (every memory location has a unique numerical address). Everything has to be explicitly stated – a computer has no intelligence; it is simply a machine following instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are bits?

A

Computers store and process data in the form of sequences of ones and zeros, where each one or zero is called a bit (the term is derived from binary digit). That is, a bit is either a 0 (zero) or a 1 (one).

A bit is the smallest unit of information. The 1 or 0 can be thought of as ‘yes or no’, ‘on or off’, or ‘true or false’, depending on the context.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a byte?

A

In computers, bits are typically organised in groups of eight, where a sequence of eight bits is usually known as a byte (a byte has 256=28 possible values). Sometimes a byte is referred to as an octet.

Half a byte (4 bits) is sometimes called a nibble (many Computer Scientists are fond of bad puns).

A kilobyte (kbyte) ought to be 1000 bytes, but is actually 1024 bytes, because 210=1024.

Similarly a megabyte (Mbyte), gigabyte (gbyte) and terabyte (tByte) are equal to 220, 230 and 240 bytes, respectively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between the IEC byte representations and the metric byte representations?

A

The metric system is in base 10, whereas IEC is in base 2.

e.g. A kilobyte is 10002 bytes, whereas a kibibyte is 10242 bytes

“The kibibyte is closely related to the kilobyte. The latter term is often used in some contexts as a synonym for kibibyte, but formally refers to 103 bytes = 1000 bytes, as the prefix kilo is defined in the International System of Units.”

Note: When a laptop is sold with a 1TB hard drive, that means the hard drive is 10004 bytes in size, but when converted to gibibytes (the actual representation of binary data) it roughly equates to 931GiB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between MB & MiB, GB & GiB etc…

A

The former is base 10 (kilobyte) whereas the latter is base 2 (kibibyte)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is hexadecimal?

A

Hexadecimal (hex) is a base 16 number representation.

Four binary digits can represent 16 values and a hex digit can represent four binary digits. For convenience we often use hex rather than binary to write numbers as stored in a computer (remembering, of course, that all computers actually operate in binary).

In order to distinguish between decimal and hexadecimal, it is common to prefix a hexadecimal number with the string 0x.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you convert binary to hex?

A
  1. Break the binary number up into nibbles (4 bits)
  2. Convert those bits into hex characters (0-F)

e.g.

100111001100

1001 = 9, 1100 = C, 1100 = C

0x9CC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the main main components of a computer?

A

The Hardware:

  • stores machine instructions (compiled programs) in main memory;and
  • executes machine instructions.

The Operating system (the OS) is a collection of computer programs that:

  • provides an interface between a user and the hardware;and
  • provides an interface between the users and the system resources, such as the file system and print services.

The Application programs (or apps):

  • provide specialised computing tools for the end user;
  • include word processors, web browsers, database management systems, games,etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the most popular ISA’s (Instruction Set Architectures)?

A

As of today, the two most widely used ISA (Instruction Set Architecture) are the Intel x86 and ARM architectures.

  • All of Intel and AMD processors (across desktop,laptops to servers) uses x86 ISA
  • ARM ISA is used by most of the mobile processors.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between a CISC processor and a RISC processor?

A

Complex Instruction Set Computer (CISC) processors, like the x86, have a rich instruction set capable of doing complex things with a single instruction. Such processors often have significant amounts of internal logic that decode machine instructions to sequences of internal operations (microcode).

RISC architectures, in contrast, have a smaller number of more general purpose instructions, that might be executed with significantly fewer transistors, making the silicon cheaper and more power efficient. Like other RISC architectures, ARM cores have a large number of general-purpose registers and many instructions execute in a single cycle. It has simple addressing modes, where all load/store addresses can be determined from register contents and instruction fields.

So ARM is a simpler architecture, leading to small silicon area and lots of power save features, which made it attractive for all sorts of battery operated devices. while x86 becoming a power beast in terms of both power consumption and production.

“Processors that have a RISC architecture typically require fewer transistors than those with a complex instruction set computing (CISC) architecture (such as the x86 processors found in most personal computers), which improves cost, power consumption, and heat dissipation. These characteristics are desirable for light, portable, battery-powered devices‍—‌including smartphones, laptops and tablet computers, and other embedded systems.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the two main components of the processor?

A

A processor (CPU) incorporates two main components:

  • the control unit – that is responsible for performing the instruction cycle, i.e. determining what should be done next;
  • the arithmetic logic unit (ALU) – that is responsible for performing arithmetic and boolean (logical) operations,i.e.actually performing the computations.

Every processor has an associated instruction set, which is the collection of instructions that the processor can process. This instruction set is specific to the type of processor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are registers?

A

Every processor has a number of special storage locations called registers.

Registers are reserved for very particular purposes. They:

  • have very limited capacity (they have less than 100 bits each);
  • can be accessed very quickly by the processor;
  • are very limited in number (typically there are less than 40 of them).

Types of registers include:

  • data registers;
  • index registers; and
  • control registers.

The exact nature of the set of registers will depend on the particular type of processor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the uses of registers?

A
  • the program counter (instruction pointer), which points to the memory location containing the instruction currently being executed;
  • memory management (i.e. deciding which portions of the computer memory are used for which programs);
  • stack management (where the stack is a special area of memory reserved for temporary storage);
  • storage for intermediate results in calculations.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a computer program?

A

A computer program is a sequence of machine instructions that can be understood by a processor

A machine instruction specifies:

  • the operation to be executed (the op code);
  • the location(s) of the operand(s) in memory (where the operands are the values used as inputs to the operation). It is important to note that the numbers of memory locations are referred to as addresses.

For example,an instruction might specify:

Add (the contents of memory address) x to (the contents of memory address) y

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are some examples of instructions?

A

Typical examples of machine instructions include:

  • Transfer data to a register from a specified location in computer memory (recalling that each memory location has a unique address);
  • Transfer data from a register to a specified location in computer memory;
  • Jump (transfer execution) to a specified location in computer memory, i.e. modify the program counter,which determines which instruction will be performed next;
  • Perform an arithmetic or logical operation on one or more values at specified locations,and store the result somewhere,e.g.in a specific register;
  • Transfer data to or from a specified input/output(I/O) device;
  • Change the contents ofa control register.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is a compiler?

A

Programs which can convert programs written in a high-level language into sequences ofmachine instructions are known as Compilers.

A compiler can include checks for poor programming practices (e.g. those which are likely to lead to security issues).

Compilers can have various settings, e.g. so that when developing a new program, the compiler includes lots of extra checks to help in debugging, i.e. the process of removing errors from a program while itis being written.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does the control unit do?

A

The control unit is responsible for performing the instruction cycle:

  • • it fetches an instruction from the memory location (address) specified by the program counter and stores it in the instruction register;
  • • it decodes the instruction to determine what action the CPU should take;
  • • it executes the instruction.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Why does the instruction register need to be secured?

A

Changes to the instruction register must be strictly controlled. If a malicious party is able to change the contents of this register, then he/she can determine which instruction is executed next.

Typically, things are arranged so that changes to control registers (and other privileged operations) can only be made by the operating system, i.e. by a trusted entity

In a similar way, changes to the program counter mustbe strictly controlled:

  • an attacker that is able to change the contents of this register can decide which machine instructions are executed;
  • protecting memory locations (registers and main memory) that control which machine instructions are executed is an essential partof computer security.
24
Q

What is a compiled program?

A

Compilers are typically used with so called imperative or procedural programming languages, such as C, C++, Go and Pascal.

Such languages are very widely used.

Firstly the program is written to produce the source code. Software of all types is often referred to simply as code.

This source code cannotbe executed directly on a computer

There are three main steps in the use of compiled programs:

  1. Compile the source code (using a platform-specific compiler) into object code:
    • compiler generates machine instructions and memory references for machine instructions;
    • may involve linking and compiling external functions provided by standard libraries.
  2. Load the object code (the program) into the computer’s main memory:
    • this may involve linking to external functions, e.g. provided by the operating system, e.g. in the form of .dll (dynamic linked library) or .so files.
  3. Execute the program.
25
Q

What is an interpreted program?

A

Interpreters are typically used with programs written in declarative (including functional and logic) programming languages such as Haskell or Prolog.

As with the use of compilers, first the program is written to produce the source code. It is what happens nextthat differentiates interpreted from compiled code.

The program is then immediately executed using an interpreter, a program that ‘runs’ (interprets) the instructions contained in the source code. That is, the instructions in the high level language are translated into machine instructions ‘on the fly’, instead ofin advance.

An interpreter can be thought of as a virtual machine that provides an interface between the source code and the hardware. This virtual machine is an imaginary computer that can directly operate on the commands of the high level programming language.

Some languages, notably Java, are part compiled (into Java bytecode) and part interpreted (by the Java virtual machine).

26
Q

What is a variable?

A

When writing computer programs in a high-level language we use variables to store working data. These variables can be given memorable names which reflect their purpose.

Variables can be used to store various types of information, e.g. integers, strings of characters,floating pointnumbers,…

In a high-level language program, the type of a variable is used to define the nature of the data stored in that variable.

When a high-level language program is translated into a sequence of machine instructions,the variable names are converted into numerical memory addresses.

27
Q

What is a function signature?

A

Acomputer programmer using a pre-written function does not need to know how the function is implemented. The programmer only needs to know what inputs to supply to a function, and the outputs that the function will return. That is, the programmer can treat a function as a ‘back box’,with known inputs and outputs.

The signature (or type) of a function specifies the types of its inputs and outputs. The signature int power(int a, int n) defines a function power that takes two integers as inputs and returns an integer.

28
Q

What is a shared library?

A

Ashared library is a language-specific suite of functions that provides a ‘toolbox’ for programmers. The functions in such a library will be designed to do things that are needed by many programs. Examples of types of functions in such a library include:

  • string-handling functions;
  • mathematical functions;
  • drawing and windowing functions (for Graphical User Interface (GUI) design);
  • cryptographic functions.

Such a library saves developers from ‘reinventing the wheel’. That is, a developer can write a program which calls these functions, without having to write new code to implement them.

29
Q

What is a data structure?

A

Adata structure is a particular way of storing and organising data in a computer (a tool of a high level programming language). Data structures are used in almost every program or software system. They are essential components of many algorithms, and they make possible to manage and process large volumes of data in efficientand simple ways.

Examples of data structures include arrays, stacks,linked lists,trees, heaps,etc.

The use of data structures enables programs to be written which operate on the data structures as components, rather than simply on single data elements. This can greatly simplify and clarify the task of the programmer.

30
Q

What is the stack data structure?

A

A stack is a last in, first out (LIFO) data structure, analogous to a stack of documents on a desk. A stack has two fundamental operations associated with it:push and pop:

  • the push operation adds an item to the top of the list, or initialises the stack if it is empty;
  • the pop operation removes an item from the top of the list, and returns this value to the caller.
31
Q

What is the heap data structure?

A

A heap is a tree-based data structure, in which every node in the tree has an associated key. It satisfies the heap property:

  • if B is a child node of A, then key(A) ≥ key(B);

This implies that an element with the greatest key is always in the root node.

Note that a tree is a special type of graph. A graph consists of a set of nodes (vertices) and a set of edges between defined pairs of nodes. A tree has the property that there are no circuits in the graph.

32
Q

What is the hash table data structure?

A

A hash table (or hash map) is a data structure that implements an associative array

  • a structure that can map keys to values.

It uses a hash function to compute an index into an array of buckets (or slots), from which the desired value can be found. Collisions: different keys may be assigned by the hash function to the same bucket.

33
Q

What is an operating system?

A

From the perspective of an application program, we can think of the operating system (OS) as an extended or virtual machine:

  • a computer has a very limited setof instructions;
  • the operating system extends the set of instructions that are available to programmers;
  • the operating system hides the details of the particular hardware on which the operating system runs.

Note that the descriptions in the next few slides are loosely based on Unix; however,at leastat this high level,Windows is quite similar

The operating system can also be thought of as a resource manager, that manages access to and protects:

  • the computer hardware;
  • a set of services and programs;
  • stored data.

It also typically provides a user interface (e.g. in the form of a shell or desktop), so that a human user can choose which applications run, manage files, install and remove applications,etc.

An operating system manages the interaction between the computer and peripheral devices. Each device has an associated device controller attached to the system bus:

  • the device controller contains a buffer (temporary storage for data) and control registers. A device driver is a piece of software that:
  • communicates with the device controller; and
  • provides functions to write data to the buffer from main memory and read data from the buffer and write it to main memory.

Device drivers are device and OS-specific.

34
Q

What are interrupts?

A

Peripheral devices communicate with the computer by means of special processor functions known as interrupts. As the name suggests, interrupts interrupt (stop) the current flow of execution of a program, and cause a different program to run. Each type of interrupt has a unique interrupt vector, i.e. a numerical value which indicates the type of interrupt The interrupt vector table (IVT) stores each interrupt vector along with the location of the program for dealing with the interrupt:

  • the IVT is stored in main memory (in an area reserved for use by the OS);
  • the IVT controls the flow of execution.

The IVT is an attractive target for an attacker:

  • if an attacker can change the IVT he can execute code of his choosing;
  • the IVT must only be changed by the operating system (or other trusted entities).
35
Q

What is mult-tasking?

A

All modern processors supportmulti-tasking:

  • memory and processor time are shared between multiple programs to maximise the use of CPU processing cycles;
  • for example, when one program is waiting for I/O, another program can use the CPU;

Although it may appear as if multiple processes are operating in parallel at the same time, in fact no more than one program is executed by the CPU at any moment in time. [This situation changes in modern multi-core processors which have more than one CPU – one processor chip can contain many CPUs].

36
Q

What is a process?

A

The concept of a process (or task) is fundamental to multi-tasking computers:

  • a process encapsulates all the information required to run a program;
  • the OS uses processes to manage the execution of multiple programs on the same CPU.

A process is defined by:

  • the machine instructions (the text section);
  • the contents of the CPU registers;
  • any global variables (the data section);
  • the contents of the process-specific stack;
  • the contents of the process-specific heap;
  • pointers to resources (such as files) that are currently being used by the process.
37
Q

What is the call stack?

A

A call stack (also known as an execution stack, control stack, function stack, or runtime stack, and often referred to as just the stack) stores information about the active functions of a program. Although maintenance of the call stack is important for the proper functioning of most software, the details are normally transparent to the author of a program written in a high-level language. The main purpose of a call stack is to keep track of the address to which each active function should return control when it finishes executing. There is usually a single call stack for each running program (or, more accurately, with each thread of a process). More generally, the stack is a section of computer memory used to store all the variables that are declared and initialised before a program is run. The heap is the section of computer memory used to store the variables created or initialised during execution of a program. That is, heap is an area of memory used for dynamic memory allocation. Blocks of memory can be allocated and freed in an arbitrary order. The pattern of allocation and size of blocks is not known until run time.

38
Q

What is the CPU dispatcher?

A

The two most importantresources ofa computer are CPU time and memory:

  • machine instructions are executed by the CPU;
  • the OS must ensure that all programs gain access to the CPU.

Process scheduling is used to determine whichprogram nextuses the CPU:

  • this is typically based on the priority of a process (a numerical value indicating how important the process is), as well as some kind of ‘round robin’ system, i.e. so that processes ofequal priority are given CPU time in turn;
  • no process should ‘die’ofprocessor ‘starvation’.

The assignmentofthe CPU to a process is done by the dispatcher:

  • the process is allocated a time slice (i.e. a specific period of time for it to execute) by the dispatcher
39
Q

What is the process execution state?

A

Every process has an executionstate. This state:

  • is maintained by the operating system;
  • defines how the process should be treated by the operating system.

The most common process states are:

  • running;
  • ready (to run);
  • blocked (waitingfor something to occur before it can run).
40
Q

How does a process transition between execution states?

A

When a program starts executing, a new process is created and added to the list of processes in the ready state, the ready list.

When it reaches the head of the ready list and the CPU becomes available the process enters the running state;

The process may enter the blocked state (waiting for I/O to complete);

Otherwise the process may be interrupted (time slice ends or higher priority process needs the processor) and returns to the ready state, and would typically be added to the bottom of the ready list (depending on its priority).

41
Q

What is the process control block?

A

The operating system requires a lot of information about each process so that it can resume execution when that process enters the ready state,including:

  • the execution state of the process (i.e. whether itis running,blocked or ready);
  • the value of the program counter and other registers;
  • memory management information (i.e. which areas of main memory are being used by the process);
  • references to I/O resources such as the set of files in use by the process.

This information is stored in a process descriptor or process control block (PCB), which is created, maintained and protected by the operatingsystem.

42
Q

What do linkers do?

A

To understand linkers, it helps to first understand what happens “under the hood” when you convert a source file (such as a C or C++ file) into an executable file (an executable file is a file that can be executed on your machine or someone else’s machine running the same machine architecture).

Under the hood, when a program is compiled, the compiler converts the source file into object byte code. This byte code (sometimes called object code) is mnemonic instructions that only your computer architecture understands. Traditionally, these files have an .OBJ extension.

After the object file is created, the linker comes into play. More often than not, a real program that does anything useful will need to reference other files. In C, for example, a simple program to print ‘Hello World’ to the screen would consist of:

printf(“Hello World!\n”);

When the compiler compiled your program into an obj file, it simply puts a reference to the printf function. The linker resolves this reference. Most programming languages have a standard library of routines to cover the basic stuff expected from that language. The linker links your OBJ file with this standard library. The linker can also link your OBJ file with other OBJ files. You can create other OBJ files that have functions that can be called by another OBJ file. The linker works almost like a word processor’s copy and paste. It “copies” out all the necessary functions that your program references and creates a single executable. Sometimes other libraries that are copied out are dependent on yet other OBJ or library files. Sometimes a linker has to get pretty recursive to do its job.

Note that not all operating systems create a single executable. Windows, for example, uses DLLs that keep all these functions together in a single file. This reduces the size of your executable, but makes your executable dependent on these specific DLLs.

43
Q

What is utility software?

A

Utility software is used to create new programs. Such software includes:

  • a compiler,which generates object code from source code;
  • a linker, which creates an executable program from object code;
  • a loader (part of the OS), which is responsible for loading the contents of an executable program (typically in a file) into main memory.

Recall that most machine instructions do something to operands, which are values that are stored either in registers or in main memory. Part of the linking and loading processes is to generate appropriate memory addresses for these operands.

44
Q

What is the program address space?

A

Source code makes references to variables and constants. By contrast, object code makes references to addresses in which variables and constants are stored.

The set of addresses referenced in the object code is called the address space.

The address space does notgenerally refer to actual physical memory locations.

The address space is virtual and addresses must be translated to physical computer memory locations at some stage. That is, an piece of software (an executable) will be constructed in such a way that it is designed to work in a fixed address space – however, it may be loaded into any part of the computer’s main memory.

45
Q

When does virtual address translation occur?

A

There are various possible occasions whenaddress translation might occur.

  • • At compile/link time:
    • this requires the compiler/linker to know where in main memory the program will be loaded;
    • such an approach is very rare today, since it is very inflexible (it means a program mustalways occupy same partof physical memory).
  • At load time:
    • this requires the code to remain in main memory once it has been loaded;
    • this is rare in multi-tasking systems because code may be re-located during execution.
  • • At run time:
    • this requires hardware support to translate addresses during the execution cycle;
    • modern processors provide support for run-time address translation, which is how modern computers work.
46
Q

How is memory managed in regards to executable programs?

A

Executable programs are loaded into main memory before execution.

Data is loaded into main memory before itis read or written.

Certain operating system data structures are also stored in the computer’s main memory.

The operating system has to manage all these competing demands for storage. In particular,the operating system has to ensure that:

  • confidential data is not read by unauthorised processes;
  • sensitive data is not modified by unauthorised processes.

Memory protection is used to ensure that a process only reads from, or writes to, memory locations for which it has the necessary authorisation.

47
Q

What is the virtual address space?

A

A virtual address space provides a way of partitioning main memory:

  • can use virtual memory management to isolate particular regions of memory;
  • can use virtual memory management for memory protection;
  • can also specify different types of access for differentregions of memory, e.g.:
    • a region containing a program can be read only;
    • a region containing data can be read/write.
48
Q

What is secondary storage?

A

Computer systems typically store large volumes of data:

  • main memory cannot be used to store the huge volumes of data processed by computers;
  • main memory is volatile, whereas a data typically needs to be stored for long periods of time;
  • hence we need a way of organising and storing large quantities of data.

Secondary storage consists of persistent, high-capacity storage media such as disk drives, DVD R, USB sticks. These forms of secondary storage have much slower access speeds than main memory (particularly in terms of latency, i.e. delay).

49
Q

What is a file system?

A

Secondary storage is typically organised using a file system:

  • an operating system will support one or more file systems;
  • a file system provides a way of organising, storing,retrieving and protecting data. A file represents a block of data that forms a logical unit:
  • the file system manages the storage and retrieval offiles;
  • a (computer) file is synonymous with a paper document. Every file is associated with a range of metadata containing information about the file, such as:
  • length, time of creation, time of last modification, owner-ID, access permissions, …

Different types of file will have differentassociated metadata types.

The file system is used to store data in, and retrieve data from, files. It provides a number of functions that can be called by application programs to interact with files. Typical operations provided by a file system include create, delete, open, close, read, write, append.

50
Q

What is the “file open” system function?

A

The file open function (a system call) is used to make a file available to an application program. When it receives a file open request,the system:

  • checks that the program is permitted to access the file (authorisation);
  • loads the file data into the process memory space;
  • adds a reference (a file handle) to the list of files being accessed by the program, where the file handle includes access control information that governs how the program can access the file (e.g. the program may be allowed to read the file but not modify it).

All calls to the open function will trigger a security check. This check will verify that the process that invoked the open function is authorised to open the requested file.

51
Q

What is a directory?

A

A directory is a user-friendly way oforganising files in a computer system:

  • it provides a structured view of the computer system, making it easier to manage files;
  • the directory is itself a special type of file that contains information about other files (namely the files contained in that directory);
  • directory names will typically form a hierarchical namespace to make it easier to locate resources.

A hierarchical namespace can be visualised as a tree-like structure:

  • the tree has a root directory;
  • the tree has the property that every (child) node has a unique parentnode;
  • the parentnode may have more than one child;
  • each file has a unique name called the absolute path name, derived from the nodes on the path from the root to the node correspondingto the file.

Each process has a working directory or current directory:

  • this working/current directory is determined by the user account information at authentication time;
  • the default current directory of a new process is that of its parent process;
  • a relative path name defines a path from the current directory;
  • in the example shown, /public_html/index.html is the path name relative to the directory /home/rorellana
52
Q

How does the operating system allow the user to interact with system resources?

A

The operating system provides an environment that enables the user to easily interactwith system resources:

  • often called a shell (in the case of a command-line interface (CLI)) or desktop (in the case of a graphical user interface (GUI));
  • a CLI is used to enter commands to run programs, print files, create or copy files, …;
  • a GUI enables a user to interact with windows and icons to run programs, print files, create or copy files,…

The user interface is a program that is run after a user has been successfully authenticated:

  • the process that is created when this program is run (recall that running any program involves creating a process) is associated with the security-related information for the user that has been authenticated;
  • any programs launched from that interface are associated with the same information;
  • in this way programs are associated with users, and so user-based access control and audit can be achieved.
53
Q

What is hardware virtualisation?

A

Hardware virtualisation involves hiding the physical characteristics of a computing platform from executing software. In such a case, the software executes on an ‘abstract’ (virtualised) computing platform.

The software that provides the virtualisation layer is called a hypervisor or virtual machine monitor (VMM).

A VMM creates a simulated computer environment, known as a virtual machine, for its guest software. The guest software is not limited to user applications; many VMMs allow the execution of complete operatingsystems. The guest software executes as if it were running directly on the physical hardware, exceptthat certain access restrictions may apply to:

  • physical system resources (such as network access, display, keyboard, and disk storage);
  • some peripherals, or only a subset of the device’s native capabilities may be available.
54
Q

Why does virtualisation involve a loss of performance?

A

Virtualisation necessarily involves a loss of performance, because of the resources required to run the hypervisor/VMM,and the need for translation of instructions.

As a result, there is reduced performance on the virtual machine compared to running ‘native’(i.e.in the non-virtualised way) on the physical machine

55
Q

What are the advantages of virtualisation?

A

Server consolidation allows many small physical servers to be replaced by one larger physical server:

  • increases utilisation of costly hardware resources such as CPU.

The hardware is consolidated,butOSs are not:

  • each OS runs inside a virtual machine;
  • a large server can hostmany such guest virtual machines.
56
Q

What is an example of a MIPS processor?

A

Note that this uses the ‘harvard memory architecture’ which stores the instructions and data in seperate storage locations, whereas the von Nuemann architecture uses shared memory.

This is a RISC based processor and has a fetch-decode-execute instruction cycle