|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nachos.machine.CoffSection
public class CoffSection
A CoffSection manages a single section within a COFF executable.
Field Summary | |
---|---|
protected Coff |
coff
The COFF object to which this section belongs. |
protected boolean |
executable
True if this section contains code. |
protected int |
firstVPN
The first virtual page number used by this section. |
static int |
headerLength
The length of a COFF section header. |
protected boolean |
initialized
True if this section contains initialized data. |
protected String |
name
The COFF name of this section. |
protected int |
numPages
The number of virtual pages in this section. |
protected boolean |
readOnly
True if this section is read-only. |
Constructor Summary | |
---|---|
protected |
CoffSection(Coff coff,
String name,
boolean executable,
boolean readOnly,
int numPages,
int firstVPN)
Allocate a new COFF section with the specified parameters. |
|
CoffSection(OpenFile file,
Coff coff,
int headerOffset)
Load a COFF section from an executable. |
Method Summary | |
---|---|
Coff |
getCoff()
Return the COFF object used to load this executable instance. |
int |
getFirstVPN()
Return the first virtual page number used by this section. |
int |
getLength()
Return the length of this section in pages. |
String |
getName()
Return the name of this section. |
boolean |
isInitialzed()
Test whether this section is initialized. |
boolean |
isReadOnly()
Test whether this section is read-only. |
void |
loadPage(int spn,
int ppn)
Load a page from this segment into physical memory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Coff coff
protected String name
protected boolean executable
protected boolean readOnly
protected boolean initialized
protected int numPages
protected int firstVPN
public static final int headerLength
Constructor Detail |
---|
protected CoffSection(Coff coff, String name, boolean executable, boolean readOnly, int numPages, int firstVPN)
coff
- the COFF object to which this section belongs.name
- the COFF name of this section.executable
- true if this section contains code.readOnly
- true if this section is read-only.numPages
- the number of virtual pages in this section.firstVPN
- the first virtual page number used by this.public CoffSection(OpenFile file, Coff coff, int headerOffset) throws EOFException
file
- the file containing the executable.headerOffset
- the offset of the section header in the
executable.
EOFException
- if an error occurs.Method Detail |
---|
public Coff getCoff()
public String getName()
public boolean isReadOnly()
public boolean isInitialzed()
public int getLength()
public int getFirstVPN()
public void loadPage(int spn, int ppn)
spn
- the page number within this segment.ppn
- the physical page to load into.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |