Commit graph

673 commits

Author SHA1 Message Date
kolya e1626709d6 free the indirect block 2008-10-16 15:00:23 +00:00
kolya e670a48358 as rtm noticed, avoid doubly-freeing pipe page 2008-10-15 17:42:56 +00:00
kolya deca9fef83 indent 2008-10-15 05:15:32 +00:00
kolya c100d9ee2d cleaner swtch.S 2008-10-15 05:14:10 +00:00
kolya 228e500a0c save cpus.intena in sched(), so we get the right EFLAGS.IF value once a
timer-preempted kernel thread resumes execution in trap() after yield().
otherwise the kernel could get an arbitrary number of nested timer intrs.
2008-10-15 05:01:39 +00:00
kolya 15ce79de14 check cp->killed before returning to user from a timer interrupt 2008-10-15 04:57:02 +00:00
kolya 00ce31c09c update .cvsignore 2008-10-15 04:54:24 +00:00
kolya 289bbef733 minor cleanup 2008-10-12 20:19:16 +00:00
kolya f73b81205e minor cleanup with STUB macro 2008-10-12 19:54:11 +00:00
kolya c780dbf967 include explicitly initialized globals (int x = 0;) in cross-refs,
also thanks to greg price.
2008-10-12 18:45:30 +00:00
kolya 6186836d28 fix: when two names only differed in case, crossrefs only included one of them.
thanks to greg price.
2008-10-12 18:33:14 +00:00
rtm 2ce40d7088 be clear what the root i-number is 2008-10-08 18:57:13 +00:00
rtm be38c8413e document lock->locked=0 vs xchg(&lock->locked, 0) 2008-09-28 10:53:54 +00:00
kolya 0159c8bb94 trap 9 does not push ec: fix from Greg Price <price@mit.edu> 2008-09-24 18:20:56 +00:00
kolya c7317d4dc7 always save and restore %fs, %gs to ensure old segment entries are never
accessible to user from the hidden CPU segment registers.
2008-09-24 01:48:31 +00:00
rtm adcd16c3f7 restore std toolprefix 2008-09-11 10:22:01 +00:00
rtm 4651d04ad1 omit *.d from tar file 2008-09-11 10:20:40 +00:00
kaashoek e9ae6f5cbe add copyright notice 2008-09-09 11:42:44 +00:00
kolya f68317533e make bochsrc work for bochs 2.2.6 2008-09-03 14:10:47 +00:00
kolya 35a6cf84ec make pdf, ps, tarball 2008-09-03 14:05:52 +00:00
kaashoek e87dca5cc5 nits in index.txt
add slides for shell, x86 intro, x86 virtual memory  (deleted JOS from slides)
2008-09-03 12:29:44 +00:00
rsc f53494c28e DO NOT MAIL: xv6 web pages 2008-09-03 04:50:04 +00:00
rtm ee3f75f229 simplify growproc 2008-08-28 17:57:47 +00:00
rtm 98754d687e avoid a bug w/ exit() 2008-08-28 00:53:24 +00:00
rtm 56082468ea the old explanation of AP startup might have been correct, but
I understand this one.
2008-08-28 00:52:05 +00:00
kolya 02cc595f28 clean up circular buffers, so pipe can queue 512 bytes rather than 511 2008-08-22 00:26:22 +00:00
kolya 5c5470a2fa fix obvious printf nits after reading through code 2008-08-21 23:24:02 +00:00
rsc 1808b2f1b3 now rev2 2008-08-20 18:00:35 +00:00
rsc 150785a1fd add nice font 2008-08-20 18:00:24 +00:00
rsc 9b62657ecd formatting updates 2008-08-20 18:00:13 +00:00
rsc 5b7f8cbe7c bochs faster 2008-08-20 17:59:29 +00:00
rsc 174729fc55 xv6: latest (as of January 2008) 2008-08-20 17:46:32 +00:00
rsc eadbd55af2 oops - wrong bit (vic zandy) 2007-12-20 18:27:07 +00:00
rsc c2258bf4d2 fork minibug 2007-11-28 20:47:22 +00:00
rsc 4f06ae0d42 More complete lapic startup (thanks Silas) 2007-11-28 20:47:10 +00:00
rsc a6c4711a38 bda[0xE] is a 16-bit segment number,
not a real address.  So shift 4.

