Segments are individual chunks of continuous address space, generally with separate characteristics (such as belonging to a particular file). Each segment structure ( struct seg ) contains a base address and a size , links to other segments that belong to the same process, and a pointer to a list of functions. This list, defined in the seg_ops structure, contains addresses of functions that perform a certain set of operations specifically for the given type of segment. These operations include things like:
Some actual functions for the different segment types are:
There are also some generic segment handling functions that deal with the segment structures themselves .
Segments are another "virtual" layer, like vnodes, to allow a range of addresses to refer to many different things (a file, a device like a frame buffer, anonymous memory) but still be handled at a high level in a standardized way. |