Commit graph

42 commits

Author SHA1 Message Date
Frans Kaashoek 3a5fa7ed90 Introduce and use sleeplocks instead of BUSY flags
Remove I_BUSY, B_BUSY, and intrans defs and usages
One spinlock per buf to avoid ugly loop in bget
fix race in filewrite (don't update f->off after releasing lock)
2011-08-26 10:08:29 -04:00
Robert Morris 5053dd6a6d avoid deadlock by calling begin_trans() before locking any inodes 2011-08-15 12:44:20 -04:00
Robert Morris 2e59046362 log write() data
usertest for big write()s
push begin_trans/commit_trans down into syscalls
2011-08-12 09:25:39 -04:00
Russ Cox 1a81e38b17 make new code like old code
Variable declarations at top of function,
separate from initialization.

Use == 0 instead of ! for checking pointers.

Consistent spacing around {, *, casts.

Declare 0-parameter functions as (void) not ().

Integer valued functions return -1 on failure, 0 on success.
2011-01-11 13:01:13 -05:00
Robert Morris 4655d42e3b copyout() copies data to a va in a pagetable, for exec() &c
usertest that passes too many arguments, break exec
2010-09-27 16:14:33 -04:00
Frans Kaashoek 40889627ba Initial version of single-cpu xv6 with page tables 2010-07-02 14:51:53 -04:00
Russ Cox 48755214c9 assorted fixes:
* rename c/cp to cpu/proc
 * rename cpu.context to cpu.scheduler
 * fix some comments
 * formatting for printout
2009-08-30 23:02:08 -07:00
Russ Cox 0aef891495 shuffle and tweak for formatting.
pdf has very good page breaks now.
would be a good copy for fall 2009.
2009-08-08 01:07:30 -07:00
Russ Cox f9a06440ab rearrangements and cleanup for text 2009-07-11 19:26:01 -07:00
rsc f3685aa391 simplify 2009-05-31 02:07:51 +00:00
kolya 15a2693637 try harder to get directory refcounts right 2008-10-17 12:42:13 +00:00
kolya f3e87bc838 make mkdir crash-safer, as noticed by many students on midterm 2008-10-16 15:18:49 +00:00
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