CYSE quiz 1

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is deallocation on dynamic partition systems?

Algorithm: tries to combine free areas of memory More complex Three dynamic partition system cases: depending on position of block to be deallocated Case 1: adjacent to another free block Case 2: between two free blocks Case 3: isolated from other free blocks Memory Manager: relocates programs All empty blocks: gathered together Empty blocks: compacted Make one memory block: large enough to accommodate some or all waiting jobs

What is paging?

Allows processes to be comprised of a number of fixed-size blocks, called pages Program references a word by means of a virtual address consists of a page number and an offset within the page each page may be located anywhere in main memory Provides for a dynamic mapping between the virtual address used in the program and a real (or physical) address in main memory

What is virtual memory?

Appearance of vast amounts of physical memory

How do you join 3 free blocks?

Between two free memory blocks List changes: reflect starting address of new free block Example: smallest beginning address (7560) Three free partitions' sizes: combined Example: (20 + 20 + 205) Total size: stored with smallest beginning address Last partition: assigned null entry status

What is the stack?

Data structure in memory Used to store temporary data like local variables variable in size grows and shrinks at runtime grows towards lower addresses

How to deallocate an isolated block?

Deallocated memory space Isolated from other free areas System: determines released memory block status Not adjacent to any free memory blocks Between two other busy areas System: searches table for a null entry Memory block between two other busy memory blocks: returned to the free list

dis(advantages) of segmented demand paged memory allocation?

Disadvantages Overhead: managing the tables Time required: referencing tables Associative memory Several registers allocated to each job Segment and page numbers: associated with main memory Page request: initiates two simultaneous searches Associative registers SMT and PMT Associative memory Primary advantage (large associative memory) Increased speed Disadvantage High cost of complex hardware

how do you determine page number and displacement of a line

Divide job space address by the page size Page number: integer quotient Displacement: remainder Instruction: determining exact location in memory Step1: Determine page number/displacement of line Step 2: Refer to the job's PMT Determine page frame containing required page Step 3: Obtain beginning address of page frame Multiply page frame number by page frame size Step 4: Add the displacement (calculated in first step) to starting address of the page frame Address resolution (address translation) Job space address (logical) → physical address (absolute)

What is segmented memory allocation?

Each job divided into several segments: different sizes One segment for each module: related functions Reduces page faults Loops: not split over two or more pages Main memory: allocated dynamically Program's structural modules: determine segments Each segment numbered when program compiled/assembled Segment Map Table (SMT) generated Memory Manager: tracks segments in memory Job Table: one for the whole system Every job in process Segment Map Table: one for each job Details about each segment Memory Map Table: one for the whole system Main memory allocation Instructions within each segment: ordered sequentially Segments: not necessarily stored contiguously

Single-User Contiguous Scheme

Entire program: loaded into memory Contiguous memory space: allocated as needed Jobs: processed sequentially Evaluates incoming process size: loads if small enough to fit; otherwise, rejects and evaluates next incoming process Monitors occupied memory space; when process ends, makes entire memory space available and returns to Step 1

What is thrashing?

Excessive page swapping: inefficient operation Main memory pages: removed frequently; called back soon thereafter Occurs across jobs Large number of jobs: limited free pages Occurs within a job Loops crossing page boundaries

What are the two page replacement policies?

First-in first-out (FIFO) policy Best page to remove: page in memory longest Least Recently Used (LRU) policy Best page to remove: page least recently accessed

What is paged memory allocation?

Incoming job: divided into pages of equal size Best condition Pages, sectors, and page frames: same size Exact sizes: determined by disk's sector size Memory manager tasks: prior to program execution Determine number of pages in program Locate enough empty page frames in main memory Load all program pages into page frames Program: stored in noncontiguous page frames Advantages: more efficient memory use; compaction scheme eliminated (no external fragmentation) New problem: keeping track of job's pages (increased operating system overhead) & entire program is required in execution

