Changeset View
Changeset View
Standalone View
Standalone View
stand/userboot/userboot/bootinfo64.c
| Show First 20 Lines • Show All 176 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_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) | bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) | ||||
| { | { | ||||
| struct preloaded_file *xp, *kfp; | struct preloaded_file *xp, *kfp; | ||||
| struct userboot_devdesc *rootdev; | struct devdesc *rootdev; | ||||
| struct file_metadata *md; | struct file_metadata *md; | ||||
| vm_offset_t addr; | vm_offset_t addr; | ||||
| uint64_t kernend; | uint64_t kernend; | ||||
| uint64_t envp; | uint64_t envp; | ||||
| vm_offset_t size; | vm_offset_t size; | ||||
| char *rootdevname; | char *rootdevname; | ||||
| int howto; | int howto; | ||||
| Show All 12 Lines | return (EINVAL); | ||||
| 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)); | ||||
| /* 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) { | ||||
| if (addr < (xp->f_addr + xp->f_size)) | if (addr < (xp->f_addr + xp->f_size)) | ||||
| addr = xp->f_addr + xp->f_size; | addr = xp->f_addr + xp->f_size; | ||||
| } | } | ||||
| /* pad to a page boundary */ | /* pad to a page boundary */ | ||||
| Show All 35 Lines | |||||