M boot/key.c => boot/key.c +8 -3
@@ 26,16 26,21 @@ getsafe(char *field, int len, uchar *sum, char *file, int pass)
void
key(int islocal, Method *mp)
{
- int fd;
+ int fd, safeoff;
Nvrsafe safe;
char password[20];
USED(islocal);
USED(mp);
+ if(strcmp(cputype, "sparc") == 0)
+ safeoff = 1024+850;
+ else
+ safeoff = 1024+900;
+
fd = open("#r/nvram", ORDWR);
if(fd < 0
- || seek(fd, 1024+900, 0) < 0
+ || seek(fd, safeoff, 0) < 0
|| read(fd, &safe, sizeof safe) != sizeof safe){
memset(&safe, 0, sizeof(safe));
warning("can't read nvram");
@@ 55,7 60,7 @@ key(int islocal, Method *mp)
safe.machsum = nvcsum(safe.machkey, DESKEYLEN);
safe.authidsum = nvcsum(safe.authid, sizeof(safe.authid));
safe.authdomsum = nvcsum(safe.authdom, sizeof(safe.authdom));
- if(seek(fd, 1024+900, 0) < 0
+ if(seek(fd, safeoff, 0) < 0
|| write(fd, &safe, sizeof safe) != sizeof safe)
warning("can't write key to nvram");
}
M pc/main.c => pc/main.c +28 -26
@@ 238,12 238,37 @@ Conf conf;
void
confinit(void)
{
- long x, i, j, *l;
+ long x, i, j, n, *l;
int pcnt;
ulong ktop;
char *cp;
char *line[MAXCONF];
+ pcnt = 0;
+
+ /*
+ * parse configuration args from dos file p9rc
+ */
+ cp = BOOTARGS; /* where b.com leaves it's config */
+ cp[BOOTARGSLEN-1] = 0;
+ n = getfields(cp, line, MAXCONF, '\n');
+ for(j = 0; j < n; j++){
+ cp = strchr(line[j], '\r');
+ if(cp)
+ *cp = 0;
+ cp = strchr(line[j], '=');
+ if(cp == 0)
+ continue;
+ *cp++ = 0;
+ if(cp - line[j] >= NAMELEN+1)
+ *(line[j]+NAMELEN-1) = 0;
+ confname[nconf] = line[j];
+ confval[nconf] = cp;
+ if(strcmp(confname[nconf], "kernelpercent") == 0)
+ pcnt = 100 - atoi(confval[nconf]);
+ nconf++;
+ }
+
/*
* the first 640k is the standard useful memory
* the next 128K is the display, I/O mem, and BIOS
@@ 285,10 310,9 @@ confinit(void)
conf.base1 = 1*MB;
conf.npage1 = (i*MB - conf.base1)/BY2PG;
conf.npage = conf.npage0 + conf.npage1;
-
conf.ldepth = 0;
- pcnt = (1<<conf.ldepth)-1; /* Calculate % of memory for page pool */
- pcnt = 70 - (pcnt*10);
+ if(pcnt < 10)
+ pcnt = 70;
conf.upages = (conf.npage*pcnt)/100;
ktop = PGROUND((ulong)end);
@@ 305,28 329,6 @@ confinit(void)
conf.nfloppy = 2;
conf.nhard = 2;
conf.nmach = 1;
-
- /*
- * parse configuration args from dos file p9rc
- */
- cp = BOOTARGS; /* where b.com leaves it's config */
- cp[BOOTARGSLEN-1] = 0;
- i = getfields(cp, line, MAXCONF, '\n');
- for(j = 0; j < i; j++){
- cp = strchr(line[j], '\r');
- if(cp)
- *cp = 0;
- cp = strchr(line[j], '=');
- if(cp == 0)
- continue;
- *cp++ = 0;
- if(cp - line[j] >= NAMELEN+1)
- *(line[j]+NAMELEN-1) = 0;
- confname[nconf] = line[j];
- confval[nconf] = cp;
- nconf++;
- }
-
}
char *mathmsg[] =
M power/fptrap.c => power/fptrap.c +2 -0
@@ 28,10 28,12 @@ void
fptrap(Ureg *ur)
{
ulong iw, iw_4, npc;
+ static int counter;
if((u->fpsave.fpstatus&(1<<17)) == 0)
return;
+if((counter&0xff) == 0)
print("fpt: %d %s %lux %lux\n", u->p->pid, u->p->text, u->fpsave.fpstatus, ur->pc);
if(tlbp(ur->pc) == 0)
M ss/main.c => ss/main.c +3 -2
@@ 343,6 343,7 @@ confinit(void)
* keyboard, too.
*/
switch(idprom[1]){
+ case 0x52: /* IPC */
case 0x54: /* SLC */
conf.monitor = 1;
fbslot = 3;
@@ 418,6 419,7 @@ confinit(void)
for(i=0; i<sparam->memscan; i++)
if(mempres[i]){
v = mempres[i];
+ i = v-'0';
for(j=i+1; j<sparam->memscan && mempres[j]>v; j++)
v = mempres[j];
npg = (j-i)*MB/BY2PG;
@@ 442,9 444,8 @@ confinit(void)
* NB. Suns must have at LEAST 8Mbytes.
*/
conf.npage1 = conf.npage0 - (8*MB)/BY2PG;
- conf.base1 = 8*MB;
+ conf.base1 = conf.base0 + 8*MB;
conf.npage0 = (8*MB)/BY2PG;
- conf.base0 = 0;
bank[1] = bank[0]-8;
bank[0] = 8;
}