Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/gnot/main.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname gnot/main.c 1990/03091
## diff -e /dev/null /n/bootesdump/1990/03091/sys/src/9/68020/main.c
0a
#include	"u.h"
#include	"lib.h"
#include	"mem.h"
#include	"dat.h"
#include	"fns.h"
#include	"io.h"
#include	"ureg.h"
#include	"init.h"

void
main(void)
{
	Lock l;
	machinit();
	mmuinit();
	confinit();
	printinit();
	flushmmu();
	procinit0();
	pgrpinit();
	chaninit();
	alarminit();
	chandevreset();
	pageinit();
	userinit();
	schedinit();
}

void
machinit(void)
{
	int n;

	n = m->machno;
	memset(m, 0, sizeof(Mach));
	m->machno = n;
	m->mmask = 1<<m->machno;
}

void
mmuinit(void)
{
	ulong l, d, i;

	/*
	 * Invalidate user addresses
	 */
	for(l=0; l<4*1024*1024; l+=BY2PG)
		putmmu(l, INVALIDPTE);
	/*
	 * Two meg of usable memory
	 */
	for(i=1,l=KTZERO; i<2*1024*1024/BY2PG; l+=BY2PG,i++)
		putkmmu(l, PPN(l)|PTEVALID|PTEKERNEL);
	/*
	 * Screen at two meg
	 */
	for(i=0,d=DISPLAYRAM; i<256*1024/BY2PG; d+=BY2PG,l+=BY2PG,i++)
		putkmmu(l, PPN(d)|PTEVALID|PTEKERNEL);
}

void
init0(void)
{
	m->proc = u->p;
	u->p->state = Running;
	u->p->mach = m;
	spllo();
	chandevinit();
	
	u->slash = (*devtab[0].attach)(0);
	u->dot = clone(u->slash, 0);

	touser();
}

FPsave	initfp;

void
userinit(void)
{
	Proc *p;
	Seg *s;
	User *up;

	p = newproc();
	p->pgrp = newpgrp();
	strcpy(p->text, "*init*");
	strcpy(p->pgrp->user, "bootes");
/*	savefpregs(&initfp);	/**/
/*	p->fpstate = FPinit;	/**/

	/*
	 * Kernel Stack
	 */
	p->sched.pc = (ulong)init0;
	p->sched.sp = USERADDR+BY2PG-20;	/* BUG */
	p->sched.sr = SUPER|SPL(7);
	p->upage = newpage(0, 0, USERADDR|(p->pid&0xFFFF));

	/*
	 * User
	 */
	up = (User*)(p->upage->pa|KZERO);
	up->p = p;

	/*
	 * User Stack
	 */
	s = &p->seg[SSEG];
	s->proc = p;
	s->o = neworig(USTKTOP-BY2PG, 1, OWRPERM, 0);
	s->minva = USTKTOP-BY2PG;
	s->maxva = USTKTOP;

	/*
	 * Text
	 */
	s = &p->seg[TSEG];
	s->proc = p;
	s->o = neworig(UTZERO, 1, 0, 0);
	s->o->pte[0].page = newpage(0, 0, UTZERO);
	memcpy((ulong*)(s->o->pte[0].page->pa|KZERO), initcode, sizeof initcode);
	s->minva = UTZERO;
	s->maxva = UTZERO+BY2PG;

	ready(p);
}

void
exit(void)
{
	int i;

	u = 0;
	splhi();
	print("exiting\n");
	for(;;)
		;
}

/*
 * Insert new into list after where
 */
void
insert(List **head, List *where, List *new)
{
	if(where == 0){
		new->next = *head;
		*head = new;
	}else{
		new->next = where->next;
		where->next = new;
	}
		
}

/*
 * Insert new into list at end
 */
void
append(List **head, List *new)
{
	List *where;

	where = *head;
	if(where == 0)
		*head = new;
	else{
		while(where->next)
			where = where->next;
		where->next = new;
	}
	new->next = 0;
}

/*
 * Delete old from list
 */
void
delete0(List **head, List *old)
{
	List *l;

	l = *head;
	if(l == old){
		*head = old->next;
		return;
	}
	while(l->next != old)
		l = l->next;
	l->next = old->next;
}

/*
 * Delete old from list.  where->next is known to be old.
 */
void
delete(List **head, List *where, List *old)
{
	if(where == 0){
		*head = old->next;
		return;
	}
	where->next = old->next;
}

Conf	conf;

void
confinit(void)
{
	conf.nmach = 1;
	if(conf.nmach > MAXMACH)
		panic("confinit");
	conf.nproc = 15;
	conf.npgrp = 15;
	conf.npage = (2*1024*1024)/BY2PG;
	conf.npte = 500;
	conf.nmod = 50;
	conf.nalarm = 50;
	conf.norig = 50;
	conf.nchan = 100;
	conf.nenv = 50;
	conf.nenvchar = 4000;
	conf.npgenv = 100;
	conf.nmtab = 50;
	conf.nmount = 100;
	conf.nmntdev = 5;
	conf.nsrv = 32;
}
.
## diffname gnot/main.c 1990/0310
## diff -e /n/bootesdump/1990/03091/sys/src/9/68020/main.c /n/bootesdump/1990/0310/sys/src/9/68020/main.c
229a
	conf.nstream = 64;
	conf.nqueue = 5 * conf.nstream;
	conf.nblock = 16 * conf.nstream;
.
23a
	streaminit();
.
## diffname gnot/main.c 1990/0312
## diff -e /n/bootesdump/1990/0310/sys/src/9/68020/main.c /n/bootesdump/1990/0312/sys/src/9/68020/main.c
230a
	conf.nmntbuf = 10;
	conf.nmnthdr = 10;
.
222c
	conf.nalarm = 1000;
