summaryrefslogtreecommitdiff
path: root/kernel
AgeCommit message (Collapse)AuthorFilesLines
2019-07-19One way of supporting a guard page below kstack: allocate kstacks inFrans Kaashoek5-14/+42
procinit() and map them high up (below TRAMPOLNE) with an empty mapping below each stack. Never free a kernel stack. Another way would be to allocate and map them dynamically, but then we need to reload page table when switching processes in scheduler() and/or have a kernel pagetable per proc (if we want k->stack to be the same virtual address in each process). One gotcha: kernel addresses are not equal to physical addresses for stack addresses. A stack address must be translated if we need its physical address (e.g., virtio passes a stack address to the disk).
2019-07-17Merge branch 'riscv' of g.csail.mit.edu:xv6-dev into riscvFrans Kaashoek11-117/+146
2019-07-17Delete x86 commentFrans Kaashoek1-6/+0
2019-07-16conservatively call sfence.vma before every satp load.Robert Morris4-2/+16
2019-07-11cosmetic changesRobert Morris2-14/+22
2019-07-11another test, to help with locking exercisesRobert Morris2-5/+8
2019-07-10nitsRobert Morris3-6/+4
2019-07-10more comment cleanupRobert Morris1-24/+30
2019-07-10document which proc fields are protected by p->lockRobert Morris1-5/+9
2019-07-10have kill() lock before looking at p->pidRobert Morris3-36/+32
document wait()'s use of np->parent w/o holding lock.
2019-07-10tweak some comments.Robert Morris4-28/+28
2019-07-08holding p->lock all the way through state=RUNNABLE means we don't need EMBRYORobert Morris2-12/+7
2019-07-07eliminate ptable. ptable.lock -> pid_lock.Robert Morris1-15/+14
2019-07-07nitsRobert Morris1-10/+11
2019-07-07avoid a double-lock of initproc->lock if child of init is reparentingRobert Morris1-2/+5
2019-07-06Maybe fix two races identified by rtm (thx!):Frans Kaashoek1-12/+20
- during exit(), hold p's parent lock and p's lock across all changes to p and its parent (e.g., reparenting and wakeup1). the lock ordering between concurrent exits of children, parent, and great parent might work out because processes form a tree. - in wakeup1() test and set p->state atomically by asking caller to have p locked. a correctness proof would be desirable.
2019-07-04Make size in stat.h be a uint64Frans Kaashoek1-2/+2
Supporting print long using %l (a bit of cheat) Modify ls to print size using %l We should probably update size in inode too.
2019-07-04xFrans Kaashoek1-1/+1
2019-07-03Simplify wakeup1Frans Kaashoek1-11/+5
2019-07-03Apply some corresponding bug fixes from wq branch hereFrans Kaashoek1-27/+25
2019-07-02Remove some debugging codeFrans Kaashoek1-8/+1
2019-07-02Fix a lost wakeup bug: the disk driver's wakeup() can run after theFrans Kaashoek1-65/+50
reading process acquired p->lock and released virtio lock in sleep(), but before the process had set p->status to SLEEPING, because the wakeup tested p->status without holding p's lock. Thus, wakeup can complete without seeing any process SLEEPING and then p sets p->status to SLEEPING. Fix some other issues: - Don't initialize proc lock in allocproc(), because freeproc() sets np->state = UNUSED and allocproc() can choose np and calls initlock() on the process's lock, releasing np's lock accidentally. Move initializing proc's lock to init. - Protect nextpid using ptable.lock (and move into its own function) Some clean up: - Don't acquire p->lock when it p is used in a private way (e.g., exit()/grow()). - Move find_runnable() back into scheduler().
2019-07-02Merge branch 'riscv' into riscv-procFrans Kaashoek8-75/+122
2019-07-02xFrans Kaashoek1-1/+1
2019-07-02Don't start processes at the end of the proc tableFrans Kaashoek1-6/+8
2019-07-02Avoid two cores selecting the same process to runFrans Kaashoek4-29/+52
2019-07-02try to continue from walk() failing to allocate a page-table pageRobert Morris2-7/+16
2019-07-02avoid allocproc() returning a struct proc with non-zero p->szRobert Morris1-0/+2
2019-07-02COW testsRobert Morris1-1/+1
2019-07-02Checkpoint switching to per-process locks, in attempt clarify xv6'sFrans Kaashoek12-79/+133
locking plan, which is a difficult to understand because ptable lock protects many invariants. This implementation has a bug: once in a while xv6 unlocks a proc lock that is locked by another core.
2019-07-02don't enable interrupts until done with sstatus, scause, &cRobert Morris1-4/+6
2019-07-01oops, don't hold mycpu() result across intr_off()Robert Morris1-4/+3
2019-07-01have fork() fail, not panic, if not enough phys memRobert Morris3-16/+39
2019-07-01sbrk() returns a pointer, so it should be 64 bitsRobert Morris3-44/+44
2019-07-01oops, don't hold mycpu() result across intr_off()Robert Morris1-4/+3
2019-07-01timer interrupt in the kernel -> yieldRobert Morris2-4/+15
2019-07-01xFrans Kaashoek1-1/+0
2019-07-01Introduce alloc3_desc and UsedArea to make code easier to readFrans Kaashoek2-33/+38
2019-06-13FD_DEVICERobert Morris7-42/+41
2019-06-13for spinlocks, use gcc intrinsics, but say what they compile toRobert Morris2-21/+21
2019-06-13clean up virtio codeRobert Morris6-39/+46
2019-06-13eliminate ramdiskRobert Morris4-8/+2
2019-06-13virtio disk driverRobert Morris11-8/+354
2019-06-11separate source into kernel/ user/ mkfs/Robert Morris43-0/+5609