Rev 34 | Rev 125 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 34 | Rev 68 | ||
---|---|---|---|
Line 117... | Line 117... | ||
117 | #ifdef __USERSPACE__ |
117 | #ifdef __USERSPACE__ |
118 | /* |
118 | /* |
119 | * Create the first user task. |
119 | * Create the first user task. |
120 | */ |
120 | */ |
121 | m = vm_create(); |
121 | m = vm_create(); |
122 | if (!m) panic(PANIC "vm_create"); |
122 | if (!m) panic("vm_create"); |
123 | u = task_create(m); |
123 | u = task_create(m); |
124 | if (!u) panic(PANIC "task_create"); |
124 | if (!u) panic("task_create"); |
125 | t = thread_create(uinit, NULL, u, THREAD_USER_STACK); |
125 | t = thread_create(uinit, NULL, u, THREAD_USER_STACK); |
126 | if (!t) panic(PANIC "thread_create"); |
126 | if (!t) panic("thread_create"); |
127 | 127 | ||
128 | /* |
128 | /* |
129 | * Create the text vm_area and copy the userspace code there. |
129 | * Create the text vm_area and copy the userspace code there. |
130 | */ |
130 | */ |
131 | a = vm_area_create(m, VMA_TEXT, 1, UTEXT_ADDRESS); |
131 | a = vm_area_create(m, VMA_TEXT, 1, UTEXT_ADDRESS); |
132 | if (!a) panic(PANIC "vm_area_create: vm_text"); |
132 | if (!a) panic("vm_area_create: vm_text"); |
133 | memcopy((__address) utext, PA2KA(a->mapping[0]), utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE); |
133 | memcopy((__address) utext, PA2KA(a->mapping[0]), utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE); |
134 | 134 | ||
135 | /* |
135 | /* |
136 | * Create the data vm_area. |
136 | * Create the data vm_area. |
137 | */ |
137 | */ |
138 | a = vm_area_create(m, VMA_STACK, 1, USTACK_ADDRESS); |
138 | a = vm_area_create(m, VMA_STACK, 1, USTACK_ADDRESS); |
139 | if (!a) panic(PANIC "vm_area_create: vm_stack"); |
139 | if (!a) panic("vm_area_create: vm_stack"); |
140 | 140 | ||
141 | thread_ready(t); |
141 | thread_ready(t); |
142 | #endif /* __USERSPACE__ */ |
142 | #endif /* __USERSPACE__ */ |
143 | 143 | ||
144 | #ifdef __TEST__ |
144 | #ifdef __TEST__ |