week 4 - L1 - Linux Operating System Flashcards

1
Q

The Linux OS comprise a number of elements. What are they?

A
Bootloader
Daemons
Shell
Graphical Server
Kernel
Desktop Environment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Bootloader

  • what is it?
  • is it part of the kernel?
A
  • Bootloader – software that manages the boot process of a computer
  • (not part of the kernel)

o Ex the dual-boot in labs that make you choose between windows and linux)

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

Kernel

A
  • Kernel – (lowest level) core of the operating system

o Manages the CPU, memory and peripheral devices

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

Daemons

  • what are they?
  • when do they start?
A
  • Daemons – the background service (like printing or sound scheduling)

o They either start during the boot OR after you log in the desktop

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

Shell

A
  • Shell – command line interface (CLI)

o (basically terminal where you write code)

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

Graphical Interface

- what does it display?

A
  • Graphical Server – sub-system that displays the graphics on the monitor (Wayland or X)
    o Basically display the graphics on the monitor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Desktop Environment

A
  • Desktop Environment – user interface* such as GNOME, KDE, XFCE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Multi-tasking

A
  • Linux and other Unix-like operating system have been designed from the ground up as complete time sharing systems, that is, as both multitasking and multi-user systems.
  • A multitasking system: allows multiple processes to operate seemingly simultaneous without interfering with each other
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Multiuser

A
  • A multi-user system: allows multiple users to use the system at the same time, with each having the illusion they’re the only ones using it (they’re the sole user)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Linux layers

  • what are the 3?
  • what do each of them do?
  • more about them:
  • what time of control over CPU does the kernel have? what about the processes?
A

User Space
Kernel
Hardware

User space: Shell, GUI, Web Browser

Kernel: Memory Management, Process Management, Network stack, Device Drivers, System calls

Hardware: CPU, RAM, Hard drive, Network Card

Hardware
– CPU, memory, storage, network interfaces

Kernel
– Core of the OS responsible for managing processes, memory and device hardware
– unrestricted access to the CPU and memory

User space

  • Consisting of processes (running programs) that the kernel manages
  • restricted access to memory and safe CPU operations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Process

  • what is it?
  • what does it consist of?
  • what does each process have? what do we use to identify it?
  • who schedules the process to run on a CPU?
  • what happens to the processes and CPU time? and what is it known as
A

An execution/instance of a program (task)
- is the basic unit of EXECUTION in a Linux OS

A process consists of the code and data (in memory) to run

A process has a PROCESS IDENTIFIER (PID)

The kernel schedules the process to run on a CPU

CPU time is distributed between running processes, which is known as scheduling
o Other processes may be swapped to swap space on persistent storage or suspended

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

what does the userspace contain?

what does the kernel contain?

what does the Hardware contain?

A

User Space:

  • User Applications,
  • GNU C library

Kernel Space:

  • System call interfaces,
  • Generic call interfaces,
  • Architecture Dependent Kernel Code

Hardware:

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

user and kernel space

  • what memory space does the process occupy? what about the kernel?
  • what happens in the userspace?
  • what must happen to the address space used by the kernel?
  • how does the userspace communicate with the kernel?
A
  • each process occupies its own virtual memory space
  • the kernel occupies a single protected address space
  • user space is where the processes are executed
  • it also contains the GNU C library (glibc) shared by many processes

the address space used by the kernel must be protected from the applications that run in user space

userspace uses system calls to communicate with the kernel
the system call interface provides a means to perform function calls from user space into the kernel (i.e. read and write)

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

about the processing scheduling algorithm

  • how is it?
  • what about the code to switch processor contexts?
  • what does the scheduler choose?
A

The scheduling algorithm is generic

The code to switch processor context is not generic, because each CPU architecture has its own registers

The scheduler chooses the next process to run and then calls the architecture-specific code to apply the context switch

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

what are the components of the kernel?

basically what we learned in he last weeks, the lecture titles

A
System call interface
Memory management 
Process management
Virtual file system
Device drivers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what are the main responsabilities of the kernel?

A
  • process and thread creation and termonation
  • CPU scheduling
  • Signal handling
17
Q

process management

  • what does it refer to? regarding the CPU
  • what is the changing of processes on CPU called?
A
  • PROCESS MANAGEMENT
    o The execution and scheduling of processes on the CPU
    o Context switching
18
Q

memory management?

  • chunks?
  • swapping?
  • page fault?
A
  • MEMORY MANAGEMENT
    o The memory is managed in chunks called pages
    o Swapping – moving pages from RAM onto disk to free up space
    o Tracking page faults – this occurs when a process accesses one of its pages that is not resident in physical memory RAM
19
Q

Scheduling

- what is it used for? regarding the processes?

A
  • Scheduling is used to allow processes to share CPU resources
    o Basically so all the processes can use the CPU

scheduling is basically scheduling processes to run on the CPU

20
Q

Context switching

  • what happens to the processes and control of the CPU
  • what are the steps?
  • what must the kernel do in a multi-CPU- system?
A
  • Context Switching – one process gives control of the CPU to another process
  • Kernel interrupts the current process running on CPU (interrupts can be triggered by timers)
  • Kernel records the current state of the CPU (i.e. program counter and registers) and memory required for resuming the process that has been interrupted
  • Kernel performs housekeeping tasks (e.g. collecting data from I/O)
  • Kernel now ready to run another process and prepares CPU
  • Kernel tells the CPU the time-slice duration to run the next process
  • Kernel switches the CPU into user mode and hands control to the new process
  • With multi-CPU systems – the kernel needs to maximize the use of all available CPUs
