Chapter 5 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Why is an OS (operating system) needed?

A

▪ Provides the environment (software platform) in which other programs can be run.
▪ Provides a user interface between user and hardware: the user can interact/communicate with the machine.
▪ Hides complexity of hardware from user.
(The hardware is unusable without an OS)

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

Examples of operating systems:

A
▪ Windows
▪ MAC OS X (Apple MACs)
▪ Android OS
▪ iOS (iPhone/iPad)
▪ MS-DOS
▪ Google Chrome OS (based on Linux)
▪ Linux
▪ UNIX
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the user interface/human computer interface (HCI) provide?

A

▪ Controls communications between user and hardware: makes navigation around the system easier.
▪ Provides facility for user inputting data
▪ Provides facility for outputting to the user
▪ User interface can be either Command Line Interface (CLI) or Graphical User Interface (GUI) (or menu-driven).

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

What is the Graphical User Interface (GUI)?

A

▪ Previously known as WIMP – Windows, Icons, Menu and Pointing device.
▪ The user interacts with icons (pictures or symbols), through a mouse, keyboard or touchscreen.

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

What is the Commnad Line Interface (CLI)?

A

▪ Provides a method of interaction that is non-graphical.
▪ A text-only service with feedback from the OS appearing in text.
▪ Requires knowledge of the written commands available on a particular machine. Instructions must be typed exactly with no errors.

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

What are the advantages of using CLI?

A

o The user is in direct communication with the computer.
o A faster way to get tasks done.
o More flexible than a GUI.
o Uses less memory (on the disk and in RAM).
o Some games, such as Minecraft, also make use of a command line tool: allows the user to bypass the main interface and alter the game’s mechanics or environment.

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

What are the tasks of the operating system?

A
Memory Management
Security Management
File Management
Process Management
Hardware Management
Interrupt Handling
Provides a User Interface
Provides a Software Platform
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does the OS manage memory?

A

Ensures that two programs do not try to use the same space.

(memory optimisation)
1. Allocates and deallocates RAM to programs.
2. Keeps track of allocated and free memory locations: determines where the programs are stored.
3. Swaps data to and from the hard drive.
(memory organisation)
4. Determines how much memory is allocated to a program and how it can be split up in the most appropriate & efficient way by:
- Handles virtual memory
- Paging // segmentation
5. Memory protection, preventing a process accessing memory not allocated to it.

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

Paged memory

A

Memory is split up into blocks of a fixed size and memory management then allocates a partition to an application.

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

Segmented memory

A

Memory is split up into blocks of size that can vary.

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

Virtual Memory

A

Storage mechanism which offers user an illusion of having a very big main memory.
It is done by treating a part of secondary memory as the main memory.

It enables a computer to be able to compensate shortages of physical memory by transferring pages of data from random access memory to disk storage. This process is done temporarily and is designed to work as a combination of RAM and space on the hard disk.

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

How does the OS manage files (secondary storage)?

A

Maintains directory structures // Provides file naming conventions // Controls access.

  1. Maintaining the directory structures
  2. Specifies tasks that can be performed on a file (e.g. open, close, delete, copy, create, move etc.)
  3. Defining file naming conventions which can be used (filename.extension)
  4. Controls access rights to files, password protection, making file sharing possible
  5. Specifies the logical method of file storage (e.g. FAT or NTFS, depending on the type of disk formatter that is used)
  6. Ensuring memory allocation to particular files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does the OS manage hardware?

A

▪ Controls access to all input/output devices connected to a computer.
It is made up of sub-management systems like printer management: controls queues and buffers.

  1. Communicating with all input and output devices using device drivers.
  2. Translating data from a file defined by the OS, into a formed that the input/output device can understand using device drivers.
  3. Ensuring each hardware resource has a priority so that it can be used and released as required.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

For example how does the OS manage a printer?

A

▪ Installs printer driver (locates and loads it into memory).
▪ Sends data to the printer buffer to print. If printer is busy or the print job has a low priority, it sends documents to the print queue.
▪ Sends commands to printer throughout the printing process.
▪ Receives and handles error messages and interrupts from the printer.

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

How does the OS manage processes?

A

▪ Allocates resources and permits the sharing and exchange of data: allows all the processes to be fully synchronised.

▪ Manages the scheduling of process.
▪ Allowing multi-tasking.
▪ Manages the resources the processes need.
▪ Enables processes to share information.
▪ Prevents interference between processes.

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

How does the OS manage security?

A

Ensuring the integrity, privacy and availability of data:

o Provides recovery (and system restore) when data is lost.
o Maintains access rights for users.
o Setting up user accounts (to prevent users entering ‘private areas’).
o Checks usernames and passwords (authentication).
o Provides automatic backup.
o Carriesout OS updates.
o Ensures antivirus software is always up-to-date.
o Communicates with firewall to check all traffic to and form the computer.
o Helps to prevent illegal/unauthorised access (ensuring the privacy of data).

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

How does the OS handle interrupts?

