old ramfs had a limit on the number of files it could serve
and file size was limited to maximum allocaiton size.
the new implementation uses multiple memory chunks to back file data
in a private compactable memory pool to overcome these limits.
files can be sparse. file metadata is maintained by 9pfile data
structures of lib9p.
mischief → ; import -p tcp!9.offblast.org!17007 / /n/9
mischief → -> import: can't mount /: EOF receiving fversion reply
mischief → on the console
mischief → bmo Mar 13 18:55:30 dialing tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 reconnected to tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 connected from 199.191.58.44
mischief → bmo Mar 13 18:55:34 exiting...bmo Mar 13 18:55:30 dialing tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 reconnected to tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 connected from 199.191.58.44
mischief → bmo Mar 13 18:55:34 exiting...
mischief → aan is dialing the *exportfs* port because i explicitly specified it
netfd is initially zero (stdin), when filter() closes fd0,
fd0 is free to be reused. this causes problems with openmount()
that assumes sfd being >2.
instead, we dup the our pipe end over netfd, and close the pipe.
stringwidth() and string() sometimes failed spuriously due
to the wrong assumption that cachechars() will only fail
when a different subfont is needed. in fact, cachechars()
can fail for other reasons like when it resizes the fontcache
(or fails todo so).
theres also the case when loadchar() is unable to translate
a character and returns 0. this case needs to be differentiated
from such temporary conditions like fontcache resize or subfont
load to stop the retry loop in string() and stringwidth().
now cachechars() returns -1 to indicate that it cannot
proceed and we test this in string() and stringwidth()
to skip over untranslatable characters to make progress
instead of retrying.
when libmach is compiled with 6c, unions in the 32bit Uregs
cause fields to be wronly aligned. use #pragma pack arround
the #include "/$objtype/include/ureg.h" statement.
the comment about Physseg.size being in pages is wrong,
change type to uintptr and correct the comment.
change the length parameter of segattach() and isoverlap()
to uintptr as well. segments can grow over 4GB in pc64 now
and globalsegattach() in devsegment calculates len argument
of isoverlap() by s->top - s->bot. note that the syscall
still takes 32bit ulong argument for the length!
check for integer overflow in segattach(), make sure segment
goes not beyond USTKTOP.
change PTEMAPMEM constant to uvlong as it is used to calculate
SEGMAXSIZE.
previous change had forgot how dithering works... m(
we *really* add a random signal when *reducing* the number
of bits. just make sure we do not overflow like in
mixin().
the check in dither() was inverted. we should only
add noise when the output bit count is greater
than input bit count (samples shifted up) to
fill the lower zero bits produced by the shift.
simplifying paging code by getting rid of duppage(). instead,
fixfault() now always makes a copy of the shared/cached page
and leaves the cache alone. newpage() uncaches pages as
neccesary.
thanks charles forsyth for the suggestion.
from http://9fans.net/archive/2014/03/26:
> It isn't needed at all. When a cached page is written, it's trying hard to
> replace the page in the cache by a new copy,
> to return the previously cached page. Instead, I copy the cached page and
> return the copy, which is what it already
> does in another instance. ...