Rev 1897 | Rev 1972 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1897 | Rev 1899 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | #include <ofw.h> |
34 | #include <ofw.h> |
35 | #include <ofw_tree.h> |
35 | #include <ofw_tree.h> |
36 | #include "ofwarch.h" |
36 | #include "ofwarch.h" |
37 | #include <align.h> |
37 | #include <align.h> |
38 | 38 | ||
39 | #define KERNEL_VIRTUAL_ADDRESS 0x400000 |
- | |
40 | - | ||
41 | bootinfo_t bootinfo; |
39 | bootinfo_t bootinfo; |
42 | 40 | ||
43 | void bootstrap(void) |
41 | void bootstrap(void) |
44 | { |
42 | { |
45 | printf("HelenOS SPARC64 Bootloader\n"); |
43 | printf("HelenOS SPARC64 Bootloader\n"); |
Line 55... | Line 53... | ||
55 | if (bootinfo.memmap.total == 0) { |
53 | if (bootinfo.memmap.total == 0) { |
56 | printf("Error: no memory detected, halting.\n"); |
54 | printf("Error: no memory detected, halting.\n"); |
57 | halt(); |
55 | halt(); |
58 | } |
56 | } |
59 | 57 | ||
60 | if (!ofw_cpu(&bootinfo.cpu)) |
- | |
61 | printf("Error: unable to get cpu properties\n"); |
- | |
62 | - | ||
63 | printf("\nDevice info\n"); |
58 | printf("\nSystem info\n"); |
64 | printf(" cpu: %dMHz\n", bootinfo.cpu.clock_frequency/1000000); |
- | |
65 | printf(" memory: %dM\n", bootinfo.memmap.total>>20); |
59 | printf(" memory: %dM\n", bootinfo.memmap.total>>20); |
66 | 60 | ||
67 | printf("\nMemory statistics\n"); |
61 | printf("\nMemory statistics\n"); |
68 | printf(" kernel entry point at %P\n", KERNEL_VIRTUAL_ADDRESS); |
62 | printf(" kernel entry point at %P\n", KERNEL_VIRTUAL_ADDRESS); |
69 | printf(" %P: boot info structure\n", &bootinfo); |
63 | printf(" %P: boot info structure\n", &bootinfo); |
Line 94... | Line 88... | ||
94 | 88 | ||
95 | printf("\nCanonizing OpenFirmware device tree..."); |
89 | printf("\nCanonizing OpenFirmware device tree..."); |
96 | bootinfo.ofw_root = ofw_tree_build(); |
90 | bootinfo.ofw_root = ofw_tree_build(); |
97 | printf("done.\n"); |
91 | printf("done.\n"); |
98 | 92 | ||
- | 93 | printf("\nChecking for secondary processors..."); |
|
- | 94 | if (!ofw_cpu()) |
|
- | 95 | printf("Error: unable to get cpu properties\n"); |
|
- | 96 | printf("done.\n"); |
|
- | 97 | ||
99 | printf("\nBooting the kernel...\n"); |
98 | printf("\nBooting the kernel...\n"); |
100 | jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo, sizeof(bootinfo)); |
99 | jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, 1, &bootinfo, sizeof(bootinfo)); |
101 | } |
100 | } |