- Timestamp:
- 2005-08-31T21:51:04Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 33ccb2c
- Parents:
- 94f0ae4
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/main.c
r94f0ae4 r393f631 54 54 #include <synch/waitq.h> 55 55 56 #include <arch/arch.h> 56 57 #include <arch.h> 57 58 #include <arch/faddr.h> … … 107 108 config.cpu_count = 1; 108 109 config.cpu_active = 1; 109 110 110 111 kernel_size = hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE; 111 112 heap_delta = PAGE_SIZE - ((hardcoded_load_address + kernel_size) % PAGE_SIZE); 112 113 heap_delta = (heap_delta == PAGE_SIZE) ? 0 : heap_delta; 113 114 kernel_size += heap_delta; 114 115 115 116 config.base = hardcoded_load_address; 116 117 config.memory_size = get_memory_size(); 117 118 config.kernel_size = kernel_size + CONFIG_STACK_SIZE; 118 119 119 120 context_save(&ctx); 121 early_mapping(config.base + hardcoded_ktext_size + hardcoded_kdata_size + heap_delta, CONFIG_STACK_SIZE + CONFIG_HEAP_SIZE); 120 122 context_set(&ctx, FADDR(main_bsp_separated_stack), config.base + kernel_size, CONFIG_STACK_SIZE); 121 context_map_stack(config.base + kernel_size, CONFIG_STACK_SIZE);122 123 context_restore(&ctx); 123 124 /* not reached */ … … 158 159 cpu_init(); 159 160 calibrate_delay_loop(); 160 161 161 162 timeout_init(); 162 163 scheduler_init(); … … 168 169 */ 169 170 m = vm_create(GET_PTL0_ADDRESS()); 170 if (!m) panic("can't create kernel vm address space\n"); 171 if (!m) 172 panic("can't create kernel vm address space\n"); 171 173 172 174 /* … … 174 176 */ 175 177 k = task_create(m); 176 if (!k) panic("can't create kernel task\n"); 177 178 if (!k) 179 panic("can't create kernel task\n"); 180 178 181 /* 179 182 * Create the first thread. 180 183 */ 181 184 t = thread_create(kinit, NULL, k, 0); 182 if (!t) panic("can't create kinit thread\n"); 185 if (!t) 186 panic("can't create kinit thread\n"); 183 187 thread_ready(t); 184 188 -
src/proc/thread.c
r94f0ae4 r393f631 186 186 spinlock_unlock(&tidlock); 187 187 cpu_priority_restore(pri); 188 188 189 189 memsetb(frame_ks, THREAD_STACK_SIZE, 0); 190 190 link_initialize(&t->rq_link); … … 194 194 t->kstack = (__u8 *) frame_ks; 195 195 t->ustack = (__u8 *) frame_us; 196 197 196 198 197 context_save(&t->saved_context);
Note:
See TracChangeset
for help on using the changeset viewer.