summaryrefslogtreecommitdiff
path: root/proc.h
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2010-08-06 11:12:18 -0400
committerRobert Morris <[email protected]>2010-08-06 11:12:18 -0400
commitc4cc10da7ef6d65f0f654445e0af35b8309f16c2 (patch)
tree771c4791115f945fc86ea9eadc350bb22c518535 /proc.h
parent1afc9d3fcaa7c5992659bb8b69f639b746dda2bc (diff)
downloadxv6-labs-c4cc10da7ef6d65f0f654445e0af35b8309f16c2.tar.gz
xv6-labs-c4cc10da7ef6d65f0f654445e0af35b8309f16c2.tar.bz2
xv6-labs-c4cc10da7ef6d65f0f654445e0af35b8309f16c2.zip
fix corner cases in exec of ELF
put an invalid page below the stack have fork() handle invalid pages
Diffstat (limited to 'proc.h')
-rw-r--r--proc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/proc.h b/proc.h
index 5e5d031..7d97dfa 100644
--- a/proc.h
+++ b/proc.h
@@ -16,7 +16,7 @@
// Contexts are stored at the bottom of the stack they
// describe; the stack pointer is the address of the context.
// The layout of the context matches the layout of the stack in swtch.S
-// at "Switch stacks" comment. Switch itself doesn't save eip explicitly,
+// at the "Switch stacks" comment. Switch doesn't save eip explicitly,
// but it is on the stack and allocproc() manipulates it.
struct context {
uint edi;
@@ -31,7 +31,7 @@ enum procstate { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };
// Per-process state
struct proc {
uint sz; // Size of process memory (bytes)
- pde_t* pgdir; // linear address of proc's pgdir
+ pde_t* pgdir; // Linear address of proc's pgdir
char *kstack; // Bottom of kernel stack for this process
enum procstate state; // Process state
volatile int pid; // Process ID
@@ -48,6 +48,7 @@ struct proc {
// Process memory is laid out contiguously, low addresses first:
// text
// original data and bss
+// invalid page
// fixed-size stack
// expandable heap