.
90c
	strcpy(p->pgrp->user, protouser);
.
30a
unloadboot(void)
{
	strncpy(protouser, BOOT->user, NAMELEN);
}

void
.
13a
	unloadboot();
.
9a
typedef struct Boot{
	long station;
	long traffic;
	char user[NAMELEN];
	char server[64];
	char line[64];
}Boot;
#define BOOT ((Boot*)0)

char protouser[NAMELEN];

void unloadboot(void);

.
## diffname gnot/main.c 1990/0320
## diff -e /n/bootesdump/1990/0312/sys/src/9/68020/main.c /n/bootesdump/1990/0320/sys/src/9/68020/main.c
239c
	conf.npage = (4*1024*1024-256*1024)/BY2PG;
.
237c
	conf.nproc = 32;
.
77c
	 * Screen at top of memory
.
74c
	for(i=1,l=KTZERO; i<(4*1024*1024-256*1024)/BY2PG; l+=BY2PG,i++)
.
72c
	 * Four meg of usable memory, with top 256K for screen
.
26d
## diffname gnot/main.c 1990/0321
## diff -e /n/bootesdump/1990/0320/sys/src/9/68020/main.c /n/bootesdump/1990/0321/sys/src/9/68020/main.c
254c
	conf.nblock = 32 * conf.nstream;
.
243,246c
	conf.nchan = 200;
	conf.nenv = 100;
	conf.nenvchar = 8000;
	conf.npgenv = 200;
.
## diffname gnot/main.c 1990/0322
## diff -e /n/bootesdump/1990/0321/sys/src/9/68020/main.c /n/bootesdump/1990/0322/sys/src/9/68020/main.c
254c
	conf.nblock = 12 * conf.nstream;
.
## diffname gnot/main.c 1990/0327
## diff -e /n/bootesdump/1990/0322/sys/src/9/68020/main.c /n/bootesdump/1990/0327/sys/src/9/68020/main.c
255a
	conf.nbitmap = 100;
	conf.nbitbyte = 200*1024;
.
## diffname gnot/main.c 1990/05151
## diff -e /n/bootesdump/1990/0327/sys/src/9/68020/main.c /n/bootesdump/1990/05151/sys/src/9/68020/main.c
249,251c
	conf.nmntdev = 10;
	conf.nmntbuf = 20;
	conf.nmnthdr = 20;
.
## diffname gnot/main.c 1990/05313
## diff -e /n/bootesdump/1990/05151/sys/src/9/68020/main.c /n/bootesdump/1990/05313/sys/src/9/68020/main.c
257c
	conf.nbitbyte = 400*1024;
.
249,251c
	conf.nmntdev = 20;
	conf.nmntbuf = 2*conf.nmntdev;
	conf.nmnthdr = 2*conf.nmntdev;
.
242c
	conf.norig = 100;
.
240c
	conf.nmod = 200;
.
## diffname gnot/main.c 1990/06021
## diff -e /n/bootesdump/1990/05313/sys/src/9/68020/main.c /n/bootesdump/1990/06021/sys/src/9/68020/main.c
238c
	bank[0] = banksize(0);
	bank[1] = banksize(16);
	conf.npage0 = (bank[0]*1024*1024)/BY2PG;
	conf.base0 = 0;
	conf.npage1 = (bank[1]*1024*1024)/BY2PG;
	conf.base1 = 16*1024*1024;
	conf.npage = conf.npage0+conf.npage1;
.
236c
	conf.nproc = 40;
.
227a
banksize(int base)
{
	ulong va;

	if(&end > (int *)((KZERO|1024L*1024L)-BY2PG))
		return 0;
	va = UZERO;	/* user page 1 is free to play with */
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG);
	*(ulong*)va=0;	/* 0 at 0M */
	putmmu(va, PTEVALID|(base+1)*1024L*1024L/BY2PG);
	*(ulong*)va=1;	/* 1 at 1M */
	putmmu(va, PTEVALID|(base+4)*1024L*1024L/BY2PG);
	*(ulong*)va=4;	/* 4 at 4M */
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG);
	if(*(ulong*)va==0)
		return 16;
	putmmu(va, PTEVALID|(base+1)*1024L*1024L/BY2PG);
	if(*(ulong*)va==1)
		return 4;
	putmmu(va, PTEVALID|(base+4)*1024L*1024L/BY2PG);
	if(*(ulong*)va==2)
		return 1;
	return 0;
}

.
143c
	k = kmap(s->o->pte[0].page);
	memcpy((ulong*)k->va, initcode, sizeof initcode);
	kunmap(k);
.
125a
	kunmap(k);
.
124c
	k = kmap(p->upage);
	up = (User*)k->va;
.
104a
	KMap *k;
.
38a
	kmapinit();
.
30a
	print("bank 0: %dM  bank 1: %dM\n", bank[0], bank[1]);
.
29a
	kmapinit();
.
19a
int bank[2];
.
## diffname gnot/main.c 1990/0603
## diff -e /n/bootesdump/1990/06021/sys/src/9/68020/main.c /n/bootesdump/1990/0603/sys/src/9/68020/main.c
295,297c
	conf.nsrv = 32*mul;
	conf.nbitmap = 100*mul;
	conf.nbitbyte = 300*1024*mul;
.
292c
	conf.nstream = 64*mul;
.
282,289c
	conf.norig = 150*mul;
	conf.nchan = 150*mul;
	conf.nenv = 100*mul;
	conf.nenvchar = 8000*mul;
	conf.npgenv = 200*mul;
	conf.nmtab = 50*mul;
	conf.nmount = 100*mul;
	conf.nmntdev = 10*mul;
.
279,280c
	mul = 1 + (conf.npage0>0);
	conf.nproc = 32*mul;
	conf.npgrp = 15*mul;
	conf.npte = 700*mul;
	conf.nmod = 400*mul;
