Protection uses base and limit registers in simple systems and per-page permission bits (read, write, execute, user or supervisor) in paging systems; hardware raises a fault on a violation, and features such as the no-execute (NX) bit stop data pages from running as code.
A page fault is a normal event when a valid page is not currently mapped (the OS can handle it); a segmentation fault is what a process receives (SIGSEGV) when it accesses an invalid address or violates permissions, and by default it terminates the process.
Loading…