What are the three tables for tracking pages?

Job Table (JT), Page Map Table (PMT), and Memory Map Table (MMT) Stored in main memory: operating system area

What is line displacement/offset?

Line distance: from beginning of its page Line location: within its page frame Relative value

How do you join adjacent blocks?

List changes: reflect starting address of the new free block Example: 7600 - address of the first instruction of the job that just released this block Memory block size changes: shows new size for the new free space Combined total: two free partitions Example: (200 + 5)

What is Demand Paging Memory Allocation

Loads only a part of the program into memory Removes restriction: entire program in memory Requires high-speed page access Exploits programming techniques Modules: written sequentially All pages: not needed simultaneously Examples Error-handling modules instructions Mutually exclusive modules Certain program options: mutually exclusive or not always accessible Less main memory required than paged memory allocation scheme Requires high-speed direct access storage device (DASDs): e.g., hard drives or flash memory

How is virtual memory made possible?

Made possible by swapping pages in/out of memory Program execution: only a portion of the program in memory at any given moment Requires cooperation between: Memory Manager: tracks each page or segment Processor hardware: issues the interrupt and resolves the virtual address

What is best fit memory allocation

Memory Manager: free/busy lists ordered by size (smallest to largest) Job: assigned smallest partition large enough Least wasted space; internal fragmentation reduced Advantage: best use of memory space Disadvantage: slower allocation Goal: find smallest memory block where job fits Entire table searched before allocation

What is first fit allocation

Memory Manager: free/busy lists organized by memory locations (low- to high-order memory) Job: assigned first partition large enough Fast allocation Advantage: faster allocation Disadvantage: memory waste Memory Manager: keeps two lists One for free memory One for busy memory blocks Loop: compares job size to each memory block size Until large enough block found: fits the job Job: stored into that memory block Memory Manager: moves out of the loop Fetches next job: entry queue If entire list searched: no memory block large enough Job: placed into waiting queue Memory Manager: fetches next job

What are the disadvantages of a Single-User Contiguous Scheme

Multiprogramming or networking not supported Not cost effective: unsuitable for business when introduced in late 1940s and early 1950s

What are fixed partitions

Permits multiprogramming Main memory: partitioned Each partition: one job Static: reconfiguration requires system shut down Responsibilities Protecting each job's memory space Matching job size with partition size Characteristics Requires contiguous loading of entire program Job allocation method First available partition with required size To work well: All jobs have similar size and memory size known ahead of time Arbitrary partition size leads to undesired results Partition too small Large jobs have longer turnaround time Partition too large Memory waste: internal fragmentation

What is Simple Batch System overhead?

Processor time alternates between execution of user programs and execution of the monitor Sacrifices: some main memory is now given over to the monitor some processor time is consumed by the monitor Despite overhead, the simple batch system improves utilization of the computer

What is last recently used?

Removes page: least recent activity Theory of locality Efficiency Additional main memory: causes either decrease in or same number of interrupts Does not experience FIFO Anomaly (Belady Anomaly) Clock replacement variation Circular queue: pointer steps through active pages' reference bits; simulates a clockwise motion Pace: computer's clock cycle Bit-shifting variation 8-bit reference byte and bit-shifting technique: tracks pages' usage (currently in memory)

What is first in first out?

Removes page: longest in memory Failure rate Ratio of page interrupts to page requests More memory: does not guarantee better performance

What will occur if a programming error happens during buffer overflow?

Segmentation fault or memory access error

What is cache memory?

Small, high-speed intermediate memory unit Computer system's performance increased Faster processor access compared to main memory Stores frequently used data and instructions Cache levels L2: connected to CPU; contains copy of bus data L1: pair built into CPU; stores instructions and data Data/instructions: move between main memory and cache Methods similar to paging algorithms

What is deallocation on fixed partition?

Straightforward process Memory Manager: resets the job's memory block status to "free" upon job completion Any code may be used: e.g., 0 = free and 1 = busy

