diff options
author | joerg <joerg@FreeBSD.org> | 1996-07-06 14:18:56 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-07-06 14:18:56 +0000 |
commit | e4d7a0d7a13415d13052400a25e6463452bde107 (patch) | |
tree | 0022238147f0a193c09184aad9fd80233159720f /sys/i386/boot/netboot | |
parent | ca4edbc50f6a1700bb4347fc8b1cb3bcbf2a75c0 (diff) | |
download | FreeBSD-src-e4d7a0d7a13415d13052400a25e6463452bde107.zip FreeBSD-src-e4d7a0d7a13415d13052400a25e6463452bde107.tar.gz |
Add the ability to specify bootflags. This is similar to boot_i386(8),
except for the root f/s options that don't seem to be useful.
Diffstat (limited to 'sys/i386/boot/netboot')
-rw-r--r-- | sys/i386/boot/netboot/bootmenu.c | 30 | ||||
-rw-r--r-- | sys/i386/boot/netboot/main.c | 4 |
2 files changed, 31 insertions, 3 deletions
diff --git a/sys/i386/boot/netboot/bootmenu.c b/sys/i386/boot/netboot/bootmenu.c index a67ac93..d8f2330 100644 --- a/sys/i386/boot/netboot/bootmenu.c +++ b/sys/i386/boot/netboot/bootmenu.c @@ -12,11 +12,12 @@ extern int hostnamelen; extern unsigned long netmask; extern eth_reset(); extern short aui; +extern int howto; int cmd_ip(), cmd_server(), cmd_kernel(), cmd_help(), exit(); int cmd_rootfs(), cmd_swapfs(), cmd_interface(), cmd_hostname(); int cmd_netmask(), cmd_swapsize(), cmd_swapopts(), cmd_rootopts(); -int cmd_aui(), cmd_gateway(); +int cmd_aui(), cmd_gateway(), cmd_flags(); struct bootcmds_t { char *name; @@ -39,6 +40,7 @@ struct bootcmds_t { {"diskboot", exit, " boot from disk"}, {"autoboot", NULL, " continue"}, {"trans", cmd_aui, "<on|off> turn transceiver on|off"}, + {"flags", cmd_flags, "[bcdhsv] set boot flags"}, {NULL, NULL, NULL} }; @@ -284,6 +286,32 @@ cmd_swapopts(p) } /************************************************************************** +CMD_FLAGS - Set boot flags +**************************************************************************/ +cmd_flags(buf) + char *buf; +{ + char p; + int flags = 0; + + while ((p = *buf++)) + switch (p) { + case 'b': flags |= RB_HALT; break; + case 'c': flags |= RB_CONFIG; break; + case 'd': flags |= RB_KDB; break; + case 'h': flags ^= RB_SERIAL; break; + case 's': flags |= RB_SINGLE; break; + case 'v': flags |= RB_VERBOSE; break; + case ' ': + case '\t': break; + default: printf("Unknown boot flag: %c\n", p); + } + + howto = flags; + return(0); +} + +/************************************************************************** EXECUTE - Decode command **************************************************************************/ execute(buf) diff --git a/sys/i386/boot/netboot/main.c b/sys/i386/boot/netboot/main.c index 0ff7c3d..daa42e7 100644 --- a/sys/i386/boot/netboot/main.c +++ b/sys/i386/boot/netboot/main.c @@ -24,7 +24,7 @@ struct bootinfo bootinfo; int root_nfs_port; unsigned long netmask; char kernel_handle[32]; -int offset; +int offset, howto; extern char eth_driver[]; extern char packet[]; @@ -316,7 +316,7 @@ cfg_done: bootinfo.bi_nfs_diskless = &nfsdiskless; bootinfo.bi_size = sizeof bootinfo; kernelentry = (void *)(head.a_entry & 0x00FFFFFF); - (*kernelentry)(RB_BOOTINFO,NODEV,0,0,0,&bootinfo,0,0,0); + (*kernelentry)(howto|RB_BOOTINFO,NODEV,0,0,0,&bootinfo,0,0,0); printf("*** %s execute failure ***\n",kernel); } |