Changeset 77147d6 in mainline
- 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
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/conf/dot.bochsrc
r44c259c r77147d6 131 131 # supported on Windows 95 and 98. 132 132 #======================================================================= 133 floppya: 1_44=image.b in, status=inserted133 floppya: 1_44=image.boot, status=inserted 134 134 #floppya: 1_44=/dev/fd0, status=inserted 135 135 -
contrib/conf/simics.conf
r44c259c r77147d6 13 13 @if not "memory_megs" in dir(): memory_megs = 256 14 14 15 @if not "floppy_image" in dir(): floppy_image = "image.b in"15 @if not "floppy_image" in dir(): floppy_image = "image.boot" 16 16 @if not "use_voodoo3_pci" in dir(): use_voodoo3_pci = 1 17 17 @if not "use_voodoo3_agp" in dir(): use_voodoo3_agp = 0 -
generic/include/mm/as.h
r44c259c r77147d6 83 83 extern as_t * as_create(pte_t *ptl0); 84 84 extern as_area_t *as_area_create(as_t *as, as_area_type_t type, size_t size, __address base); 85 extern void as_area_ load_mapping(as_area_t *a, index_t *pfn);85 extern void as_area_set_mapping(as_area_t *a, index_t vpn, index_t pfn); 86 86 extern int as_page_fault(__address page); 87 87 extern void as_install(as_t *m); -
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 /* -
generic/src/mm/as.c
r44c259c r77147d6 143 143 * Frames will be allocated on-demand by 144 144 * as_page_fault() or preloaded by 145 * as_area_ load_mapping().145 * as_area_set_mapping(). 146 146 */ 147 147 a->mapping[i] = UNALLOCATED_PFN; … … 169 169 * Initialize a->mapping. 170 170 * 171 * @param a Target address space area. 172 * @param pfn Array of frame numbers. Number of elements must match with a->mapping. 173 */ 174 void as_area_load_mapping(as_area_t *a, index_t *pfn) 175 { 171 * @param a Target address space area. 172 * @param vpn Page number relative to area start. 173 * @param pfn Frame number to map. 174 */ 175 void as_area_set_mapping(as_area_t *a, index_t vpn, index_t pfn) 176 { 177 ASSERT(vpn < a->size); 178 ASSERT(a->mapping[vpn] == UNALLOCATED_PFN); 179 ASSERT(pfn != UNALLOCATED_PFN); 180 176 181 ipl_t ipl; 177 int i;178 182 179 183 ipl = interrupts_disable(); 180 184 spinlock_lock(&a->lock); 181 182 for (i = 0; i < a->size; i++) { 183 ASSERT(a->mapping[i] == UNALLOCATED_PFN); 184 ASSERT(pfn[i] != UNALLOCATED_PFN); 185 a->mapping[i] = pfn[i]; 186 } 185 186 a->mapping[vpn] = pfn; 187 187 188 188 spinlock_unlock(&a->lock); … … 254 254 area->mapping[vpn] = frame / FRAME_SIZE; 255 255 ASSERT(area->mapping[vpn] != UNALLOCATED_PFN); 256 } else {256 } else 257 257 frame = area->mapping[vpn] * FRAME_SIZE; 258 }259 258 260 259 switch (area->type) {
Note:
See TracChangeset
for help on using the changeset viewer.