CSCI 340 OS Midterm

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

What is file? What is file system? What is logical disk?

File system = a collection of info that OS maintains about all files stored on hard disk Logical disk = portion of hard drive described by a single file system, are completely independent of each other, each has its own OS

What is CPU core? What does it mean "quad-core CPU", "octa-core CPU" ?

Independent instruction executing unit, "quad-core" means 4 cores in the same processor simultaneously running programs independently

What is IPC?

Inter-process communication (IPC) refers specifically to the mechanisms an operating system provides to allow processes it manages to share data.

What is multitasking? How is it arranged?

Technique to pick simultaneous execution of multiple programs on a single CPU core, uses I/O controller (scheduling) to manage which process gets device, when, and for how much time

What do threads belonging to the same process share? What they don't share?

They share: -Text section -Data section They do not share: -Stack

What is thread of execution (a.k.a. just thread)?

Thread = a separate sequence/path of execution/executable instructions taken within a program

What is the memory address of a larger chunk of memory?

-

What is URL?

URL is the address of a resource on the Internet that is made to be more "English-like" or human-readable, it contains the protocol used to access the resource

What is memory stall?

Undesirable situation where CPU waits for RAM memory to deliver data

User threads vs kernel threads

User threads: Managed without the help of the OS Kernel threads: Managed with the help of the OS User threads are: +Fast to create & delete -One thread blocks all -Cannot use multiple cores Kernel threads are: +Can use multiple cores

How can we execute program written in higher-level languages?

Using a compiler (translates program to machine language for execution) or interpreter (translates program line by line during execution)

Why we might want to create new processes instead of new threads?

-Can run different programs -Fault independent

fork()

-Creates a copy of a calling process -Returns 0 to newly created process ("child") -Returns x > 0 to original process ("parent") -The child process copies all the data that comes before the fork function is called, including all variables -The Child executes everything AFTER THE FORK

exec()

-Exec(prog.file) -Wipes process clean in RAM -Fills the process w/ code and data from "prog.file" -Spawn() = fork + exec on child

Why we might want to create new threads of execution instead of new processes?

-Faster to create -RAM efficient -Context switch is faster -Shared memory by default

What are user and kernel modes? What are user and kernel level programs/processes.

-In user mode, the application program does not have direct access to system resources. In order to access the resources, a system call must be made (applications run in user mode) -In kernel mode, the program has direct and unrestricted access to system resources. (core OS components run in kernel mode)

List five process states (use the naming from our textbook and class please)

-New (not ready to use) -Ready (ready and willing) -Running (using the CPU right now) -Waiting (doesn't need the CPU right now) -Terminated (won't need the CPU anymore)

wait()

-Process execution pauses -Stay paused until your child terminates -Process is sent to a wait queue -Get child exit status and resume

What is the difference between process and program?

-Program = set of instructions written to perform a specific task -Process = instance of program

exit()

-Terminates the calling process -All resources belonging to this process are released -Process still remains as "zombie process" -returns "exit status"

Why IP address alone isn't enough for networking communications?

-They don't provide enough info about how to route data between networks -Can't identify specific process running on a device -Don't provide reliable, end-to-end communication on their own

Steps of machine cycle

1) Fetch 2) Decode 3) Execute 4) Write back

List of operating systems functions. For each item on this list, be ready to give a short description.

1) Running programs - 2) Managing CPU 3) Managing RAM 4) Managing storage devices 5) Managing I/O devices 6) Networking 7) User Interface 8) Security 9) Inter-Process Communication(IPC)

