Add pages for esc1+shift and esc1+ctrl - some UK USB keyboards (Dell) and it seems some
German ones: https://groups.google.com/forum/#!topic/comp.os.plan9/ycok6NTCWCg seem to
generate an esc1 + code scancode combination for the pipe/backslash key. Seems like
overkill to add two whole pages for just two keys, but there again RAM is cheap these days.
Probably should take the changes across to omap/kbd.c (and by extension bcm/kbd.c)
but the changes are trivial.
catch the error() that can be thrown by sleep() and tsleep()
in kprocs.
add missing pexit() calls.
always set the freemem argument to pexit() from kproc otherwise
the process gets added to the broken list.
catch the error() that can be thrown by sleep() and tsleep()
in kprocs.
add missing pexit() calls.
always set the freemem argument to pexit() from kproc otherwise
the process gets added to the broken list.
from 9atom/acmearrowfun patch:
reported by mark van atten
In Plan 9 acme, if you type
{}
then go back and type text between the brackets
{Curiouser and curiouser!}
the right arrow is blocked when you want to go over the closing
bracket to continue typing to its right. (If you first go to the left,
and then back to the right, it works.)
Same for the other brackets: [ ], ( ), < >.
noted that brackets are not necessary. same behavior with any
character.
fix is to textcommit before moving.
we have to fail the whole query that got no cached
nameservers and nameservers are looping, not just omit
the looping nameserver. issuequery() will refresh
nameserver info for the domain when recursing up.
never try to resolve a nameserver address when that nameserver
is in the set of nameservers already being queried.
this situation can happen when the Ta and Taaaa RR's expire, but
the Tns records are still in the cache so there is no usable
nameserver but they still refer to each another.
stop absolute/relative dual use of RR.ttl. now RR.ttl is
*always* the *relative* ttl value. we derive absolute
timeout in RR.expire.
remove unused lookuptime field in DN. replace refs and
keep with mark field in DN. we do not care about the
number of references. only *iff* it is referenced, so
use a single bit for that (bit 0). for keep, we use
bit 1.
remove dolock parameter in dnagenever(), it is not
needed. we always need to lock.
mark local dns servers and domains as never to be aged.
the keeper bit is *just* a cache optimization, preventing
the domain and the domains it points to from being flushed.
it should not be used as a write protect bit in rrattach()
for preventing spoofing as it will prevent updates of say,
cname domains.
remove "removing spam ..." message. these are usualy just
hints, so normal. still, remove the hint as we currently
do no check if the nameserver has authority over the
cname domain.
remove "mydnsquery: trying to send to myself (%s); bzzzt"
message. this can happen when myaddr() fails for other
reasons. myaddr() will print error for us anyway.
ndb keys are strictly case sensitive, so consitently
use strcmp() when comparing attribute keys.
dblookup() used to lower case convert its name argument
inplace to match domain/sys name in ndb. better to do
the convesion in its own buffer and only read from the
name argument.
always use cistrcmp() when comparing DN.name.
the Domlen constant denotes the size of the buffer including
the null terminator. consistently use it as such.
have to hold dnlock in freearea() before reading list
head pointer.
the image cache should not hold onto the text file channel
when not neccesary. now, the image keeps track of the number
of page cache references in Image.pgref. if the number of
page cache references and Image.ref are equal, this means
all the references to this image are from the page cache.
so no segments are using this image. in that case, we can
close the channel, but keep the Image in the hash table.
when attachimage() finds our image, it will check if Image.c
is nil and reattach the channel to the image before it is
used.
the Image.nocache flag isnt needed anymore.
the libmad samples need to be scaled properly. the
previous assumption was that it is 32 bits, but it
really is MAD_F_FRACTBITS + sign bit and rest used
for overflow.
thanks eekee!
in ape's vfprintf we don't check if the file we're writing is actually a string buffer, resulting in a return of -1, when we should actually return the number of bytes that would be written.
frinsert() shouldnt modify the runes passed and the
buffer isnt going to be modified my us during the call
so removing the temporary copies.
namecomplete() makes utf-8 copies of the rune strings so
theres no need to copy the runes.
xfidflush() now uses a simpler way to flush another xfid.
when we can send to Xfid.c channel, we know that the
xfid is completed. so all xfidflush() needs todo is to
do an alt sending to both Xfid.c and Xfid.flushc.
once the send to Xfid.c succeeds, we know the xfid is gone
and we can respond to the flush request.
theres no need to keep track of flush state anymore. so
Xfid.active and Xfid.flushing can be removed.
note, that it is ok to respond normally to a currently
flushed request.
flushing isnt optional for concurrently handled requests.
we need to ensure that Rflush is replied *after* the
origianl request.
so we assign the flushtag for *every* xfid in xfidctl(),
and filsysrespond() checks if the xfid was flushed
*after* replying and wakes up the flushing xfid.
when multiple flushes are send, they need to be replied
in order. we ensure this by having the flush xfid taking
over the flushtag (synchronized with a new fs->csyncflush
channel) so the next flush will flush the previous flush.
the diver used to skip auto negotiation when
auto-negotiation enable (bit 12 in command register)
was clear.
setting the bit now, which makes auto negotiation work.
we skip auto negotiation only when it was already enabled
and status regiser indicates completion (bit 9).
the shr mount is linked into the Mhead with m->to initially nil. only
after the the server has been attached is m->to set. just check for
it in createdir().
the image cache has the property of keeping a channel
for the executable binary arround which prevents the
mountpoint from going away.
this can easily be reproduced by running:
@{rfork n; ramfs; cp /bin/echo /tmp; /tmp/echo}
observe how ramfs stays arround until the image is
reclaimed. the echo binary is also cached but is
unreachable from any namespace.
we now restrict the caching to mounts that use the client
cache (-C flag) only. this should always be the case
for /bin. places where this isnt the case might observe
a performance regression.
closechanq() is unable to fork a new closeproc when palloc
is locked. so we spawn a closeproc early in chandevinit()
and make sure theres always one process arround to handle
the queue.
we'r getting a rectangle taller than a single line from
coladd() which causes textresize() to collapse the tag
text to zero height.
should probably fix coladd() instead.
introduce kernel inspured Block structure with
read/write pointers to pass packets arround.
the intend is to avoid copying when adding/removing
frame headers and simplifying the drivers.
the driver now calls etheriq() directly allowing it to
queue multiple packets in one pass without having
to keep state.
transmit gets a buffer passed that has room for
frame headers and trailers so no copying is needed.
blocks are refcounted avoiding another copy when
passed to only one receive queue (common case).
receive queues are now limited to 100KB avoiding
buffer bloat.
Dq* a memory leak in destroyfid has been fixed.
lots of minor cleanups.
from: http://9fans.net/archive/2013/04/327
since <compose>x is not yet entrenched, i have a suggestion for ease of
input. suppose <compose>x were redefined so the syntax were
"<compose>x[0-9a-f]+;". in the case that 6 hex digits are entered, then
the ";" is not necessary.
not only would this allow for entering 21-bit runes, it would also allow for
short sequences to be entered more easily.
- erik
using strlen() gives the number of bytes in the utf-8 string.
could use utflen() instead, but decided to just go in a loop
and get rid of the counters all together.
UTF-16 surrogates are not handled.
the process is *NOT* allowed to exit after a srvrelease() as
it still holds a reference (srv->rref) preventing the srv
from beging freed/ended (listensrv) before srvacquire().
ethernet packets with sizes that where not multiples of 4 where
discarded because the check uses the smsc frame size instead of
the payload size. when a usb read returns just one packet, theres
no next frame header and the calculated frame size is bigger than
the usb read which caused the whole packet to be discarded as invalid.
thanks to mischief for testing and debugging!
usb is bound after /dev, so a hanging usb device will hang
access to /dev. we avoid this by releasing the srv, which
allows the fs to still handle reads and walks of the
directories.
ios are serialized by a qlock in the Umsc structure.
add checktag and nil checks in cfsdump() making sure to notice
when the roroot directory structures is corrupted.
cwrecur() used tag == Tsuper to indicate that this is the first
level recursive invocation. this is confusing as we really expect
Tdir tag in that case for the root directory. instead, we now
pass the correct tag (Tdir) and use cw->depth > 1 to see if we
are past the root.
the block tag was only checked when the block was not in
the memory cache. check the tag always!
fork child exportfs with new rendezvous group.
fix missing close of pipe filedescriptors on error.
fix missing close of other end of pipe in child.
dont bark when we get eof on the first init string read.
this condition can happen when unmount opens and
immidiately closes a exported srv file.
running page in own note group avoids killing it when we
exit mothra.
copypaste dupfds() function from page and use it to close
unneeded file descriptors.
we are not using stdout (fd=1) and it, so dup nullfd over it.
this drops the old window reference when using with -w flag.
the RFNAMEG flag isnt needed because we are calling newwindow()
which forks the namespace for us.
reopen stdin/stdout for the external viewer to the new window.
newwindow() used to mount the new window directly on /dev, resulting
in the old window and the new one being mounted over each other.
we now try to unmount the old window from /dev first, mount new
window to /mnt/wsys (replacing the old) and then bind /mnt/wsys
before /dev.
if theres no /mnt/wsys, just mount window directly before /dev.
dont rely on postnote to shutdown client. instead, make reads on
cons, kbd and mouse error. when we mount a window system over
exportfs, the pid useless and even dangerous! pid should be
only used by clients forked by rio itself.
fix bug in resized(), goodrect() takes rect in screen coordinates!
make rectonscreen() fix window size if the window doesnt fit
on the screen.
improve goodrect() to check for windows outside of the screen or
bigger than screen without borders visible.
the openbsd sis(4) driver does not actually go through the rest
of softreset() with sis cards. also, rev 635 reads the mac address
differently, so copy-paste code from openbsd to handle that.
the automatic routing from jack to dac/adc sometimes gets us
a path thats not audible. manually specifying a route path
gets us arround these. the syntax is just a comma separated
list of node ids in the "pin" and "inpin" audioctl commands
instead of a single pin node id.
to find alternative paths, audiostat now lists all the widgets;
not just the pins; and ther input connections.
initially mute all pins and amps of all function groups.
connectpath() and disconnectpath() will mute and unmute
the widgets as required later.
forkret() labels the instructions that can raise exceptions
so they can be handled in trap(). this can happen when
segment descriptors get invalidated.
the standard is i/o bar 0 is the mixer and bar 1 is status/control.
the magic with the bar sizes made it fail in qemu. so removing it
for now as all devices seen so far comply to the standard.
if we ever see a sis7012 where this might be swaped uncomment the i=0;
the busywait timeout is too long in ac97mixreset() because rd/wr
have a timeout on ther own. just remove the busy looping and do
a one second delay after mixer reset. (tested with t23)
semaphore locks have much higher overhead than initially presented
in the "Semaphores in Plan9" paper. until the reason for it has been
found out i will revert the changes.
validaddr looks up the segments for an address range
and checks the flags and if the address range lies
within bounds on the segments.
as we'r going to lookup the segment in the syssem*
syscalls anyway, we can do the checks ourselfs avoiding
the double segment array lookups.
the implication of this tho is that now a semaphore cannot
span multiple segments. but this would be highly unusual
given that segments are page aligned.
smart boot manager has a "FAT" signature in its mbr causing
9bootfat to "detect" it as a fat filesystem and then fails
to find plan9.ini.
there shouldnt be a fat filesystem on harddrives at block 0, only
on floppy drives. but some bioses use floppy drive numbers
for usb harddrives so still check for a partition table.
thanks aap for debugging this.
On ARM, it turns out that comparisons with NaN can be made to do the
right thing with no code penalty, by a more careful selection of
condition code values in the subsequent conditional branch. The
meaning of the CC bits in the PSR is subtly different when they've
been copied from the floating point status register.
Suggested patch is 5c-nan-cmp (works on both vfp and emulated arm7500).
the changeset r541ead66e8af:
"libdraw: make ebread() return buffer immidiately if available"
makes mouse sluggish when the program cant keep up as mouse
events queue up. this more or less restores the original
behaviour but only for mouse events.
when the screen is resized, we scale the windows to
match the new screen size. when the screen is too
small tho, the scaled down window rect might result
in a bad window rect. before, we kept the window
in its original position and size making it possible
to move a window out of the screen by resizing its
outer rio.
now, if we get a bad rectangle after scaling, we
just tralslate position to the new scaled r.min
point but preserve its orginal size. this keeps
the window always accessible.
we loaded APMDSEG instead of APMDSEL into DS. (ouch!)
its not really clear why we loaded DS (wong) in the
first place as bios is supposed to do this. for the
machines where this worked it could have no effect
anyway because it was wrong so removing the DS load
and just zero all segment registers.
we cannot do:
cmdpid = rfork(... RFMEM);
because cmdpid is a global variable in the data segment
and hence shared between parent and child process. use a
temporary variable on the stack.
- TLSconn structure on stack but not initialized (zeroed)
- original filedescriptor double closed in error case
- original filedescriptor leaked in success case
- leaked TLSconn.sessionID and TLSconn.cert
- clarify in pushtls(2) and pushssl(2)
new io interface was added. user defines amlmapio() and amlunmapio() functions
that will fill out Amlio structure with function pointers to read/write
routines for a particular region.
amlnew() function added allowing the creation of aml objects like buffers
or packages. these can be passed to amleval() with b, p or * format.
amltake()/amldrop() exclude an aml object from garbage collection.
on load, names are not always resolvable until the whole table is loaded.
for this, we create n objects that are just name strings. after load, we
recursively traverse the namespace and resolve them (see fixnames()).
the FindSetLeftBit and FindSetRightBit opcodes got implemened.
the difficulty is freeing items while parsing because items might already
be linked into various linked lists like in docinfo.images or form.fiels.
so we link images, tables and formfields to the docinfo as the final step
of getitems() pass using the new recursive function linkitems(). as only
reachable items get linked theres no danger of dangeling pointers.
always look for 9fat in plan9 partition even tho the partition
is *not* maked active. marking partitions active is not
recommended anymore with grub so this makes life easier for
some people. multiple plan9 partitions on a single drive
is not supported.
have to copy partition table as buf gets trashed when reading
first block of fat partition. it worked only when the first
fat partition found (the one marked active) was the right one,
but conffat() can fail.
png: colorspace will never be CYCbCr (this is no
doubt from copy-pasting from jpg)
tif: everyone else uses colorspace as a function
argument, so we will too
readtif, writetif: credit paul bourke
Port Reset R/W. 1=Port is in Reset. 0=Port is not in Reset. Default = 0. When
software writes a one to this bit (from a zero), the bus reset sequence as defined in the
USB Specification Revision 2.0 is started. Software writes a zero to this bit to terminate
the bus reset sequence. Software must keep this bit at a one long enough to ensure the
reset sequence, as specified in the USB Specification Revision 2.0, completes. Note:
when software writes this bit to a one, it must also write a zero to the Port Enable bit.
Note that when software writes a zero to this bit there may be a delay before the bit
status changes to a zero. The bit status will not read as a zero until after the reset
has completed.
openmode() can raise error with invalid mode passed, but we already
incremented the exclusive mouse refcount at that point! call openmode()
early to avoid this.
spawn a kernel process to check the broken state of the controller.
if the firmware crashed, or rfkill was toggled we will reset and
reboot the firmware. also power down the card when rfkill is off.
double the td abort delay and make sure the tsleep() isnt
shortened by a pending note. in that case, tsleep() would
raise error(Eintr); immidiately and would not sleep the
requested amount potentially cauing us to release active
dma memory too early! so we wrap the tsleep() call in a
while(waserror()) so we will at least wait the Abortdelay
amount if error is raised.
also, only try to idle the still active td's.
do not copy data in epio() when there was an error, theres
no reason to touch user buffer in that case.
for uhci, we also check that theres not more data in the
buffers than requested to avoid overflowing user buffer
in epio(). this should not happen but we'r paranoid.
for ehci, we also halt the queue head first in aborttds().
mark the queue heads as Qfree after unlinking and remove
some silly nil checks that are impossible.
on races... normal forks will all share the /env environment but
not the in memory variables of rc. so when we would normally fork
whoever does an exec (flush) first will override what the values of the
/env variables are, *independent* of the variables that where
actually modified *in* the process.
when we flush *before* fork, then at least both processes start out
with marked clean in memory variables and the processes will flush
only the things they actually change.
the "auth" ctl command only sets the rsne of the current selected
access point. so on deassociation, we wait for the connection to
the potentially new access point and then setup new rsne before
processing eapol messages.
fix the default note handler for event programs. only handle non system
notes or notes in the slave processes. for interrupt in the main process,
just call exits() which will do the cleanup and restore window label
properly.
this makes completely overriding the note handler in gping and
stats uneccesary.
many queued mouse events delay eresize() because
new ebread() takes from the queue first before attempting
to read from the event pipe. this is a waste of memory, so
just process (dequeue) all the events as long as there are
any on each iteration.
from the manual:
Tm2sec converts a broken-down time to seconds since the
start of the epoch. It ignores wday, and assumes the local
time zone if zone is not GMT.
so we can assume localtime if Tm.zone is not set to GMT.
all code that wants no localtime conversion should set
Tm.zone explicitely to GMT. (see previous commits)
tm2sec() now does the reverse of localtime() when Tm.zone[0] == 0
which seems to be what the calling code (dossrv, zipfs) assumes.
this also makes sense because theres no simple way todo it
outside of libc as theres otherwise no access to the timezone
structure with the daylight saving periods.
tm2sec() ignores tm.tzoff and will use the local timezone for
conversion. to make it work right, we convert the dos timestamp
as GMT and then correct timezone with the offset provided by the
server.
instructions like BKPT, BX and BLX. Decoding these correctly allows db/acid to
single step through BX and BLX on armv5t+, and to show a breakpoint instruction
as 'BKPT $#0' instead of 'TEQ R0@>R0,R0'.
using a shared reply queue and a pool of worker procs does
result in replies to be send out of order under some conditions.
the symptoms are mnt errors when interrupting requests (Rflush
arriving before the original requests response).
this change gives each connection its own reply queue and its
own srvo process. so now a connection consists of one reply
queue, a srvi process reading the connections file descriptor
and a srvo process reading the reply queue and writng replies
to the connections file descriptor.
the srvi processes live as long as the connection is established.
the srvo prcoesses live forever and are attached to the chan
(which gets reused).
to avoid excessive process creation, we limit the number of
connections to 30. srvchan() returns nil when all 30 network
channels are in use.
due to the xfid handlers clearing flushtag too early, xfidflush might respond too early
causing spurious replies send later by the handler. now, we clear the flushtag in
filsysrespond *after* the reply was send. xfidflush will wait for us on the active
qlock.
scrollbars used to put the mouse on the scrollbar while scrolling. if latency
is high, this often results to the cursor jumping back. instead, make button 2
srolling work without needing the mouse to be inside the scrollbar and leave
the mouse position alone.
From richard:
A couple of patches applied yesterday should make debugging on ARM a
bit more reliable. Using db or acid on ARM, you may have noticed that
a program being debugged would sometimes execute through a breakpoint
without stopping, or run away while being single stepped. It turns out,
as often happens, that one symptom had two separate causes. For details:
/n/sources/patch/applied/5db-condcode/readme
/n/sources/patch/applied/arm-bkpt-cond/readme
To take advantage of the patches, rebuild libmach.a, then acid and db.
On machines with a kw kernel (sheevaplug et al), you'll also want to
rebuild /arm/9plug; otherwise breakpoints will stop working at all.
The new 9plug will, however, still work with the old libmach; and
the bcm and teg2 kernels are already compatible with the new libmach.
the heuristics that limits kernel memory on a cpu server to
a fixed amout (64MB + size for page tables) makes using devdraw
impractical.
if *imagemaxmb= is specified, we can assume that the draw device
will be used so we want to get a reasonable amount (30% default)
of kernel memory.
link status not working on 82567 was due to wrong phy number
used. instead of hardcoding the phy numbers, probe the phys
by reading id1 and id2 registers (code stolen from ethermii).
on the 82567, reading any phy register just gives 0 back.
however, the card works just fine and no action is required
to (re-)start auto negotiation. so we add maclproc() which just
reads the speed setting and link status from the mac status
register instead of reading the phy registers.
we'v probably seen this symptom on other cards (link: 0) like
82566. we should test if we can make link status work on
these cards as well by just using the maclproc().
rx pool exhaustion causes the system to deadlock when netbooted.
queue management should (etheroq) already makes sure the systen
can keep up with the data thowing away buffers.
icansleep() violates the lock ordering due to the following cases:
rbfree(): ilock(Rbpool.Lock) -> wakeup(): spli(), lock(Rbpool.Rendez)
sleep(): splhi(), lock(Rbpool.Rendez) -> icansleep(): ilock(Rbpool.Lock)
erik fixed this moving the wakeup() out of the ilock() in rbfree(),
but i think it is an error to try acquiering a ilock in sleeps wait
condition function in general.
so this is what we do:
in the icansleep() function, we check for the *real* event we care about;
that is, if theres a buffer available in the Rbpool. this is to handle
the case when rbfree() makes a buffer available *before* it sees us
setting p->starve = 1.
p->starve is now just used to gate rbfree() from calling wakeup() as
an optimization.
this might cause spurious wakeups but they are not a problem. missed
wakeups is the thing we have to prevent.
this patch consists of two bits of work submitted as one
patch.
the first bit fixed a "pacing" problem, where a tcp connection
rate-limited by the reading process would experience 10%
of the expected throughput, and could even get into live
lock. it was noticed at the time of this initial work that
the stack often sent tiny grams. some good bits from nix'
original tcp were merged in. the test program
/n/sources/contrib/quanstro/tcptest.c
will verify that under most conditions, a reader-paced connection
now gets the expected throughput. expected arguments
would be
tcptest -s1 -n 5000 -l
the second bit is a first step in preparing tcp to handle
modest (1-2MB) bandwidth-delay products. the strategy
was to completely implement NewReno. the testing network
was a 7/35/70ms by 100Mbit wan emulator with 0/.05/.1% loss.
here are the performance comparisons from the changes after
the first round "old" to the submitted patch "new". the
smallest improvement was 80%, the largest was 11x.
loss% rtt old new
0.10 7 4.40 7.85
0.10 35 0.88 1.79
0.10 70 0.47 0.84
0.05 7 4.80 9.38
0.05 35 1.00 2.02
0.05 70 0.52 1.77
0.01 7 5.33 11.87
0.01 35 1.14 10.97
0.01 70 0.54 4.75
0.00 7 4.49 11.92
0.00 35 1.04 11.35
0.00 70 0.58 10.56
since the diff is not very easy to read, i wrote a small
paper detailing the changes
http://www.quanstro.net/plan9/tcp/tcp.pdf
- erik
the cmd box is not part of the alt display hirarchy. for command
typing to show the box in alt display, we call pldraw() on it
in eresized() to initialize its cmd->b image so it knows where to
draw itself on typing.
the driver should work for standard sdhc
(see http://www.sdcard.org/) controllers,
but matches for the ricoh controller only
as it was the only one i have for testing.
if LocalX or ArgX is a package, the store into
a element should *not* type convert. so when taking
the index reference, we have to carry over the type.