Browse Source

Plan 9 from Bell Labs 2007-12-15

David du Colombier 12 years ago
parent
commit
105ab492e3

+ 8 - 8
dist/replica/_plan9.db

@@ -18,7 +18,7 @@
 386/bin/8l - 775 sys sys 1148500567 115711
 386/bin/9660srv - 775 sys sys 1168402261 104975
 386/bin/aan - 775 sys sys 1196742429 129831
-386/bin/acid - 775 sys sys 1196914668 405249
+386/bin/acid - 775 sys sys 1197665698 405309
 386/bin/acme - 775 sys sys 1196742437 431741
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1173754547 134719
@@ -5839,7 +5839,7 @@ sys/games - 20000000775 sys sys 1117225532 0
 sys/games/lib - 20000000775 sys sys 1165337608 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1195163116 267897
+sys/games/lib/fortunes - 664 sys sys 1197673161 267929
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -6125,7 +6125,7 @@ sys/include/trace.h - 664 sys sys 1138460022 640
 sys/include/venti.h - 664 sys sys 1188621741 9941
 sys/lib - 20000000775 sys sys 1105564897 0
 sys/lib/acid - 20000000775 sys sys 1114524607 0
-sys/lib/acid/386 - 664 sys sys 1168035402 3188
+sys/lib/acid/386 - 664 sys sys 1197656621 3173
 sys/lib/acid/68020 - 664 sys sys 944955985 2487
 sys/lib/acid/acme - 664 sys sys 969499632 2291
 sys/lib/acid/alef - 664 sys sys 944955985 2293
@@ -9456,7 +9456,7 @@ sys/src/cmd/acid/exec.c - 664 sys sys 1196895288 8400
 sys/src/cmd/acid/expr.c - 664 sys sys 1196895295 15497
 sys/src/cmd/acid/lex.c - 664 sys sys 1131289460 7963
 sys/src/cmd/acid/list.c - 664 sys sys 1131289462 3680
-sys/src/cmd/acid/main.c - 664 sys sys 1196895291 8547
+sys/src/cmd/acid/main.c - 664 sys sys 1197656636 8647
 sys/src/cmd/acid/mkfile - 664 sys sys 1046199006 366
 sys/src/cmd/acid/print.c - 664 sys sys 1131289462 6831
 sys/src/cmd/acid/proc.c - 664 sys sys 1143223273 4333
@@ -9489,7 +9489,7 @@ sys/src/cmd/acme/xfid.c - 664 sys sys 1125314186 19766
 sys/src/cmd/aquarela - 20000000775 sys sys 1135892145 0
 sys/src/cmd/aquarela/COPYRIGHT - 664 sys sys 1135892145 43
 sys/src/cmd/aquarela/addname.c - 664 sys sys 1135892108 1281
-sys/src/cmd/aquarela/alarm.c - 664 sys sys 1135892108 2194
+sys/src/cmd/aquarela/alarm.c - 664 sys sys 1197673331 2170
 sys/src/cmd/aquarela/alloc.c - 664 sys sys 1135892108 245
 sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1136651999 7027
 sys/src/cmd/aquarela/cifscmd.c - 664 sys sys 1135892108 4430
@@ -10268,7 +10268,7 @@ sys/src/cmd/disk/prep - 20000000775 sys sys 1055692957 0
 sys/src/cmd/disk/prep/calc.y - 664 sys sys 1135487935 2406
 sys/src/cmd/disk/prep/edit.c - 664 sys sys 1017854327 9714
 sys/src/cmd/disk/prep/edit.h - 664 sys sys 1015009215 994
-sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1193693218 22265
+sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1197673079 22324
 sys/src/cmd/disk/prep/mkfile - 664 sys sys 1022450200 250
 sys/src/cmd/disk/prep/prep.c - 664 sys sys 1193692640 10170
 sys/src/cmd/disk/rd9660.c - 664 sys sys 1021579990 7446
@@ -12532,7 +12532,7 @@ sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1185923430 20620
 sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1185923495 39912
 sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1184880750 233
 sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