.
270,271d
266a
	int mul;
.
## diffname gnot/main.c 1990/06111
## diff -e /n/bootesdump/1990/0603/sys/src/9/68020/main.c /n/bootesdump/1990/06111/sys/src/9/68020/main.c
299c
	conf.nbitbyte = 300*1024*mul*mul;
.
## diffname gnot/main.c 1990/0612
## diff -e /n/bootesdump/1990/06111/sys/src/9/68020/main.c /n/bootesdump/1990/0612/sys/src/9/68020/main.c
278c
	mul = 1 + (conf.npage1>0);
.
## diffname gnot/main.c 1990/0613
## diff -e /n/bootesdump/1990/0612/sys/src/9/68020/main.c /n/bootesdump/1990/0613/sys/src/9/68020/main.c
256,257c
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG);
	if(*(ulong*)va == 4)
.
254c
	if(*(ulong*)va == 1)
.
251c
	if(*(ulong*)va == 0)
.
249c
	*(ulong*)va = 4;	/* 4 at 4M */
.
247c
	*(ulong*)va = 1;	/* 1 at 1M */
.
245c
	*(ulong*)va = 0;	/* 0 at 0M */
.
97c
	if(!waserror()){
		c = namec("#e/bootline", Acreate, OWRITE, 0600);
		(*devtab[c->type].write)(c, bootline, 64);
		close(c);
	}
	poperror();
.
88a
	Chan *c;

	u->nerrlab = 0;
.
50a
	memcpy(bootline, BOOT->line, 64);
.
19a
char bootline[64];
.
16c
};
.
10c
typedef struct Boot Boot;

