]> Devi Nivas Git - cs3210-lab0.git/log
cs3210-lab0.git
19 years agooops
kaashoek [Tue, 15 Aug 2006 15:54:53 +0000 (15:54 +0000)]
oops

19 years agocommented out code for cwd
kaashoek [Tue, 15 Aug 2006 15:53:46 +0000 (15:53 +0000)]
commented out code for cwd

19 years agouser-level programs: mkdir and rm
kaashoek [Mon, 14 Aug 2006 21:22:13 +0000 (21:22 +0000)]
user-level programs: mkdir and rm
shell parses arguments (very simplistic)
readme version of README (sh doesn't deal with capital characters)
printf recognizes %c
nicer output format for ls

19 years agoset size for directories correctly in wdir and mkfs
kaashoek [Mon, 14 Aug 2006 14:13:52 +0000 (14:13 +0000)]
set size for directories correctly in wdir and mkfs
mkdir
ls shows stat info for each dir entry

19 years agostart on mkdir
kaashoek [Mon, 14 Aug 2006 03:00:13 +0000 (03:00 +0000)]
start on mkdir
stat

19 years agowdir now uses readi/writei
rtm [Sun, 13 Aug 2006 20:06:42 +0000 (20:06 +0000)]
wdir now uses readi/writei

19 years agofix iget() bug that allocated in-use inode[] entries
rtm [Sun, 13 Aug 2006 15:51:58 +0000 (15:51 +0000)]
fix iget() bug that allocated in-use inode[] entries

19 years agodon't print unallocated dir entries
kaashoek [Sun, 13 Aug 2006 15:05:58 +0000 (15:05 +0000)]
don't print unallocated dir entries

19 years agonamei returns locked parent dir inode for create / unlink
rtm [Sun, 13 Aug 2006 12:22:44 +0000 (12:22 +0000)]
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

19 years agozero freed blocks
kaashoek [Sun, 13 Aug 2006 05:28:04 +0000 (05:28 +0000)]
zero freed blocks
multi-block directories
track size of directory (size = number entries in use)
should namei (and other code that scans through directories) scan through all blocks of a directory and not use size?

19 years agolink()
rtm [Sun, 13 Aug 2006 02:12:44 +0000 (02:12 +0000)]
link()

19 years agozero out all of dirent.name when creating
rtm [Sat, 12 Aug 2006 22:44:26 +0000 (22:44 +0000)]
zero out all of dirent.name when creating
don't increase length of directory

19 years agoLRU disk cache replacement
rtm [Sat, 12 Aug 2006 22:34:13 +0000 (22:34 +0000)]
LRU disk cache replacement

19 years agofree inode only when noone is holding a pointer to it. should fix open-unlink-
kaashoek [Sat, 12 Aug 2006 22:03:01 +0000 (22:03 +0000)]
free inode only when noone is holding a pointer to it.  should fix open-unlink-
read problem, but untested

19 years agobuffer cache, fifo replacement
rtm [Sat, 12 Aug 2006 17:17:35 +0000 (17:17 +0000)]
buffer cache, fifo replacement

19 years agomknod set nlink = 1
rtm [Sat, 12 Aug 2006 16:47:48 +0000 (16:47 +0000)]
mknod set nlink = 1
usertests for concurrent create/delete, and read() after unlink()

19 years agofix getblk to actually lock the block
rtm [Sat, 12 Aug 2006 11:38:57 +0000 (11:38 +0000)]
fix getblk to actually lock the block
no more cons_put system calls
usertests tests two processes writing files

19 years agofstat
kaashoek [Sat, 12 Aug 2006 04:33:50 +0000 (04:33 +0000)]
fstat
primitive ls

19 years agounlink,mknod,create with multi-component pathnames should work now
kaashoek [Sat, 12 Aug 2006 01:25:45 +0000 (01:25 +0000)]
unlink,mknod,create with multi-component pathnames should work now
remove console init code from userfs

19 years agofix deadlock---iput(dp) asap
kaashoek [Fri, 11 Aug 2006 18:18:38 +0000 (18:18 +0000)]
fix deadlock---iput(dp) asap
working unlink, but doesn't free dir blocks that become empty
remove out-of-date comment in ioapic

19 years agoinit creates console, opens 0/1/2, runs sh
rtm [Fri, 11 Aug 2006 13:55:18 +0000 (13:55 +0000)]
init creates console, opens 0/1/2, runs sh
sh accepts 0-argument commands (like userfs)
reads from console

19 years agointerrupts could be recursive since lapic_eoi() called before rti
rtm [Thu, 10 Aug 2006 22:08:14 +0000 (22:08 +0000)]
interrupts could be recursive since lapic_eoi() called before rti
so fast interrupts overflow the kernel stack
fix: cli() before lapic_eoi()

19 years agolow-level keyboard input (not hooked up to /dev yet)
rtm [Thu, 10 Aug 2006 02:07:10 +0000 (02:07 +0000)]
low-level keyboard input (not hooked up to /dev yet)
fix acquire() to cli() *before* incrementing nlock
make T_SYSCALL a trap gate, not an interrupt gate
sadly, various crashes if you hold down a keyboard key...

19 years agoprintf
kaashoek [Thu, 10 Aug 2006 01:28:57 +0000 (01:28 +0000)]
printf
convert userfs to use printf
bfree
ifree
writei
start on unlink

19 years agoiread for T_DEV
kaashoek [Wed, 9 Aug 2006 19:25:20 +0000 (19:25 +0000)]
iread for T_DEV
O_RDWR, etc.
create file

19 years agofix test program: don't close before writing
kaashoek [Wed, 9 Aug 2006 17:25:10 +0000 (17:25 +0000)]
fix test program: don't close before writing
set fd to writeable on open for write

19 years agodevsw
kaashoek [Wed, 9 Aug 2006 16:04:04 +0000 (16:04 +0000)]
devsw
checkpoint: write(fd,"hello\n",6) where fd is a console dev almost works

19 years agooops, update directory inode too
kaashoek [Wed, 9 Aug 2006 01:19:48 +0000 (01:19 +0000)]
oops, update directory inode too

19 years agoblock bitmap
kaashoek [Wed, 9 Aug 2006 01:09:36 +0000 (01:09 +0000)]
block bitmap
balloc

19 years agofix race in holding() check in acquire()
rtm [Tue, 8 Aug 2006 19:58:06 +0000 (19:58 +0000)]
fix race in holding() check in acquire()
give cpu1 a TSS and gdt for when it enters scheduler()
and a pseudo proc[] entry for each cpu
cpu0 waits for each other cpu to start up
read() for files

19 years agomknod,ialloc,iupdate
kaashoek [Tue, 8 Aug 2006 18:07:37 +0000 (18:07 +0000)]
mknod,ialloc,iupdate

19 years agobwrite
kaashoek [Mon, 7 Aug 2006 01:38:46 +0000 (01:38 +0000)]
bwrite

19 years agogeneralize async read to support write too
kaashoek [Sun, 6 Aug 2006 20:28:15 +0000 (20:28 +0000)]
generalize async read to support write too

19 years agonit
kaashoek [Fri, 4 Aug 2006 18:23:23 +0000 (18:23 +0000)]
nit

19 years agobetter interrupt plan---this one appears to work
kaashoek [Fri, 4 Aug 2006 18:12:31 +0000 (18:12 +0000)]
better interrupt plan---this one appears to work
ioapic

19 years agoopen()
rtm [Sat, 29 Jul 2006 09:35:02 +0000 (09:35 +0000)]
open()

19 years agoacquire+release ide_lock in ide_intr
kaashoek [Sat, 29 Jul 2006 01:20:15 +0000 (01:20 +0000)]
acquire+release ide_lock in ide_intr

19 years agoexec arguments
rtm [Fri, 28 Jul 2006 22:33:07 +0000 (22:33 +0000)]
exec arguments

19 years agoprimitive exec
rtm [Thu, 27 Jul 2006 21:10:00 +0000 (21:10 +0000)]
primitive exec

19 years agoupdate
rtm [Wed, 26 Jul 2006 10:17:39 +0000 (10:17 +0000)]
update

19 years agonamei
rtm [Fri, 21 Jul 2006 22:10:40 +0000 (22:10 +0000)]
namei

19 years agobread
rtm [Fri, 21 Jul 2006 13:18:04 +0000 (13:18 +0000)]
bread
iget
mkfs makes a file system image
put this in your .bochsrc:
ata0-slave: type=disk, mode=flat, path="fs.img", cylinders=1024, heads=1, spt=1

19 years agouint32_t -> uint &c
rtm [Thu, 20 Jul 2006 09:07:53 +0000 (09:07 +0000)]
uint32_t -> uint &c

19 years agoprevent longjmp / forkret from writing over tf->edi
rtm [Tue, 18 Jul 2006 19:22:37 +0000 (19:22 +0000)]
prevent longjmp / forkret from writing over tf->edi

19 years agoadd ide_lock for sleep
rsc [Mon, 17 Jul 2006 05:00:25 +0000 (05:00 +0000)]
add ide_lock for sleep

19 years agostandarize on unix-like lowercase struct names
rsc [Mon, 17 Jul 2006 01:58:13 +0000 (01:58 +0000)]
standarize on unix-like lowercase struct names

19 years agono more cons_putc; real_cons_putc -> cons_putc
rsc [Mon, 17 Jul 2006 01:53:43 +0000 (01:53 +0000)]
no more cons_putc; real_cons_putc -> cons_putc

19 years agoadd uint and standardize on typedefs instead of unsigned
rsc [Mon, 17 Jul 2006 01:52:13 +0000 (01:52 +0000)]
add uint and standardize on typedefs instead of unsigned

19 years agocleaner
rsc [Mon, 17 Jul 2006 01:51:47 +0000 (01:51 +0000)]
cleaner

19 years agogoodbye PushRegs
rsc [Mon, 17 Jul 2006 01:36:39 +0000 (01:36 +0000)]
goodbye PushRegs

19 years agocleaner
rsc [Mon, 17 Jul 2006 01:36:32 +0000 (01:36 +0000)]
cleaner

19 years agonitpicks
rsc [Mon, 17 Jul 2006 01:25:22 +0000 (01:25 +0000)]
nitpicks

19 years agoEliminate annoying Pseudodesc structure.
rsc [Sun, 16 Jul 2006 16:55:52 +0000 (16:55 +0000)]
Eliminate annoying Pseudodesc structure.
Eliminate unnecessary parts of mmu.h.

19 years agovarious little fixes that should have been in earlier checkins
rsc [Sun, 16 Jul 2006 16:06:03 +0000 (16:06 +0000)]
various little fixes that should have been in earlier checkins

19 years agomore idiomatic c
rsc [Sun, 16 Jul 2006 16:05:37 +0000 (16:05 +0000)]
more idiomatic c

19 years agono memlayout.h
rsc [Sun, 16 Jul 2006 16:04:44 +0000 (16:04 +0000)]
no memlayout.h

19 years agowas empty; gone
rsc [Sun, 16 Jul 2006 16:04:15 +0000 (16:04 +0000)]
was empty; gone

19 years agofix main return type
rsc [Sun, 16 Jul 2006 16:03:51 +0000 (16:03 +0000)]
fix main return type

19 years agoadd %s to cprintf for cons_puts
rsc [Sun, 16 Jul 2006 16:00:03 +0000 (16:00 +0000)]
add %s to cprintf for cons_puts

19 years agoKeep interrupts disabled during startup.
rsc [Sun, 16 Jul 2006 15:50:13 +0000 (15:50 +0000)]
Keep interrupts disabled during startup.

19 years agostandardize on not using foo_ prefix in struct foo
rsc [Sun, 16 Jul 2006 15:41:47 +0000 (15:41 +0000)]
standardize on not using foo_ prefix in struct foo

19 years agorename swtch.S to setjmp.S
rsc [Sun, 16 Jul 2006 15:40:51 +0000 (15:40 +0000)]
rename swtch.S to setjmp.S

19 years agostandardize on #include "foo" not <foo>
rsc [Sun, 16 Jul 2006 15:40:05 +0000 (15:40 +0000)]
standardize on #include "foo" not <foo>

19 years agoadd minimal comments to generator vector table
rsc [Sun, 16 Jul 2006 15:38:56 +0000 (15:38 +0000)]
add minimal comments to generator vector table

19 years agoremove acquire1 and release1
rsc [Sun, 16 Jul 2006 15:38:13 +0000 (15:38 +0000)]
remove acquire1 and release1

19 years agoadd cons_puts for atomic (readable) output
rsc [Sun, 16 Jul 2006 15:38:00 +0000 (15:38 +0000)]
add cons_puts for atomic (readable) output

19 years agoAdd user.h for prototypes.
rsc [Sun, 16 Jul 2006 15:36:31 +0000 (15:36 +0000)]
Add user.h for prototypes.
Add cons_puts for cleaner output.

19 years agotidy up
rsc [Sun, 16 Jul 2006 15:35:18 +0000 (15:35 +0000)]
tidy up

19 years agoDon't kill process when inside kernel.
rsc [Sun, 16 Jul 2006 02:09:45 +0000 (02:09 +0000)]
Don't kill process when inside kernel.

19 years agomore name cleanup
rsc [Sun, 16 Jul 2006 02:04:58 +0000 (02:04 +0000)]
more name cleanup

19 years agoremove non-idiomatic increment/decrement
rsc [Sun, 16 Jul 2006 01:52:22 +0000 (01:52 +0000)]
remove non-idiomatic increment/decrement

19 years agoRename fd_reference to more suggestive fd_incref.
rsc [Sun, 16 Jul 2006 01:49:03 +0000 (01:49 +0000)]
Rename fd_reference to more suggestive fd_incref.
(Fd_reference sounds like it might just return the ref count.)

19 years agoAttempt to clean up newproc somewhat.
rsc [Sun, 16 Jul 2006 01:47:40 +0000 (01:47 +0000)]
Attempt to clean up newproc somewhat.

Also remove all calls to memcpy in favor of
memmove, which has defined semantics when
the ranges overlap.  The fact that memcpy was
working in console.c to scroll the screen is not
guaranteed by all implementations.

19 years agoNew scheduler.
rsc [Sun, 16 Jul 2006 01:15:28 +0000 (01:15 +0000)]
New scheduler.

Removed cli and sti stack in favor of tracking
number of locks held on each CPU and explicit
conditionals in spinlock.c.

19 years agoUndo change from this morning that wasn't intended to get in.
rsc [Sun, 16 Jul 2006 01:12:57 +0000 (01:12 +0000)]
Undo change from this morning that wasn't intended to get in.

19 years agomove everything having to do with proc_table_lock into proc.c
rsc [Sat, 15 Jul 2006 17:24:54 +0000 (17:24 +0000)]
move everything having to do with proc_table_lock into proc.c

19 years agosilence load_icode signedness warning
rsc [Sat, 15 Jul 2006 17:23:17 +0000 (17:23 +0000)]
silence load_icode signedness warning

19 years agoAdd void for ANSI C
rsc [Sat, 15 Jul 2006 17:17:00 +0000 (17:17 +0000)]
Add void for ANSI C

19 years agoChange fetchint, fetcharg, and putint to return -1 on error, 0 on success.
rsc [Sat, 15 Jul 2006 17:13:56 +0000 (17:13 +0000)]
Change fetchint, fetcharg, and putint to return -1 on error, 0 on success.
They had been returning 0 on error, 1 on success, but all the callers
were checking for return value < 0.

19 years agono more recursive locks
rtm [Sat, 15 Jul 2006 12:03:57 +0000 (12:03 +0000)]
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

19 years agoand the file
kaashoek [Wed, 12 Jul 2006 17:19:24 +0000 (17:19 +0000)]
and the file

19 years agoextract lapic code from mp.c
kaashoek [Wed, 12 Jul 2006 17:00:54 +0000 (17:00 +0000)]
extract lapic code from mp.c

19 years agopasses both usertests
rtm [Wed, 12 Jul 2006 15:35:33 +0000 (15:35 +0000)]
passes both usertests
exit had acquire where I meant release
swtch now checks that you hold no locks

19 years agoi think my cmpxchg use was wrong in acquire
rtm [Wed, 12 Jul 2006 11:15:38 +0000 (11:15 +0000)]
i think my cmpxchg use was wrong in acquire
nesting cli/sti: release shouldn't always enable interrupts
separate setup of lapic from starting of other cpus, so cpu() works earlier
flag to disable locking in console output
make locks work even when curproc==0
(still crashes in clock interrupt)

19 years agocvs add spinlock.h
rtm [Wed, 12 Jul 2006 09:10:25 +0000 (09:10 +0000)]
cvs add spinlock.h
fix race in schedule()

19 years agono more big kernel lock
rtm [Wed, 12 Jul 2006 01:48:35 +0000 (01:48 +0000)]
no more big kernel lock
succeeds at usertests.c pipe test

19 years agogive each cpu its own clock, so that preemption works on cpu 1
rtm [Tue, 11 Jul 2006 18:45:27 +0000 (18:45 +0000)]
give each cpu its own clock, so that preemption works on cpu 1

19 years agopre-empt both user and kernel, in clock interrupt
rtm [Tue, 11 Jul 2006 17:39:45 +0000 (17:39 +0000)]
pre-empt both user and kernel, in clock interrupt
usertest.c tests pre-emption
kill()

19 years agoChanges to allow use of native x86 ELF compilers, which on my
rsc [Tue, 11 Jul 2006 01:07:40 +0000 (01:07 +0000)]
Changes to allow use of native x86 ELF compilers, which on my
Linux 2.4 box using gcc 3.4.6 don't seem to follow the same
conventions as the i386-jos-elf-gcc compilers.
Can run make 'TOOLPREFIX=' or edit the Makefile.

curproc[cpu()] can now be NULL, indicating that no proc is running.
This seemed safer to me than having curproc[0] and curproc[1]
both pointing at proc[0] potentially.

The old implementation of swtch depended on the stack frame layout
used inside swtch being okay to return from on the other stack
(exactly the V6 you are not expected to understand this).
It also could be called in two contexts: at boot time, to schedule
the very first process, and later, on behalf of a process, to sleep
or schedule some other process.

I split this into two functions: scheduler and swtch.

The scheduler is now a separate never-returning function, invoked
by each cpu once set up.  The scheduler looks like:

scheduler() {
setjmp(cpu.context);

pick proc to schedule
blah blah blah

longjmp(proc.context)
}

The new swtch is intended to be called only when curproc[cpu()] is not NULL,
that is, only on behalf of a user proc.  It does:

swtch() {
if(setjmp(proc.context) == 0)
longjmp(cpu.context)
}

to save the current proc context and then jump over to the scheduler,
running on the cpu stack.

Similarly the system call stubs are now in assembly in usys.S to avoid
needing to know the details of stack frame layout used by the compiler.

Also various changes in the debugging prints.

19 years agoqueue with disk requests
kaashoek [Mon, 10 Jul 2006 19:06:48 +0000 (19:06 +0000)]
queue with disk requests

19 years agooops
kaashoek [Mon, 10 Jul 2006 16:27:15 +0000 (16:27 +0000)]
oops

19 years agoread the disk using interrupts
kaashoek [Mon, 10 Jul 2006 13:08:37 +0000 (13:08 +0000)]
read the disk using interrupts

19 years agodisable all interrupts when acquiring lock
kaashoek [Thu, 6 Jul 2006 21:47:22 +0000 (21:47 +0000)]
disable all interrupts when acquiring lock
user program that makes a blocking system call

19 years agotimer interrupts
kaashoek [Wed, 5 Jul 2006 20:00:14 +0000 (20:00 +0000)]
timer interrupts
disk interrupts (assuming bochs has a bug)

19 years agoswtch saves callee-saved registers
rtm [Sat, 1 Jul 2006 21:26:01 +0000 (21:26 +0000)]
swtch saves callee-saved registers
swtch idles on per-CPU stack, not on calling process's stack
fix pipe bugs
usertest.c tests pipes, fork, exit, close

19 years agodisable interrupts when holding kernel lock
kaashoek [Wed, 28 Jun 2006 16:44:41 +0000 (16:44 +0000)]
disable interrupts when holding kernel lock

19 years agotimer interrupts
kaashoek [Wed, 28 Jun 2006 16:35:03 +0000 (16:35 +0000)]
timer interrupts

19 years agofile descriptors
rtm [Tue, 27 Jun 2006 14:35:53 +0000 (14:35 +0000)]
file descriptors
pipes

19 years agosystem call return values
rtm [Mon, 26 Jun 2006 20:31:52 +0000 (20:31 +0000)]
system call return values
initialize 2nd cpu's idt

19 years agostick mpstack in cpu structure
kaashoek [Mon, 26 Jun 2006 16:40:43 +0000 (16:40 +0000)]
stick mpstack in cpu structure