A

▪ Identifies priorities of interrupts.
▪ Saves data on power outage.
▪ Loads appropriate Interrupt Service Routine (ISR).
▪ Stops the execution of the current process.
▪ Stores the values of the current process on the stack.

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

Examples of utility softwares:

A
o Hard disk formatter
o Virus checker
o Defragmentation software
o Disk contents analysis/repair software
o File compression
o Back-up software
o Firewall
o System Clean up
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How does the OS format the hard disk?

A

▪ Prepares the disk for initial use. Prepares it to allow data/files to be stored and retrieved.
▪ Organises storage space by assigning it to data blocks, called partitions. The drive is partitioned into logical drives.
▪ Sets up the specified file system in order to be able to format the partitions.
o Writing files which will hold directory data and table of contents at the beginning of each partition ➔ the OS recognises a file and know where to find it on the disk surface.
▪ May check for errors on the disk
o Finding bad sector errors – these sectors are flagged as ‘bad’ and replaced by unused sectors.
o Bad sectors can be classified into hard (difficult to repair) or soft.
- Hard: e.g.: caused by manufacturing errors
- Soft: e.g.: sudden loss of power leading to data corruption in some of the sectors

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

What does a virus checker do?

A

Provides defence against malware.

o Check software/files before they are run/loaded.
o Compare possible viruses against a database of known viruses.
o Carry out heuristic checking.
- Checking software behaviour that could indicate a possible error.
- Put files/programs which may be infected into quarantine to delete the virus or allow the user to decide.

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

How does the defragmentation software work?

A

▪ Re-organises the disk contents.
▪ Moves split files so they are in contiguous sectors, considerably reducing HDD head movements and allowing faster data access time.
▪ Creates a larger area of (contiguous) free space.

22
Q

What does a disk analysis/repair software do?

A

▪ Checks disk drives for errors, bad sectors, empty space and disk usage by reviewing files and file folders.
▪ Marks bad sectors on the disk (as unusable).
▪ Retrieves data from a damaged disk.
▪ Removes unwanted files and downloads.
o Deleting auto saving files, cookies, download files, etc.

23
Q

What do disk compression and file compression softwares do?

A

▪ Disk compression software compresses data before storage on an HDD.

▪ File compression saves storage space and makes it quicker to download/upload files and quicker to send files via email.

24
Q

What does a back-up software do?

A

▪ Makes copies of files on a portable storage device.
▪ Allows a schedule for backing up files to be made.
▪ Only carries out a back-up procedure if there have been any changes made to a file.
▪ It can restore data, files or the computer from the back-up (needed if files have been lost).
▪ It can create a restore point – restores the computer to its state at some point in the past (needed if file is deleted and cannot be recovered by any other utility).
▪ Provides options of where to save back-up files.

25
Q

What are program libraries?

A

Libraries on a computer where programs and routines are stored which can be freely accessed by other programmers for use in their own programs.

26
Q

What is a library program?

A

Program stored in a library for future use by other programmers.

27
Q

What is a library routine?

A

Pre-existing and tested code available in the development system of programming language that
can be linked into a program to perform common or complex tasks.

28
Q

+ of using library routines?

A

▪ The code is already written, so the programmer is not starting over again which saves time.
▪ The code has been used and tested by many people, so it should be relatively error-free and it reduces time testing.
▪ Users do not need to work out how to write complex algorithms (e.g. mathematical/graphics functions). They can use it and be sure that it will perform as it
should (simplifies the program).
▪ Use of named library functions can simplify the program and make it easier to read.
▪ Leads to modular programming, which means several programmers can be working on the same code at the same time.
▪ The code should conform to industry standards, and therefore contribute towards a more robust program.

29
Q
  • of using library routines?
A

▪ Compatibility issues - may not work with the other code/may require changing program for it to work.
▪ Not guaranteed thorough testing – may be unknown or unexpected bugs / virus.
▪ Library routine may not meet exact needs – may give unexpected results.
▪ If library routine is changed – there may be unexpected results / errors.

30
Q

What is are Static program libraries:

A

Software is linked to executable code in the library at the time of compilation.
So, the library routines would be embedded directly into the new program code

31
Q

What are Dynamic – Dynamic Link Library files (DLL):

A

Self-contained programs (shared library) that are already compiled and linked to the main program during run time (execution).
They are separate from the .exe file.
Can be made available to several applications at the same time.

32
Q

+ of using DLL files?

A

▪ The executable file is smaller, since DLL files are only loaded into memory at run time.
▪ Changes to the DLL file code are done independently of the main program, so there is no need to recompile the main program.
▪ A single DLL file can be made available to several application programs, saving space in memory.

33
Q
  • of using DLL files?
A

▪ The executable code is not self-contained; the DLL file(s) needed to be included at run time.
▪ Appropriate (linking) software must be available at run-time, to link the DLL files.
▪ The DLL file must be present, otherwise (unable to find X.dll) errors.
▪ Unexpected changes to the DLL file (/corrupted DLL file), could mean the program stops working as expected.
▪ Malicious changes to the DLL file, could install a virus on the user’s computer or corrupt related files.

