Commit graph

30 commits

Author SHA1 Message Date
rsc 666f58c711 believe it or not, this was working
the macro expansion of "char *cp;" turned into
char *(curproc[cpu()]);  which declares a dynamically
sized array of char* called curproc.

so then &cp == &(curproc[cpu()]) was actually a
stack variable as "expected".  it was one past the
end of the array, but the implicit alloca allocated
more than was necessary.

do not tell me that making cp a #define was a bad idea.
there are worse problems to fix.  more on that later.
2007-09-27 05:13:10 +00:00
rsc 5516be1fed spaces around else for rtm 2007-08-28 18:37:41 +00:00
rsc e4d6a21165 more consistent spacing 2007-08-28 18:32:08 +00:00
rsc 7834cca604 remove _ from pipe; be like file 2007-08-28 04:22:35 +00:00
rsc 3a2310f746 make code match comment 2007-08-27 23:53:17 +00:00
rsc 64c4737477 make code match comment 2007-08-27 23:53:17 +00:00
rsc 558ab49f13 delete unnecessary #include lines 2007-08-27 23:26:33 +00:00
rsc 603deefc6b oops 2007-08-27 16:06:15 +00:00
rsc e79b16598c nits 2007-08-27 14:39:50 +00:00
rsc 1ccff18b24 fileincref -> filedup (consistent with idup) 2007-08-27 14:35:09 +00:00
rsc 8d2e9a4867 shuffle for formatting 2007-08-24 22:17:54 +00:00
rsc aa6824ab64 remove unused variable 2007-08-24 20:59:43 +00:00
rsc 07090dd705 Remove struct uinode.
Remove type arg to mknod (assume T_DEV).
2007-08-24 20:54:23 +00:00
rsc eaea18cb9c PDF at http://am.lcs.mit.edu/~rsc/xv6.pdf
Various changes made while offline.

 + bwrite sector argument is redundant; use b->sector.
 + reformatting of files for nicer PDF page breaks
 + distinguish between locked, unlocked inodes in type signatures
 + change FD_FILE to FD_INODE
 + move userinit (nee proc0init) to proc.c
 + move ROOTDEV to param.h
 + always parenthesize sizeof argument
2007-08-22 06:01:32 +00:00
rsc bd39955ecc ARGMAX -> MAXARGS 2007-08-21 20:01:11 +00:00
rsc f32f3638f4 Various cleanup:
- Got rid of dummy proc[0].  Now proc[0] is init.
 - Added initcode.S to exec /init, so that /init is
   just a regular binary.
 - Moved exec out of sysfile to exec.c
 - Moved code dealing with fs guts (like struct inode)
   from sysfile.c to fs.c.  Code dealing with system call
   arguments stays in sysfile.c
 - Refactored directory routines in fs.c; should be simpler.
 - Changed iget to return *unlocked* inode structure.
   This solves the lookup-then-use race in namei
   without introducing deadlocks.
   It also enabled getting rid of the dummy proc[0].
2007-08-21 19:22:08 +00:00
rsc e2a620da49 checkpoint - simpler namei interface 2007-08-20 19:37:15 +00:00
rsc dca5b5ca2e avoid assignments in declarations 2007-08-10 17:17:42 +00:00
rsc b6095304b7 Make cp a magic symbol. 2007-08-10 16:37:27 +00:00
rsc 806f4c11f7 oops 2007-08-09 17:53:03 +00:00
rsc 9583b476bf try to use cp only for curproc[cpu()] 2007-08-09 17:32:40 +00:00
rsc 7366e042d9 save process name for debugging 2007-08-08 08:38:11 +00:00
rsc 19297caf0d fix ide, pit interfaces 2006-09-07 15:29:54 +00:00
rsc 70c3260dc4 fix pipe bug 2006-09-07 14:38:56 +00:00
rsc 224f6598c1 refactor syscall code 2006-09-07 14:13:26 +00:00
rsc 0cfc7290e8 wrap long lines 2006-09-06 19:08:14 +00:00
rsc 50e514be98 fd_* => file_* 2006-09-06 18:43:45 +00:00
rsc 9936bffa45 fd.* -> file.* 2006-09-06 18:40:28 +00:00
rsc 39593d2f1a struct fd -> struct file 2006-09-06 18:38:56 +00:00
rsc 2685309fb4 split syscall.c into sysfile.c and sysproc.c 2006-09-06 18:19:11 +00:00