Previous Table of Contents Next


The tags-in-segment bit identifies whether there are any MI pointers in the segment. In Chapter 2, we discussed extensions to the PowerPC architecture and introduced the special bit called the tag bit. To review, a tag bit is associated with every MI address (a 16-byte pointer), and these bits prevent unauthorized address modification. Tag bits are kept in a part of the AS/400 main memory that is not visible to MI programs. When a page is moved to or from disk, these hidden tag bits need to be moved by storage management. The tags-in-segment bit tells storage management whether it has to deal with tags in the segment. Chapter 8 goes into more detail about the tag bits.

The two remaining fields in a segment header are addresses. The first is the address of the base segment. The second is the address of the next secondary segment, which for a system object is usually the associated space segment. These two addresses provide the capability to link from one segment to another in a multisegment object.

Note that the addresses below the MI in headers and elsewhere are the 64-bit addresses recognized by the hardware. At the MI, addresses are always contained in a pointer and occupy 128 bits (16 bytes). The pointers protect the addresses contained within them from unauthorized modification and use. They also provide part of the MI’s technology independence. Below the MI there is neither that protection nor the technology independence. This is the reason all users of the MI, including OS/400 itself, are not allowed below the MI.

EPA Headers

An EPA header is contained in the base segment of every system object. This header contains the following information about the object:

•  Attribute byte
—  Permanent object
—  Suspended object
—  Damaged object
—  Access group present
—  Object being traced
—  Object under commitment control
•  Object identification
—  Object type
—  Object subtype (user defined)
—  Object name
•  Space attributes
—  Fixed/variable size
—  Initial value of space
—  Size of space
•  Total object size
•  Version number of object
•  Creation time stamp
•  User profile address
•  Context address
•  Access group address
•  Object-specific header address
•  Other information and addresses

The object attributes are contained at the beginning of the EPA header. The bits in the attribute byte are checked at runtime whenever a system pointer is used to reference a system object. The first attribute identifies whether the object is permanent or temporary. This attribute, which is also present as the existence bit in the segment header, is repeated here for ease of checking at runtime.

The suspended and damaged bits describe the condition of the object. A suspended object is one in which only the headers are available. The contents of a suspended object do not exist. Suppose the owner of a system object explicitly destroys the object. What happens if someone else in the system has a pointer to that object and tries to access it after it has been destroyed? The answer is that (s)he finds a suspended object.

With a suspended object, only the headers of the object are left, and the suspended bit in the EPA header is turned on. If someone references the deleted object, (s)he finds just the headers. The system recognizes that the object existed at one time but no longer exists, and it takes the appropriate action.

Further, when a permanent object is destroyed, the address space is not reused. With this approach, there is never a need to look through the system to find all pointers to the destroyed object and invalidate them. The address space will not be reassigned to any other object. There are, therefore, no security or integrity exposures that might result if the address space was reassigned and someone still had a pointer to that address. Other systems have invented elaborate schemes for “garbage collection” to find pointers to the destroyed object. That is not needed in an AS/400.6 The address space is not reused, but the disk space occupied by the object, except for the headers, is cleared.


6Computer science research projects at various universities have dealt with the problems of garbage collection for years. Untold numbers of graduate students have worked on solutions to this problem. Sometimes it is smarter to eliminate the problem than to solve it, and that is the AS/400 approach.

Two classes of object damage can be identified: hard and soft. Hard damage means the object has no functional use — it is so badly damaged it can only be destroyed. Soft damage says some data can still be extracted from the object. When damage is detected, OS/400 gets involved in the recovery process.

The damage attribute is used to report problems with the objects across the MI. Storage management is one of the major components in the system that identifies damage. A source of damage is bad disk sectors. Storage management may not be able to read a sector and reports the problem with the damage attribute.

Some other attributes in the EPA header identify that an access group exists for this object, that the object is being traced, and that the object is under commitment control. We cover more details about these object attributes in Chapter 6.

The EPA header has three fields reserved for object identification. The object type is contained in one field and the object subtype in another. The object type is defined to be one of the MI system object types. The subtype is the user-defined field. It is user-defined in the sense that OS/400 programmers are users of MI system objects. Only a few object types (such as the User Space) can have their subtypes specified by programmers outside of Rochester development. The object name field contains the name of the object as it would appear in a context.

The space attributes identify whether the space is fixed or variable in size, the initial value of the space (has it been cleared or set to all zeros?), and the size of the space. The total object size field contains the size for all segments in the object. The version number and creation timestamp further identify information about the object when it was created.

Some of the fields in the EPA header are addresses. The more important ones are the address of the user profile for both the owner and the creator, the address of the context that contains the object name, the address of the access group if the object appears in an access group, and the address of the customized header in the object. Still other information and addresses are in the EPA header for components of the system that have yet to be discussed.


Previous Table of Contents Next

Copyright © NEWS/400 Books