Saarett [Sun, 5 Feb 2017 10:44:56 +0000 (12:44 +0200)]
Free pgdir in setupkvm in case of mappages failure
There is a potential memory leak when mappages() fails inside setupkvm().
A call to freevm() is added in this case so as to reclaim the lost mapping pages.
Peter Froehlich [Fri, 23 Dec 2016 01:26:37 +0000 (20:26 -0500)]
Fix long-standing switchuvm() inconsistency.
switchuvm() is supposed to switch the TSS and page table to the
process p it is passed. Alas, instead of using p to access the
kstack field, it used the global proc. This worked fine because
(a) most uses of switchuvm() pass proc anyway and (b) because in
the schedule, where we call switchuvm with the newly scheduled
process, we actually set the global proc before the call. But I
think it's still a bug, even if it never broke a test case. :-)
when a zero PDE is encountered while searching for present PTEs to free,
resume searching at first entry of the next page table instead of the
current entry of the next page table.
Frans Kaashoek [Fri, 2 Sep 2016 12:31:13 +0000 (08:31 -0400)]
APIC IDs may not be consecutive and start from zero, so we cannot really use it
as a direct index into cpus. Record apicid in struct cpu and have cpunum() look
for it. Replace cpu->id with cpunum() everywhere, and replace cpu->id with cpu->apicid.
Thanks to Xi Wang.
Frans Kaashoek [Fri, 26 Aug 2016 12:20:11 +0000 (08:20 -0400)]
set iomb to forbid i/o instructions from user space
add to test that they indeed trap in user space
thanks to pablogventura@gmail.com and nwolovick@gmail.com
Frans Kaashoek [Sat, 27 Jun 2015 16:39:13 +0000 (12:39 -0400)]
Pick up where i left off in april:
- move log into metadata part of disk, so that marking
that the log's blocks are in use falls out for free
- superblock describes the whole disk (sizes and offets)
- sizes and offsets are computed in one place (mkfs) and
the rest of the code refers to the superblock for these values,
instead of recomputing them.
Frans Kaashoek [Sat, 11 Apr 2015 00:39:40 +0000 (20:39 -0400)]
One ide command for nsector_per_block generates nsector_per_block interrupts,
instead of 1. ideintr() should wait for nsector_per_block interrupts before
waking up the reader; now it wakes up the reader after 1 interrupt, which
apparently means that the first sector is available of the command instead of all.
For now keep BSIZE to 512.
Frans Kaashoek [Fri, 3 Apr 2015 12:22:02 +0000 (08:22 -0400)]
Disentangle block size from the disk's sector size. Set block size to 1024 to show
that they can be different. Clean up mkfs, simplifying specifying fs parameters,
remove some redundancy between fs and mkfs, and fix disk layout bugs. Call blocks
in the file system blocks instead of sectors. Passes usertests for different
block sizes.
Austin Clements [Wed, 25 Mar 2015 00:54:39 +0000 (20:54 -0400)]
Fix missing NUL-terminator in grep
Currently, grep read()s into a buffer and then uses the buffer as a
string. Since there's no NUL-terminator, this can cause it to falsely
identify line breaks and matches from leftover data on earlier lines
and, if a line fills up the entire buffer, to read past the end of the
buffer.
Fix this by NUL-terminating any data returned by read().
Austin Clements [Fri, 3 Oct 2014 13:39:09 +0000 (09:39 -0400)]
Fix kernelmemfs linking
Commit 9aa0337d introduced a linker script for linking the kernel image,
but only changed the kernel target to use it. kernelmemfs was still
using the old linker command line arguments, which weren't sufficient.