struct Boot
{
.
## diffname gnot/main.c 1990/0614
## diff -e /n/bootesdump/1990/0613/sys/src/9/68020/main.c /n/bootesdump/1990/0614/sys/src/9/68020/main.c
164c
	memcpy((ulong*)VA(k), initcode, sizeof initcode);
.
143c
	up = (User*)VA(k);
.
## diffname gnot/main.c 1990/0617
## diff -e /n/bootesdump/1990/0614/sys/src/9/68020/main.c /n/bootesdump/1990/0617/sys/src/9/68020/main.c
292c
	conf.nproc = 40*mul;
.
## diffname gnot/main.c 1990/0623
## diff -e /n/bootesdump/1990/0617/sys/src/9/68020/main.c /n/bootesdump/1990/0623/sys/src/9/68020/main.c
312a
	conf.nfont = 10*mul;
.
## diffname gnot/main.c 1990/0709
## diff -e /n/bootesdump/1990/0623/sys/src/9/68020/main.c /n/bootesdump/1990/0709/sys/src/9/68020/main.c
312c
	conf.nbitbyte = 300*1024*mul;
	if(*(uchar*)MOUSE & (1<<4))
		conf.nbitbyte *= 2;	/* ldepth 1 */
.
307c
	conf.nstream = 64;
.
303c
	conf.nmount = 80*mul;
.
293c
	conf.npgrp = 12*mul;
.
## diffname gnot/main.c 1990/0717
## diff -e /n/bootesdump/1990/0709/sys/src/9/68020/main.c /n/bootesdump/1990/0717/sys/src/9/68020/main.c
315a
	conf.nurp = 32;
.
## diffname gnot/main.c 1990/0721
## diff -e /n/bootesdump/1990/0717/sys/src/9/68020/main.c /n/bootesdump/1990/0721/sys/src/9/68020/main.c
298c
	conf.nchan = 200*mul;
.
292c
	conf.nproc = 50*mul;
.
## diffname gnot/main.c 1990/0722
## diff -e /n/bootesdump/1990/0721/sys/src/9/68020/main.c /n/bootesdump/1990/0722/sys/src/9/68020/main.c
309c
	conf.nblock = 24 * conf.nstream;
.
## diffname gnot/main.c 1990/0724
## diff -e /n/bootesdump/1990/0722/sys/src/9/68020/main.c /n/bootesdump/1990/0724/sys/src/9/68020/main.c
311c
	conf.nbitmap = 300*mul;
.
## diffname gnot/main.c 1990/0802
## diff -e /n/bootesdump/1990/0724/sys/src/9/68020/main.c /n/bootesdump/1990/0802/sys/src/9/68020/main.c
162a
	s->o->npage = 1;
.
## diffname gnot/main.c 1990/08163
## diff -e /n/bootesdump/1990/0802/sys/src/9/68020/main.c /n/bootesdump/1990/08163/sys/src/9/68020/main.c
128,129c
	p->fpstate = FPinit;
.
66a
	m->fpstate = FPinit;
	fprestore((FPsave*)&fpnull);
.
61a
	long fpnull = 0;
.
## diffname gnot/main.c 1990/0905
## diff -e /n/bootesdump/1990/08163/sys/src/9/68020/main.c /n/bootesdump/1990/0905/sys/src/9/68020/main.c
69c
	fprestore(&initfp);
.
62d
## diffname gnot/main.c 1990/0911
## diff -e /n/bootesdump/1990/0905/sys/src/9/68020/main.c /n/bootesdump/1990/0911/sys/src/9/68020/main.c
318a
	conf.nasync = 1;
.
311c
	conf.nblock = 32 * conf.nstream;
.
## diffname gnot/main.c 1990/0917
## diff -e /n/bootesdump/1990/0911/sys/src/9/68020/main.c /n/bootesdump/1990/0917/sys/src/9/68020/main.c
109a
		close(c);
		c = namec("#e/bootdevice", Acreate, OWRITE, 0600);
		(*devtab[c->type].write)(c, bootdevice, 2);
.
55a
	bootdevice[0] = BOOT->device;
.
23a
char bootdevice[2];
.
18a
	char device;
.
## diffname gnot/main.c 1990/0918
## diff -e /n/bootesdump/1990/0917/sys/src/9/68020/main.c /n/bootesdump/1990/0918/sys/src/9/68020/main.c
112a
		close(c);
		c = namec("#e/bootserver", Acreate, OWRITE, 0600);
		(*devtab[c->type].write)(c, bootserver, 64);
.
57a
	memcpy(bootserver, BOOT->server, 64);
.
24a
char bootserver[64];
.
## diffname gnot/main.c 1990/0921
## diff -e /n/bootesdump/1990/0918/sys/src/9/68020/main.c /n/bootesdump/1990/0921/sys/src/9/68020/main.c
156a
	up->mc.next = 0;
.
33a
	u = 0;
.
## diffname gnot/main.c 1990/0928
## diff -e /n/bootesdump/1990/0921/sys/src/9/68020/main.c /n/bootesdump/1990/0928/sys/src/9/68020/main.c
158d
## diffname gnot/main.c 1990/1004
## diff -e /n/bootesdump/1990/0928/sys/src/9/68020/main.c /n/bootesdump/1990/1004/sys/src/9/68020/main.c
182a
	m->proc = p;
.
149c
	p->sched.sr = SUPER|SPL(0);
.
142d
104,108c
	restore();
.
## diffname gnot/main.c 1990/1006
## diff -e /n/bootesdump/1990/1004/sys/src/9/68020/main.c /n/bootesdump/1990/1006/sys/src/9/68020/main.c
327a
	conf.npipe = conf.nstream/2;
.
## diffname gnot/main.c 1990/1104
## diff -e /n/bootesdump/1990/1006/sys/src/9/68020/main.c /n/bootesdump/1990/1104/sys/src/9/68020/main.c
328a
	conf.nservice = conf.nproc/5;
.
48a
	serviceinit();
.
## diffname gnot/main.c 1990/1110
## diff -e /n/bootesdump/1990/1104/sys/src/9/68020/main.c /n/bootesdump/1990/1110/sys/src/9/68020/main.c
330a
	conf.nfsyschan = 31 + conf.nchan/20;
.
49a
	filsysinit();
.
## diffname gnot/main.c 1990/1115
## diff -e /n/bootesdump/1990/1110/sys/src/9/68020/main.c /n/bootesdump/1990/1115/sys/src/9/68020/main.c
331c
	conf.nservice = 3*mul;			/* was conf.nproc/5 */
.
319,322c
	conf.nstream = 40 + 16*mul;		/* was 64 */
	conf.nqueue = 4 * conf.nstream;		/* was 5 */
	conf.nblock = 24 * conf.nstream;	/* was 32 */
	conf.nsrv = 16*mul;			/* was 32 */
.
## diffname gnot/main.c 1990/11151
## diff -e /n/bootesdump/1990/1115/sys/src/9/68020/main.c /n/bootesdump/1990/11151/sys/src/9/68020/main.c
320c
	conf.nqueue = 5 * conf.nstream;
.
## diffname gnot/main.c 1990/11211
## diff -e /n/bootesdump/1990/11151/sys/src/9/68020/main.c /n/bootesdump/1990/11211/sys/src/9/68020/main.c
139c
	strcpy(p->pgrp->user, user);
.
60c
	strncpy(user, BOOT->user, NAMELEN);
.
49,50c
/*	serviceinit(); /**/
/*	filsysinit(); /**/
.
23c
char user[NAMELEN];
.
## diffname gnot/main.c 1990/1127
## diff -e /n/bootesdump/1990/11211/sys/src/9/68020/main.c /n/bootesdump/1990/1127/sys/src/9/68020/main.c
321c
	conf.nblock = 24 * conf.nstream;
.
319c
	conf.nstream = 40 + 32*mul;
.
317c
	conf.nmntbuf = conf.nmntdev;
.
## diffname gnot/main.c 1990/1128
## diff -e /n/bootesdump/1990/1127/sys/src/9/68020/main.c /n/bootesdump/1990/1128/sys/src/9/68020/main.c
317c
	conf.nmntbuf = conf.nmntdev+3;
.
## diffname gnot/main.c 1990/1211
## diff -e /n/bootesdump/1990/1128/sys/src/9/68020/main.c /n/bootesdump/1990/1211/sys/src/9/68020/main.c
332a
}

/*
 *  set up floating point for a new process
 */
void
setup(Proc *p)
{
	long fpnull;

	fpnull = 0;
	splhi();
	m->fpstate = FPinit;
	p->fpstate = FPinit;
	fprestore((FPsave*)&fpnull);
	spllo();
}

/*
 * Save the part of the process state.
 */
void
save(uchar *state, int len)
{
	Balu *balu;

	if(len < sizeof(Balu))
		panic("save state too small");
	balu = (Balu *)state;
	fpsave(&u->fpsave);
	if(u->fpsave.type){
		if(u->fpsave.size > sizeof u->fpsave.junk)
			panic("fpsize %d max %d\n", u->fpsave.size, sizeof u->fpsave.junk);
		fpregsave(u->fpsave.reg);
		u->p->fpstate = FPactive;
		m->fpstate = FPdirty;
	}
	if(BALU->cr0 != 0xFFFFFFFF)	/* balu busy */
		memcpy(balu, BALU, sizeof(Balu));
	else{
		balu->cr0 = 0xFFFFFFFF;
		BALU->cr0 = 0xFFFFFFFF;
	}
}

/*
 *  Restore what save() saves
 *
 *  Save() makes sure that what state points to is long enough
 */
