1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 *
| 1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 *
|
26 * $FreeBSD: head/sys/boot/i386/libi386/bootinfo32.c 59087 2000-04-08 01:22:14Z ps $
| 26 * $FreeBSD: head/sys/boot/i386/libi386/bootinfo32.c 59854 2000-05-01 17:41:25Z bp $
|
27 */ 28 29#include <stand.h> 30#include <sys/param.h> 31#include <sys/reboot.h> 32#include <sys/linker.h> 33#include <machine/bootinfo.h> 34#include "bootstrap.h" 35#include "libi386.h" 36#include "btxv86.h" 37 38static struct bootinfo bi; 39 40/* 41 * Return a 'boothowto' value corresponding to the kernel arguments in 42 * (kargs) and any relevant environment variables. 43 */ 44static struct 45{ 46 char *ev; 47 int mask; 48} howto_names[] = { 49 {"boot_askname", RB_ASKNAME}, 50 {"boot_cdrom", RB_CDROM}, 51 {"boot_userconfig", RB_CONFIG}, 52 {"boot_ddb", RB_KDB}, 53 {"boot_gdb", RB_GDB}, 54 {"boot_single", RB_SINGLE}, 55 {"boot_verbose", RB_VERBOSE}, 56 {NULL, 0} 57}; 58 59int 60bi_getboothowto(char *kargs) 61{ 62 char *cp; 63 int howto; 64 int active; 65 int i; 66 67 /* Parse kargs */ 68 howto = 0; 69 if (kargs != NULL) { 70 cp = kargs; 71 active = 0; 72 while (*cp != 0) { 73 if (!active && (*cp == '-')) { 74 active = 1; 75 } else if (active) 76 switch (*cp) { 77 case 'a': 78 howto |= RB_ASKNAME; 79 break; 80 case 'c': 81 howto |= RB_CONFIG; 82 break; 83 case 'C': 84 howto |= RB_CDROM; 85 break; 86 case 'd': 87 howto |= RB_KDB; 88 break; 89 case 'g': 90 howto |= RB_GDB; 91 break; 92 case 'h': 93 howto |= RB_SERIAL; 94 break; 95 case 'r': 96 howto |= RB_DFLTROOT; 97 break; 98 case 's': 99 howto |= RB_SINGLE; 100 break; 101 case 'v': 102 howto |= RB_VERBOSE; 103 break; 104 default: 105 active = 0; 106 break; 107 } 108 cp++; 109 } 110 } 111 /* get equivalents from the environment */ 112 for (i = 0; howto_names[i].ev != NULL; i++) 113 if (getenv(howto_names[i].ev) != NULL) 114 howto |= howto_names[i].mask; 115 if (!strcmp(getenv("console"), "comconsole")) 116 howto |= RB_SERIAL; 117 return(howto); 118} 119 120/* 121 * Copy the environment into the load area starting at (addr). 122 * Each variable is formatted as <name>=<value>, with a single nul 123 * separating each variable, and a double nul terminating the environment. 124 */ 125vm_offset_t 126bi_copyenv(vm_offset_t addr) 127{ 128 struct env_var *ep; 129 130 /* traverse the environment */ 131 for (ep = environ; ep != NULL; ep = ep->ev_next) { 132 i386_copyin(ep->ev_name, addr, strlen(ep->ev_name)); 133 addr += strlen(ep->ev_name); 134 i386_copyin("=", addr, 1); 135 addr++; 136 if (ep->ev_value != NULL) { 137 i386_copyin(ep->ev_value, addr, strlen(ep->ev_value)); 138 addr += strlen(ep->ev_value); 139 } 140 i386_copyin("", addr, 1); 141 addr++; 142 } 143 i386_copyin("", addr, 1); 144 addr++; 145 return(addr); 146} 147 148/* 149 * Copy module-related data into the load area, where it can be 150 * used as a directory for loaded modules. 151 * 152 * Module data is presented in a self-describing format. Each datum 153 * is preceeded by a 32-bit identifier and a 32-bit size field. 154 * 155 * Currently, the following data are saved: 156 * 157 * MOD_NAME (variable) module name (string) 158 * MOD_TYPE (variable) module type (string) 159 * MOD_ARGS (variable) module parameters (string) 160 * MOD_ADDR sizeof(vm_offset_t) module load address 161 * MOD_SIZE sizeof(size_t) module size 162 * MOD_METADATA (variable) type-specific metadata 163 */ 164#define COPY32(v, a) { \ 165 u_int32_t x = (v); \ 166 i386_copyin(&x, a, sizeof(x)); \ 167 a += sizeof(x); \ 168} 169 170#define MOD_STR(t, a, s) { \ 171 COPY32(t, a); \ 172 COPY32(strlen(s) + 1, a); \ 173 i386_copyin(s, a, strlen(s) + 1); \ 174 a += roundup(strlen(s) + 1, sizeof(u_long));\ 175} 176 177#define MOD_NAME(a, s) MOD_STR(MODINFO_NAME, a, s) 178#define MOD_TYPE(a, s) MOD_STR(MODINFO_TYPE, a, s) 179#define MOD_ARGS(a, s) MOD_STR(MODINFO_ARGS, a, s) 180 181#define MOD_VAR(t, a, s) { \ 182 COPY32(t, a); \ 183 COPY32(sizeof(s), a); \ 184 i386_copyin(&s, a, sizeof(s)); \ 185 a += roundup(sizeof(s), sizeof(u_long)); \ 186} 187 188#define MOD_ADDR(a, s) MOD_VAR(MODINFO_ADDR, a, s) 189#define MOD_SIZE(a, s) MOD_VAR(MODINFO_SIZE, a, s) 190 191#define MOD_METADATA(a, mm) { \ 192 COPY32(MODINFO_METADATA | mm->md_type, a); \ 193 COPY32(mm->md_size, a); \ 194 i386_copyin(mm->md_data, a, mm->md_size); \ 195 a += roundup(mm->md_size, sizeof(u_long));\ 196} 197 198#define MOD_END(a) { \ 199 COPY32(MODINFO_END, a); \ 200 COPY32(0, a); \ 201} 202 203vm_offset_t 204bi_copymodules(vm_offset_t addr) 205{
| 27 */ 28 29#include <stand.h> 30#include <sys/param.h> 31#include <sys/reboot.h> 32#include <sys/linker.h> 33#include <machine/bootinfo.h> 34#include "bootstrap.h" 35#include "libi386.h" 36#include "btxv86.h" 37 38static struct bootinfo bi; 39 40/* 41 * Return a 'boothowto' value corresponding to the kernel arguments in 42 * (kargs) and any relevant environment variables. 43 */ 44static struct 45{ 46 char *ev; 47 int mask; 48} howto_names[] = { 49 {"boot_askname", RB_ASKNAME}, 50 {"boot_cdrom", RB_CDROM}, 51 {"boot_userconfig", RB_CONFIG}, 52 {"boot_ddb", RB_KDB}, 53 {"boot_gdb", RB_GDB}, 54 {"boot_single", RB_SINGLE}, 55 {"boot_verbose", RB_VERBOSE}, 56 {NULL, 0} 57}; 58 59int 60bi_getboothowto(char *kargs) 61{ 62 char *cp; 63 int howto; 64 int active; 65 int i; 66 67 /* Parse kargs */ 68 howto = 0; 69 if (kargs != NULL) { 70 cp = kargs; 71 active = 0; 72 while (*cp != 0) { 73 if (!active && (*cp == '-')) { 74 active = 1; 75 } else if (active) 76 switch (*cp) { 77 case 'a': 78 howto |= RB_ASKNAME; 79 break; 80 case 'c': 81 howto |= RB_CONFIG; 82 break; 83 case 'C': 84 howto |= RB_CDROM; 85 break; 86 case 'd': 87 howto |= RB_KDB; 88 break; 89 case 'g': 90 howto |= RB_GDB; 91 break; 92 case 'h': 93 howto |= RB_SERIAL; 94 break; 95 case 'r': 96 howto |= RB_DFLTROOT; 97 break; 98 case 's': 99 howto |= RB_SINGLE; 100 break; 101 case 'v': 102 howto |= RB_VERBOSE; 103 break; 104 default: 105 active = 0; 106 break; 107 } 108 cp++; 109 } 110 } 111 /* get equivalents from the environment */ 112 for (i = 0; howto_names[i].ev != NULL; i++) 113 if (getenv(howto_names[i].ev) != NULL) 114 howto |= howto_names[i].mask; 115 if (!strcmp(getenv("console"), "comconsole")) 116 howto |= RB_SERIAL; 117 return(howto); 118} 119 120/* 121 * Copy the environment into the load area starting at (addr). 122 * Each variable is formatted as <name>=<value>, with a single nul 123 * separating each variable, and a double nul terminating the environment. 124 */ 125vm_offset_t 126bi_copyenv(vm_offset_t addr) 127{ 128 struct env_var *ep; 129 130 /* traverse the environment */ 131 for (ep = environ; ep != NULL; ep = ep->ev_next) { 132 i386_copyin(ep->ev_name, addr, strlen(ep->ev_name)); 133 addr += strlen(ep->ev_name); 134 i386_copyin("=", addr, 1); 135 addr++; 136 if (ep->ev_value != NULL) { 137 i386_copyin(ep->ev_value, addr, strlen(ep->ev_value)); 138 addr += strlen(ep->ev_value); 139 } 140 i386_copyin("", addr, 1); 141 addr++; 142 } 143 i386_copyin("", addr, 1); 144 addr++; 145 return(addr); 146} 147 148/* 149 * Copy module-related data into the load area, where it can be 150 * used as a directory for loaded modules. 151 * 152 * Module data is presented in a self-describing format. Each datum 153 * is preceeded by a 32-bit identifier and a 32-bit size field. 154 * 155 * Currently, the following data are saved: 156 * 157 * MOD_NAME (variable) module name (string) 158 * MOD_TYPE (variable) module type (string) 159 * MOD_ARGS (variable) module parameters (string) 160 * MOD_ADDR sizeof(vm_offset_t) module load address 161 * MOD_SIZE sizeof(size_t) module size 162 * MOD_METADATA (variable) type-specific metadata 163 */ 164#define COPY32(v, a) { \ 165 u_int32_t x = (v); \ 166 i386_copyin(&x, a, sizeof(x)); \ 167 a += sizeof(x); \ 168} 169 170#define MOD_STR(t, a, s) { \ 171 COPY32(t, a); \ 172 COPY32(strlen(s) + 1, a); \ 173 i386_copyin(s, a, strlen(s) + 1); \ 174 a += roundup(strlen(s) + 1, sizeof(u_long));\ 175} 176 177#define MOD_NAME(a, s) MOD_STR(MODINFO_NAME, a, s) 178#define MOD_TYPE(a, s) MOD_STR(MODINFO_TYPE, a, s) 179#define MOD_ARGS(a, s) MOD_STR(MODINFO_ARGS, a, s) 180 181#define MOD_VAR(t, a, s) { \ 182 COPY32(t, a); \ 183 COPY32(sizeof(s), a); \ 184 i386_copyin(&s, a, sizeof(s)); \ 185 a += roundup(sizeof(s), sizeof(u_long)); \ 186} 187 188#define MOD_ADDR(a, s) MOD_VAR(MODINFO_ADDR, a, s) 189#define MOD_SIZE(a, s) MOD_VAR(MODINFO_SIZE, a, s) 190 191#define MOD_METADATA(a, mm) { \ 192 COPY32(MODINFO_METADATA | mm->md_type, a); \ 193 COPY32(mm->md_size, a); \ 194 i386_copyin(mm->md_data, a, mm->md_size); \ 195 a += roundup(mm->md_size, sizeof(u_long));\ 196} 197 198#define MOD_END(a) { \ 199 COPY32(MODINFO_END, a); \ 200 COPY32(0, a); \ 201} 202 203vm_offset_t 204bi_copymodules(vm_offset_t addr) 205{
|
206 struct loaded_module *mp; 207 struct module_metadata *md;
| 206 struct preloaded_file *fp; 207 struct file_metadata *md;
|
208 209 /* start with the first module on the list, should be the kernel */
| 208 209 /* start with the first module on the list, should be the kernel */
|
210 for (mp = mod_findmodule(NULL, NULL); mp != NULL; mp = mp->m_next) {
| 210 for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) {
|
211
| 211
|
212 MOD_NAME(addr, mp->m_name); /* this field must come first */ 213 MOD_TYPE(addr, mp->m_type); 214 if (mp->m_args) 215 MOD_ARGS(addr, mp->m_args); 216 MOD_ADDR(addr, mp->m_addr); 217 MOD_SIZE(addr, mp->m_size); 218 for (md = mp->m_metadata; md != NULL; md = md->md_next)
| 212 MOD_NAME(addr, fp->f_name); /* this field must come first */ 213 MOD_TYPE(addr, fp->f_type); 214 if (fp->f_args) 215 MOD_ARGS(addr, fp->f_args); 216 MOD_ADDR(addr, fp->f_addr); 217 MOD_SIZE(addr, fp->f_size); 218 for (md = fp->f_metadata; md != NULL; md = md->md_next)
|
219 if (!(md->md_type & MODINFOMD_NOCOPY)) 220 MOD_METADATA(addr, md); 221 } 222 MOD_END(addr); 223 return(addr); 224} 225 226/* 227 * Load the information expected by an i386 kernel. 228 * 229 * - The 'boothowto' argument is constructed 230 * - The 'botdev' argument is constructed 231 * - The 'bootinfo' struct is constructed, and copied into the kernel space. 232 * - The kernel environment is copied into kernel space. 233 * - Module metadata are formatted and placed in kernel space. 234 */ 235int 236bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip) 237{
| 219 if (!(md->md_type & MODINFOMD_NOCOPY)) 220 MOD_METADATA(addr, md); 221 } 222 MOD_END(addr); 223 return(addr); 224} 225 226/* 227 * Load the information expected by an i386 kernel. 228 * 229 * - The 'boothowto' argument is constructed 230 * - The 'botdev' argument is constructed 231 * - The 'bootinfo' struct is constructed, and copied into the kernel space. 232 * - The kernel environment is copied into kernel space. 233 * - Module metadata are formatted and placed in kernel space. 234 */ 235int 236bi_load(char *args, int *howtop, int *bootdevp, vm_offset_t *bip) 237{
|
238 struct loaded_module *xp;
| 238 struct preloaded_file *xp;
|
239 struct i386_devdesc *rootdev; 240 vm_offset_t addr, bootinfo_addr; 241 char *rootdevname; 242 int bootdevnr, i; 243 u_int pad; 244 char *kernelname; 245 const char *kernelpath; 246 247 *howtop = bi_getboothowto(args); 248 249 /* 250 * Allow the environment variable 'rootdev' to override the supplied device 251 * This should perhaps go to MI code and/or have $rootdev tested/set by 252 * MI code before launching the kernel. 253 */ 254 rootdevname = getenv("rootdev"); 255 i386_getdev((void **)(&rootdev), rootdevname, NULL); 256 if (rootdev == NULL) { /* bad $rootdev/$currdev */ 257 printf("can't determine root device\n"); 258 return(EINVAL); 259 } 260 261 /* Try reading the /etc/fstab file to select the root device */ 262 getrootmount(i386_fmtdev((void *)rootdev)); 263 264 /* Do legacy rootdev guessing */ 265 switch(rootdev->d_type) { 266 case DEVT_DISK: 267 /* pass in the BIOS device number of the current disk */ 268 bi.bi_bios_dev = bd_unit2bios(rootdev->d_kind.biosdisk.unit); 269 bootdevnr = bd_getdev(rootdev); 270 if (bootdevnr != -1) 271 break; 272 printf("root device %s invalid\n", i386_fmtdev(rootdev)); 273 return(EINVAL); 274 275 case DEVT_NET: 276 break; 277 278 default: 279 printf("WARNING - don't know how to boot from device type %d\n", rootdev->d_type); 280 } 281 free(rootdev); 282 *bootdevp = bootdevnr; 283 284 /* legacy bootinfo structure */ 285 bi.bi_version = BOOTINFO_VERSION; 286 bi.bi_kernelname = 0; /* XXX char * -> kernel name */ 287 bi.bi_nfs_diskless = 0; /* struct nfs_diskless * */ 288 bi.bi_n_bios_used = 0; /* XXX would have to hook biosdisk driver for these */ 289 for (i = 0; i < N_BIOS_GEOM; i++) 290 bi.bi_bios_geom[i] = bd_getbigeom(i); 291 bi.bi_size = sizeof(bi); 292 bi.bi_memsizes_valid = 1; 293 bi.bi_basemem = bios_basemem / 1024; 294 bi.bi_extmem = bios_extmem / 1024; 295 296 /* find the last module in the chain */ 297 addr = 0;
| 239 struct i386_devdesc *rootdev; 240 vm_offset_t addr, bootinfo_addr; 241 char *rootdevname; 242 int bootdevnr, i; 243 u_int pad; 244 char *kernelname; 245 const char *kernelpath; 246 247 *howtop = bi_getboothowto(args); 248 249 /* 250 * Allow the environment variable 'rootdev' to override the supplied device 251 * This should perhaps go to MI code and/or have $rootdev tested/set by 252 * MI code before launching the kernel. 253 */ 254 rootdevname = getenv("rootdev"); 255 i386_getdev((void **)(&rootdev), rootdevname, NULL); 256 if (rootdev == NULL) { /* bad $rootdev/$currdev */ 257 printf("can't determine root device\n"); 258 return(EINVAL); 259 } 260 261 /* Try reading the /etc/fstab file to select the root device */ 262 getrootmount(i386_fmtdev((void *)rootdev)); 263 264 /* Do legacy rootdev guessing */ 265 switch(rootdev->d_type) { 266 case DEVT_DISK: 267 /* pass in the BIOS device number of the current disk */ 268 bi.bi_bios_dev = bd_unit2bios(rootdev->d_kind.biosdisk.unit); 269 bootdevnr = bd_getdev(rootdev); 270 if (bootdevnr != -1) 271 break; 272 printf("root device %s invalid\n", i386_fmtdev(rootdev)); 273 return(EINVAL); 274 275 case DEVT_NET: 276 break; 277 278 default: 279 printf("WARNING - don't know how to boot from device type %d\n", rootdev->d_type); 280 } 281 free(rootdev); 282 *bootdevp = bootdevnr; 283 284 /* legacy bootinfo structure */ 285 bi.bi_version = BOOTINFO_VERSION; 286 bi.bi_kernelname = 0; /* XXX char * -> kernel name */ 287 bi.bi_nfs_diskless = 0; /* struct nfs_diskless * */ 288 bi.bi_n_bios_used = 0; /* XXX would have to hook biosdisk driver for these */ 289 for (i = 0; i < N_BIOS_GEOM; i++) 290 bi.bi_bios_geom[i] = bd_getbigeom(i); 291 bi.bi_size = sizeof(bi); 292 bi.bi_memsizes_valid = 1; 293 bi.bi_basemem = bios_basemem / 1024; 294 bi.bi_extmem = bios_extmem / 1024; 295 296 /* find the last module in the chain */ 297 addr = 0;
|
298 for (xp = mod_findmodule(NULL, NULL); xp != NULL; xp = xp->m_next) { 299 if (addr < (xp->m_addr + xp->m_size)) 300 addr = xp->m_addr + xp->m_size;
| 298 for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { 299 if (addr < (xp->f_addr + xp->f_size)) 300 addr = xp->f_addr + xp->f_size;
|
301 } 302 /* pad to a page boundary */ 303 pad = (u_int)addr & PAGE_MASK; 304 if (pad != 0) { 305 pad = PAGE_SIZE - pad; 306 addr += pad; 307 } 308 309 /* copy our environment */ 310 bi.bi_envp = addr; 311 addr = bi_copyenv(addr); 312 313 /* pad to a page boundary */ 314 pad = (u_int)addr & PAGE_MASK; 315 if (pad != 0) { 316 pad = PAGE_SIZE - pad; 317 addr += pad; 318 } 319 /* copy module list and metadata */ 320 bi.bi_modulep = addr; 321 addr = bi_copymodules(addr); 322 323 /* all done copying stuff in, save end of loaded object space */ 324 bi.bi_kernend = addr; 325 326 *howtop |= RB_BOOTINFO; /* it's there now */ 327 328 /* 329 * Get the kernel name, strip off any device prefix. 330 */ 331 kernelname = getenv("kernelname"); 332 i386_getdev(NULL, kernelname, &kernelpath); 333 bi.bi_kernelname = VTOP(kernelpath); 334 *bip = VTOP(&bi); 335 336 return(0); 337}
| 301 } 302 /* pad to a page boundary */ 303 pad = (u_int)addr & PAGE_MASK; 304 if (pad != 0) { 305 pad = PAGE_SIZE - pad; 306 addr += pad; 307 } 308 309 /* copy our environment */ 310 bi.bi_envp = addr; 311 addr = bi_copyenv(addr); 312 313 /* pad to a page boundary */ 314 pad = (u_int)addr & PAGE_MASK; 315 if (pad != 0) { 316 pad = PAGE_SIZE - pad; 317 addr += pad; 318 } 319 /* copy module list and metadata */ 320 bi.bi_modulep = addr; 321 addr = bi_copymodules(addr); 322 323 /* all done copying stuff in, save end of loaded object space */ 324 bi.bi_kernend = addr; 325 326 *howtop |= RB_BOOTINFO; /* it's there now */ 327 328 /* 329 * Get the kernel name, strip off any device prefix. 330 */ 331 kernelname = getenv("kernelname"); 332 i386_getdev(NULL, kernelname, &kernelpath); 333 bi.bi_kernelname = VTOP(kernelpath); 334 *bip = VTOP(&bi); 335 336 return(0); 337}
|