-sys/src/cmd/ip/linklocal.c - 664 sys sys 1177099730 867
+sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1185920805 1267
 sys/src/cmd/ip/ping.c - 664 sys sys 1186208356 10518
@@ -15258,7 +15258,7 @@ sys/src/libdraw/ellipse.c - 664 sys sys 1040442971 1936
 sys/src/libdraw/emenuhit.c - 664 sys sys 1014927874 7136
 sys/src/libdraw/event.c - 664 sys sys 1143695460 8960
 sys/src/libdraw/fmt.c - 664 sys sys 1070344369 270
-sys/src/libdraw/font.c - 664 sys sys 1115916587 7623
+sys/src/libdraw/font.c - 664 sys sys 1197673270 7648
 sys/src/libdraw/freesubfont.c - 664 sys sys 984709664 259
 sys/src/libdraw/getdefont.c - 664 sys sys 1135547941 1108
 sys/src/libdraw/getrect.c - 664 sys sys 1014927875 3046

+ 8 - 8
dist/replica/plan9.db

@@ -18,7 +18,7 @@
 386/bin/8l - 775 sys sys 1148500567 115711
 386/bin/9660srv - 775 sys sys 1168402261 104975
 386/bin/aan - 775 sys sys 1196742429 129831
-386/bin/acid - 775 sys sys 1196914668 405249
+386/bin/acid - 775 sys sys 1197665698 405309
 386/bin/acme - 775 sys sys 1196742437 431741
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1173754547 134719
@@ -5839,7 +5839,7 @@ sys/games - 20000000775 sys sys 1117225532 0
 sys/games/lib - 20000000775 sys sys 1165337608 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1195163116 267897
+sys/games/lib/fortunes - 664 sys sys 1197673161 267929
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -6125,7 +6125,7 @@ sys/include/trace.h - 664 sys sys 1138460022 640
 sys/include/venti.h - 664 sys sys 1188621741 9941
 sys/lib - 20000000775 sys sys 1105564897 0
 sys/lib/acid - 20000000775 sys sys 1114524607 0
-sys/lib/acid/386 - 664 sys sys 1168035402 3188
+sys/lib/acid/386 - 664 sys sys 1197656621 3173
 sys/lib/acid/68020 - 664 sys sys 944955985 2487
 sys/lib/acid/acme - 664 sys sys 969499632 2291
 sys/lib/acid/alef - 664 sys sys 944955985 2293
@@ -9456,7 +9456,7 @@ sys/src/cmd/acid/exec.c - 664 sys sys 1196895288 8400
 sys/src/cmd/acid/expr.c - 664 sys sys 1196895295 15497
 sys/src/cmd/acid/lex.c - 664 sys sys 1131289460 7963
 sys/src/cmd/acid/list.c - 664 sys sys 1131289462 3680
-sys/src/cmd/acid/main.c - 664 sys sys 1196895291 8547
+sys/src/cmd/acid/main.c - 664 sys sys 1197656636 8647
 sys/src/cmd/acid/mkfile - 664 sys sys 1046199006 366
 sys/src/cmd/acid/print.c - 664 sys sys 1131289462 6831
 sys/src/cmd/acid/proc.c - 664 sys sys 1143223273 4333
@@ -9489,7 +9489,7 @@ sys/src/cmd/acme/xfid.c - 664 sys sys 1125314186 19766
 sys/src/cmd/aquarela - 20000000775 sys sys 1135892145 0
 sys/src/cmd/aquarela/COPYRIGHT - 664 sys sys 1135892145 43
 sys/src/cmd/aquarela/addname.c - 664 sys sys 1135892108 1281
-sys/src/cmd/aquarela/alarm.c - 664 sys sys 1135892108 2194
+sys/src/cmd/aquarela/alarm.c - 664 sys sys 1197673331 2170
 sys/src/cmd/aquarela/alloc.c - 664 sys sys 1135892108 245
 sys/src/cmd/aquarela/aquarela.c - 664 sys sys 1136651999 7027
 sys/src/cmd/aquarela/cifscmd.c - 664 sys sys 1135892108 4430
