xref: /illumos-gate/usr/src/uts/intel/amd64/krtld/kobj_boot.c (revision 22028508fd28d36ff74dc02c5774a8ba1f0db045)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*
27  * Bootstrap the linker/loader.
28  */
29 
30 #include <sys/types.h>
31 #include <sys/bootconf.h>
32 #include <sys/link.h>
33 #include <sys/auxv.h>
34 #include <sys/kobj.h>
35 #include <sys/bootsvcs.h>
36 #include <vm/kboot_mmu.h>
37 #include <sys/kobj_impl.h>
38 
39 /*
40  * the kernel's entry point (from locore.s)
41  */
42 extern void _locore_start();
43 
44 /*
45  * fakebop and dboot don't create the boot auxillary vector information.
46  * Do that here before calling krtld initialization.
47  */
48 /*ARGSUSED3*/
49 void
50 _kobj_boot(
51 	struct boot_syscalls *syscallp,
52 	void *dvec,
53 	struct bootops *bootops,
54 	Boot *ebp)
55 {
56 	val_t bootaux[BA_NUM];
57 	int i;
58 
59 	for (i = 0; i < BA_NUM; i++)
60 		bootaux[i].ba_val = 0;
61 
62 	bootaux[BA_ENTRY].ba_ptr = (void *)_locore_start;
63 	bootaux[BA_PAGESZ].ba_val = PAGESIZE;
64 	bootaux[BA_LPAGESZ].ba_val = kbm_nucleus_size;
65 
66 	/*
67 	 * Off to krtld initialization.
68 	 */
69 	kobj_init(syscallp, dvec, bootops, bootaux);
70 }
71