void
restore(Proc *p, uchar *state)
{
	Balu *balu;

	balu = (Balu *)state;
	if(p->fpstate != m->fpstate){
		if(p->fpstate == FPinit){
			u->p->fpstate = FPinit;
			fprestore(&initfp);
			m->fpstate = FPinit;
		}else{
			fpregrestore(u->fpsave.reg);
			fprestore(&u->fpsave);
			m->fpstate = FPdirty;
		}
	}
	if(balu->cr0 != 0xFFFFFFFF)	/* balu busy */
		memcpy(BALU, balu, sizeof balu);
.
302a
	conf.maxialloc = (4*1024*1024-256*1024-BY2PG);
.
180d
139a
	p->fpstate = FPinit;
.
106c
	u->nerrlab = 0;
	m->proc = u->p;
	u->p->state = Running;
	u->p->mach = m;
	spllo();

.
9a
#include	<libg.h>
#include	<gnot.h>

.
## diffname gnot/main.c 1990/1212
## diff -e /n/bootesdump/1990/1211/sys/src/9/68020/main.c /n/bootesdump/1990/1212/sys/src/9/68020/main.c
393c
procrestore(Proc *p, uchar *state)
.
390c
 *  Procsave() makes sure that what state points to is long enough
.
388c
 *  Restore what procsave() saves
.
364c
procsave(uchar *state, int len)
.
348c
procsetup(Proc *p)
.
341a
	conf.copymode = 0;		/* copy on write */
.
## diffname gnot/main.c 1991/0110
## diff -e /n/bootesdump/1990/1212/sys/src/9/68020/main.c /n/bootesdump/1991/0110/sys/src/9/68020/main.c
342a
	conf.portispaged = 0;
.
## diffname gnot/main.c 1991/0115
## diff -e /n/bootesdump/1991/0110/sys/src/9/68020/main.c /n/bootesdump/1991/0115/sys/src/9/68020/main.c
326c
	conf.nmntbuf = conf.nmntdev+6;
.
## diffname gnot/main.c 1991/0117
## diff -e /n/bootesdump/1991/0115/sys/src/9/68020/main.c /n/bootesdump/1991/0117/sys/src/9/68020/main.c
326c
	conf.nmntbuf = conf.nmntdev+3;
.
## diffname gnot/main.c 1991/0118
## diff -e /n/bootesdump/1991/0117/sys/src/9/68020/main.c /n/bootesdump/1991/0118/sys/src/9/68020/main.c
326c
	conf.nmntbuf = conf.nmntdev+5;
.
## diffname gnot/main.c 1991/0205
## diff -e /n/bootesdump/1991/0201/sys/src/9/68020/main.c /n/bootesdump/1991/0205/sys/src/9/gnot/main.c
314c
	conf.npgrp = 20*mul;
.
## diffname gnot/main.c 1991/0318
## diff -e /n/bootesdump/1991/0205/sys/src/9/gnot/main.c /n/bootesdump/1991/0318/sys/src/9/gnot/main.c
412c
		memmove(BALU, balu, sizeof balu);
.
382c
		memmove(balu, BALU, sizeof(Balu));
.
184c
	memmove((ulong*)VA(k), initcode, sizeof initcode);
.
64,65c
	memmove(bootline, BOOT->line, 64);
	memmove(bootserver, BOOT->server, 64);
.
## diffname gnot/main.c 1991/0411
## diff -e /n/bootesdump/1991/0318/sys/src/9/gnot/main.c /n/bootesdump/1991/0411/sys/src/9/gnot/main.c
127c
		(*devtab[c->type].write)(c, bootdevice, 2, 0);
.
124c
		(*devtab[c->type].write)(c, bootserver, 64, 0);
.
121c
		(*devtab[c->type].write)(c, bootline, 64, 0);
.
## diffname gnot/main.c 1991/0428
## diff -e /n/bootesdump/1991/0411/sys/src/9/gnot/main.c /n/bootesdump/1991/0428/sys/src/9/gnot/main.c
77d
## diffname gnot/main.c 1991/0605
## diff -e /n/bootesdump/1991/0428/sys/src/9/gnot/main.c /n/bootesdump/1991/0605/sys/src/9/gnot/main.c
411a
}

void
buzz(int f, int d)
{
}

void
lights(int val)
{
}

void
firmware(void)
{
	panic("you asked for it");
.
42a
	duartinit();
	screeninit();
.
## diffname gnot/main.c 1991/0608
## diff -e /n/bootesdump/1991/0605/sys/src/9/gnot/main.c /n/bootesdump/1991/0608/sys/src/9/gnot/main.c
424,429d
344a
	conf.cntrlp = 0;
.
200,202c
	firmware();
.
198a
	spllo();
	while(consactive())
		for(i=0; i<1000; i++)
			;
.
## diffname gnot/main.c 1991/0705
## diff -e /n/bootesdump/1991/0608/sys/src/9/gnot/main.c /n/bootesdump/1991/0705/sys/src/9/gnot/main.c
321d
318,319d
316a
	conf.nseg = conf.nproc*4;
	conf.npagetab = conf.nseg*2;
	conf.nswap = 4096;
	conf.nimage = 50;
.
292c
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG, 0);
.
289c
	putmmu(va, PTEVALID|(base+1)*1024L*1024L/BY2PG, 0);
.
286c
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG, 0);
.
284c
	putmmu(va, PTEVALID|(base+4)*1024L*1024L/BY2PG, 0);
.
282c
	putmmu(va, PTEVALID|(base+1)*1024L*1024L/BY2PG, 0);
.
280c
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG, 0);
.
187,188d
179,184c
	s = newseg(SG_TEXT, UTZERO, 1);
	p->seg[TSEG] = s;
	segpage(s, newpage(1, 0, UTZERO));
	k = kmap(s->map[0]->pages[0]);
.
170,174c
	s = newseg(SG_STACK, USTKTOP-BY2PG, 1);
	p->seg[SSEG] = s;