What is the Segmented/Demand Paged Memory Allocation

Subdivides segments: equal-sized pages Smaller than most segments More easily manipulated than whole segments Segmentation's logical benefits Paging's physical benefits Segmentation problems removed Compaction, external fragmentation, secondary storage handling Three-dimensional addressing scheme Segment number, page number (within segment), and displacement (within page) Scheme requires four tables Job Table: one for the whole system Every job in process Segment Map Table: one for each job Details about each segment Page Map Table: one for each segment Details about every page Memory Map Table: one for the whole system Monitors main memory allocation: page frames

What is swapping?

Swapping: how and when pages passed between memory and secondary storage Depends on predefined policies Swapping process Resident memory page: exchanged with secondary storage page Resident page: copied to disk (if modified) New page: written into available page frame Requires close interaction between: Hardware components Software algorithms Policy schemes

What is uniprogramming?

The processor spends a certain amount of time executing, until it reaches an I/O instruction; it must then wait until that I/O instruction concludes before proceeding

(dis)advantages of segmented memory allocation?

Two-dimensional addressing scheme Segment number and displacement Disadvantage External fragmentation Major difference between paging and segmentation Pages: physical units; invisible to the program Segments: logical units; visible to the program; variable sizes

How can buffer overflow lead to a software attack?

You can use it to inject code/data in a program and then Change the program control flow. (If used bad) you can crash a system process (DoS) (If used well) Can lead to privilege escalation / Malicious Code execution.

What is a buffer?

a contiguous block of memory, that holds multiple instances of the same data type

What is vulnerability?

a security flaw caused by a software defect

What is an exploit?

a technique that take advantage of a vulnerability. A malicious hacker uses them to ATTACK a system. (There may be many exploits per vulnerability)

What is worst fit

allocates largest free available block Opposite of best-fit Good way to explore theory of memory allocation Not best choice for an actual system

What is multiprogramming?

also known as multitasking memory is expanded to hold three, four, or more programs and switch among all of them

What is the EBP?

bottom of stack

What is the memory map table?

entry for each page frame Location Free/busy status

What is the job table?

information for each active job Job size Memory location: job's PMT

What is the page map table

information for each page Page number: beginning with Page 0 Memory address

Where is the fragmentation in paged memory allocation?

job's last page frame only

What is deallocation?

releasing allocated memory space

What is the space between the ebp and esp called?

stack frame every function has its own

What is next fit?

starts searching from last allocated block for next available block

What is virtual memory?

the ability of the CPU and the operating system software to use the hard disk drive as additional RAM when needed (safety net)

What is the ESP?

top of the stack

What is the general unix architecture?

unix commands/libraries &applications -> system call interface -> kernel -> hardware

What is compaction?

(memory defragmentation): operating system reclaims fragmented memory space sections Most or all programs in memory: relocated Contiguous arrangement Operating system: distinguishes between addresses and data values Every address and address reference: adjusted to match the program's new memory location Data values: left alone

What are the advantages/disadvantages of paged memory allocation?

Advantages Efficient memory use: job allocation in noncontiguous memory Disadvantages Increased overhead: address resolution Internal fragmentation: last page Page size: crucial Too small: very long PMTs Too large: excessive internal fragmentation

(dis)advantages to Virtual memory

Advantages Job size: not restricted to size of main memory More efficient memory use Unlimited amount of multiprogramming possible Code and data sharing allowed Dynamic linking of program segments facilitated Disadvantages Higher processor hardware costs More overhead: handling paging interrupts Increased software complexity: prevent thrashing


Ensembles d'études connexes

American Politics Today-Chapter 11 The Presidency

View Set

Relias: Exam : Application of HIPAA in Behavioral Health

View Set

Networking Essentials - Module 6

View Set

Chap.3: Pharmacology (Autonomic nervous system)

View Set

Chapter 3: Toxic Effects of Drugs PrepU

View Set