OK, turing.

<- leave blank

Mon Jun 1 02:07:56 EDT 2020

christoph
christoph
christoph
christoph
christoph
christoph
christoph
christoph
christoph
christoph

Sun May 31 22:13:55 EDT 2020
Authentication-Results: minnie.tuhs.org;
	dkim=fail reason="signature verification failed" (2048-bit key;
	unprotected) header.d=gmail.com header.i=@gmail.com header.b="vQsSw1Ym";
	dkim-atps=neutral
From: Rob Pike <robpike@gmail.com>
Date: Mon, 1 Jun 2020 08:01:58 +1000
To: Warner Losh <imp@bsdimp.com>
Subject: Re: [TUHS] non-blocking IO
Cc: TUHS main list <tuhs@minnie.tuhs.org>, Paul Ruizendaal
<pnr@planet.nl>
Errors-To: tuhs-bounces@minnie.tuhs.org
Sender: "TUHS" <tuhs-bounces@minnie.tuhs.org>

>
> I’m not quite sure why the Research lineage did not include non-blocking
> behaviour, especially in view of the man page comments.  Maybe it was seen
> as against the Unix philosophy, with select() offering sufficient mechanism
> to avoid blocking (with open() the hard corner case)?


That's it.  Select was good enough for our purposes.

-rob




Sun May 31 12:36:06 EDT 2020
#!/bin/rc

. /sys/lib/git/common.rc

gitup -m

opts=()
args=()

fn fakerepo {
	mkdir -p /tmp/fakerepo.$pid/.git
	bind -c $1 /tmp/fakerepo.$pid/.git
	cd /tmp/fakerepo.$pid
}

