a page-table entry
/ abbr. PTE /
Think of one line in a library's catalogue card for a single book. It does not just say 'shelf 214'; it also records useful facts — is this book currently in the library or out on loan? may you only read it in the building or take it home? has anyone touched it lately? has it been written in? A PAGE-TABLE ENTRY (PTE) is exactly one such line for one page: it stores not only the frame number but a handful of CONTROL BITS that describe and govern that page.
Concretely, the page table is an array of page-table entries, one per page, and entry p describes page p. The most important fields are: the FRAME NUMBER (which physical frame holds the page); a VALID / INVALID bit (sometimes called present) saying whether this entry maps to a real, accessible page right now — if invalid, any access traps to the OS; PROTECTION bits saying which operations are allowed (read, write, execute), so the hardware can forbid writing to read-only code or executing data; a REFERENCED (accessed) bit the hardware sets whenever the page is touched, used by page-replacement policies to spot unused pages; and a MODIFIED / DIRTY bit the hardware sets when the page is written, so the OS knows a frame must be saved back to disk before reuse (a clean page can simply be discarded). On every access the hardware reads the matching PTE, checks these bits, and either proceeds or traps.
Page-table entries matter because they are where memory protection, sharing, and virtual memory are actually enforced, one bit at a time. A few honest points: the valid bit and the protection bits do different jobs — invalid means 'no mapping here', while a protection violation means 'mapped, but you may not do that' — and confusing them leads to misreading why an access faults. The dirty bit is purely an optimisation hint (it lets the OS skip writing back unchanged pages), and the referenced bit only approximates 'recently used'; neither is precise, but both are cheap for hardware to maintain and hugely useful to the OS.
A PTE for a shared library's code page might read: frame = 88, valid = 1, read = 1, write = 0, execute = 1, referenced = 1, dirty = 0. A write attempt to this page is refused by the hardware (write = 0) and traps to the OS; because dirty = 0, if the OS ever reclaims frame 88 it can discard it without saving, since the on-disk copy is still current.
One entry carries the frame number plus the bits that enforce validity, protection, and track use and modification.
The valid bit ('is there a mapping?') and the protection bits ('what may you do?') are different — a fault can come from either, for different reasons. The dirty bit is an optimisation that lets the OS skip writing back unmodified pages.