|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.kernel.userprog.NoffHeader
class NoffHeader
A NoffHeader object is the kernel representation of the header portion of a NOFF executable file. It contains information about the three segments (code, initialized data, uninitialized) data in the file, which is needed for initializing a user address space.
Nested Class Summary | |
---|---|
(package private) static class |
NoffHeader.NoffSegment
A NoffSegment object contains information about one segment of a NOFF executable file. |
Field Summary | |
---|---|
(package private) NoffHeader.NoffSegment |
code
Information about the executable code segment. |
(package private) NoffHeader.NoffSegment |
initData
Information about the initialized data segment. |
(package private) static int |
noffMagic
Magic number found at the beginning of a NOFF file. |
(package private) NoffHeader.NoffSegment |
uninitData
Information about the "uninitialized" data segment, which must be zeroed before use. |
Constructor Summary | |
---|---|
private |
NoffHeader()
Private constructor, to force use of readHeader() to initialize a NoffHeader. |
Method Summary | |
---|---|
private static boolean |
checkMagic(OpenFile f)
Read a word from a file and check that it matches noffMagic. |
private static int |
convertByte(byte raw)
Take bytes read from the file and interpret them as unsigned rather than signed values. |
private static int |
convertWord(byte[] raw)
Take four bytes read from the file and assemble them into an unsigned integer. |
(package private) static NoffHeader |
readHeader(OpenFile f)
Initialize a NoffHeader object by reading its values from a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int noffMagic
NoffHeader.NoffSegment code
NoffHeader.NoffSegment initData
NoffHeader.NoffSegment uninitData
Constructor Detail |
---|
private NoffHeader()
Method Detail |
---|
private static int convertByte(byte raw)
raw
- A raw byte read from the file.
private static int convertWord(byte[] raw)
raw
- The four bytes read from the file.
private static boolean checkMagic(OpenFile f)
f
- The file to read.
static NoffHeader readHeader(OpenFile f)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |