summaryrefslogtreecommitdiff
path: root/sys/src/9
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-06-04 08:07:21 +0000
committercinap_lenrek <cinap_lenrek@centraldogma>2011-06-04 08:07:21 +0000
commit7827e7ae6f82ebdbe127b50cdbea411a55ec5cf4 (patch)
treebdabf7134b8e116b9ef49e176f39f68c3309f957 /sys/src/9
parentf55d5517ed35c21b26c3e5eb0211f9a02f341ee1 (diff)
cleanup boot(8), replace read(1), fix cpu kernel configs
Diffstat (limited to 'sys/src/9')
-rw-r--r--sys/src/9/boot/aux.c24
-rw-r--r--sys/src/9/boot/boot.c32
-rw-r--r--sys/src/9/boot/bootrc2
-rw-r--r--sys/src/9/kw/plug2
-rw-r--r--sys/src/9/omap/beagle2
-rw-r--r--sys/src/9/pc/pccpuf2
-rw-r--r--sys/src/9/port/bootfs.proto1
7 files changed, 9 insertions, 56 deletions
diff --git a/sys/src/9/boot/aux.c b/sys/src/9/boot/aux.c
index 7499c9051..2c7c64af0 100644
--- a/sys/src/9/boot/aux.c
+++ b/sys/src/9/boot/aux.c
@@ -84,27 +84,3 @@ setenv(char *name, char *val, int ec)
write(f, val, strlen(val));
close(f);
}
-
-void
-srvcreate(char *name, int fd)
-{
- char *srvname;
- int f;
- char buf[64];
-
- srvname = strrchr(name, '/');
- if(srvname)
- srvname++;
- else
- srvname = name;
-
- snprint(buf, sizeof buf, "#s/%s", srvname);
- f = create(buf, 1, 0666);
- if(f < 0)
- fatal(buf);
- sprint(buf, "%d", fd);
- if(write(f, buf, strlen(buf)) != strlen(buf))
- fatal("write");
- close(f);
-}
-
diff --git a/sys/src/9/boot/boot.c b/sys/src/9/boot/boot.c
index 496dbd665..d4950f475 100644
--- a/sys/src/9/boot/boot.c
+++ b/sys/src/9/boot/boot.c
@@ -5,8 +5,6 @@
#include "../boot/boot.h"
char cputype[64];
-char reply[256];
-int printcol;
int mflag;
int fflag;
int kflag;
@@ -14,8 +12,6 @@ int kflag;
void
boot(int argc, char *argv[])
{
- Waitmsg *w;
- int pid, i;
char buf[32];
fmtinstall('r', errfmt);
@@ -33,6 +29,8 @@ boot(int argc, char *argv[])
bind("#s", "/srv", MREPL|MCREATE);
if(Debug){
+ int i;
+
print("argc=%d\n", argc);
for(i = 0; i < argc; i++)
print("%lux %s ", (ulong)argv[i], argv[i]);
@@ -53,7 +51,8 @@ boot(int argc, char *argv[])
readfile("#e/cputype", cputype, sizeof(cputype));
setenv("bootdisk", bootdisk, 0);
-
+ setenv("cpuflag", cpuflag ? "1" : "0", 0);
+
/* setup the boot namespace */
bind("/boot", "/bin", MAFTER);
run("/bin/paqfs", "-q", "-c", "8", "-m" "/root", "/boot/bootfs.paq", nil);
@@ -61,26 +60,5 @@ boot(int argc, char *argv[])
snprint(buf, sizeof(buf), "/%s/bin", cputype);
bind(buf, "/bin", MAFTER);
bind("/rc/bin", "/bin", MAFTER);
-
- switch(pid = rfork(RFFDG|RFREND|RFPROC)){
- case -1:
- fatal("fork error");
- case 0:
- setenv("cpuflag", cpuflag ? "1" : "0", 0);
- run("/bin/rc", "/rc/bin/bootrc", nil);
- break;
- default:
- while((w = wait()) != nil)
- if(w->pid == pid)
- break;
- if(w == nil){
- free(w);
- fatal("wait error");
- }
- free(w);
- break;
- }
-
- for(;;)
- ;
+ run("/bin/bootrc", nil);
}
diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc
index f8f238df8..5b745483c 100644
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -34,7 +34,7 @@ fn ask {
echo -n $3
echo -n '] '
}
- $1=`{read}
+ $1=`{dd -bs 64 -count 1 >[2]/dev/null}
if(~ $#$1 0)
$1=$3
if(~ $"$1 '!rc'){
diff --git a/sys/src/9/kw/plug b/sys/src/9/kw/plug
index b20e221e6..aa13a138f 100644
--- a/sys/src/9/kw/plug
+++ b/sys/src/9/kw/plug
@@ -66,7 +66,7 @@ port
int cpuserver = 1;
int i8250freq = 3686000;
-boot boot
+boot cpu
tcp
local
diff --git a/sys/src/9/omap/beagle b/sys/src/9/omap/beagle
index ea238d55a..67fcf9ef0 100644
--- a/sys/src/9/omap/beagle
+++ b/sys/src/9/omap/beagle
@@ -69,7 +69,7 @@ port
int cpuserver = 1;
int i8250freq = 3686000;
-boot boot
+boot cpu
tcp
local
diff --git a/sys/src/9/pc/pccpuf b/sys/src/9/pc/pccpuf
index 38403cd40..42ea02ea4 100644
--- a/sys/src/9/pc/pccpuf
+++ b/sys/src/9/pc/pccpuf
@@ -118,7 +118,7 @@ ip
port
int cpuserver = 1;
-boot boot
+boot cpu
tcp
local
diff --git a/sys/src/9/port/bootfs.proto b/sys/src/9/port/bootfs.proto
index 696e85498..9b195a2e6 100644
--- a/sys/src/9/port/bootfs.proto
+++ b/sys/src/9/port/bootfs.proto
@@ -23,7 +23,6 @@ $cputype
mntgen
mount
rc
- read
rm
sed
srv