9boot: add wait word

This commit is contained in:
cinap_lenrek 2011-11-09 15:26:26 +01:00
parent 29c9eb1c21
commit a4a3f519a6
3 changed files with 19 additions and 5 deletions

View file

@ -36,6 +36,12 @@ is specified, the first parameter that matches the prefix
is removed. If the
.IR prefix
argument is omitted, the whole configuration will be reset.
If the word
.B wait
appears in the configuration then
.IR 9boot
will return to the console prompt after processing the file.
The word
.B boot
will end the console and resume booting the kernel.

View file

@ -55,10 +55,11 @@ test.iso: 9bootiso
rm -fr tmp $target
mkdir tmp
mkdir tmp/386
mkdir tmp/cfg
cp 9bootiso tmp/386
cp /386/9pcf tmp/386
mkdir tmp/cfg
echo 'bootfile=/386/9pcf' >tmp/cfg/plan9.ini
cp /sys/lib/dist/cfg/plan9.ini tmp/cfg/plan9.ini
echo wait >>tmp/cfg/plan9.ini
disk/mk9660 -B 386/9bootiso -p /sys/lib/sysconfig/proto/allproto -s tmp $target
rm -fr tmp

View file

@ -189,10 +189,11 @@ char*
configure(void *f, char *path)
{
char line[64], *kern, *s, *p;
int inblock, n;
int inblock, nowait, n;
Clear:
kern = 0;
nowait = 1;
inblock = 0;
memset(BOOTLINE, 0, BOOTLINELEN);
@ -209,8 +210,14 @@ Loop:
inblock = memcmp("[common]", line, 8);
continue;
}
if(!memcmp("boot", line, 5))
if(!memcmp("boot", line, 5)){
nowait=1;
break;
}
if(!memcmp("wait", line, 5)){
nowait=0;
continue;
}
if(!memcmp("clear", line, 5)){
if(line[5] == 0){
print("ok");
@ -249,7 +256,7 @@ Loop:
close(f);
f = 0;
if(kern && timeout(1000))
if(kern && (nowait==0 || timeout(1000)))
goto Loop;
}