This source file includes following definitions.
- cpu_configure
- device_register
- diskconf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 #include <sys/param.h>
47 #include <sys/systm.h>
48 #include <sys/user.h>
49 #include <sys/buf.h>
50 #include <sys/dkstat.h>
51 #include <sys/disklabel.h>
52 #include <sys/conf.h>
53 #include <sys/reboot.h>
54 #include <sys/device.h>
55 #include <sys/socket.h>
56 #include <sys/socketvar.h>
57
58 #include <net/if.h>
59 #include <net/if_types.h>
60 #include <netinet/in.h>
61 #include <netinet/if_ether.h>
62
63 #include <uvm/uvm_extern.h>
64
65 #include <machine/pte.h>
66 #include <machine/cpu.h>
67 #include <machine/gdt.h>
68 #include <machine/biosvar.h>
69 #include <machine/kvm86.h>
70
71 #include <dev/cons.h>
72
73 #include "ioapic.h"
74
75 #if NIOAPIC > 0
76 #include <machine/i82093var.h>
77 #endif
78
79
80
81
82
83
84 extern dev_t bootdev;
85
86
87 #ifdef I686_CPU
88 extern struct timeout viac3_rnd_tmo;
89 extern int viac3_rnd_present;
90 void viac3_rnd(void *);
91
92 #ifdef CRYPTO
93 void viac3_crypto_setup(void);
94 extern int i386_has_xcrypt;
95 #endif
96 #endif
97
98
99
100
101 void
102 cpu_configure(void)
103 {
104
105
106
107
108
109 startrtclock();
110
111 gdt_init();
112
113
114 i386_proc0_tss_ldt_init();
115
116 #ifdef KVM86
117 kvm86_init();
118 #endif
119
120 if (config_rootfound("mainbus", NULL) == NULL)
121 panic("cpu_configure: mainbus not configured");
122
123 #if NIOAPIC > 0
124 if (nioapics > 0)
125 goto nomasks;
126 #endif
127 printf("biomask %x netmask %x ttymask %x\n", (u_short)IMASK(IPL_BIO),
128 (u_short)IMASK(IPL_NET), (u_short)IMASK(IPL_TTY));
129
130 #if NIOAPIC > 0
131 nomasks:
132 ioapic_enable();
133 #endif
134
135 proc0.p_addr->u_pcb.pcb_cr0 = rcr0();
136
137 #ifdef MULTIPROCESSOR
138
139 cpu_init_idle_pcbs();
140 #endif
141 spl0();
142
143
144
145
146
147 cold = 0;
148
149 #ifdef I686_CPU
150
151
152
153
154 if (viac3_rnd_present) {
155 timeout_set(&viac3_rnd_tmo, viac3_rnd, &viac3_rnd_tmo);
156 viac3_rnd(&viac3_rnd_tmo);
157 }
158 #ifdef CRYPTO
159
160
161
162 if (i386_has_xcrypt)
163 viac3_crypto_setup();
164 #endif
165 #endif
166 }
167
168 void
169 device_register(struct device *dev, void *aux)
170 {
171 }
172
173
174
175
176
177
178 void
179 diskconf(void)
180 {
181 int majdev, unit, part = 0;
182 struct device *bootdv = NULL;
183 dev_t tmpdev;
184 char buf[128];
185 #if defined(NFSCLIENT)
186 extern bios_bootmac_t *bios_bootmac;
187 #endif
188
189 dkcsumattach();
190
191 if ((bootdev & B_MAGICMASK) == (u_int)B_DEVMAGIC) {
192 majdev = B_TYPE(bootdev);
193 unit = B_UNIT(bootdev);
194 part = B_PARTITION(bootdev);
195 snprintf(buf, sizeof buf, "%s%d%c", findblkname(majdev),
196 unit, part + 'a');
197 bootdv = parsedisk(buf, strlen(buf), part, &tmpdev);
198 }
199
200 #if defined(NFSCLIENT)
201 if (bios_bootmac) {
202 struct ifnet *ifp;
203
204 printf("PXE boot MAC address %s, ",
205 ether_sprintf(bios_bootmac->mac));
206 for (ifp = TAILQ_FIRST(&ifnet); ifp != NULL;
207 ifp = TAILQ_NEXT(ifp, if_list)) {
208 if ((ifp->if_type == IFT_ETHER ||
209 ifp->if_type == IFT_FDDI) &&
210 bcmp(bios_bootmac->mac,
211 ((struct arpcom *)ifp)->ac_enaddr,
212 ETHER_ADDR_LEN) == 0)
213 break;
214 }
215 if (ifp) {
216 printf("interface %s\n", ifp->if_xname);
217 mountroot = nfs_mountroot;
218 bootdv = parsedisk(ifp->if_xname, strlen(ifp->if_xname),
219 0, &tmpdev);
220 part = 0;
221 } else
222 printf("unknown interface\n");
223 }
224 #endif
225
226 setroot(bootdv, part, RB_USERREQ);
227 dumpconf();
228 }
229
230 struct nam2blk nam2blk[] = {
231 { "wd", 0 },
232 { "fd", 2 },
233 { "sd", 4 },
234 { "cd", 6 },
235 { "mcd", 7 },
236 { "rd", 17 },
237 { "raid", 19 },
238 { NULL, -1 }
239 };