This commit is contained in:
2024-12-30 05:59:42 +08:00
parent bf78b95c9d
commit 72320ede22
42 changed files with 1758 additions and 1556 deletions

View File

@@ -1,4 +1,4 @@
/* noff.h
/* noff.h
* Data structures defining the Nachos Object Code Format
*
* Basically, we only know about three types of segments:
@@ -6,23 +6,22 @@
*/
#define NOFFMAGIC 0xbadfad /* magic number denoting Nachos
* object code file
*/
/* object code file*/
typedef struct segment {
int virtualAddr; /* location of segment in virt addr space */
int inFileAddr; /* location of segment in this file */
int size; /* size of segment */
int virtualAddr; /* location of segment in virt addr space */
int inFileAddr; /* location of segment in this file */
int size; /* size of segment */
} Segment;
typedef struct noffHeader {
int noffMagic; /* should be NOFFMAGIC */
Segment code; /* executable code segment */
Segment code; /* executable code segment */
Segment initData; /* initialized data segment */
#ifdef RDATA
Segment readonlyData; /* read only data */
#endif
Segment uninitData; /* uninitialized data segment --
* should be zero'ed before use
*/
* should be zero'ed before use
*/
} NoffHeader;