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 is removed. If the
.IR prefix .IR prefix
argument is omitted, the whole configuration will be reset. 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 The word
.B boot .B boot
will end the console and resume booting the kernel. will end the console and resume booting the kernel.

View file

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

View file

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