Changeset 77147d6 in mainline for generic/src/main/kinit.c
- Timestamp:
- 2006-01-15T21:16:06Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d2ab23
- Parents:
- 44c259c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/main/kinit.c
r44c259c r77147d6 72 72 as_t *as; 73 73 as_area_t *a; 74 __address frame;75 index_t pfn [1];74 index_t frame, frames; 75 index_t pfn; 76 76 task_t *u; 77 77 … … 134 134 if ((t = thread_create(kconsole, "kconsole", TASK, 0))) 135 135 thread_ready(t); 136 else panic("thread_create/kconsole\n"); 136 else 137 panic("thread_create/kconsole\n"); 137 138 138 139 interrupts_enable(); … … 142 143 * Create the first user task. 143 144 */ 145 146 if (KA2PA(config.init_addr) % FRAME_SIZE) 147 panic("config.init_addr is not frame aligned"); 148 144 149 as = as_create(NULL); 145 150 if (!as) … … 154 159 /* 155 160 * Create the text as_area and copy the userspace code there. 156 */ 157 a = as_area_create(as, AS_AREA_TEXT, 1, UTEXT_ADDRESS); 161 */ 162 163 frame = KA2PA(config.init_addr) / FRAME_SIZE; 164 frames = config.init_size / FRAME_SIZE; 165 if (config.init_size % FRAME_SIZE > 0) 166 frames++; 167 168 a = as_area_create(as, AS_AREA_TEXT, frames, UTEXT_ADDRESS); 158 169 if (!a) 159 170 panic("as_area_create: text\n"); 160 171 161 // FIXME: Better way to initialize static code/data 162 frame = frame_alloc(0, ONE_FRAME, NULL); 163 memcpy((void *) PA2KA(frame), (void *) config.init_addr, config.init_size < PAGE_SIZE ? config.init_size : PAGE_SIZE); 164 165 pfn[0] = frame / FRAME_SIZE; 166 as_area_load_mapping(a, pfn); 172 for (pfn = 0; pfn < frames; pfn++) 173 as_area_set_mapping(a, pfn, frame + pfn); 167 174 168 175 /*
Note:
See TracChangeset
for help on using the changeset viewer.