@@ -10268,7 +10268,7 @@ sys/src/cmd/disk/prep - 20000000775 sys sys 1055692957 0
 sys/src/cmd/disk/prep/calc.y - 664 sys sys 1135487935 2406
 sys/src/cmd/disk/prep/edit.c - 664 sys sys 1017854327 9714
 sys/src/cmd/disk/prep/edit.h - 664 sys sys 1015009215 994
-sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1193693218 22265
+sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1197673079 22324
 sys/src/cmd/disk/prep/mkfile - 664 sys sys 1022450200 250
 sys/src/cmd/disk/prep/prep.c - 664 sys sys 1193692640 10170
 sys/src/cmd/disk/rd9660.c - 664 sys sys 1021579990 7446
@@ -12532,7 +12532,7 @@ sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1185923430 20620
 sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1185923495 39912
 sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1184880750 233
 sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
-sys/src/cmd/ip/linklocal.c - 664 sys sys 1177099730 867
+sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1185920805 1267
 sys/src/cmd/ip/ping.c - 664 sys sys 1186208356 10518
@@ -15258,7 +15258,7 @@ sys/src/libdraw/ellipse.c - 664 sys sys 1040442971 1936
 sys/src/libdraw/emenuhit.c - 664 sys sys 1014927874 7136
 sys/src/libdraw/event.c - 664 sys sys 1143695460 8960
 sys/src/libdraw/fmt.c - 664 sys sys 1070344369 270
-sys/src/libdraw/font.c - 664 sys sys 1115916587 7623
+sys/src/libdraw/font.c - 664 sys sys 1197673270 7648
 sys/src/libdraw/freesubfont.c - 664 sys sys 984709664 259
 sys/src/libdraw/getdefont.c - 664 sys sys 1135547941 1108
 sys/src/libdraw/getrect.c - 664 sys sys 1014927875 3046

+ 8 - 0
dist/replica/plan9.log

@@ -18143,3 +18143,11 @@
 1197574206 1 c sys/man/8/ipserv - 664 sys sys 1197574309 3268
 1197574206 2 c sys/man/8/pop3 - 664 sys sys 1197574309 3122
 1197579605 0 c 386/bin/snoopy - 775 sys sys 1197579415 195288
+1197657004 0 c sys/lib/acid/386 - 664 sys sys 1197656621 3173
+1197657004 1 c sys/src/cmd/acid/main.c - 664 sys sys 1197656636 8647
+1197666003 0 c 386/bin/acid - 775 sys sys 1197665698 405309
+1197673204 0 c sys/games/lib/fortunes - 664 sys sys 1197673161 267929
+1197673204 1 c sys/src/cmd/aquarela/alarm.c - 664 sys sys 1197673331 2170
+1197673204 2 c sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1197673079 22324
+1197673204 3 c sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
+1197673204 4 c sys/src/libdraw/font.c - 664 sys sys 1197673270 7648

+ 1 - 0
sys/games/lib/fortunes

@@ -4208,3 +4208,4 @@ Customer stickiness reduces churn making it a valuable benefit.
 SIP is the Linux of telephony. - Sape
 There was an error during the CUPS operation: 'client-error-not-possible'.
 The following recipient(s) could not be reached: OpenView Service Desk on 11/7/2007 4:24 PM  The message could not be delivered because the recipient's mailbox is full.  - automated response to mail complaining that limits on mailbox size are too low
+Dear Valued Customer #88143191!

+ 20 - 21
sys/lib/acid/386

