summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/boot.c
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>2000-05-01 17:41:25 +0000
committerbp <bp@FreeBSD.org>2000-05-01 17:41:25 +0000
commit816e92565a65b81ec26724758fea6f694964d18f (patch)
tree1dc1dbf863d6b27d97804bdaca0c1d05f196c481 /sys/boot/common/boot.c
parent222439bc50eba6251adfdfbf06fc7474d33911ad (diff)
downloadFreeBSD-src-816e92565a65b81ec26724758fea6f694964d18f.zip
FreeBSD-src-816e92565a65b81ec26724758fea6f694964d18f.tar.gz
Update loader logic to distinguish modules vs. files.
Add support for module metadata. The old way of dependancy handling will be supported for a while. Reviewed by: peter
Diffstat (limited to 'sys/boot/common/boot.c')
-rw-r--r--sys/boot/common/boot.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/boot/common/boot.c b/sys/boot/common/boot.c
index 4fded2c..e4d0583 100644
--- a/sys/boot/common/boot.c
+++ b/sys/boot/common/boot.c
@@ -50,7 +50,7 @@ COMMAND_SET(boot, "boot", "boot a file or loaded kernel", command_boot);
static int
command_boot(int argc, char *argv[])
{
- struct loaded_module *km;
+ struct preloaded_file *fp;
char *cp;
int try;
int i;
@@ -61,7 +61,7 @@ command_boot(int argc, char *argv[])
if ((argc > 1) && (argv[1][0] != '-')) {
/* XXX maybe we should discard everything and start again? */
- if (mod_findmodule(NULL, NULL) != NULL) {
+ if (file_findfile(NULL, NULL) != NULL) {
sprintf(command_errbuf, "can't boot '%s', kernel module already loaded", argv[1]);
return(CMD_ERROR);
}
@@ -76,7 +76,7 @@ command_boot(int argc, char *argv[])
/*
* See if there is a kernel module already loaded
*/
- if (mod_findmodule(NULL, NULL) == NULL) {
+ if (file_findfile(NULL, NULL) == NULL) {
for (try = 0; (cp = getbootfile(try)) != NULL; try++) {
if (mod_load(cp, argc - 1, argv + 1) != 0) {
printf("can't load '%s'\n", cp);
@@ -91,7 +91,7 @@ command_boot(int argc, char *argv[])
/*
* Loaded anything yet?
*/
- if ((km = mod_findmodule(NULL, NULL)) == NULL) {
+ if ((fp = file_findfile(NULL, NULL)) == NULL) {
command_errmsg = "no bootable kernel";
return(CMD_ERROR);
}
@@ -101,9 +101,9 @@ command_boot(int argc, char *argv[])
* XXX should we merge arguments? Hard to DWIM.
*/
if (argc > 1) {
- if (km->m_args != NULL)
- free(km->m_args);
- km->m_args = unargv(argc - 1, argv + 1);
+ if (fp->f_args != NULL)
+ free(fp->f_args);
+ fp->f_args = unargv(argc - 1, argv + 1);
}
/* Hook for platform-specific autoloading of modules */
@@ -116,7 +116,7 @@ command_boot(int argc, char *argv[])
(devsw[i]->dv_cleanup)();
/* Call the exec handler from the loader matching the kernel */
- module_formats[km->m_loader]->l_exec(km);
+ file_formats[fp->f_loader]->l_exec(fp);
return(CMD_ERROR);
}
OpenPOWER on IntegriCloud