Reported by Silas.

Jim McKie says this code only matters
on ancient EISA MP systems.
2007-11-28 20:17:04 +00:00
rtm fd6b029401 proc_wait -> wait 2007-10-20 18:25:38 +00:00
rsc 949352af66 Model verifying that wakeup really
can be called after release without
causing deadlock.
2007-10-12 04:21:04 +00:00
rsc 943fd378a1 Incorporate new understanding of/with Intel SMP spec.
Dropped cmpxchg in favor of xchg, to match lecture notes.

Use xchg to release lock, for future protection and to
keep gcc from acting clever.
2007-10-01 20:43:15 +00:00
rsc 9fd9f80431 Re: why cpuid() in locking code?
rtm wrote:
> Why does acquire() call cpuid()? Why does release() call cpuid()?

The cpuid in acquire is redundant with the cmpxchg, as you said.
I have removed the cpuid from acquire.

The cpuid in release is actually doing something important,
but not on the hardware.  It keeps gcc from reordering the
lock->locked assignment above the other two during optimization.
(Not that current gcc -O2 would choose to do that, but it is allowed to.)
I have replaced the cpuid in release with a "gcc barrier" that
keeps gcc from moving things around but has no hardware effect.

On a related note, I don't think the cpuid in mpmain is necessary,
for the same reason that the cpuid wasn't needed in release.

As to the question of whether

  acquire();
  x = protected;
  release();

might read protected after release(), I still haven't convinced
myself whether it can.  I'll put the cpuid back into release if
we determine that it can.

Russ
2007-09-30 14:30:04 +00:00
rsc c840f3ecdc tricks 2007-09-30 14:20:47 +00:00
rsc af7366c945 interrupts during system calls
"It just works."
2007-09-27 21:37:45 +00:00
rsc ab08960f64 Final word on the locking fiasco?
Change pushcli / popcli so that they can never turn on
interrupts unexpectedly.  That is, if interrupts are on,
then pushcli(); popcli(); turns them off and back on, but
if they are off to begin with, then pushcli(); popcli(); is
a no-op.

I think our fundamental mistake was having a primitive
(release and then popcli nee spllo) that could turn
interrupts on at unexpected moments instead of being
explicit about when we want to start allowing interrupts.

With the new semantics, all the manual fiddling of ncli
to force interrupts off in certain sections goes away.
In return, we must explicitly mark the places where
we want to enable interrupts unconditionally, by calling sti().
There is only one: inside the scheduler loop.
2007-09-27 21:25:37 +00:00
rsc f97f0d2b3d cleaner 2007-09-27 21:02:03 +00:00
rsc c95bde8163 yank out stack overflow checking ugliness 2007-09-27 20:38:53 +00:00
rsc 4f74de0edc okay, that was long enough - revert 2007-09-27 20:32:45 +00:00
rsc ce2e751555 test: store curproc at top of stack
I don't actually think this is worthwhile, but I figured
I would check it in before reverting it, so that it can
be in the revision history.

Pros:
  * curproc doesn't need to turn on/off interrupts
  * scheduler doesn't have to edit curproc anymore

Cons:
  * it's ugly
  * all the stack computation is more complicated.
  * it doesn't actually simplify anything but curproc,
    and even curproc is harder to follow.
2007-09-27 20:29:50 +00:00
rsc aefc13f8ba nit 2007-09-27 20:25:32 +00:00
rsc 3807c1f20b rename splhi/spllo to pushcli/popcli 2007-09-27 20:09:40 +00:00
rsc 39c3fb1b15 overkill: use segments to catch stack overflow (delete before next year) 2007-09-27 19:39:10 +00:00