Operating Systems

download Operating Systems

If you can't read please download the document

description

Operating Systems. Shared Pages. Segmentation. CPU. Example. Sharing of Segments. Protection. Associate valid/invalid bit with each segment table entry to indicate if the referenced segment is part of the process address space or not - PowerPoint PPT Presentation

Transcript of Operating Systems

  • Copyright Virtual University of Pakistan

  • Shared Pages

    Copyright Virtual University of Pakistan

  • SegmentationCPU

    Copyright Virtual University of Pakistan

  • Example

    Copyright Virtual University of Pakistan

  • Sharing of Segments

    Copyright Virtual University of Pakistan

  • Protection Associate valid/invalid bit with each segment table entry to indicate if the referenced segment is part of the process address space or not Read, write, and execute bits to define legal operations on a segment

    Copyright Virtual University of Pakistan

  • Paged Segmentation Divide every segment in a process into fixed size pagesNeed for a page table per segmentCPUs memory management unit must support both segmentation and paging

    Copyright Virtual University of Pakistan

  • Paged Segmentation 1324logical memory 5physical memory

    Copyright Virtual University of Pakistan

  • Paged Segmentation 1324logical memory 5physical memory12030123...

    10

    126 1273112610page table

    Copyright Virtual University of Pakistan

  • Paged Segmentation Logical address is still , with s used to index the segment tableEach segment table entry consist of the tuple The logical address is legal if d < segment-length

    Copyright Virtual University of Pakistan

  • Paged Segmentation Segment offset, d, is partitioned into two parts: p and d, where p is used to index the page table associated with segment, s, and d is used as offset within a page

    Copyright Virtual University of Pakistan

  • Paged Segmentation p indexes the page table to retrieve frame, f, and physical address (f,d) is formedsdpdindex segment tableindex page tableoffset within the page p

    Copyright Virtual University of Pakistan

  • Paged Segmentation

    Copyright Virtual University of Pakistan

  • GE 345 processorLogical address = 34 bits Page size = 1 KBs is 18 bits and d is 16 bitsSize of p and d, largest segment size, and max. number of segments per process?

    Copyright Virtual University of Pakistan

  • Largest segment= 2d bytes= 216 bytesMaximum number of pages per segment= 216 / 1 K = 64|p| = log2 64 bits= 6 bits|d| = log2 1 K= 10 bitsMaximum number of segments per process= 2s = 218

    Copyright Virtual University of Pakistan

  • sdpd18 bits6 bits10 bits

    Copyright Virtual University of Pakistan

  • Consider a process with its segment 15 having 5096 bytes. The process generates a logical address (15,3921). Is it a legal address? How many pages does the segment have? What page does the logical address refer to?

    Copyright Virtual University of Pakistan

  • Is it a legal address? YesHow many pages does the segment have? ceiling[5096/1024]= 5What page does the logical address refers to? ceiling[3921/1024]= 4(i.e., page number 3)

    Copyright Virtual University of Pakistan

  • What are the value of d and the physical address if page number 3 (i.e., the fourth page) is in frame 12?d = 3921 3*1K= 849Physical address= 12*1K + 849 = 13137

    Copyright Virtual University of Pakistan

  • 1539213849spddpage table for segment 150123412

    Copyright Virtual University of Pakistan

  • 15 39213 849392112 12 84913137

    Copyright Virtual University of Pakistan

  • IBM OS/2, Microsoft Windows, and LinuxPaged segmentation with two-level pagingLogical address = 48 bits 16-bit selector and 32-bit offsetPage size = 4 KB

    Copyright Virtual University of Pakistan

  • 4-byte page table entry32-entry TLB, covering 32*4K (128 KB) memory TLB Reach

    Copyright Virtual University of Pakistan

  • 13-bit Segment #16-bit Selectorgp32-bit Offsets2-bit field for specifying the privilege level1-bit field to specify GDT or LDT

    Copyright Virtual University of Pakistan

  • Real Mode20-bit physical address is obtained by shifting left the Selector value by four bits and adding to it the 16-bit effective address

    Copyright Virtual University of Pakistan