Rev 3995 | Rev 4014 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3995 | Rev 4012 | ||
---|---|---|---|
Line 62... | Line 62... | ||
62 | #include <interrupt.h> |
62 | #include <interrupt.h> |
63 | #include <console/kconsole.h> |
63 | #include <console/kconsole.h> |
64 | #include <security/cap.h> |
64 | #include <security/cap.h> |
65 | #include <lib/rd.h> |
65 | #include <lib/rd.h> |
66 | #include <ipc/ipc.h> |
66 | #include <ipc/ipc.h> |
- | 67 | #include <debug.h> |
|
- | 68 | #include <string.h> |
|
67 | 69 | ||
68 | #ifdef CONFIG_SMP |
70 | #ifdef CONFIG_SMP |
69 | #include <smp/smp.h> |
71 | #include <smp/smp.h> |
70 | #endif /* CONFIG_SMP */ |
72 | #endif /* CONFIG_SMP */ |
71 | 73 | ||
Line 76... | Line 78... | ||
76 | 78 | ||
77 | #ifdef CONFIG_KCONSOLE |
79 | #ifdef CONFIG_KCONSOLE |
78 | static char alive[ALIVE_CHARS] = "-\\|/"; |
80 | static char alive[ALIVE_CHARS] = "-\\|/"; |
79 | #endif |
81 | #endif |
80 | 82 | ||
- | 83 | #define BOOT_PREFIX "boot:" |
|
- | 84 | #define BOOT_PREFIX_LEN 5 |
|
- | 85 | ||
81 | /** Kernel initialization thread. |
86 | /** Kernel initialization thread. |
82 | * |
87 | * |
83 | * kinit takes care of higher level kernel |
88 | * kinit takes care of higher level kernel |
84 | * initialization (i.e. thread creation, |
89 | * initialization (i.e. thread creation, |
85 | * userspace initialization etc.). |
90 | * userspace initialization etc.). |
Line 173... | Line 178... | ||
173 | if (init.tasks[i].addr % FRAME_SIZE) { |
178 | if (init.tasks[i].addr % FRAME_SIZE) { |
174 | printf("init[%" PRIc "].addr is not frame aligned\n", i); |
179 | printf("init[%" PRIc "].addr is not frame aligned\n", i); |
175 | continue; |
180 | continue; |
176 | } |
181 | } |
177 | 182 | ||
- | 183 | /* |
|
- | 184 | * Construct task name from the 'boot:' prefix and the |
|
- | 185 | * name stored in the init structure (if any). |
|
- | 186 | */ |
|
- | 187 | ||
- | 188 | char namebuf[TASK_NAME_BUFLEN], *name; |
|
- | 189 | ||
178 | char *name = init.tasks[i].name; |
190 | name = init.tasks[i].name; |
179 | if (name[0] == '\0') name = "init-bin"; |
191 | if (name[0] == '\0') name = "<unknown>"; |
- | 192 | ||
- | 193 | ASSERT(TASK_NAME_BUFLEN >= BOOT_PREFIX_LEN); |
|
- | 194 | strncpy(namebuf, BOOT_PREFIX, TASK_NAME_BUFLEN); |
|
- | 195 | strncpy(namebuf + BOOT_PREFIX_LEN, name, |
|
- | 196 | TASK_NAME_BUFLEN - BOOT_PREFIX_LEN); |
|
180 | 197 | ||
181 | int rc = program_create_from_image((void *) init.tasks[i].addr, |
198 | int rc = program_create_from_image((void *) init.tasks[i].addr, |
182 | name, &programs[i]); |
199 | namebuf, &programs[i]); |
183 | 200 | ||
184 | if ((rc == 0) && (programs[i].task != NULL)) { |
201 | if ((rc == 0) && (programs[i].task != NULL)) { |
185 | /* |
202 | /* |
186 | * Set capabilities to init userspace tasks. |
203 | * Set capabilities to init userspace tasks. |
187 | */ |
204 | */ |