@@ -111,28 +111,28 @@ defn pstop(pid)
 
 aggr Ureg
 {
-	'U' 0 di;
-	'U' 4 si;
-	'U' 8 bp;
-	'U' 12 nsp;
-	'U' 16 bx;
-	'U' 20 dx;
-	'U' 24 cx;
-	'U' 28 ax;
-	'U' 32 gs;
-	'U' 36 fs;
-	'U' 40 es;
-	'U' 44 ds;
-	'U' 48 trap;
-	'U' 52 ecode;
-	'U' 56 pc;
-	'U' 60 cs;
-	'U' 64 flags;
+	'X' 0 di;
+	'X' 4 si;
+	'X' 8 bp;
+	'X' 12 nsp;
+	'X' 16 bx;
+	'X' 20 dx;
+	'X' 24 cx;
+	'X' 28 ax;
+	'X' 32 gs;
+	'X' 36 fs;
+	'X' 40 es;
+	'X' 44 ds;
+	'X' 48 trap;
+	'X' 52 ecode;
+	'X' 56 pc;
+	'X' 60 cs;
+	'X' 64 flags;
 	{
-	'U' 68 usp;
-	'U' 68 sp;
+	'X' 68 usp;
+	'X' 68 sp;
 	};
-	'U' 72 ss;
+	'X' 72 ss;
 };
 
 defn
@@ -156,7 +156,6 @@ Ureg(addr) {
 	print("	cs	", addr.cs, "\n");
 	print("	flags	", addr.flags, "\n");
 	print("	sp	", addr.sp, "\n");
-	print("}\n");
 	print("	ss	", addr.ss, "\n");
 };
 sizeofUreg = 76;

+ 13 - 3
sys/src/cmd/acid/main.c

@@ -18,6 +18,7 @@ static	int attachfiles(char*, int);
 int	xfmt(Fmt*);
 int	isnumeric(char*);
 void	die(void);
+void	loadmoduleobjtype(void);
 
 void
 usage(void)
@@ -110,6 +111,8 @@ main(int argc, char *argv[])
 		varreg();		/* use default register set on error */
 
 	loadmodule("/sys/lib/acid/port");
+	loadmoduleobjtype();
+
 	for(i = 0; i < nlm; i++) {
 		if(access(lm[i], AREAD) >= 0)
 			loadmodule(lm[i]);
@@ -193,6 +196,16 @@ die(void)
 	exits(0);
 }
 
