Computers & The Internet Flashcards
What is an OS?
An operating system (OS) is a program that controls the execution of application programs and acts as an interface between applications and the computer hardware.
What are the objectives of an OS
It needs to be convenient, efficient, and have the ability to evolve.
What services do the operating system provide?
File management, input/output management, process management, memory management, and multiprocessor management.
What is the kernel?
The most central part of the OS. Its functionality depends on the OS design.
What is a kernel context switch?
Transition between user mode and kernel mode, they are computationally expensive (i.e. require a lot of CPU usage) therefore an OS tried to limit the number of context switches.
What is a monolithic OS structure?
All services are implemented by a large kernel, any new feature is added to the kernel, “everything is connected to everything”.
What are the pros and cons of a monolithic OS structure?
Pros – Communication with kernel is fast; Cons – Difficult to understand, difficult to modify, lack of security.
What is a layered OS structure?
Services are implemented by a large kernel which is organised into layers. Each layer can only communicate with adjacent layers, and any given layer only needs to know the functionality of adjacent layers.
What are the pros and cons of a layered OS structure?
Pros – It is easy to debug; Cons – Poor performance due to requiring traversal through multiple layers to obtain a service.
What is a microkernel OS structure?
Services are implemented by servers, and a small kernel delivering messages between them.
What are the pros and cons of microkernel OS structure?
Pros – Secure and reliable; Cons – Poor performance due to increased system-function overhead.
What is a modular OS structure?
Starts with a small kernel and additional services are loaded on demand via modules.
What are the pros and cons of a modular OS structure?
Pros – Fast because we don’t load unnecessary services and any module can directly communicate with any other module; Cons – As more modules are loaded it becomes similar to monolithic structure.
What is a virtual machine?
A host operating system provides virtual hardware to one or multiple guest OS’s. Enables multiple environments with different OS’s on one machine.
What is a file?
A file is a named collection of related information that is recorded on secondary storage (non-volatile memory). File extensions help the OS determine how to interpret the file.
What are the attributes of a file?
Typical file attributes include: The name of the file, the identifier of the file, the location of the file on a storage device, the size of the file, the protection mode of the file (permissions), and the times when the file was created, accessed and modified.
How does file management work in linux?
In Linux everything is represented by a file in the file system. There are six types of files: Regular files, directories, special files, pipes, links, and symbolic links. There is also a tree-like inode pointer structure.
What are hard and soft links?
Hard links – point to a file via its inode, this means if the file is moved/deleted the link will still work. Soft (symbolic) links – pointer to a filename, this means if the file is moved/deleted the link will still work.
What are blocks?
In Linux, files are allocated in blocks, with each block typically being 4096 bytes.
What is the Inode Pointer Structure?
This is used by the inode of a file to list the addresses of files data blocks. This consists of fifteen pointers, twelve of which point directly to blocks of the file’s data (direct pointers). Then there is a single indirect pointer (a pointer that points to a block of pointers that then point to blocks of the file’s data), a doubly indirect pointer (a pointer that points to a block of pointers that point to other blocks of pointers that then point to blocks of the file’s data), and a triply indirect pointer (a pointer that points to a block of pointers that point to other blocks of pointers that point to other blocks of pointers that then point to blocks of the file’s data).
What are magnetic disks and how do they work?
These are primarily HDD’s but also floppy disks. A magnetic disk has a number of spinning circular platters, over which hover some heads attached to a movable arm. The magnetic disk is read/written by having the head sense/change the magnetism of a sector. At a bit level magnetism in one direction represents a one, and magnetism in the other direction represents a zero. Each platter is divided into circular tracks, and each track is divided into sectors. A set of tracks across different platters at a given position make up a cylinder. Each sector has a fixed amount of data (usually 512 bytes), which is the smallest unit of data you can transfer to or from a disk. A magnetic disk is read/written by moving the arms in/out to the requires cylinder. All heads/arms move together. The platters rotate; the rotation speed is related to the data transfer rate.
What are SSDs’ and how do they work?
A SSD has no moving parts and instead stores data using flash memory. A SSD has a controller (an embedded processor), buffer memory (volatile memory), and flash memory. A typical SSD might have 4 kB pages and a 512kB block size, which means each block has 128 pages. The act of erasing flash memory requires a high amount of voltage, is rather slow, and can only be done on block level. Reading and Writing is done on page level and is fast to do. Overwriting requires an erase operation, and is therefore slower than reading or writing to an empty drive. A SSD is read by: copying a flash memory page into the buffer and reading data from the page in the buffer. A SSD is written by copying a memory block into the buffer, erasing the block in flash memory, modifying the block in the buffer, and writing the block from the buffer to the flash memory.
What are the pros and cons of SSDs’ over Magnetic Disks?
SSDs are faster, more reliable, more expensive, and more power efficient than magnetic disks. However SSD’s deteriorate with every write process.
What is Wear-Levelling?
A block will fail once it reaches a critical number of writes. Wear-levelling spreads out the writes evenly among the blocks. There are two types: Dynamic and Static. It is applied by the controller.