Changeset View
Changeset View
Standalone View
Standalone View
stand/userboot/userboot/bootinfo32.c
| Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | |||||
| * - The 'bootinfo' struct is constructed, and copied into the kernel space. | * - The 'bootinfo' struct is constructed, and copied into the kernel space. | ||||
| * - The kernel environment is copied into kernel space. | * - The kernel environment is copied into kernel space. | ||||
| * - Module metadata are formatted and placed in kernel space. | * - Module metadata are formatted and placed in kernel space. | ||||
| */ | */ | ||||
| int | int | ||||
| bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernendp) | bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernendp) | ||||
| { | { | ||||
| struct preloaded_file *xp, *kfp; | struct preloaded_file *xp, *kfp; | ||||
| struct i386_devdesc *rootdev; | struct devdesc *rootdev; | ||||
| struct file_metadata *md; | struct file_metadata *md; | ||||
| vm_offset_t addr; | vm_offset_t addr; | ||||
| vm_offset_t kernend; | vm_offset_t kernend; | ||||
| vm_offset_t envp; | vm_offset_t envp; | ||||
| vm_offset_t size; | vm_offset_t size; | ||||
| vm_offset_t ssym, esym; | vm_offset_t ssym, esym; | ||||
| char *rootdevname; | char *rootdevname; | ||||
| int bootdevnr, howto; | int bootdevnr, howto; | ||||
| Show All 11 Lines | bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernendp) | ||||
| rootdevname = getenv("rootdev"); | rootdevname = getenv("rootdev"); | ||||
| userboot_getdev((void **)(&rootdev), rootdevname, NULL); | userboot_getdev((void **)(&rootdev), rootdevname, NULL); | ||||
| if (rootdev == NULL) { /* bad $rootdev/$currdev */ | if (rootdev == NULL) { /* bad $rootdev/$currdev */ | ||||
| printf("can't determine root device\n"); | printf("can't determine root device\n"); | ||||
| return(EINVAL); | return(EINVAL); | ||||
| } | } | ||||
| /* Try reading the /etc/fstab file to select the root device */ | /* Try reading the /etc/fstab file to select the root device */ | ||||
| getrootmount(userboot_fmtdev((void *)rootdev)); | getrootmount(devformat(rootdev)); | ||||
| bootdevnr = 0; | bootdevnr = 0; | ||||
| #if 0 | #if 0 | ||||
| if (bootdevnr == -1) { | if (bootdevnr == -1) { | ||||
| printf("root device %s invalid\n", i386_fmtdev(rootdev)); | printf("root device %s invalid\n", devformat(rootdev)); | ||||
| return (EINVAL); | return (EINVAL); | ||||
| } | } | ||||
| #endif | #endif | ||||
| free(rootdev); | free(rootdev); | ||||
| /* find the last module in the chain */ | /* find the last module in the chain */ | ||||
| addr = 0; | addr = 0; | ||||
| for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { | for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { | ||||
| ▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines | |||||