.
157c
	p->upage = newpage(1, 0, USERADDR|(p->pid&0xFFFF));
.
150d
146a
	p->egrp = newegrp();
	p->fgrp = newfgrp();

.
141c
	Segment *s;
.
131a

	kickpager();
.
92c
		putmmu(l, INVALIDPTE, 0);
.
55a
	swapinit();
.
49c
	initseg();
	grpinit();
.
## diffname gnot/main.c 1991/0710
## diff -e /n/bootesdump/1991/0705/sys/src/9/gnot/main.c /n/bootesdump/1991/0710/sys/src/9/gnot/main.c
206,271d
## diffname gnot/main.c 1991/0711
## diff -e /n/bootesdump/1991/0710/sys/src/9/gnot/main.c /n/bootesdump/1991/0711/sys/src/9/gnot/main.c
161c
	p->sched.sp = USERADDR+BY2PG-MAXSYSARG*BY2WD;
.
## diffname gnot/main.c 1991/0717
## diff -e /n/bootesdump/1991/0711/sys/src/9/gnot/main.c /n/bootesdump/1991/0717/sys/src/9/gnot/main.c
135d
## diffname gnot/main.c 1991/0719
## diff -e /n/bootesdump/1991/0717/sys/src/9/gnot/main.c /n/bootesdump/1991/0719/sys/src/9/gnot/main.c
160c
	p->sched.sp = USERADDR+BY2PG-5*BY2WD;
.
## diffname gnot/main.c 1991/0906
## diff -e /n/bootesdump/1991/0719/sys/src/9/gnot/main.c /n/bootesdump/1991/0906/sys/src/9/gnot/main.c
155a

.
154c
	strcpy(p->pgrp->user, "bootes");
	strcpy(user, "bootes");
.
122a
		c = namec("#e/bootuser", Acreate, OWRITE, 0600);
		(*devtab[c->type].write)(c, bootuser, 64, 0);
		close(c);
.
67c
	strncpy(bootuser, BOOT->user, NAMELEN);
.
26c
char	user[NAMELEN];
char bootuser[NAMELEN];
.
## diffname gnot/main.c 1991/0907
## diff -e /n/bootesdump/1991/0906/sys/src/9/gnot/main.c /n/bootesdump/1991/0907/sys/src/9/gnot/main.c
131c
		(*devtab[c->type].write)(c, bootserver, strlen(bootuser), 0);
.
125c
		(*devtab[c->type].write)(c, bootuser, strlen(bootuser), 0);
.
## diffname gnot/main.c 1991/0912
## diff -e /n/bootesdump/1991/0907/sys/src/9/gnot/main.c /n/bootesdump/1991/0912/sys/src/9/gnot/main.c
134c
		(*devtab[c->type].write)(c, bootdevice, strlen(bootdevice), 0);
.
131c
		(*devtab[c->type].write)(c, bootserver, strlen(bootserver), 0);
.
128c
		(*devtab[c->type].write)(c, bootline, strlen(bootline), 0);
.
## diffname gnot/main.c 1991/0926
## diff -e /n/bootesdump/1991/0912/sys/src/9/gnot/main.c /n/bootesdump/1991/0926/sys/src/9/gnot/main.c
137d
135a
		poperror();
.
123a
		c = namec("#e/terminal", Acreate, OWRITE, 0600);
		(*devtab[c->type].write)(c, "at&t gnot 1", strlen("at&t gnot 1"), 0);
		close(c);
		c = namec("#e/cputype", Acreate, OWRITE, 0600);
		(*devtab[c->type].write)(c, "68020", strlen("68020"), 0);
		close(c);
.
## diffname gnot/main.c 1991/0927
## diff -e /n/bootesdump/1991/0926/sys/src/9/gnot/main.c /n/bootesdump/1991/0927/sys/src/9/gnot/main.c
124,141c
		ksetenv("terminal", "at&t gnot 1");
		ksetenv("cputype", "68020");
		ksetenv("bootuser", bootuser);
		ksetenv("bootline", bootline);
		ksetenv("bootserver", bootserver);
		ksetenv("bootdevice", bootdevice);
.
## diffname gnot/main.c 1991/1101
## diff -e /n/bootesdump/1991/0927/sys/src/9/gnot/main.c /n/bootesdump/1991/1101/sys/src/9/gnot/main.c
124c
		ksetenv("terminal", "at&t gnot");
.
## diffname gnot/main.c 1991/1102
## diff -e /n/bootesdump/1991/1101/sys/src/9/gnot/main.c /n/bootesdump/1991/1102/sys/src/9/gnot/main.c
124c
		ksetterm("at&t %s");
.
## diffname gnot/main.c 1991/1105
## diff -e /n/bootesdump/1991/1102/sys/src/9/gnot/main.c /n/bootesdump/1991/1105/sys/src/9/gnot/main.c
152c
	strcpy(p->user, "bootes");
.
## diffname gnot/main.c 1991/1107
## diff -e /n/bootesdump/1991/1105/sys/src/9/gnot/main.c /n/bootesdump/1991/1107/sys/src/9/gnot/main.c
280a
	conf.dkif = 2;
.
## diffname gnot/main.c 1991/1109
## diff -e /n/bootesdump/1991/1107/sys/src/9/gnot/main.c /n/bootesdump/1991/1109/sys/src/9/gnot/main.c
152,153c
	strcpy(p->user, eve);
.
26d
## diffname gnot/main.c 1991/1112
## diff -e /n/bootesdump/1991/1109/sys/src/9/gnot/main.c /n/bootesdump/1991/1112/sys/src/9/gnot/main.c
148a
	p->procmode = 0640;