34
Q

What is a translator?

A

System software that translates a program written in a high level or low level programming language to machine code.

35
Q

How many computer translators are there?

A

o Assembler
o Compiler
o Interpreter

36
Q

What is an assembler?

A

▪ Software that translates program written in (low level language) assembly language to machine code.
▪Object program is generated, the executable file:
- Can be loaded in main memory or stored on disk to be used later: a loader program is needed to load the executable file.
▪ The stored object program can be executed many times without being re-translated.
▪ Each line of source code generates one machine code instruction, one to one translation.
▪ Assembly language programs are machine dependent; they are not portable form one computer to another.

37
Q

Where can assembly be used?

A

Device drivers software is written in low-level language, where very close control of the processing in the CPU is needed.
(Drivers tell the computer how to communicate with, for example, a specific printer or scanner; graphics cards; boot code stored in ROM)

▪ Control programs in embedded systems in washing machines, modems, routers, aeroplanes, cars, digital watches etc.
▪ Real time applications that need an instant response; network software, medical equipment.

38
Q

What is a compiler?

A

▪ System software that translates program written in high level language in machine code.
▪ While translating an object program is generated, the executable file.
- It can be loaded in main memory or stored on disk to be used later: a loader program is needed to load the executable file.
- No need for the compiler then.
▪ The source code is translated all at once (in one go).
▪ A list of errors is produced at the end of the compilation process.
- You can go back and fix them.
▪ The stored object program can be executed many times without being retranslated. It needs to be re-translated when changes will be done in the source code.
▪ The compilation process is quite slow whereas the object code (executable file) will run very quickly.

39
Q

+ of a compiler?

A

▪ Produces an executable file.
▪ Once translated the compiler software is not needed to run the program.
▪ Compiled code should execute faster.
▪ The executable file produced by a compiler can be distributed without users viewing the source code. Users are unable to make changes to the program (secure).
▪ The final program does not need to be re-compiled each time it is run.
▪ The program can be compiled to run on different platforms.

40
Q

What is an interpreter?

A

▪ System software that translates program written in high level language to machine code.
▪ No object program is generated.
▪ Every line in a program is interpreted and then executed each time the program is run.
So, interpreter is always needed.
▪ If a syntax error is encountered, it displays an error message and stops until the correction is made.
- Makes it easier to develop software.
▪ Whilst interpreting is faster than the compilation process (each line is of code is translated immediately), interpreted programs take longer to run.
▪ Used when program development is completed.

41
Q

+ of an interpreter?

A

▪ Easier de-bugging.
▪ The interpreter stops when error encountered (no need to wait for the error report until the end of the process).
▪ The interpreter translates a statement then executes it immediately.
▪ Parts of the program can be tested, without all the program code being available.
▪ Used during program development.

42
Q

What does being “machine independent mean”?

A

High level programming languages are machine independent, portable.
This means that the program code can be translated to run on any type of processor (platform), provided there is a compiler or interpreter.

43
Q

What is partial compiling & interpreting?

A

▪ System that is partially compilation and partially interpretation.
- This is done to achieve shorter execution times.
▪ Source code is checked and translated by a compiler into object code, which is a low level machine independent code.
▪ To execute the program, the object code can be interpreted by an interpreter or compiled by a compiler.

44
Q

Partial compiling & interpreting in java/python?

A

▪ Java uses a two-step translation process.
Java code is partially interpreted – partially compiled.
▪ Code is translated first into intermediate code (bytecode) using the Java compiler.
▪ The bytecode is finally interpreted by the Java Virtual Machine.

45
Q

What is IDE?

A
Integrated development environment.
Used by programmers to aid writing and development of programs.
Examples of IDE:
PyCharm
Visual Studio
NetBeans
46
Q

What helpful features does the IDE have when coding?

A

▪ A source code editor.
▪ A compiler, an interpreter, or both.
▪ A run-time environment with a debugger.
▪ An auto-documenter.

47
Q

What are the features of the IDE source code editor?

A

▪ Program is written and edited without the need of separate editor: speeds up the development process.
▪ Colours code in a meaningful way.
▪ It offers context sensitive prompts with text completion for variable names and reserved words.
▪ It provides dynamic syntax checking.

48
Q

What are the features of the IDE’s compiler and/or interpreter?

A

▪ Interpreter often used for developing the program.

▪ Compiler used to produce the final version of the object code.

49
Q

What are the features of the IDE’s run time environment that includes a debugger?

A

▪ Debugger: aids the process of debugging; able to check for any logic errors & check if the program works as intended.
o The programmer goes through the program a line at a time (single stepping) or sets a breakpoint to stop the execution of the program at a certain point.
o Report window: shows the contents of the variables and expressions evaluated at that point in the program.

50
Q

What are the features of the IDE’s auto-documenter?

A

To explain the function and purpose of programming code.