Understand what happens to processes in reality when process states change (don't be fooled by process "movements" in typical visualizations).

When the state of a process is changed, its PCB is unlinked from its current queue and moved to its new state queue

Examples of OS

Windows Linux MacOS Solarious Android iOS Unix

What is operating systems API?

Windows API, POSIX API -A set of programming instructions/standards for accessing and using services provided by an OS

What happens to a process when it requests I/O operation (like file reading) in the classic "blocking" scenario?

With blocking I/O a process is moved to the wait queue when an I/O request is made, and moved back to the ready queue when the request completes, allowing other processes to run in the meantime.

What is (networking) socket?

An endpoint for communication between two programs running on the network. It is a combination of IP address + Networking port Ex: 123.445.67:80 (IP:Networking port)

What is the length of memory address? What does it mean "32-bit address"?

An memory address is typically 32 bits long, 32-bit address means it requires a 32 bit memory pointer to represent it

Where does the process go once the I/O request is complete?

Back to the ready queue

What is byte? What is bit? How many bits are in a byte?

Byte: unit of data 8 binary digits long Bit: Unit of data (usually 1 bit long) 8 bits in a byte

Which computer component executes programs?

CPU

What is operating system kernel (central part of OS).

Central part of OS that performs most important tasks, one of the parts that is constantly loaded into memory

What is compiler? What are compiler advantages?

Compiler is a program that takes source code and translates it into CPU instructions, advantages: improved performance

What is the relationship between C++ variable, RAM and memory address?

Computer will allocates 4 consecutive bytes in memory for a C++ variable, when a value is assigned to the variable it is put in the memory address reserved for it

What is network (a bunch of computers connected together to exchange data)?

Connected computers/computing devices that can exchange data with each other.

What is "word"?

Data word = amount of data a computer can handle in one operation

What is DNS?

Domain Name System - translates domain names (URLs) to IP addresses to access a specific web resource

What does it mean to run a program?

Executing program code instruction after instruction

What are the properties of stack?

Faster than heap, has limited size, data stored can only be accessed by owner thread,

What is memory address?

A number that uniquely identifies a (memory) storage location.

What is process?

A program in execution, process is constantly changing and it interacts with OS

What are drivers?

A small program that handles interaction between OS and device, they are OS specific and device specific

What is an operating system?

A special program (needs CPU) that manages hardware and provides other programs with an environment to run

What is communication protocol?

A system of rules that allow communication/exchange of data between two or more entities of a communication system (TCP, IP, HTTP)

What is virtual memory?

A technique that allows a computer to fake larger RAM memory using the hard disk, makes it possible to run programs larger than what is in your system due to virtual mem

What is networking port?

A unique number that identify where network connections start and end or a connection endpoint

What is the language that the CPU understands?

Machine language

Can shared memory kind of IPC communication be used for two processes running on two different computers? Why do you think so?

No because shared memory requires a region of memory physically shared by multiple processes.

Can memory contain nothing at all?

No, memory can never be empty

Process Control Block (PCB). What typical components can you see there?

PCB = record that OS maintains for every process in the system -Process Identification (PID) -Process state -Register file -Program Counter -CPU scheduling info -Memory management info -List of opened files

What is POSIX?

Portable Operating System Interface -represents a set of standards implemented primarily for UNIX-based operating systems

What are well-known ports? (the answer "first 1024 ports" is worth 0 points)

Ports with predefined purpose (0 - 1023)

What are the properties of heap (it is fragmented, full of holes)? How does it affect the typical dynamic memory allocation like using the operator new?

Properties: slow, fragmented, full of holes it affects dynamic memory allocation bc processing time of heap is slower than stack, there is no automatic de-allocation so garbage collectors are needed, heap memory is visible to all threads.

How speed of CPU, RAM and hard disk compare to each other?

RAM slower than CPU, hard disks slower than RAM

Where is the running program stored? What else (other than the program code) is stored there?

RAM, open files are also stored

What do we know about RAM memory? (random-access, slow and volatile)

Random-access: takes small amount of time to access data Volatile: data is stored only for as long as power system is on

What is interpreter? What are interpreter advantages?

Reads and executes source code line by line without translating to machine code, advantage: portability (processes source code directly)

What is ready queue? How many ready queues do you expect in the system?

Ready queue = set of processes ready and willing to use CPU. The amount depends on the system.

What is RPC?

Remote Procedure Codes - used to invoke a procedure/start functions on remote computers/on a remote host

What is machine cycle?

Sequence of steps CPU takes to execute 1 instruction:

What is context switch?

Sequence of steps to switch CPU from executing one program to executing another 1) Pause Program 1, 2) Save context (PC, CPU Registers) to RAM, 3) Restore context of Program 2, 4) Resume Program 2

What are two general classes of IPC (shared memory and message passing)?

Shared memory and message passing

What is the idea of shared memory? What are advantages and disadvantages of shared memory?

Shared memory is a piece of RAM memory that can be read or written into by multiple processes simultaneously Advantages: Fast Disadvantages: Bug prone, same computer only

What is IP address? How does classic IP address (IPv4) look like?

A 32-bit number that uniquely identifies a host (like a computer or other device). IPv4 looks like: 126.45.0.67 (4 numbers from 0-255 separated by a period)

What is client?

A computer hardware/software that requests access to a service available on a server or information on a server

What is server? (like "web server" or "email server")

A computer program/device dedicated to providing information/a service in response to requests from a client

What is an executable file?

A file that contains a sequence of instructions that can be executed directly by OS

How does memory look like?

A linear array of bytes

Layout of a process in memory: text section, data section, heap, and stack.

From top down: 1) Stack, 2) space for heap/stack, 3) heap, 4) data section, 5) text section

What types of long-term storage do we have?

Hard disk drives (HDD) and solid state drives (SSD), SSDs can access, read, and write files faster than HDDs

What is I/O queue? How many I/O queues do you expect in the system?

I/O queue = buffer that holds data waiting to be transferred between an I/O device and the CPU The amount depends on the system.

What is the idea of message passing? What are advantages and disadvantages of message passing?

In the message-passing model, communication takes place by means of messages exchanged between the cooperating processes. Advantages: Less bug prone, network capable Disadvantages: Slower

What are interrupts? What are interrupt handlers? What issues interrupts? What is the sequence of things that happen when the interrupt arrives?

Interrupts = a signal about an important event that requires immediate attention Interrupt handlers = when interrupt arrives, computer immediately pauses current program to execute Hardware or software can issue interrupts (hardware by way of the system bus and software by way of a system call) Sequence: When the CPU is interrupted, it stops what it is doing and immediately transfers execution to a fixed location. The fixed location usually contains the starting address where the service routine for the interrupt is located. The interrupt service routine executes; on completion, the CPU resumes the interrupted computation.

Context switch. Why context switching has a small performance overhead associated with it? How does that performance overhead affect system calls?

because the system does no useful work while switching. ... Context switching is overhead because it is cycles (time) that the processor is being used but no user code is executing, so no directly productive computing is getting done. A system call executes kernel code and therefore, it must wait for the old process to be saved (by context switch) before that execution.

What different types of computers exist? How different are operating systems for different computer types.

personal, mobile devices, servers, embedded Operating systems can change depending on the computer type


संबंधित स्टडी सेट्स

ITF Block 4: Unit 4 Domain Name System (DNS)

View Set

Physical Science - Ch. 4 comprehension check study practice

View Set

Pamela Paul - "You and Me and Pornography: How Porn Affects Relationships"

View Set

Ch. 2 Obtaining a Health History

View Set

first semester ap art history MC

View Set

radioactive decay, radiometric dating, earth's age

View Set