.
## diffname gnot/main.c 1991/1113
## diff -e /n/bootesdump/1991/1112/sys/src/9/gnot/main.c /n/bootesdump/1991/1113/sys/src/9/gnot/main.c
39a
	active.exiting = 0;
	active.machs = 1;
.
## diffname gnot/main.c 1991/1114
## diff -e /n/bootesdump/1991/1113/sys/src/9/gnot/main.c /n/bootesdump/1991/1114/sys/src/9/gnot/main.c
270a
	conf.nmux = 10;
.
## diffname gnot/main.c 1992/0122
## diff -e /n/bootesdump/1991/1114/sys/src/9/gnot/main.c /n/bootesdump/1992/0122/sys/src/9/gnot/main.c
352c
		memmove(BALU, balu, sizeof BALU);
.
339d
337c
	Balu *balu = (Balu *)u->balusave;
.
335c
procrestore(Proc *p)
.
310,312d
308c
	Balu *balu = (Balu *)u->balusave;
.
306c
procsave(Proc *p)
.
## diffname gnot/main.c 1992/0208
## diff -e /n/bootesdump/1992/0122/sys/src/9/gnot/main.c /n/bootesdump/1992/0208/sys/src/9/gnot/main.c
274c
	conf.nsubfont = 10*mul;
.
## diffname gnot/main.c 1992/0209
## diff -e /n/bootesdump/1992/0208/sys/src/9/gnot/main.c /n/bootesdump/1992/0209/sys/src/9/gnot/main.c
274a
	conf.nfont = 10*mul;
.
10c
#include	<libng.h>
.
## diffname gnot/main.c 1992/0211
## diff -e /n/bootesdump/1992/0209/sys/src/9/gnot/main.c /n/bootesdump/1992/0211/sys/src/9/gnot/main.c
10c
#include	<libg.h>
.
## diffname gnot/main.c 1992/0318
## diff -e /n/bootesdump/1992/0211/sys/src/9/gnot/main.c /n/bootesdump/1992/0318/sys/src/9/gnot/main.c
189a
}

uchar *
pusharg(char *p)
{
	int n;

	n = strlen(p)+1;
	sp -= n;
	memmove(sp, p, n);
	return sp;
}

