Commit graph

54 commits

Author SHA1 Message Date
Russ Cox
cf4b1ad90b xv6: formatting, cleanup, rev5 (take 2) 2011-02-19 21:17:55 -05: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
Robert Morris
a9183883b8 map kernel instructions r/o 2010-09-20 06:00:22 -04:00
Robert Morris
05d66b0629 my comment is wrong, exec handles BSS fine 2010-09-19 13:47:52 -04:00
Austin Clements
b1d41d6788 Remove the stack guard page. Processes are now contiguous from 0 to proc->sz, which means our syscall argument validation is correct. Add a pointer validation test and remove the stack test, which tested for the guard page. 2010-09-01 16:46:37 -04:00
Austin Clements
b0751a3e9b Space police 2010-09-01 00:41:25 -04:00
Austin Clements
dd645ef119 Cleanup if allocuvm fails to alloc. Add a test. 2010-08-31 21:49:49 -04:00
Robert Morris
789b508d53 uptime() sys call for benchmarking
increase PHYSTOP
2010-08-11 14:34:45 -04:00
Robert Morris
83d2db91f7 allow sbrk(-x) to de-allocate user memory 2010-08-10 17:08:41 -04:00
Robert Morris
c4cc10da7e fix corner cases in exec of ELF
put an invalid page below the stack
have fork() handle invalid pages
2010-08-06 11:12:18 -04:00
Robert Morris
eb18645f17 fix allocuvm() to handle sbrk() with non-page-granularity argument
(maybe this never worked, but it works now)
2010-08-05 12:10:54 -04:00
rsc
34295f461a group locks into structs they protect.
few naming nits.
2009-05-31 05:12:21 +00:00
rsc
d522571068 make slow bigdir last test 2007-09-27 12:29:06 +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
56c1a151d2 debugging prints 2007-09-26 23:24:23 +00:00
rsc
e0e7d07e5a test that fork fails gracefully 2007-08-24 20:20:23 +00:00
rtm
2036534834 add missing iput() at end of _namei() 2007-08-24 14:56:17 +00:00
rtm
b55513796f oops, O_CREATE doesn't truncate, so holes can't exist, thus no bug 2007-08-24 12:55:15 +00:00
rtm
3d5f21ee1f test concurrent open/unlink of same file (ok)
test files with holes (not ok)
2007-08-24 12:19:13 +00:00
rsc
c88bf235fe check unlink of non-empty directory 2007-08-22 02:21:22 +00:00
rsc
2d61a40b20 bug in usertests! 2007-08-20 21:00:20 +00:00
rsc
5e03dd86c8 add test for rm . 2007-08-10 17:53:09 +00:00
rsc
dca5b5ca2e avoid assignments in declarations 2007-08-10 17:17:42 +00:00
rsc
c664dd5d23 missing void 2007-08-08 09:32:39 +00:00
rsc
115e177400 standardize on not using unsigned keyword 2007-08-08 09:30:48 +00:00
rsc
f3c393ba9f fix tests 2006-09-07 20:06:08 +00:00
rsc
0517a730db remove bogus test 2006-09-07 15:31:40 +00:00
rsc
6c8acf9e04 check super-long lookups 2006-09-07 15:15:46 +00:00
kaashoek
a64cd81342 one regression test program 2006-09-07 13:23:41 +00:00
rsc
9e9bcaf143 standardize various * conventions 2006-09-06 17:27:19 +00:00
rtm
dfcc5b997c prune unneeded panics and debug output 2006-08-29 19:06:37 +00:00
rtm
3b95801add i broke sbrk, fix it 2006-08-29 17:01:40 +00:00
kaashoek
74493bf446 kill user process when it generates an unhandled trap (e.g., 13)
fix bug in test code of malloc
2006-08-25 00:43:17 +00:00
kaashoek
81d5219998 bug in sbrk
test malloc
2006-08-24 19:24:36 +00:00
kaashoek
8787cd01df chdir
cd in shell
nits in mkdir, ls, etc.
2006-08-19 23:41:34 +00:00
rtm
350e63f7a9 no more proc[] entry per cpu for idle loop
each cpu[] has its own gdt and tss
no per-proc gdt or tss, re-write cpu's in scheduler (you win, cliff)
main0() switches to cpu[0].mpstack
2006-08-15 22:18:20 +00:00
rtm
211ff0c67e namei returns locked parent dir inode for create / unlink
don't hold fd table lock across idecref() (latter does block i/o)
idecref calls iput() in case last ref -> freeing inode
dir size is 512 * # blocks, so readi/writei &c work
unlink deletes dirent even if ip->nlink > 0
2006-08-13 12:22:44 +00:00
rtm
9e5970d596 link() 2006-08-13 02:12:44 +00:00
rtm
cd93074e5b LRU disk cache replacement 2006-08-12 22:34:13 +00:00
rtm
14938f9392 buffer cache, fifo replacement 2006-08-12 17:17:35 +00:00
rtm
7ce01cf9be mknod set nlink = 1
usertests for concurrent create/delete, and read() after unlink()
2006-08-12 16:47:48 +00:00
rtm
4357207237 fix getblk to actually lock the block
no more cons_put system calls
usertests tests two processes writing files
2006-08-12 11:38:57 +00:00
rtm
8455980b27 exec arguments 2006-07-28 22:33:07 +00:00
rsc
c54c79267f nitpicks 2006-07-17 01:25:22 +00:00
rsc
9b37d1bfaa Add user.h for prototypes.
Add cons_puts for cleaner output.
2006-07-16 15:36:31 +00:00
rtm
46bbd72f3e no more recursive locks
wakeup1() assumes you hold proc_table_lock
sleep(chan, lock) provides atomic sleep-and-release to wait for condition
ugly code in swtch/scheduler to implement new sleep
fix lots of bugs in pipes, wait, and exit
fix bugs if timer interrupt goes off in schedule()
console locks per line, not per byte
2006-07-15 12:03:57 +00:00
rtm
6eb6f10c56 passes both usertests
exit had acquire where I meant release
swtch now checks that you hold no locks
2006-07-12 15:35:33 +00:00
rtm
664324745e cvs add spinlock.h
fix race in schedule()
2006-07-12 09:10:25 +00:00
rtm
4e8f237be8 no more big kernel lock
succeeds at usertests.c pipe test
2006-07-12 01:48:35 +00:00