41 |
|
|
42 |
#include "i386-segment.h" |
#include "i386-segment.h" |
43 |
|
|
44 |
|
#if NCPUS > 1 |
45 |
|
#include "smp.h" |
46 |
|
#endif |
47 |
|
|
48 |
void |
void |
49 |
init386 (void) |
init386 (void) |
50 |
{ |
{ |
51 |
extern struct multiboot_info *cpu_multiboot_ptr; |
extern struct multiboot_info *cpu_multiboot_ptr; |
52 |
extern char kernel_text, end; |
extern char kernel_text, end; |
53 |
vm_offset_t vstart, vend; |
vm_offset_t vstart, vend; |
54 |
|
int tss_seg; |
55 |
|
|
56 |
/* Initialize all bootstrap modules. */ |
/* Initialize all bootstrap modules. */ |
57 |
|
|
84 |
|
|
85 |
initclocks (); |
initclocks (); |
86 |
|
|
87 |
|
#if NCPUS > 1 |
88 |
|
smp_bootstrap (); |
89 |
|
#endif |
90 |
|
|
91 |
/* Initialize the virtual memory system. We have to do it in |
/* Initialize the virtual memory system. We have to do it in |
92 |
this exact order; |
this exact order; |
93 |
|
|
109 |
/* Boostrap pmap. */ |
/* Boostrap pmap. */ |
110 |
pmap_bootstrap ((vm_offset_t) &kernel_text, (vm_offset_t) &end); |
pmap_bootstrap ((vm_offset_t) &kernel_text, (vm_offset_t) &end); |
111 |
|
|
112 |
|
#if NCPUS > 1 |
113 |
|
smp_init_cpus (); |
114 |
|
#endif |
115 |
|
|
116 |
|
/* Set kernel TSS. */ |
117 |
|
tss_seg = KERNEL_TSS + (0x8 * CPU_CURRENT ()); |
118 |
|
__asm__ __volatile__ ("ltr %0" :: "rm" ((unsigned short) tss_seg)); |
119 |
|
|
120 |
/* Boostrap resident pages. */ |
/* Boostrap resident pages. */ |
121 |
vm_page_resident_pages_init (&vstart, &vend); |
vm_page_resident_pages_init (&vstart, &vend); |
122 |
|
|