mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-26 16:18:31 +00:00
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.
This commit is contained in:
parent
b4e6f7299c
commit
960710e6ea
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16989
@ -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}
|
||||
};
|
||||
|
||||
@ -283,6 +285,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
|
||||
**************************************************************************/
|
||||
|
@ -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 @@ load()
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user