diff a288db973cf0436575a3e660d2a1c68adbee9e56 uncommitted --- a/sys/src/cmd/stats.c +++ b/sys/src/cmd/stats.c @@ -22,6 +22,7 @@ Machine *mach; int overflow; Image *overtmp; + uvlong hiwater; }; enum @@ -399,7 +400,112 @@ } +/* round vmax such that ylabel's have at most 3 non-zero digits */ +uvlong +roundvmax(uvlong v) +{ + int e, o; + + e = ceil(log10(v)) - 2; + if(e <= 0) + return v + (v % 4); + o = pow10(e); + v /= o; + v &= ~1; + return v * o; +} + + void +labelstrs(Graph *g, char strs[Nlab][Lablen], int *np) +{ + int j; + uvlong v, vmax; + + g->newvalue(g->mach, &v, &vmax, 1); + if(vmax == 0) + vmax = 1; + if(g->hiwater > vmax) + vmax = g->hiwater; + vmax = roundvmax(vmax); + if(logscale){ + for(j=1; j<=2; j++) + sprint(strs[j-1], "%g", scale*pow10(j)*(double)vmax/100.); + *np = 2; + }else{ + for(j=1; j<=3; j++) + sprint(strs[j-1], "%g", scale*j*(double)vmax/4.0); + *np = 3; + } +} + +int +labelwidth(void) +{ + int i, j, n, w, maxw; + char strs[Nlab][Lablen]; + + maxw = 0; + for(i=0; i<ngraph; i++){ + /* choose value for rightmost graph */ + labelstrs(&graph[ngraph*(nmach-1)+i], strs, &n); + for(j=0; j<n; j++){ + w = stringwidth(font, strs[j]); + if(w > maxw) + maxw = w; + } + } + return maxw; +} + +int +drawlabels(int maxx) +{ + int x, j, k, y, dy, dx, starty, startx, nlab, ly; + int wid; + Graph *g; + char labs[Nlab][Lablen]; + Rectangle r; + + /* label left edge */ + x = screen->r.min.x; + y = screen->r.min.y + Labspace+font->height+Labspace; + dy = (screen->r.max.y - y)/ngraph; + dx = Labspace+stringwidth(font, "0")+Labspace; + startx = x+dx+1; + starty = y; + dx = (screen->r.max.x - startx)/nmach; + + if(!dy>Nlab*(font->height+1)) + return maxx; + + /* if there's not enough room */ + if((wid = labelwidth()) >= dx-10) + return maxx; + + maxx -= 1+Lx+wid; + draw(screen, Rect(maxx, starty, maxx+1, screen->r.max.y), display->black, nil, ZP); + y = starty; + for(j=0; j<ngraph; j++, y+=dy){ + /* choose value for rightmost graph */ + g = &graph[ngraph*(nmach-1)+j]; + labelstrs(g, labs, &nlab); + r = Rect(maxx+1, y, screen->r.max.x, y+dy-1); + if(j == ngraph-1) + r.max.y = screen->r.max.y; + draw(screen, r, cols[g->colindex][0], nil, paritypt(r.min.x)); + for(k=0; k<nlab; k++){ + ly = y + (dy*(nlab-k)/(nlab+1)); + draw(screen, Rect(maxx+1, ly, maxx+1+Lx, ly+1), display->black, nil, ZP); + ly -= font->height/2; + string(screen, Pt(maxx+1+Lx, ly), display->black, ZP, font, labs[k]); + } + } + return maxx; +} + + +void redraw(Graph *g, uvlong vmax) { int i, c; @@ -418,6 +524,19 @@ char buf[48]; int overflow; + overflow = 0; + if(v > g->hiwater){ + g->hiwater = v; + if(v > vmax){ + overflow = 1; + g->hiwater = v; + if(ylabels) + drawlabels(screen->r.max.x); + redraw(g, g->hiwater); + } + } + if(g->hiwater > vmax) + vmax = g->hiwater; if(g->overflow && g->overtmp!=nil) draw(screen, g->overtmp->r, g->overtmp, nil, g->overtmp->r.min); draw(screen, g->r, screen, nil, Pt(g->r.min.x+1, g->r.min.y)); @@ -425,10 +544,6 @@ memmove(g->data+1, g->data, (g->ndata-1)*sizeof(g->data[0])); g->data[0] = v; g->overflow = 0; - if(logscale) - overflow = (v>10*vmax*scale); - else - overflow = (v>vmax*scale); if(overflow && g->overtmp!=nil){ g->overflow = 1; draw(g->overtmp, g->overtmp->r, screen, nil, g->overtmp->r.min); @@ -1049,52 +1164,13 @@ } void -labelstrs(Graph *g, char strs[Nlab][Lablen], int *np) -{ - int j; - uvlong v, vmax; - - g->newvalue(g->mach, &v, &vmax, 1); - if(vmax == 0) - vmax = 1; - if(logscale){ - for(j=1; j<=2; j++) - sprint(strs[j-1], "%g", scale*pow(10., j)*(double)vmax/100.); - *np = 2; - }else{ - for(j=1; j<=3; j++) - sprint(strs[j-1], "%g", scale*(double)j*(double)vmax/4.0); - *np = 3; - } -} - -int -labelwidth(void) -{ - int i, j, n, w, maxw; - char strs[Nlab][Lablen]; - - maxw = 0; - for(i=0; i<ngraph; i++){ - /* choose value for rightmost graph */ - labelstrs(&graph[ngraph*(nmach-1)+i], strs, &n); - for(j=0; j<n; j++){ - w = stringwidth(font, strs[j]); - if(w > maxw) - maxw = w; - } - } - return maxw; -} - -void resize(void) { - int i, j, k, n, startx, starty, x, y, dx, dy, ly, ondata, maxx, wid, nlab; + int i, j, n, startx, starty, x, y, dx, dy, ondata, maxx; Graph *g; Rectangle machr, r; uvlong v, vmax; - char buf[128], labs[Nlab][Lablen]; + char buf[128]; draw(screen, screen->r, display->white, nil, ZP); @@ -1129,33 +1205,9 @@ } maxx = screen->r.max.x; + if(ylabels) + maxx = drawlabels(maxx); - /* label right, if requested */ - if(ylabels && dy>Nlab*(font->height+1)){ - wid = labelwidth(); - if(wid < dx-10){ - /* else there's not enough room */ - maxx -= 1+Lx+wid; - draw(screen, Rect(maxx, starty, maxx+1, screen->r.max.y), display->black, nil, ZP); - y = starty; - for(j=0; j<ngraph; j++, y+=dy){ - /* choose value for rightmost graph */ - g = &graph[ngraph*(nmach-1)+j]; - labelstrs(g, labs, &nlab); - r = Rect(maxx+1, y, screen->r.max.x, y+dy-1); - if(j == ngraph-1) - r.max.y = screen->r.max.y; - draw(screen, r, cols[g->colindex][0], nil, paritypt(r.min.x)); - for(k=0; k<nlab; k++){ - ly = y + (dy*(nlab-k)/(nlab+1)); - draw(screen, Rect(maxx+1, ly, maxx+1+Lx, ly+1), display->black, nil, ZP); - ly -= font->height/2; - string(screen, Pt(maxx+1+Lx, ly), display->black, ZP, font, labs[k]); - } - } - } - } - /* create graphs */ for(i=0; i<nmach; i++){ machr = Rect(startx+i*dx, starty, startx+(i+1)*dx - 1, screen->r.max.y); @@ -1188,6 +1240,9 @@ g->newvalue(g->mach, &v, &vmax, 0); if(vmax == 0) vmax = 1; + if(g->hiwater > vmax) + vmax = g->hiwater; + vmax = roundvmax(vmax); redraw(g, vmax); } } @@ -1415,6 +1470,7 @@ graph[i].newvalue(graph[i].mach, &v, &vmax, 0); if(vmax == 0) vmax = 1; + vmax = roundvmax(vmax); graph[i].update(&graph[i], v, vmax); } flushimage(display, 1);
Fri Apr 19 10:01:35 EDT 2024
From: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Fri, 19 Apr 2024 14:01:27 +0000 Subject: [PATCH] Fix minor typos and error redirections --- diff c655b6552cae96cc174549f07d55c0255d246615 3a9eb2b59068e49022ea322ff5306809892fded8 --- a/sys/man/1/git +++ b/sys/man/1/git @@ -230,7 +230,7 @@ .B -b option will cause the repository to be initialized as a bare repository. Passing the -. -u +.B -u .I upstream option will cause the upstream to be configured to .I upstream. --- a/sys/src/9/ip/devip.c +++ b/sys/src/9/ip/devip.c @@ -816,7 +816,7 @@ } /* - * find a unused loacal port for a protocol. + * find a unused local port for a protocol. * * p needs to be locked */ --- a/sys/src/cmd/aux/getflags.c +++ b/sys/src/cmd/aux/getflags.c @@ -5,7 +5,7 @@ void usage(void) { - print("status=usage\n"); + fprint(2, "status=usage\n"); exits(0); } --- a/sys/src/cmd/aux/vga/igfx.c +++ b/sys/src/cmd/aux/vga/igfx.c @@ -837,7 +837,7 @@ dpll = igfx->pipe[x].dpll; /* enable pll */ dpll->ctrl.v = 1<<31; - /* LCPLL 2700 (non scc) reference */ + /* LCPLL 2700 (non ssc) reference */ dpll->ctrl.v |= 3<<28; genwrpll(freq, &n2, &p1, &r2); --- a/sys/src/cmd/cmp.c +++ b/sys/src/cmd/cmp.c @@ -127,6 +127,6 @@ static void usage(void) { - print("usage: cmp [-lLs] file1 file2 [offset1 [offset2] ]\n"); + fprint(2, "usage: cmp [-lLs] file1 file2 [offset1 [offset2] ]\n"); exits("usage"); }
Fri Apr 19 09:57:30 EDT 2024
From: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Fri, 19 Apr 2024 13:57:07 +0000 Subject: [PATCH] Fix minor typos and error redirections --- diff c655b6552cae96cc174549f07d55c0255d246615 161026bb511b31e397c1067d8c74308b3fec8d31 --- a/sys/man/1/git +++ b/sys/man/1/git @@ -230,7 +230,7 @@ .B -b option will cause the repository to be initialized as a bare repository. Passing the -. -u +.B -u .I upstream option will cause the upstream to be configured to .I upstream. --- a/sys/src/9/ip/devip.c +++ b/sys/src/9/ip/devip.c @@ -816,7 +816,7 @@ } /* - * find a unused loacal port for a protocol. + * find a unused local port for a protocol. * * p needs to be locked */ --- a/sys/src/cmd/aux/getflags.c +++ b/sys/src/cmd/aux/getflags.c @@ -5,7 +5,7 @@ void usage(void) { - print("status=usage\n"); + fprint(2, "status=usage\n"); exits(0); } --- a/sys/src/cmd/cmp.c +++ b/sys/src/cmd/cmp.c @@ -127,6 +127,6 @@ static void usage(void) { - print("usage: cmp [-lLs] file1 file2 [offset1 [offset2] ]\n"); + fprint(2, "usage: cmp [-lLs] file1 file2 [offset1 [offset2] ]\n"); exits("usage"); }
Fri Apr 19 07:55:25 EDT 2024
From: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Fri, 19 Apr 2024 11:55:01 +0000 Subject: [PATCH] Add caps kbmap The default behaviour of the key labelled as Caps Lock is to be a Ctrl key, but in some cases in can be desirable to have it like an actual Caps Lock. A new kbmap file is added and the keyboard documentation is updated. git/commit /sys/lib/kbmap/caps /sys/man/6/keybo --- diff ec73849b6936d839410ccb239d14b2f7c7ca3d6f c655b6552cae96cc174549f07d55c0255d246615 --- /dev/null +++ b/sys/lib/kbmap/caps @@ -1,0 +1,1 @@ + none 58 63588 --- a/sys/man/6/keyboard +++ b/sys/man/6/keyboard @@ -25,6 +25,15 @@ .B Caps .B Lock acts as an additional control key. +To make it work like an actual +.B Caps +.B Lock +key you can get it with: +.PP +.RS +.L +cat /sys/lib/kbmap/caps >/dev/kbmap +.RE .PP The delete character .RB ( 0x7F )
Fri Apr 19 07:20:46 EDT 2024
diff ec73849b6936d839410ccb239d14b2f7c7ca3d6f uncommitted --- a/sys/man/6/keyboard +++ b/sys/man/6/keyboard @@ -25,6 +25,15 @@ .B Caps .B Lock acts as an additional control key. +To make it work like an actual +.B Caps +.B Lock +key ou can get it with: +.PP +.RS +.L +echo none 58 63588 >/dev/kbmap +.RE .PP The delete character .RB ( 0x7F )
Fri Apr 19 07:16:06 EDT 2024
diff ec73849b6936d839410ccb239d14b2f7c7ca3d6f uncommitted --- a/lib/namespace +++ b/lib/namespace @@ -43,3 +43,10 @@ . /lib/namespace.local . /lib/namespace.$sysname . /cfg/$sysname/namespace + +bind -c /usr/glenda /n/fossil/usr/glenda +bind -c /n/fossil/usr/ /usr/ +bind -c /n/other/usr/$user/tmp /usr/$user/tmp +bind -c /usr/$user/tmp /tmp + +cd /usr/$user --- a/rc/bin/fshalt +++ b/rc/bin/fshalt @@ -24,6 +24,10 @@ bind -c '#s' /srv bind '#p' /proc +# start venti flushing +venti/sync -h localhost >[2]/dev/null & +venti/sync >[2]/dev/null & + unmount /mnt/consoles >[2]/dev/null kill consolefs | rc # don't compete with /mnt/consoles sleep 1 @@ -30,12 +34,31 @@ c=`{ls /srv/cwfs*cmd >[2]/dev/null} h=`{ls /srv/hjfs*cmd >[2]/dev/null} -e=`{ls /srv/ext4*cmd >[2]/dev/null} -s=`{awk '/^sd./ {print substr($1,3,1)}' '#S/sdctl' >[2]/dev/null} +f=`{ls /srv/fscons*>[2]/dev/null} # for scram, don't scram other systems bind -b '#P' /dev >[2]/dev/null +if(! ~ $reboot yes){ + if (test -e '#P'/apm) + scram=yes + if (test -e '#P'/acpitbls -a -e '#P'/iow) + scram=yes +} +echo -n syncing... +for(i in $f) @ { + echo -n $i... + echo fsys all sync >>$i +} + +# flush the last bit of possible fossil traffic +if (ls /srv | grep -s fossil) { + echo -n venti... + venti/sync -h localhost >[2]/dev/null & + venti/sync >[2]/dev/null & + sleep 5 +} + # halting (binaries we run can't be on the fs we're halting) ramfs builtin cd /tmp @@ -73,6 +96,12 @@ while(test -e $i) sleep 1 } + for(i in $f) @ { + echo -n $i... + echo fsys all halt >>$i + sleep 2 + } + echo echo done halting --- a/rc/bin/service/telcodata +++ b/rc/bin/service/telcodata @@ -1,3 +1,15 @@ #!/bin/rc -echo This is the plan 9 incoming fax line. -echo Please do not make data calls to us. + +fn sigint { +} + +fn sighup { + echo kill > /proc/$pid/note +} + +while () { + echo -n user: + user=`{read -n 1} + if (~ $#user 1) + auth/login $user +} --- a/rc/bin/termrc +++ b/rc/bin/termrc @@ -93,9 +93,4 @@ if(test -f /dev/apm) aux/apm -if(~ $terminal *reform*){ - reform/pm - reform/audio -} - -dontkill '^(ipconfig|factotum|mntgen|venti|hjfs|kfs|cfs|cwfs.*|9660srv|dossrv|paqfs|cs|dns|listen|reboot|usbd|kb|disk|ether|wpa)$' +dontkill '^(ipconfig|factotum|mntgen|venti|hjfs|kfs|cfs|cwfs.*|9660srv|dossrv|paqfs|cs|dns|listen|reboot|usbd|kb|disk|ether|wpa|fossil)$' --- a/sys/man/1/git +++ b/sys/man/1/git @@ -230,7 +230,7 @@ .B -b option will cause the repository to be initialized as a bare repository. Passing the -. -u +.B -u .I upstream option will cause the upstream to be configured to .I upstream. --- a/sys/man/6/keyboard +++ b/sys/man/6/keyboard @@ -25,6 +25,15 @@ .B Caps .B Lock acts as an additional control key. +To make it work like an actual +.B Caps +.B Lock +key ou can get it with: +.PP +.RS +.L +echo none 58 63588 >/dev/kbmap +.RE .PP The delete character .RB ( 0x7F ) --- a/sys/src/9/boot/nusbrc +++ b/sys/src/9/boot/nusbrc @@ -5,7 +5,7 @@ mkdir -p -m 700 '#σc/usb' mkdir -p -m 700 '#σc/usbnet' -if(! nusb/usbd) +if(! nusb/usbd -d) exit @{ @@ -71,7 +71,7 @@ devs='#σc/sdU'^($1 $5) rm -rf '#σc/usb/'^$1.* '#σc/usb/'^$5.hid '#σc/usbnet/'^$1.* $devs $devs.* } - rc < '#σ/usb/usbevent' & + rc -x < '#σ/usb/usbevent' & } # usbd removes this file once all devices have been enumerated --- a/sys/src/9/ip/devip.c +++ b/sys/src/9/ip/devip.c @@ -816,7 +816,7 @@ } /* - * find a unused loacal port for a protocol. + * find a unused local port for a protocol. * * p needs to be locked */ --- a/sys/src/cmd/aux/getflags.c +++ b/sys/src/cmd/aux/getflags.c @@ -5,7 +5,7 @@ void usage(void) { - print("status=usage\n"); + fprint(2, "status=usage\n"); exits(0); } --- a/sys/src/cmd/aux/vga/igfx.c +++ b/sys/src/cmd/aux/vga/igfx.c @@ -837,7 +837,7 @@ dpll = igfx->pipe[x].dpll; /* enable pll */ dpll->ctrl.v = 1<<31; - /* LCPLL 2700 (non scc) reference */ + /* LCPLL 2700 (non ssc) reference */ dpll->ctrl.v |= 3<<28; genwrpll(freq, &n2, &p1, &r2); --- a/sys/src/cmd/cmp.c +++ b/sys/src/cmd/cmp.c @@ -127,6 +127,6 @@ static void usage(void) { - print("usage: cmp [-lLs] file1 file2 [offset1 [offset2] ]\n"); + fprint(2, "usage: cmp [-lLs] file1 file2 [offset1 [offset2] ]\n"); exits("usage"); }
Fri Apr 19 03:16:04 EDT 2024
Sawubona, bengifuna ukwazi intengo yakho.
Thu Apr 18 10:19:26 EDT 2024
ramfs -a -m /tmp -S ramsrv mkdir '#σc'/ram echo 3 > '#σc'/ram/ram <>[3]/srv/ramsrv mkdir -p /tmp/^(bin dev fd env srv shr proc lib sys/lib net) dircp /bin /tmp/bin dircp /lib /tmp/lib dircp /sys/lib /tmp/sys/lib mount -a /srv/cs /net mount -a /srv/dns /net bind -c /tmp / bind '#c' /dev bind '#d' /fd bind -c '#e' /env bind '#p' /proc bind -c '#s' /srv bind -q '#σ' /shr bind -a '#¤' /dev bind -qa '#¶' /dev bind -a '#l' /net bind -a '#I' /net bind -a '#a' /net
Thu Apr 18 10:06:56 EDT 2024
ramfs mkdir -p /tmp/^(bin dev fd env srv shr proc lib sys/lib net) dircp /bin /tmp/bin dircp /lib /tmp/lib dircp /sys/lib /tmp/sys/lib bind '#c' /dev bind '#d' /fd bind -c '#e' /env bind '#p' /proc bind -c '#s' /srv bind -q '#σ' /shr bind -a '#¤' /dev bind -qa '#¶' /dev bind -a '#l' /net bind -a '#I' /net bind -a '#a' /net mount -a /srv/cs /net mount -a /srv/dns /net bind -c /tmp /
Thu Apr 18 10:06:38 EDT 2024
src(0xffffffff8011767c); // dumpstack+0x10 // data at 0xffffffff8208f460? 80171012 src(0xffffffff80171012); // panic+0xeb // data at 0xffffffff8208f5b0? 8021991e src(0xffffffff8021991e); // cclone+0x42 // data at 0xffffffff8208f5f8? 8021a505 src(0xffffffff8021a505); // createdir+0x73 // data at 0xffffffff8208f628? 801eb6d6 src(0xffffffff801eb6d6); // shrcreate+0x34b // data at 0xffffffff8208f698? 8021b290 src(0xffffffff8021b290); // namec+0x970 // data at 0xffffffff8208f768?
Thu Apr 18 06:38:31 EDT 2024
Aloha, makemake wau eʻike i kāu kumukūʻai.