fn dcmd {
	if(~ $#gitdebug 1)
		echo $* >[1=2]
	$*
}

fn cmd_init{
	while(~ $1 -*){
		switch($1){
		case --bare
			opts=(-b)
		case -*
			die unknown command init $*
		case *
			args=($args $1)
		}
		shift
	}
	ls >[1=2]
	dcmd git/init $opts $args
}

fn cmd_clone{
	branch=()
	while(~ $1 -*){
		switch($1){
		case -b
			branch=$2
			shift
		case -*
			die unknown command clone $*
		case *
			args=($args $1)
		}
		shift
	}
	dcmd git/init $opts $args
	if(~ $#branch 1)
		dcmd git/branch -n -b $1 origin/$1
}

fn cmd_pull{
	if(~ $1 -*)
		die unknown command pull $*
	fakerepo `{pwd}
	dcmd git/pull
}

fn cmd_fetch{
	while(~ $1 -*){
		switch($1){
		case --all
			opts=($opts -a)
		case -f
			opts=($opts -u $2)
			shift
		case -*
			die unknown command clone $*
		case *
			args=($args $1)
		}
		shift
	}
	fakerepo `{pwd}
	dcmd git/pull -f $opts
}


fn cmd_checkout{
	if(~ $1 -*)
		die unknown command pull $*
	if(~ $#* 0)
		die git checkout branch
	dcmd git/branch $b
}

fn cmd_log{
	dcmd log $*
	exit unimpl
}

fn rev-parse{
	while(~ $1 -*){
		switch($1){
		case --git-dir
			echo .git
			shift
		case --abbrev-ref
			echo `{dcmd git/branch | sed s@^heads/@@g}
			shift
		case *
			dprint option $opt
		}
		shift
	}
}

fn cmd_show-ref{
	if(~ $1 -*)
		die unknown command pull $*
	for(b in `{cd .dcmd git/refs/ && walk -f})
		echo`{cat .dcmd git/refs/$b} refs/$b
}

fn cmd_remote{
	if(!  ~ $1 add)
		die unimplemented remote cmd $*
	fakerepo `{pwd}
	>>.git/config{
		echo '[remote "'$2'"]'
		echo ' url='$3
	}
}

fn cmd_submodule{
	dcmd submodule $*
	exit unimpl
}

fn cmd_version{
	echo git version 2.2.0
}

fn cmd_config{
	dcmd config $*
}

fn usage{
	echo 'git <command> <args>' >[1=2]
	exit usage
}

echo '=== cmd:' $* >[1=2]
echo '=== pwd:' `{pwd} >[1=2]
cmd_$1 $*(2-)


Sun May 31 11:39:08 EDT 2020
IN SUMMARY:
- Plan 9 is a research operating system
	-> simplifies the core primitives of Unix
	-> adds some key innovations like 9P and per-process namespaces
	-> makes them network transparent
	-> is a complete, self-hosting, distributed computing environment
	-> at least 10x simpler than any other operating system which makes
	similar claims
	-> the result has broadly influenced many mainstays of modern computing

Sun May 31 11:15:51 EDT 2020
	astro/pdate.c: custom date formatting.
	    Care needs to be taken -- it handles the gregorian
	    change, date(1) does proleptic gregorian.

	auth/cron.c: should be fine, needs a double-check.
	auth/lib/getexpiration.c: see above, may need to remove
	    year offsets.

	auth/secstore/secuser.c: fine, but we can improve it
	    with tmparse().

	aux/msexceltables.c: probably needs to stay, excel dates
	    are fucked.

	aux/gps/gpsfs.c: can use tmnorm(), and fix limits.

	aux/timesync.c: don't need to do anything, but needs a
	    double check.

	calendar.c: custom date formatting can be deleted.

	cwfs/time.c: can use tmnorm()

	date.c: mostly goes away

	webcookies.c: strototime() can go away.

	faces/plumb.c: parsedate() can go away

	gzip/unzip.c: fine, unless we decide to change tm->year.

	ip/ftpfs.c: cracktime() can go away: drugs are bad.

	upas/*: ...it's everywhere.


Sat May 30 22:08:05 EDT 2020
diff -r d45cfe9072cd sys/src/cmd/upas/imap4d/date.c
--- a/sys/src/cmd/upas/imap4d/date.c Sat May 30 13:03:05 2020 +0200
+++ b/sys/src/cmd/upas/imap4d/date.c Sat May 30 19:08:04 2020 -0700
@@ -1,142 +1,10 @@
 #include "imap4d.h"

-static char *wdayname[] = {
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
-};
-
-static char *monname[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
"Dec"
-};
-
-/*
- * zone : [A-Za-z][A-Za-z][A-Za-z] some time zone names
- * | [A-IK-Z] military time; rfc1123 says the rfc822 spec is wrong.
- * | "UT" universal time
- * | [+-][0-9][0-9][0-9][0-9]
- * zones is the rfc-822 list of time zone names
- */
-static Namedint zones[] =
-{
- {"A", -1 * 3600},
- {"B", -2 * 3600},
- {"C", -3 * 3600},
- {"CDT", -5 * 3600},
- {"CST", -6 * 3600},
- {"D", -4 * 3600},
- {"E", -5 * 3600},
- {"EDT", -4 * 3600},
- {"EST", -5 * 3600},
- {"F", -6 * 3600},
- {"G", -7 * 3600},
- {"GMT", 0},
- {"H", -8 * 3600},
- {"I", -9 * 3600},
- {"K", -10 * 3600},
- {"L", -11 * 3600},
- {"M", -12 * 3600},
- {"MDT", -6 * 3600},
- {"MST", -7 * 3600},
- {"N", +1 * 3600},
- {"O", +2 * 3600},
- {"P", +3 * 3600},
- {"PDT", -7 * 3600},
- {"PST", -8 * 3600},
- {"Q", +4 * 3600},
- {"R", +5 * 3600},
- {"S", +6 * 3600},
- {"T", +7 * 3600},
- {"U", +8 * 3600},
- {"UT", 0},
- {"V", +9 * 3600},
- {"W", +10 * 3600},
- {"X", +11 * 3600},
- {"Y", +12 * 3600},
- {"Z", 0},
-};
-
-static void
-zone2tm(Tm *tm, char *s)
-{
- int i;
- Tm aux, *atm;
-
- if(*s == '+' || *s == '-'){
- i = strtol(s, &s, 10);
- tm->tzoff = (i/100)*3600 + i%100;
- strncpy(tm->zone, "", 4);
- return;
- }
-
- /*
- * look it up in the standard rfc822 table
- */
- strncpy(tm->zone, s, 3);
- tm->zone[3] = 0;
- tm->tzoff = 0;
- for(i = 0; i < nelem(zones); i++){
- if(cistrcmp(zones[i].name, s) == 0){
- tm->tzoff = zones[i].v;
- return;
- }
- }
-
- /*
- * one last try: look it up in the current local timezone
- * probe a couple of times to get daylight/standard time change.
- */
- aux = *tm;
- memset(aux.zone, 0, 4);
- aux.hour--;
- for(i = 0; i < 2; i++){
- atm = localtime(tm2sec(&aux));
- if(cistrcmp(tm->zone, atm->zone) == 0){
- tm->tzoff = atm->tzoff;
- return;
- }
- aux.hour++;
- }
-
- strncpy(tm->zone, "GMT", 4);
- tm->tzoff = 0;
-}
-
-/*
- * hh[:mm[:ss]]
- */
-static void
-time2tm(Tm *tm, char *s)
-{
- tm->hour = strtoul(s, &s, 10);
- if(*s++ != ':')
- return;
- tm->min = strtoul(s, &s, 10);
- if(*s++ != ':')
- return;
- tm->sec = strtoul(s, &s, 10);
-}
-
-static int
-dateindex(char *d, char **tab, int n)
-{
- int i;
-
- for(i = 0; i < n; i++)
- if(cistrcmp(d, tab[i]) == 0)
- return i;
- return -1;
-}
-
 int
 imap4date(Tm *tm, char *date)
 {
- char *flds[4];
-
- if(getfields(date, flds, 3, 0, "-") != 3)
+ if(tmparse(tm, "DD-MM-YYYY", date, nil) == nil)
		return 0;
-
- tm->mday = strtol(flds[0], nil, 10);
- tm->mon = dateindex(flds[1], monname, 12);
- tm->year = strtol(flds[2], nil, 10) - 1900;
	return 1;
 }

@@ -146,29 +14,11 @@
 ulong
 imap4datetime(char *date)
 {
- char *flds[4], *sflds[4];
- ulong t;
	Tm tm;

- if(getfields(date, flds, 4, 0, " ") != 3)
+ if(tmparse(&tm, "DD-MM-YYYY hh:mm:ss ?ZZZ", date, nil) == nil)
		return ~0;
-
- if(!imap4date(&tm, flds[0]))
- return ~0;
-
- if(getfields(flds[1], sflds, 3, 0, ":") != 3)
- return ~0;
-
- tm.hour = strtol(sflds[0], nil, 10);
- tm.min = strtol(sflds[1], nil, 10);
- tm.sec = strtol(sflds[2], nil, 10);
-
- strcpy(tm.zone, "GMT");
- tm.yday = 0;
- t = tm2sec(&tm);
- zone2tm(&tm, flds[2]);
- t -= tm.tzoff;
- return t;
+ return tm.abs;
 }

 /*
@@ -181,85 +31,16 @@
 Tm*
 date2tm(Tm *tm, char *date)
 {
- char *flds[7], *s, dstr[64];
- int n;
- Tm gmt, *atm;
+ char **f, *fmts[] = {
+ "?W ?DD ?MMM ?YYYY hh:mm:ss ?Z",
+ "?W, ?DD ?MMM ?YYYY hh:mm:ss ?Z",
+ "?W, ?DD ?MMM hh:mm:ss ?Z ?YYYY",
+ "?MMM hh:mm:ss ?Z ?YYYY",
+ nil
+ };
+ for(f = fmts; *f != nil; f++)
+ if(tmparse(tm, *f, date, nil) != nil)
+ return tm;
+ return nil;
+}

- /*
- * default date is Thu Jan 1 00:00:00 GMT 1970
- */
- tm->wday = 4;
- tm->mday = 1;
- tm->mon = 1;
- tm->hour = 0;
- tm->min = 0;
- tm->sec = 0;
- tm->year = 70;
- strcpy(tm->zone, "GMT");
- tm->tzoff = 0;
-
- strncpy(dstr, date, sizeof dstr);
- dstr[sizeof dstr - 1] = 0;
- n = tokenize(dstr, flds, 7);
- if(n != 6 && n != 5)
- return nil;
-
- if(n == 5){
- for(n = 5; n >= 1; n--)
- flds[n] = flds[n - 1];
- n = 5;
- }else{
- /*
- * Wday[,]
- */
- s = strchr(flds[0], ',');
- if(s != nil)
- *s = 0;
- tm->wday = dateindex(flds[0], wdayname, 7);
- if(tm->wday < 0)
- return nil;
- }
-
- /*
- * check for the two major formats:
- * Month first or day first
- */
- tm->mon = dateindex(flds[1], monname, 12);
- if(tm->mon >= 0){
- tm->mday = strtoul(flds[2], nil, 10);
- time2tm(tm, flds[3]);
- zone2tm(tm, flds[4]);
- tm->year = strtoul(flds[5], nil, 10);
- if(strlen(flds[5]) > 2)
- tm->year -= 1900;
- }else{
- tm->mday = strtoul(flds[1], nil, 10);
- tm->mon = dateindex(flds[2], monname, 12);
- if(tm->mon < 0)
- return nil;
- tm->year = strtoul(flds[3], nil, 10);
- if(strlen(flds[3]) > 2)
- tm->year -= 1900;
- time2tm(tm, flds[4]);
- zone2tm(tm, flds[5]);
- }
-
- if(n == 5){
- gmt = *tm;
- strncpy(gmt.zone, "", 4);
- gmt.tzoff = 0;
- atm = gmtime(tm2sec(&gmt));
- tm->wday = atm->wday;
- }else{
- /*
- * Wday[,]
- */
- s = strchr(flds[0], ',');
- if(s != nil)
- *s = 0;
- tm->wday = dateindex(flds[0], wdayname, 7);
- if(tm->wday < 0)
- return nil;
- }
- return tm;
-}


Sat May 30 21:37:04 EDT 2020
#include <u.h>
#include <libc.h>
#include <date.h>

/*
 * seconds absolute_date ...  - convert absolute_date to seconds since epoch
 */
char *formats[] = {
	/* asctime */
	"W MMM DD hh:mm:ss ZZZ YYYY",
	/* RFC5322 */
	"?W ?DD ?MMM ?YYYY hh:mm:ss ?Z",
	"?W, DD-?MM-YY hh:mm:ss ?Z",
	/* RFC822/RFC8222 */
	"DD MMM YY hh:mm ZZZ",
	"DD MMM YY hh:mm Z",
	/* RFC850 */
	"W, DD-MMM-06 hh:mm:ss MST",
	/* RFC1123 */
	"WW, DD MMM YYYY hh:mm:ss ZZZ",
	/* RFC1123Z */
	"WW, DD MMM YYYY hh:mm:ss ZZ",
	/* RFC3339 */
	"YYYY-01-DD[T]hh:mm:ss[Z]ZZ",
	"YYYY-01-DD[T]hh:mm:ss[Z]Z",
	"YYYY-01-DD[T]hh:mm:ss ZZ",
	"YYYY-01-DD[T]hh:mm:ss Z",
	/* RFC 3339 and human-readable variants */
	"YYYY-MM-DD hh:mm:ss",
	"YYYY-MM-DD hh:mm:ss ?Z",
	"YYYY-MM-DD [@] hh:mm:ss",
	"YYYY-MM-DD [@] hh:mm:ss ?Z",
	nil
};

static void
usage(void)
{
	fprint(2, "usage: %s date-time ...\n", argv0);
	exits("usage");
}

void
main(int argc, char **argv)
{
	Tmd tm;
	char **f, *fmt;
	int i;

	fmt = nil;
	ARGBEGIN{
	case 'f':
		fmt = EARGF(usage());
		break;
	default:
		usage();
	}ARGEND;

	for(i = 0; i < argc; i++){
		if(fmt != nil){
			if(tmparse(fmt, argv[i], nil, &tm) != nil)
				goto Found;
		}else{
			for(f = formats; *f != nil; f++)
				if(tmparse(*f, argv[i], nil, &tm) != nil)
					goto Found;
		}
		sysfatal("tmparse: %r");
Found:
		print("%lld\n", tm.abs);
	}
	exits(nil);
}


Sat May 30 20:12:27 EDT 2020
% cd '#ec'; for(i in *){echo $i '=' `{cat $i}}
*acpi =
*e820 = 1 0x0000000000000000 0x000000000009c400 2 0x000000000009c400
0x00000000000a0000 2 0x00000000000e0000 0x0000000000100000 1 0x0000000000100000
0x00000000810e0000 4 0x00000000810e0000 0x00000000810e1000 2 0x00000000810e1000
0x00000000810e2000 1 0x00000000810e2000 0x0000000089a2a000 2 0x0000000089a2a000
0x000000008a65d000 1 0x000000008a65d000 0x000000008a720000 4 0x000000008a720000
0x000000008aaac000 2 0x000000008aaac000 0x000000008afff000 1 0x000000008afff000
0x000000008b000000 1 0x0000000100000000 0x000000026f000000 2 0x000000008b000000
0x0000000090000000 2 0x00000000e0000000 0x00000000f0000000 2 0x00000000fe000000
0x00000000fe011000 2 0x00000000fec00000 0x00000000fec01000 2 0x00000000fed00000
0x00000000fed01000 2 0x00000000fee00000 0x00000000fee01000 2 0x00000000ff000000
0x0000000100000000
auth = 107.191.116.128
bootargs = local!/shr/sdU8d2e6/9front.iso
bootfile = 9pc64
ether0 = type=iwl essid=ATT868PK2D
fs = 104.59.85.219
monitor = vesa
mouseport = ps2intellimouse
nora6 =
service = terminal
sysname = k
user = sl
vgasize = ask
wpapsk = 46zkt56q+b8a

% cat '#'P/archctl
cpu Celeron 1800 pge
pge on
coherence mfence
cmpswap cmpswap486
arch ACPI
cache default wb
cache 0xc0000000 1073741824 uc
cache 0xa0000000 536870912 uc
cache 0x90000000 268435456 uc
cache 0x8c000000 67108864 uc
cache 0x8b800000 8388608 uc
cache 0x2000000000 68719476736 uc

% cat '#'P/irqalloc
	  1 0 debugexc
	  3 0 debugpt
	  7 0 mathemu
	  8 0 doublefault
	  9 0 mathover
	 14 0 faultamd64
	 15 0 unexpected
	 16 0 matherror
	 19 0 simderror
	 50 18 clock
	 51 19 lapicerror
	 63 31 lapicspurious
	 65 11 ether0
	 73 11 ether1
	 81 1 kbd
	 89 11 sdE (ahci)

% cat '#'P/ioalloc
      20 21 i8259.0
      40 43 i8253
      60 60 i8042.data
      61 61 i8253.cntr2c
      62 62 ec.data
      64 64 i8042.cs
      66 66 ec.sc
      70 71 rtc/nvr
      a0 a1 i8259.1
     2b0 2df vga
     3c0 3da vga
     fff fff dummy
    e000 e0ff rtl8169

% cat '#'c/config
# pc64 - amd64 pc terminal with local disk
dev
	root
	cons
	swap
	arch
	pnp pci
	env
	pipe
	proc
	mnt
	srv
	shr
	dup
	rtc
	ssl
	tls
	cap
	kprof
	fs

	ether netif
	bridge netif log
	ip arp chandial ip ipv6 ipaux iproute netlog ethermedium nullmedium
	pktmedium inferno

	draw screen vga vgax vgasoft
	mouse mouse
	kbd
	vga

	sd
# floppy dma
	aoe
# lpt

	audio dma
# pccard
# i82365 cis
	uart
	usb

	segment
	vmx
	dtracy

link
# devpccard
# devi82365
	cputemp
# ether2000 ether8390
# ether2114x pci
# ether589 etherelnk3
	ether79c970 pci
# ether8003 ether8390
	ether8139 pci
	ether8169 pci ethermii
# should be obsoleted by igbe
# ether82543gc pci
# ether82557 pci
	ether82563 pci
	ether82598 pci
	etherx550 pci
# ether83815 pci
	etherbcm pci
# etherdp83820 pci ethermii
# etherec2t ether8390
# etherelnk3 pci
# etherga620 pci
	etherigbe pci ethermii
# ethervgbe pci ethermii
# ethervt6102 pci ethermii
# ethervt6105m pci ethermii
	ethersink
# ethersmc devi82365 cis
	etheryuk pci
# etherwavelan wavelan devi82365 cis pci
	etheriwl pci wifi
	etherwpi pci wifi
	etherrt2860 pci wifi
	ethervirtio pci
	ethermedium
# pcmciamodem
	netdevmedium
	loopbackmedium
	usbuhci
	usbohci
	usbehci usbehcipc
	usbxhci pci

# audiosb16 dma
# audioac97 audioac97mix
	audiohda

misc
	archacpi mp apic squidboy ec
	archmp mp apic squidboy
	mtrr

	sdaoe
	sdide pci sdscsi
	sd53c8xx pci sdscsi
# sdmylex pci sdscsi
	sdiahci pci sdscsi led
# sdodin pci sdscsi led
	sdvirtio pci sdscsi
	sdmmc pci pmmc
	sdnvme pci
	sdloop
	sdram

	uarti8250
	uartisa
	uartpci pci

	vgasoft =cur swcursor
# vga3dfx +cur
# vgaark2000pv +cur
# vgabt485 =cur
# vgaclgd542x +cur
# vgaclgd546x +cur
# vgact65545 +cur
# vgacyber938x +cur
# vgaet4000 +cur
# vgageode +cur
# vgahiqvideo +cur
# vgai81x +cur
	vgaigfx +cur
# vgamach64xx +cur
# vgamga2164w +cur
# vgamga4xx +cur
# vganeomagic +cur
# vganvidia +cur
	vgaradeon +cur
# vgargb524 =cur
# vgas3 +cur vgasavage
# vgat2r4 +cur
# vgatvp3020 =cur
# vgatvp3026 =cur
	vgavesa
# vgavmware +cur

	dtracysys
	dtracytimer

ip
	tcp
	udp
	rudp
	ipifc
	icmp
	icmp6
	gre
	ipmux
	esp
	il

port
	int cpuserver = 0;

bootdir
	/$objtype/bin/paqfs
	/$objtype/bin/auth/factotum
	bootfs.paq
	boot

% cat '#'c/sysstat
	  0 7970 28869 5350 8040 0 0 5 99 0
	  1 2759 12255 5481 6244 0 0 0 99 0
	  2 639 11450 685 1439 0 0 0 99 0
	  3 573 11410 882 1078 0 0 0 99 0
	  4 12403 13309 8812 10955 0 0 0 99 0
	  5 3893 12528 4613 6477 0 0 0 99 0
	  6 1248 11484 1068 2344 0 0 0 99 0
	  7 1113 11454 1345 2233 0 0 0 99 0

% cat '#'¶/swap
8457793536 memory
4096 pagesize
524288 kernel
526/1491180 user
0/160000 swap
1136/1491180 reclaim
6005328/6078816/2139377280 kernel malloc
0/0/1925439552 kernel draw
2976/65568/16777216 kernel secret

% awk /^Plan 9/{p=1} /^init: starting/{exit} {if(p)print} '#'c/kmesg
Plan 9
125 holes free
0x00024000 0x0009c000 491520
0x00100000 0x00110000 65536
0x00979000 0x7ffff000 2137546752
2138103808 bytes free
cpu0: 1800MHz GenuineIntel Celeron (AX 000806EA CX 77FAFBBF DX BFEBFBFF)
ignoring 64-bit bar 0: 2ffe000004 16777216 from PCI.0.2.0
ignoring 64-bit bar 0: 2fff027004 4096 from PCI.0.8.0
ignoring 64-bit bar 0: 2fff010004 65536 from PCI.0.20.0
ignoring 64-bit bar 0: 2fff026004 4096 from PCI.0.20.2
ignoring 64-bit bar 0: 2fff025004 4096 from PCI.0.22.0
ignoring 64-bit bar 0: 2fff020004 16384 from PCI.0.31.3
ignoring 64-bit bar 4: 2fff000004 65536 from PCI.0.31.3
ignoring 64-bit bar 0: 2fff024004 256 from PCI.0.31.4
pcirouting: ignoring south bridge PCI.0.31.0 8086/9D4E
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP01.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP02.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP05.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP06.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP07.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP08.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP09.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP10.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP11.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP12.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP13.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP14.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP15.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP16.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP17.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP18.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP19.PXSX.RPXX failed
amlmapio: no address
amlmapio: mapping \_SB.PCI0.RP20.PXSX.RPXX failed
LAPIC: fee00000 0xffffff00fee00000
ec: cmd 66, data 62
ELCR: 0800
cpu0: lapic clock at 24MHz
cpu4: 1800MHz GenuineIntel Celeron (AX 000806EA CX 77FAFBBF DX BFEBFBFF)
cpu1: 1800MHz GenuineIntel Celeron (AX 000806EA CX 77FAFBBF DX BFEBFBFF)
cpu5: 1800MHz GenuineIntel Celeron (AX 000806EA CX 77FAFBBF DX BFEBFBFF)
cpu2: 1800MHz GenuineIntel Celeron (AX 000806EA CX 77FAFBBF DX BFEBFBFF)
cpu6: 1800MHz GenuineIntel Celeron (AX 000806EA CX 77FAFBBF DX BFEBFBFF)
cpu3: 1800MHz GenuineIntel Celeron (AX 000806EA CX 77FAFBBF DX BFEBFBFF)
cpu7: 1800MHz GenuineIntel Celeron (AX 000806EA CX 77FAFBBF DX BFEBFBFF)
#l0: iwl: 54Mbps port 0xDFD00000 irq 11 ea 100ba9babf18
rtl8169: oui 0x732 phyno 1, macv = 0x54000000 phyv = 0x0000
#l1: rtl8169: 10Mbps port 0xE000 irq 11 ea 000000000000
#S/sdE: ahci: sata-II with 3 ports
#A0: bogus bar0 00000000 size 0
8075M memory: 2250M kernel data, 5824M user, 6449M swap
#l0: firmware: iwn-6005, rev 12a80601, build 0, size 25c50+14000+20868+14000+0
sdE2: LLBA 500,118,192 sectors
  LITEON CV3-8D256 T887901 SS0L25062L1TH698005X [newdrive]
nusb/usbd: no hubs

/dev/sdE0:
/dev/sdE1:
/dev/sdE2: LITEON CV3-8D256
/dev/sdE2/data
/dev/sdE2/dos
/dev/sdE2/esp dos
/dev/sdE2/msr
bootargs is (tcp, tls, il, local!device)[local!/shr/sdU8d2e6/9front.iso] tls
secstore password:
secstore


% pci -v
0.0.0: brg 06.00.00 8086/5914 0
	Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM
	Registers
0.2.0: vid 03.00.00 8086/5917 11 2:c000000c 268435456 4:0000f001 64
	Intel Corporation UHD Graphics 620
0.8.0: base 08.80.00 8086/1911 11
	Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core
	Processor Gaussian Mixture Model
0.20.0: usb 0c.03.30 8086/9d2f 11
	Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller
0.20.2: sigl 11.80.00 8086/9d31 11
	Intel Corporation Sunrise Point-LP Thermal subsystem
0.22.0: ser 07.80.00 8086/9d3a 11
	Intel Corporation Sunrise Point-LP CSME HECI #1
0.23.0: disk 01.06.01 8086/9d03 11 0:dff04000 8192 1:dff07000 256 2:0000f091 16
3:0000f081 16 4:0000f061 32 5:dff06000 2048
	Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode]
0.28.0: brg 06.04.00 8086/9d12 11
	Intel Corporation Sunrise Point-LP PCI Express Root Port #3
0.28.3: brg 06.04.00 8086/9d13 11
	Intel Corporation Sunrise Point-LP PCI Express Root Port #4
0.31.0: brg 06.01.00 8086/9d4e 0
	Intel Corporation Sunrise Point LPC Controller/eSPI Controller
0.31.2: mem 05.80.00 8086/9d21 0
	Intel Corporation Sunrise Point-LP PMC
0.31.3: aud 04.03.00 8086/9d71 11
	Intel Corporation Sunrise Point-LP HD Audio
0.31.4: smb 0c.05.00 8086/9d23 11 4:0000f041 32
	Intel Corporation Sunrise Point-LP SMBus
1.0.0: net 02.00.00 10ec/8168 11 0:0000e001 256 2:dfe04004 4096 4:dfe00004 16384
	Realtek Semiconductor Co., Ltd.  RTL8111/8168/8411 PCI Express Gigabit
	Ethernet Controller
2.0.0: net 02.80.00 8086/0082 11 0:dfd00004 8192
	Intel Corporation Centrino Advanced-N 6205 [Taylor Peak]

% aux/cpuid
vendor GenuineIntel
procmodel 000806ea / 01100800
typefammod 0 06 086 a
features fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat
features pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
features pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm
pcid sse4_1 sse4_2
features x2apic movbe popcnt tscdeadline aes xsave avx f16c rdrnd
features xsaveopt
extmodel 00000000 / 00000000
extfeatures syscall nx pg1g tscp lm
extfeatures ahf64 lzcnt 3dnow!p
procname Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
physbits 39
virtbits 48

% aux/icanhasmsi
0.2.0
0.8.0
0.20.0
0.20.2
0.22.0
0.23.0
0.28.0
0.28.3
0.31.3
1.0.0
2.0.0

% aux/icanhasvmx -v
vmcsrev 0x4
vmxonsz 1024
vmcsmem 6
extcontrols 1
pin extirq nmiexit virtnmi preempt
proc irqwin tscoffset hltexit invlpgexit mwaitexit rdpmcexit rdtscexit cr3ldexit
proc cr3stexit cr8ldexit cr8stexit tprshadow nmiwin movdrexit ioexit iobitmap mtf
proc msrbitmap monitorexit pauseexit
proc2 virtapic ept gdtexit rdtscp virtx2apic vpid wbinvdexit unrestr pauseloopexit
proc2 rdrandexit invpcid vmfunc enclsexit rdseedexit pml #ve conceal xsave
eptxmode
entry loaddebug guest64 entrysmm dualmonitor loadperfglobal loadpat loadefer
loadbndcfgs
entry concealentries
exit savedebug host64 saveperfglobal ackextirq !savepat !loadpat saveefer loadefer
exit savepreempt savebndcfgs concealexits
misc preemptdiv:7 cr3targ:4 maxmsr:0 mseg:0x0
misc longmodeswitch hlt shutdown ipi pt rdmsrsmm smmblock vmwriteany zerolenswirq
cr0fixed pe ne pg
cr4fixed !umip vmxe !smxe !pke
vmcsenum 0x2e
ept xonly pwl4 ucmem wbmem 2MBpage 1GBpage invept dirtybits violexitinfo
invept.single
ept invept.all
vpid invvpid invvpid.addr invvpid.single invvpid.all invvpid.noglob

% aux/pcmcia

% cat '#'u/usb/ctl

% cat '#'S/sdctl
sdE ahci ahci port 0xffffff00dff06000: 64a ncq led clo am pmb slum pslum apts iss
3 ncs 31 np 3 ghc 80000002 isr 0 pi 7 0-2 ver 10301
sdZ ram 4 units

% cat '#'S/sdE0/ctl
inquiry
no disk present [null]
reg task 7f cmd 4004016 serr 0 ci 0 is 0 sig ffffffff sstatus 004
cmd alpe fr pod sud
mode auto sataiii
geometry 0 0
alignment 0 0
missirq 0

% cat '#'S/sdE1/ctl
inquiry
no disk present [null]
reg task 7f cmd 4004016 serr 0 ci 0 is 0 sig ffffffff sstatus 004
cmd alpe fr pod sud
mode auto sataiii
geometry 0 0
alignment 0 0
missirq 0

% cat '#'S/sdE2/ctl
inquiry LITEON CV3-8D256
model LITEON CV3-8D256
serial SS0L25062L1TH698005X
firm T887901
wwn 5002303100b3ed51
flag lba llba smart ata8 sct
udma 6
reg task 50 cmd c017 serr 0 ci 0 is 0 sig 101 sstatus 133
cmd cr fr pod sud st
mode auto sataiii
geometry 500118192 512
alignment 512 0
missirq 0
part data 0 500118192
part esp 2048 206848
part msr 206848 239616
part dos 239616 500117504

% cat '#'l0/ether0/addr
100ba9babf18
% cat '#'l0/ether0/stats
in: 4496
link: 1
out: 2859
crc errs: 0
overflows: 0
soft overflows: 0
framing errs: 0
buffer errs: 0
output errs: 0
prom: 0
mbps: 27
addr: 100ba9babf18

% cat '#'l0/ether0/ifstats
essid: ATT868PK2D
bssid: f82c18239a91
status: associated
channel: 04
rxkey1: ccmp:[16]
rxkey4: ccmp:[16]
txkey0: ccmp:[16]
brsne: 30140100000FAC040100000FAC040100000FAC020C00
node: 3cea4fc0bd11 0431 104890 06 2WIRE598
node: f82c18239a91 0411 0 04 ATT868PK2D
node: 34ef44da5761 0431 105190 03 2WIRE790

% cat '#'l1/ether1/addr
000000000000
% cat '#'l1/ether1/stats
in: 0
link: 0
out: 0
crc errs: 0
overflows: 0
soft overflows: 0
framing errs: 0
buffer errs: 0
output errs: 0
prom: 0
mbps: 10
addr: 000000000000

% cat '#'l1/ether1/ifstats
TxOk: 0
RxOk: 0
TxEr: 0
RxEr: 0
MissPkt: 0
FAE: 0
Tx1Col: 0
TxMCol: 0
RxOkPh: 0
RxOkBrd: 0
RxOkMu: 0
TxAbt: 0
TxUndrn: 0
serr: 0
fovw: 0
txdu: 0
tcpf: 0
udpf: 0
ipf: 0
fovf: 0
rer: 0
rdu: 0
punlc: 0
tcr: 0x57100f00
rcr: 0x0000870e
multicast: 0
phy: 1040 7989 001c c800 01e1 0000 0064 2001
	0000 0200 0000 0000 0000 0000 0000 2000
	0000 0000 0000 0000 0000 0000 0000 0000
	319b 0040 1002 0002 0000 0000 0000 0000

% cat '#'v/vgactl
type cga
hwgc off
hwaccel off
hwblank off
panning off
addr p 0x0 v 0x0 size 0x0
softscreen off

@{rfork n; aux/realemu; aux/vga -p}
vesa flag Ulinear|Hlinear|Fsnarf
vesa sig VESA 3.0
vesa oem Intel(R) SKL/KBL Mobile/Desktop Graphics Chipset Accelerated VGA BIOS 0.0
vesa vendor <nil>
vesa product <nil>
vesa rev <nil>
vesa cap 8-bit-dac
vesa mem 67043328
vesa dsp con 4
vesa dsp act 4
vesa mode 0x13a 1600x1200x8 m8 packed
vesa mode 0x14b 1600x1200x16 r5g6b5 direct
vesa mode 0x15a 1600x1200x32 x8r8g8b8 direct
vesa mode 0x107 1280x1024x8 m8 packed
vesa mode 0x11a 1280x1024x16 r5g6b5 direct
vesa mode 0x11b 1280x1024x32 x8r8g8b8 direct
vesa mode 0x105 1024x768x8 m8 packed
vesa mode 0x117 1024x768x16 r5g6b5 direct
vesa mode 0x118 1024x768x32 x8r8g8b8 direct
vesa mode 0x112 640x480x32 x8r8g8b8 direct
vesa mode 0x114 800x600x16 r5g6b5 direct
vesa mode 0x115 800x600x32 x8r8g8b8 direct
vesa mode 0x101 640x480x8 m8 packed
vesa mode 0x103 800x600x8 m8 packed
vesa mode 0x111 640x480x16 r5g6b5 direct
vesa mode 0x17d 1920x1200x8 m8 packed
vesa mode 0x17e 1920x1200x16 r5g6b5 direct
vesa mode 0x17f 1920x1200x32 x8r8g8b8 direct
edid mfr KDC
edid serialstr
edid name
edid product 0
edid serial 0
edid version 1.4
edid mfrdate 2015.20
edid size (cm) 26x16
edid gamma 2.20
edid vert (Hz) 0-0
edid horz (Hz) 0-0
edid pclkmax 0
edid flags digital
edid 1920x1200@60Hz
		clock=147
		shb=1936 ehb=1952 ht=1984
		vrs=1215 vre=1217 vt=1235
		hsync=+ vsync=-

% xd -x1 '#'r/nvram
0000000 09 00 12 10 00 22 01 31 05 20 26 02 50 80 00 00
0000010 00 bf df fd c7 71 02 ff ff ff ef fe ff ff ff ff
0000020 ff ff ff ff ff fb df ff ff 7f ff ff ef df 19 d9
0000030 ff ff 20 ff df 0f 08 ff 00 00 00 00 00 00 00 00
0000040 00 00 71 22 e3 f0 f0 00 00 00 00 00 00 00 00 00
0000050 00 00 00 00 00 00 00 00 3a 64 00 00 00 00 00 00
0000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000080 09 00 12 10 00 22 01 31 05 20 26 02 40 80 00 00
0000090 00 bf df fd c7 71 02 ff ff ff ef fe ff ff ff ff
00000a0 ff ff ff ff ff fb df ff ff 7f ff ff ef df 19 d9
00000b0 ff ff 20 ff df 0f 08 ff 00 00 00 00 00 00 00 00
00000c0 00 00 71 22 e3 f0 f0 00 00 00 00 00 00 00 00 00
00000d0 00 00 00 00 00 00 00 00 3a 64 00 00 00 00 00 00
00000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000100
0000100

% cat '#'A/audiostat

% cat '#'A/volume

% cat /mnt/apm/ctl



Sat May 30 20:11:34 EDT 2020
0.0.0: brg 06.00.00 8086/5914 0
	Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM
	Registers
0.2.0: vid 03.00.00 8086/5917 11 2:c000000c 268435456 4:0000f001 64
	Intel Corporation UHD Graphics 620
0.8.0: base 08.80.00 8086/1911 11
	Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core
	Processor Gaussian Mixture Model
0.20.0: usb 0c.03.30 8086/9d2f 11
	Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller
0.20.2: sigl 11.80.00 8086/9d31 11
	Intel Corporation Sunrise Point-LP Thermal subsystem
0.22.0: ser 07.80.00 8086/9d3a 11
	Intel Corporation Sunrise Point-LP CSME HECI #1
0.23.0: disk 01.06.01 8086/9d03 11 0:dff04000 8192 1:dff07000 256 2:0000f091 16
3:0000f081 16 4:0000f061 32 5:dff06000 2048
	Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode]
0.28.0: brg 06.04.00 8086/9d12 11
	Intel Corporation Sunrise Point-LP PCI Express Root Port #3
0.28.3: brg 06.04.00 8086/9d13 11
	Intel Corporation Sunrise Point-LP PCI Express Root Port #4
0.31.0: brg 06.01.00 8086/9d4e 0
	Intel Corporation Sunrise Point LPC Controller/eSPI Controller
0.31.2: mem 05.80.00 8086/9d21 0
	Intel Corporation Sunrise Point-LP PMC
0.31.3: aud 04.03.00 8086/9d71 11
	Intel Corporation Sunrise Point-LP HD Audio
0.31.4: smb 0c.05.00 8086/9d23 11 4:0000f041 32
	Intel Corporation Sunrise Point-LP SMBus
1.0.0: net 02.00.00 10ec/8168 11 0:0000e001 256 2:dfe04004 4096 4:dfe00004 16384
	Realtek Semiconductor Co., Ltd.  RTL8111/8168/8411 PCI Express Gigabit
	Ethernet Controller
2.0.0: net 02.80.00 8086/0082 11 0:dfd00004 8192
	Intel Corporation Centrino Advanced-N 6205 [Taylor Peak]


Sat May 30 19:35:27 EDT 2020
diff -r d45cfe9072cd sys/src/9/pc/audiohda.c
--- a/sys/src/9/pc/audiohda.c Sat May 30 13:03:05 2020 +0200
+++ b/sys/src/9/pc/audiohda.c Sun May 31 01:35:26 2020 +0200
@@ -1896,7 +1896,10 @@

	ctlr->no = adev->ctlrno;
	ctlr->size = p->mem[0].size;
- ctlr->q = qopen(256, 0, 0, 0);
+ if(ctlr->size == 0){
+ print("#A%d: bogus bar0 %.8lux size %d\n", ctlr->no, p->mem[0].bar,
p->mem[0].size);
+ return -1;
+ }
	ctlr->mem = vmap(p->mem[0].bar & ~0x0F, ctlr->size);
	if(ctlr->mem == nil){
		print("#A%d: can't map %.8lux\n", ctlr->no, p->mem[0].bar);
@@ -1956,6 +1959,8 @@

	intrenable(irq, hdainterrupt, adev, tbdf, "hda");
	lastcard = ctlr;
+
+ ctlr->q = qopen(256, 0, 0, 0);
	addarchfile("hdacmd", 0664, hdacmdread, hdacmdwrite);

	return 0;


Sat May 30 17:31:16 EDT 2020
diff -r d45cfe9072cd sys/src/libc/fmt/vsnprint.c
--- a/sys/src/libc/fmt/vsnprint.c Sat May 30 13:03:05 2020 +0200
+++ b/sys/src/libc/fmt/vsnprint.c Sat May 30 14:31:13 2020 -0700
@@ -2,19 +2,27 @@
 #include <libc.h>

 int
+fmtbufinit(Fmt *f, char *buf, int len)
+{
+ if(len <= 0)
+ return -1;
+ f->runes = 0;
+ f->start = buf;
+ f->to = buf;
+ f->stop = buf + len - 1;
+ f->flush = nil;
+ f->farg = nil;
+ f->nfmt = 0;
+ return 0;
+}
+
+int
 vsnprint(char *buf, int len, char *fmt, va_list args)
 {
	Fmt f;

- if(len <= 0)
+ if(fmtbufinit(&f, buf, len) == -1)
		return -1;
- f.runes = 0;
- f.start = buf;
- f.to = buf;
- f.stop = buf + len - 1;
- f.flush = nil;
- f.farg = nil;
- f.nfmt = 0;
	f.args = args;
	dofmt(&f, fmt);
	*(char*)f.to = '\0';


prev | next