Rev 4345 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4345 | Rev 4691 | ||
---|---|---|---|
Line 65... | Line 65... | ||
65 | 65 | ||
66 | 66 | ||
67 | /** Prints bootloader version information. */ |
67 | /** Prints bootloader version information. */ |
68 | static void version_print(void) |
68 | static void version_print(void) |
69 | { |
69 | { |
70 | printf("HelenOS ARM32 Bootloader\nRelease %s%s%s\nCopyright (c) 2007 HelenOS project\n", |
70 | printf("HelenOS ARM32 Bootloader\nRelease %s%s%s\nCopyright (c) 2009 HelenOS project\n", |
71 | release, revision, timestamp); |
71 | release, revision, timestamp); |
72 | } |
72 | } |
73 | 73 | ||
74 | 74 | ||
75 | /** Copies all images (kernel + user tasks) to #KERNEL_VIRTUAL_ADDRESS and jumps there. */ |
75 | /** Copies all images (kernel + user tasks) to #KERNEL_VIRTUAL_ADDRESS and jumps there. */ |
Line 85... | Line 85... | ||
85 | 85 | ||
86 | printf("\nMemory statistics\n"); |
86 | printf("\nMemory statistics\n"); |
87 | printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS); |
87 | printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS); |
88 | printf(" %L: boot info structure\n", &bootinfo); |
88 | printf(" %L: boot info structure\n", &bootinfo); |
89 | 89 | ||
90 | unsigned int i, j; |
- | |
91 | for (i = 0; i < COMPONENTS; i++) { |
- | |
92 | printf(" %L: %s image (size %d bytes)\n", |
- | |
93 | components[i].start, components[i].name, components[i].size); |
- | |
94 | } |
- | |
95 | - | ||
96 | printf("\nCopying components\n"); |
- | |
97 | - | ||
98 | unsigned int top = 0; |
90 | unsigned int top = 0; |
99 | bootinfo.cnt = 0; |
91 | bootinfo.cnt = 0; |
- | 92 | unsigned int i, j; |
|
100 | for (i = 0; i < COMPONENTS; i++) { |
93 | for (i = 0; i < COMPONENTS; i++) { |
101 | printf(" %s...", components[i].name); |
- | |
102 | top = ALIGN_UP(top, KERNEL_PAGE_SIZE); |
94 | top = ALIGN_UP(top, KERNEL_PAGE_SIZE); |
103 | memcpy(((void *) KERNEL_VIRTUAL_ADDRESS) + top, components[i].start, components[i].size); |
- | |
104 | if (i > 0) { |
95 | if (i > 0) { |
105 | bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top; |
96 | bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top; |
106 | bootinfo.tasks[bootinfo.cnt].size = components[i].size; |
97 | bootinfo.tasks[bootinfo.cnt].size = components[i].size; |
107 | strncpy(bootinfo.tasks[bootinfo.cnt].name, |
98 | strncpy(bootinfo.tasks[bootinfo.cnt].name, |
108 | components[i].name, BOOTINFO_TASK_NAME_BUFLEN); |
99 | components[i].name, BOOTINFO_TASK_NAME_BUFLEN); |
109 | bootinfo.cnt++; |
100 | bootinfo.cnt++; |
110 | } |
101 | } |
111 | top += components[i].size; |
102 | top += components[i].size; |
112 | printf("done.\n"); |
- | |
113 | } |
103 | } |
- | 104 | j = bootinfo.cnt - 1; |
|
- | 105 | ||
- | 106 | printf("\nCopying components\n"); |
|
- | 107 | printf("Component\tAddress\t\tSize (Bytes)\n"); |
|
- | 108 | printf("============================================\n"); |
|
- | 109 | for (i = COMPONENTS - 1; i > 0; i--, j--) { |
|
- | 110 | printf("%s\t\t0x%x\t%d\n", components[i].name, bootinfo.tasks[j].addr, components[i].size); |
|
- | 111 | memcpy((void *)bootinfo.tasks[j].addr, components[i].start, |
|
- | 112 | components[i].size); |
|
114 | 113 | } |
|
- | 114 | printf("KERNEL\t\t0x%x\t%d\n", KERNEL_VIRTUAL_ADDRESS, components[0].size); |
|
- | 115 | ||
- | 116 | memcpy((void *)KERNEL_VIRTUAL_ADDRESS, components[0].start, |
|
- | 117 | components[0].size); |
|
- | 118 | ||
115 | printf("\nBooting the kernel...\n"); |
119 | printf("\nBooting the kernel...\n"); |
116 | jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo); |
120 | jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo); |
117 | } |
121 | } |
118 | 122 | ||
119 | /** @} |
123 | /** @} |