Full Marks

A-level Computer Science Year 13 · Topic 10

Software and software development

Software and software development covers the software that controls computers, and how large programs are built.

We will study operating systems, memory management, interrupts and scheduling.

Then we look at types of operating system, licensing, translators and compilation, and development methodologies.

In this topic

  1. 10.1Operating systems: memory management, paging, segmentation and virtual memoryFree below · 48 questions
  2. 10.2Interrupts and scheduling algorithmsOpen in Full Marks · 30 questions
  3. 10.3Types of operating system, BIOS, device drivers and virtual machinesOpen in Full Marks · 32 questions
  4. 10.4Applications, utility software, open source and closed source licensingOpen in Full Marks · 32 questions
  5. 10.5Translators: compilers, interpreters and assemblersOpen in Full Marks · 26 questions
  6. 10.6Stages of compilation, linkers, loaders and librariesOpen in Full Marks · 33 questions
  7. 10.7Software development methodologies: waterfall, agile, extreme programming, spiral and RADOpen in Full Marks · 23 questions

10.1 · Free notes

Operating systems: memory management, paging, segmentation and virtual memory

Diagram: Operating systems: memory management, paging, segmentation and virtual memory

Key points

In more detail

Practice

Operating systems: memory management, paging, segmentation and virtual memory: 10 questions

Pick an answer to check it, or open the answer for the explanation.

1. In paging, what name is given to the fixed-size blocks into which physical memory is divided?

  1. Segments
  2. Frames
  3. Pages
  4. Sectors
Show answer

B: Frames. Physical memory is divided into frames; logical memory is divided into pages of the same size. Segments are variable-sized logical units.

2. A system uses 4096-byte pages. A process uses logical address 10 000. Which page number and offset does this give?

  1. Page 2, offset 1808
  2. Page 3, offset 1808
  3. Page 1, offset 5904
  4. Page 2, offset 1904
Show answer

A: Page 2, offset 1808. 10 000 ÷ 4096 = 2 remainder 1808 (2 × 4096 = 8192; 10 000 − 8192 = 1808). Offset 5904 would exceed the page size.

3. An 18 KiB program is loaded using 4 KiB pages. How many pages are needed and how much internal fragmentation results?

  1. 4 pages, 2 KiB
  2. 5 pages, 4 KiB
  3. 5 pages, 2 KiB
  4. 5 pages, 0 KiB
Show answer

C: 5 pages, 2 KiB. 18 ÷ 4 = 4.5, rounded up to 5 pages (20 KiB). The unused part of the last page is 20 − 18 = 2 KiB of internal fragmentation.

4. Which statement about segmentation is correct?

  1. Segmentation removes any need for address translation
  2. Segments are variable-sized logical units such as code, data or stack
  3. Segments cannot be placed in virtual memory
  4. Segments are all the same fixed size
Show answer

B: Segments are variable-sized logical units such as code, data or stack. Segments reflect the logical structure of a program and vary in size. Each has a base and limit in a segment table, so translation is still needed.

5. What is a page fault?

  1. The page being accessed is not in RAM and must be loaded from disk
  2. A page table with every entry marked valid
  3. A program writing outside its segment limit
  4. A faulty RAM chip causing corrupted data
Show answer

A: The page being accessed is not in RAM and must be loaded from disk. A page fault occurs when a referenced page is not in a frame. The OS fetches it from secondary storage, possibly replacing another page.

6. Page 5 maps to frame 12 and pages are 1024 bytes. What is the physical address of offset 100 in page 5?

  1. 1324
  2. 12 388
  3. 12 288
  4. 5220
Show answer

B: 12 388. Physical address = 12 × 1024 + 100 = 12 288 + 100 = 12 388. 5220 wrongly uses the page number instead of the frame number.

7. Which type of fragmentation is eliminated by paging?

  1. Neither internal nor external
  2. Internal fragmentation
  3. External fragmentation
  4. Both internal and external
Show answer

C: External fragmentation. Fixed-size frames mean any free frame can be used, so no external fragmentation. Internal fragmentation remains in a process's last page.

8. What is the main benefit of virtual memory?

  1. It makes disk access faster than RAM access
  2. Programs larger than the physical RAM can still be run
  3. It removes the need for page tables
  4. It permanently increases the amount of installed RAM
Show answer

B: Programs larger than the physical RAM can still be run. Virtual memory uses secondary storage as an extension of RAM, so only the needed pages are in RAM and large programs can run. It does not add physical RAM.

9. Why does heavy use of virtual memory slow a computer down?

  1. Virtual memory disables the processor cache
  2. Page tables can only be stored on disk
  3. The CPU clock speed is reduced when swap is used
  4. Secondary storage has much higher access times than RAM
Show answer

D: Secondary storage has much higher access times than RAM. Swapping pages to and from secondary storage is orders of magnitude slower than accessing RAM, so frequent page faults cause delays.

10. A segment has base 5000 and limit 800. A process requests offset 900 in that segment. What happens?

  1. The segment is moved to a larger free area
  2. Physical address 4100 is accessed
  3. Physical address 5900 is accessed
  4. The access is refused because 900 exceeds the limit of 800
Show answer

D: The access is refused because 900 exceeds the limit of 800. The offset must be less than the limit. 900 > 800, so the OS raises a segmentation fault instead of reading 5900, protecting other memory.

Keep going in Full Marks

Full Marks has 48 questions on Operating systems: memory management, paging, segmentation and virtual memory (38 more than here), set out in practice levels. You also get notes and 3D models for all 7 subtopics of Software and software development, plus games, timed exams and past papers.

On your exam board

All A-level Computer Science Year 13 topics