21
Q

signals

  • when do they occur?
  • what can the kernel use the signal for?
  • when can the signals be handled by the process?
  • what sources can generate signals?
A

Signals are generated when an event occurs that requires attention (when something happens basically that needs to be solved)
be thought of as the software version of hardware interrupts

The kernel can use the signal for example to kill a process

The process can handle the signal if it has declared a SIGNAL HANDLER IN ADVANCE

signals can be generated by:

  • Hardware
  • System Kernel
  • Other processes
  • User

o Hardware – Example: division by zero, address protection (this are errors)
o System Kernel – Example: notifying the I/O devices for which a process has been waiting that is available
o Other processes – Example: a child process notifying its parent that is has terminated
o User – Example: pressing a keyboard sequence (ctrl + c) that raises a terminate signal

22
Q

memory management

  • name for the memory of a process
  • what is it divided in? what size do they have?
  • what illusion is produced by virtual memory?
  • what’s physical memory divided into?
  • what does each process have? what does it store?
  • what needs to happen so that a process is able to exceed it’s memory?
A

Memory management
Virtual memory – kernel memory management
- The memory space of a process is described as virtual (construct provided by the kernel) rather than physical memory that only the kernel sees

  • Virtual memory is divided into chunks called pages (4096 bytes, or 4kB for most architecture)
  • Virtual memory gives a process the illusion that it has its own address space that is protected from other processes, which means that a process cannot peak into other processes virtual memory
  • Physical memory is divided into page frames
    o They are the same size as process pages (4096bytes)
  • Each process has a page table which maps virtual( also called logical) page numbers to physical RAM frame numbers
    o Basically connects virtual memory to physical memory
  • A process virtual memory address can exceed the physically installed memory as the kernel can enable the process to continue by moving pages around, by storing pages of a process that are currently not being used on disk instead of physical RAM
23
Q

swapping

  • when does it happen?
  • how does it work?
  • what is swap space?
  • what can the swap space be?
A

When physical memory is exhausted

pages are moved out of the physical memory aka RAM onto the disk
RAM -> disk

  • Swap space in Linux is used when the amount of physical memory(RAM) is full
  • Swap space can be a dedicated swap partition, a swap file, or a combination of both
24
Q

File management

  • where does the virtual file system sit?
  • what does it allow?
  • what is the Linux filesystem organized in?
  • underneath the file system, files are represented in …?
  • what information about the file do these things contain?
A

File management / Virtual file system
- The virtual file system is a layer that sits on top of an actual file system and which allows a user to access different types of file systems
o Macro basically, and let you choose which type of file system

  • The Linux file system is organised into directories for easy navigation and use
  • Underneath the file system, files are represented by inodes
    o All the information related to the file are represented by inodes
  • Inodes contains metadata such as:
    o Location: pointer to file location on system
    o Size: current file size
    o Protection: controls who can read, write etc.
    o Time, date: for usage monitoring
25
Q

block devices

  • what are files stored on?
  • what is it? a sequence of …
  • what is the maximum length of a block device known as?
  • define BLOCKING
  • define UNBLOCKING
  • what is blocked data normally stored in?
  • what does the blocking speed up?
A

Block devices
- Files are stored on block devices

  • a block device is a sequence of bytes or bits, usually containing some whole number of records,
  • having a maximum length, a block size
  • BLOCKING – the process of storing data into blocks
  • DEBLOCKING – the process of extracting data from blocks
  • Blocked data is normally stored in a data buffer and read or written a whole block at a time
  • Blocking speeds up the handling of data-streams
26
Q

services - daemons

  • when do they start?
  • where do they run?
  • what are they?
  • examples
  • services that end in ___ and ___ are daemons
A

Services (daemons)

  • System services are processes started by the operating system and sit in the background waiting to answer requests
  • In a Linux system a service is called a daemon
  • Example: the cron daemon – schedules tasks (i.e. runs programs) at specified times
  • A daemon is a good spirit that constantly works in the background

o i.e. background services (disk checking, scheduling logging, print managers)

  • Cron is a daemon for scheduling processes at regular intervals
  • In Linux services ending in a and d such as httpd and sshd are daemons (background services)
  • Systemd handles services in Linux
27
Q

device drivers

A

Device drivers
- A device that enables the kernel to communicate with a piece of hardware
- Linux uses loadable kernel modules which allow drivers not currently resident in memory to be dynamically loaded
o (example different wifi cards have different settings, and they are loaded in the memory dynamically)

28
Q

Linux system calls

  • what do system calls do?
  • who do they provide an interface between?
  • how are they made?
A

Linux System Calls
- A system call is how a program requests a service that the kernel provides

  • System calls provide an INTERFACE between processes and kernels
  • They make a request to the operating system to perform some activity
  • The way a system call is usually made is by writing a C function that calls a kernel function with matching arguments
    o Example include fork(), wait(), execve(), write()
29
Q

POSIX

A

POSIX(Portability standard)

- POSIX “Portable Operating System Interface [for Unix]” to define the application programming interface (API)