+void
+loadmoduleobjtype(void)
+{
+	char *buf;
+
+	buf = smprint("/sys/lib/acid/%s", mach->name);
+	loadmodule(buf);
+	free(buf);
+}
+
 void
 userinit(void)
 {
@@ -200,9 +213,6 @@ userinit(void)
 	Node *n;
 	char *buf, *p;
 
-	buf = smprint("/sys/lib/acid/%s", mach->name);
-	loadmodule(buf);
-	free(buf);
 	p = getenv("home");
 	if(p != 0) {
 		buf = smprint("%s/lib/acid", p);

+ 0 - 1
sys/src/cmd/aquarela/alarm.c

@@ -37,7 +37,6 @@ alarmist(void *)
 				snooze = MaxLong;
 			else
 				snooze = vsnooze;
-			qunlock(&alarmlist);
 		}
 		else
 			snooze = 60 * 1000;

+ 2 - 0
sys/src/cmd/disk/prep/fdisk.c

@@ -231,6 +231,7 @@ enum {
 	TypeAMOEBA	= 0x93,
 	TypeAMOEBABB	= 0x94,
 	TypeBSD386	= 0xA5,
+	TypeNETBSD	= 0XA9,
 	TypeBSDI	= 0xB7,
 	TypeBSDISWAP	= 0xB8,
 	TypeOTHER	= 0xDA,
@@ -307,6 +308,7 @@ static Type types[256] = {
 	[TypeAMOEBA]		{ "AMOEBA", "amoeba" },
 	[TypeAMOEBABB]		{ "AMOEBABB", "amoebaboot" },
 	[TypeBSD386]		{ "BSD386", "bsd386" },
+	[TypeNETBSD]		{ "NETBSD", "netbsd" },
 	[TypeBSDI]		{ "BSDI", "bsdi" },
 	[TypeBSDISWAP]		{ "BSDISWAP", "bsdiswap" },
 	[TypeOTHER]		{ "OTHER", "other" },

+ 58 - 19
sys/src/cmd/ip/linklocal.c

@@ -1,53 +1,92 @@
 /*
- * linklocal - print ipv6 linklocal address of a mac address
+ * linklocal - print ipv6 link-local or 6to4 address of a mac address.
+ * eui is ieee's extended unique identifier, per rfc2373.
  */
 
 #include <u.h>
 #include <libc.h>
 #include <ip.h>
 
+enum {
+	Mac0mcast	= 1<<0,		/* multicast address */
+	Mac0localadm	= 1<<1,		/* locally-administered address, */
+	V60globaladm	= 1<<1,		/* but ipv6 reverses the meaning */
+};
+
+static char *v4_6to4;
+
+static void
+usage(void)
+{
+	fprint(2, "usage: %s [-t ipv4] ether...\n", argv0);
+	exits("usage");
+}
+
+void
+ea2eui64(uchar *lla, uchar *ea)
+{
+	*lla++ = *ea++ | V60globaladm;	/* oui (company id) */
+	*lla++ = *ea++;			/* " */
+	*lla++ = *ea++;			/* " */
+	*lla++ = 0xFF;			/* mac-48 in eui-64 (sic) */
+	*lla++ = 0xFE;			/* " */
+	*lla++ = *ea++;			/* manufacturer-assigned */
+	*lla++ = *ea++;			/* " */
+	*lla = *ea;			/* " */
+}
+
+void
+eaip26to4(uchar *lla, uchar *ea, uchar *ipv4)
+{
+	*lla++ = 0x20;			/* 6to4 address */
+	*lla++ = 0x02;			/* " */
+	memmove(lla, ipv4, IPv4addrlen);
+	lla += IPv4addrlen;
+	memset(lla, 0, 2);
+	ea2eui64(lla + 2, ea);
+}
+
 void
 ea2lla(uchar *lla, uchar *ea)
 {
-	assert(IPaddrlen == 16);
-	memset(lla, 0, IPaddrlen);
-	lla[0]  = 0xFE;
-	lla[1]  = 0x80;
-	lla[8]  = ea[0] | 0x2;
-	lla[9]  = ea[1];
-	lla[10] = ea[2];
-	lla[11] = 0xFF;
-	lla[12] = 0xFE;
-	lla[13] = ea[3];
-	lla[14] = ea[4];
-	lla[15] = ea[5];
+	*lla++ = 0xFE;			/* link-local v6 */
+	*lla++ = 0x80;			/* " */
+	memset(lla, 0, 6);
+	ea2eui64(lla + 6, ea);
 }
 
 static void
 process(char *ether)
 {
-	uchar ethaddr[6], ipaddr[16];
+	uchar ethaddr[6], ipaddr[IPaddrlen], ipv4[IPv4addrlen];
 
 	if (parseether(ethaddr, ether) < 0)
 		sysfatal("%s: not an ether address\n", ether);
-	ea2lla(ipaddr, ethaddr);
+	if (v4_6to4) {
+		v4parseip(ipv4, v4_6to4);
+		eaip26to4(ipaddr, ethaddr, ipv4);
+	} else
+		ea2lla(ipaddr, ethaddr);
 	print("%I\n", ipaddr);
 }
 
 void
 main(int argc, char *argv[])
 {
-	int i, errflg = 0;
+	int i;
 
 	ARGBEGIN {
+	case 't':
+		v4_6to4 = EARGF(usage());
+		break;
 	default:
-		errflg++;
+		usage();
 		break;
 	} ARGEND
 
 	fmtinstall('I', eipfmt);
-	if (argc <= 0 || errflg)
-		sysfatal("usage: %s ether...", argv0);
+	if (argc <= 0)
+		usage();
 
 	for (i = 0; i < argc; i++)
 		process(argv[i]);

+ 2 - 0
sys/src/libdraw/font.c

@@ -355,6 +355,8 @@ fontresize(Font *f, int wid, int ncache, int depth)
 	ret = 0;
 	if(depth <= 0)
 		depth = 1;
+	if(wid <= 0)
+		wid = 1;
 
 	d = f->display;
 	if(d == nil)