xref: /titanic_44/usr/src/uts/intel/ia32/krtld/kobj_boot.c (revision bde3d612a7c090234c60e6e4578821237a5db135)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
27 
28 /*
29  * Bootstrap the linker/loader.
30  */
31 
32 #include <sys/types.h>
33 #include <sys/bootconf.h>
34 #include <sys/link.h>
35 #include <sys/auxv.h>
36 #include <sys/kobj.h>
37 #include <sys/bootsvcs.h>
38 #include <vm/kboot_mmu.h>
39 #include <sys/kobj_impl.h>
40 
41 /*
42  * the kernel's entry point (from locore.s)
43  */
44 extern void _locore_start();
45 
46 /*
47  * fakebop transfers control here.
48  *
49  * fakebop and dboot don't construct any boot vector or aux vector information.
50  * We figure all this out for ourself instead.
51  */
52 /*ARGSUSED3*/
53 void
54 _kobj_boot(
55 	struct boot_syscalls *syscallp,
56 	void *dvec,
57 	struct bootops *bootops,
58 	Boot *ebp)
59 {
60 	val_t bootaux[BA_NUM];
61 	int i;
62 
63 	for (i = 0; i < BA_NUM; i++)
64 		bootaux[i].ba_val = NULL;
65 
66 	bootaux[BA_ENTRY].ba_ptr = (void *)_locore_start;
67 	bootaux[BA_PAGESZ].ba_val = MMU_PAGESIZE;
68 	bootaux[BA_LPAGESZ].ba_val = kbm_nucleus_size;
69 
70 	/*
71 	 * Initialize krtld.
72 	 */
73 	kobj_init(syscallp, dvec, bootops, bootaux);
74 }
75