void
bootargs(ulong base)
{
 	int i, ac;
	uchar *av[32];
	char *p, *pp;
	uchar **lsp;

	sp = (uchar*)base + BY2PG - MAXSYSARG*BY2WD;

	ac = 0;
	for(p = bootline; p && *p; p = pp){
		pp = strchr(p, ' ');
		if(pp)
			*pp++ = 0;
		av[ac++] = pusharg(p);
	}
	if(bootuser[0]){
		av[ac++] = pusharg("-u");
		av[ac++] = pusharg(bootuser);
	}
	av[ac++] = pusharg(bootserver);

	/* 4 byte word align stack */
	sp = (uchar*)((ulong)sp & ~3);

	/* build argc, argv on stack */
	sp -= (ac+1)*sizeof(sp);
	lsp = (uchar**)sp;
	for(i = 0; i < ac; i++)
		*lsp++ = av[i] + ((USTKTOP - BY2PG) - base);
	*lsp = 0;
	sp += (USTKTOP - BY2PG) - base - sizeof(sp);
.
177a
	pg = newpage(1, 0, USTKTOP-BY2PG);
	segpage(s, pg);
	k = kmap(pg);
	bootargs(VA(k));
	kunmap(k);
.
174c
	 * User Stack, copy in boot arguments
.
145a
	Page *pg;
.
134c
	touser(sp);
.
127,130d
71,72c
	memmove(s, BOOT->server, 64);
	switch(BOOT->device){
	case 'a':
		sprint(bootserver, "19200!%s", s);
		break;
	case 'A':
		sprint(bootserver, "9600!%s", s);
		break;
	case 'i':
		sprint(bootserver, "incon!%s", s);
		break;
	default:
		sprint(bootserver, "scsi!%s", s);
		break;
	}
.
68a
	char s[64];

.
26,30c
char	bootuser[NAMELEN];
char	bootline[64];
char	bootserver[72];
int	bank[2];
uchar	*sp;
.
14d
## diffname gnot/main.c 1992/0320
## diff -e /n/bootesdump/1992/0318/sys/src/9/gnot/main.c /n/bootesdump/1992/0320/sys/src/9/gnot/main.c
272c
	if(end > (char *)((KZERO|1024L*1024L)-BY2PG))
.
## diffname gnot/main.c 1992/0321
## diff -e /n/bootesdump/1992/0320/sys/src/9/gnot/main.c /n/bootesdump/1992/0321/sys/src/9/gnot/main.c
2c
#include	"../port/lib.h"
.
## diffname gnot/main.c 1992/0325
## diff -e /n/bootesdump/1992/0321/sys/src/9/gnot/main.c /n/bootesdump/1992/0325/sys/src/9/gnot/main.c
83a
		/* older boot ROM's don't zero out BOOT->user if it isn't set. */
		memset(bootuser, 0, sizeof(bootuser));
.
70,72c
	memmove(bootuser, BOOT->user, sizeof(bootuser)-1);
	bootuser[sizeof(bootuser)-1] = 0;
	memmove(bootline, BOOT->line, sizeof(bootline)-1);
	bootline[sizeof(bootline)-1] = 0;
	memmove(s, BOOT->server, sizeof(s) - 1);
	s[sizeof(s)-1] = 0;
.
## diffname gnot/main.c 1992/0427
## diff -e /n/bootesdump/1992/0325/sys/src/9/gnot/main.c /n/bootesdump/1992/0427/sys/src/9/gnot/main.c
341c
	conf.nsubfont = 30*mul;
.
## diffname gnot/main.c 1992/0516
## diff -e /n/bootesdump/1992/0427/sys/src/9/gnot/main.c /n/bootesdump/1992/0516/sys/src/9/gnot/main.c
142a

	kproc("alarm", alarmkproc, 0);
	chandevinit();

.
138,139d
## diffname gnot/main.c 1992/0602
## diff -e /n/bootesdump/1992/0516/sys/src/9/gnot/main.c /n/bootesdump/1992/0602/sys/src/9/gnot/main.c
53d
## diffname gnot/main.c 1992/0611
## diff -e /n/bootesdump/1992/0602/sys/src/9/gnot/main.c /n/bootesdump/1992/0611/sys/src/9/gnot/main.c
352a
	confinit1(mul);
.
## diffname gnot/main.c 1992/0621
## diff -e /n/bootesdump/1992/0611/sys/src/9/gnot/main.c /n/bootesdump/1992/0621/sys/src/9/gnot/main.c
352a

.
346,348d
335d
328,332d
322,324d
318,319d
315c
	conf.upages = (conf.npage*70)/100;

.
## diffname gnot/main.c 1992/0622
## diff -e /n/bootesdump/1992/0621/sys/src/9/gnot/main.c /n/bootesdump/1992/0622/sys/src/9/gnot/main.c
330,333d
326,328d
312,313c
	conf.npage1 = (bank[1]*MB)/BY2PG;
	conf.base1 = 16*MB;
.
310c
	conf.npage0 = (bank[0]*MB)/BY2PG;
.
293c
	putmmu(va, PTEVALID|(base+0)*MB/BY2PG, 0);
.
290c
	putmmu(va, PTEVALID|(base+1)*MB/BY2PG, 0);
.
287c
	putmmu(va, PTEVALID|(base+0)*MB/BY2PG, 0);
.
285c
	putmmu(va, PTEVALID|(base+4)*MB/BY2PG, 0);
.
283c
	putmmu(va, PTEVALID|(base+1)*MB/BY2PG, 0);
.
281c
	putmmu(va, PTEVALID|(base+0)*MB/BY2PG, 0);
.
55,56d
## diffname gnot/main.c 1992/0623
## diff -e /n/bootesdump/1992/0622/sys/src/9/gnot/main.c /n/bootesdump/1992/0623/sys/src/9/gnot/main.c
164,165c
	p->egrp = smalloc(sizeof(Egrp));
	p->egrp->ref = 1;
	p->fgrp = smalloc(sizeof(Fgrp));
	p->fgrp->ref = 1;
.
## diffname gnot/main.c 1992/0625
## diff -e /n/bootesdump/1992/0623/sys/src/9/gnot/main.c /n/bootesdump/1992/0625/sys/src/9/gnot/main.c
332d
321,328d
56d
51,52d
48a
	pageinit();
.
42a
	xinit();
.
## diffname gnot/main.c 1992/0629
## diff -e /n/bootesdump/1992/0625/sys/src/9/gnot/main.c /n/bootesdump/1992/0629/sys/src/9/gnot/main.c
322a
	conf.nconc = 2;
.
## diffname gnot/main.c 1992/0630
## diff -e /n/bootesdump/1992/0629/sys/src/9/gnot/main.c /n/bootesdump/1992/0630/sys/src/9/gnot/main.c
119a
	l = PGROUND((ulong)end);
	gscreen.base = (ulong*)l;
.
118c
	 * Screen after end
.
115c
	for(i=1,l=KTZERO; i<MB4/BY2PG; l+=BY2PG,i++)
.
105c
	ulong l, d, i, scr;
.
30a
extern	GBitmap	gscreen;

.
## diffname gnot/main.c 1992/0711
## diff -e /n/bootesdump/1992/0630/sys/src/9/gnot/main.c /n/bootesdump/1992/0711/sys/src/9/gnot/main.c
404a
	USED(val);
.
399a
	USED(f, d);
.
355a
	USED(p);
.
131,132d
107c
	ulong l, d, i;
.
## diffname gnot/main.c 1992/0715
## diff -e /n/bootesdump/1992/0711/sys/src/9/gnot/main.c /n/bootesdump/1992/0715/sys/src/9/gnot/main.c
316a

	ktop = PGROUND((ulong)end);
	ktop = PADDR(ktop);
	conf.npage0 -= ktop/BY2PG;
	conf.base0 += ktop;
.
305a
	ulong ktop;

.
## diffname gnot/main.c 1992/0720
## diff -e /n/bootesdump/1992/0715/sys/src/9/gnot/main.c /n/bootesdump/1992/0720/sys/src/9/gnot/main.c
318c

	pcnt = screenbits()-1;		/* Calculate % of memory for page pool */
	pcnt = 70 - (pcnt*10);
	conf.upages = (conf.npage*pcnt)/100;
.
305c
	int mul, pcnt;
.
## diffname gnot/main.c 1992/0725
## diff -e /n/bootesdump/1992/0720/sys/src/9/gnot/main.c /n/bootesdump/1992/0725/sys/src/9/gnot/main.c
336,337d
334d
## diffname gnot/main.c 1992/0807
## diff -e /n/bootesdump/1992/0725/sys/src/9/gnot/main.c /n/bootesdump/1992/0807/sys/src/9/gnot/main.c
310a
	conf.monitor = 1;
.
## diffname gnot/main.c 1992/0812
## diff -e /n/bootesdump/1992/0807/sys/src/9/gnot/main.c /n/bootesdump/1992/0812/sys/src/9/gnot/main.c
335c
	confinit1(mul);
.
271a
	if(ispanic)
		for(;;);
.
262c
exit(int ispanic)
.
## diffname gnot/main.c 1993/0501 # deleted
## diff -e /n/bootesdump/1992/0812/sys/src/9/gnot/main.c /n/fornaxdump/1993/0501/sys/src/brazil/gnot/main.c
1,416d

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].