Segmentation with Paging in Operating Systems | OS Tutorials YASH PAL, June 23, 2026June 23, 2026 In an operating system, if the segments are large, it may be inconvenient or even impossible to keep them in main memory. This leads to the idea of paging them, so that only those pages that are actually needed have to be in main memory. Both paging and segmentation have their advantages and disadvantages. The two most popular microprocessors, Motorola is based on flat address space and segmentation, respectively.If we combine these two schemes to improve on each, then the different architectures generated, which is best the innovative but not widely used MULTICS system. MULTICS contains 218 segments of virtual memory for each program, each of which could be up to 65536 words long. To implement this, the MULTICS designers chose to treat each segment as a virtual memory and to page it.Table of Contents Segmentation with PagingHardware ImplementationCharacteristics of Paging and SegmentationComparison of Paging and SegmentationSegmentation with PagingTo implement segmentation, combining the advantages of paging (i.e., uniform page size and not having to keep the whole segment in memory, only part of it is being used) and the advantages of segmentation (ease of programming, modularity, protection, sharing). Paging eliminates external fragmentation and makes the allocation problem trivial: any empty frame can be used for a desired page.Hardware ImplementationThe hardware implementation of this scheme is shown in Figure 1.Figure 1: Paged Segmentation on the MULTICSEach page in MULTICS consists of 1K words. Thus, the segment offset (16 bits) is broken into a 6-bit page number and a 10-bit page offset. The page number indexes into the page table to give the frame number. Finally, the frame number is combined with the page offset to form a physical address.DrawbackEven though the page segmentation view of MULTICS is simple, the segment number is an 18-bit quantity, so we could have up to 2,62,144 segments, which requires an excessively large segment table.Resolving DrawbackTo overcome this drawback, MULTICS pages the segment table. The segment number of 18 bits is broken into an 8-bit page number and a 10-bit page offset. Hence, the segment table is implemented as a page table with up to 28 entries. Thus, in general, a logical address in MULTICS is as follows:Figure 2: Segment TableHere S1 is an index into the page table of the segment table. S2 is the displacement within the page of the segment table. d1 is a displacement into the page table of the desired segment. d2 is a displacement into the page containing the word to be accessed.Characteristics of Paging and SegmentationSimple pagingVirtual memorypagingSimple segmentationVirtual Memorysegmentation(i)Main memory is partitioned into small fixed chunks called frames.Main memory is partitioned into small fixed-size chunks called framesMain memory not partitioned.Main memory not partitioned.(ii)Program broken into pages by the compiler or memory management system.Program broken into pages by the compiler or memory management system.Program segments specified by the programmer to the compiler (i.e., the decision is made by the programmer).Program segments specified by the programmer to the compiler (i.e., the decision is made by the programmer).(iii)Internal fragmentation within a frame.Internal fragmentation within a frame.No internal fragmentation.No internal fragmentation.(iv)No external fragmentation.No external fragmentation.External fragmentation.External fragmentation.(v)The operating system must maintain a page table for each process showing which frame each page occupies.The operating system must maintain a page table for each process showing which frame each page occupies.The operating system must maintain a list of free holes in main memory.The operating system must maintain a list of free holes in main memory.(vi)The processor uses the page number and offset to calculate the absolute address.The processor uses the page number and offset to calculate the absolute address.The processor uses the segment number and offset to calculate the absolute address.The processor uses the segment number and offset to calculate the absolute address.(vii)All the pages of a process must be in main memory for the process to run, unless overlays are used.Not all pages of a process must be in main memory for the process to run. Pages may be read in as needed.All the segments of a process must be in main memory for the process to run, unless overlays are used.Not all segments of a process must be in main memory for the process to run. Segments may be read in as needed.(viii)Reading a page into main memory may require writing a page out to disk.Reading a segment into main memory requires writing one or more segments out to disk.Table 1: Compare Characteristics of Paging and SegmentationComparison of Paging and SegmentationConsiderationPagingSegmentationDoes the programmer need to be aware that this technique is being used?NoYesHow many linear address spaces are there?1ManyCan the total address space exceed the size of physical memory?YesYesCan procedures and data be distinguished and separately protected?NoYesCan tables whose size fluctuates be accommodated easilyNoYesIs sharing of procedures between users facilitated?NoYesWhy was this technique invented?To get a large linear address space without having to buy more physical memory.To allow programs and data to be paged up into logically independent address spaces and aid in sharing and protectionTable 2: Compare Paging and Segmentation engineering subjects Operating System Operating System