Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 717 → Rev 718

/kernel/trunk/contrib/conf/dot.bochsrc
130,7 → 130,7
# drive letters such as a: or b: as the path. Raw floppy access is not
# supported on Windows 95 and 98.
#=======================================================================
floppya: 1_44=image.bin, status=inserted
floppya: 1_44=image.boot, status=inserted
#floppya: 1_44=/dev/fd0, status=inserted
 
#=======================================================================
/kernel/trunk/contrib/conf/simics.conf
12,7 → 12,7
@if not "clock_freq_mhz" in dir(): clock_freq_mhz = 40
@if not "memory_megs" in dir(): memory_megs = 256
 
@if not "floppy_image" in dir(): floppy_image = "image.bin"
@if not "floppy_image" in dir(): floppy_image = "image.boot"
@if not "use_voodoo3_pci" in dir(): use_voodoo3_pci = 1
@if not "use_voodoo3_agp" in dir(): use_voodoo3_agp = 0
@if not "boot_dev" in dir(): boot_dev = "A"
/kernel/trunk/generic/include/mm/as.h
82,7 → 82,7
 
extern as_t * as_create(pte_t *ptl0);
extern as_area_t *as_area_create(as_t *as, as_area_type_t type, size_t size, __address base);
extern void as_area_load_mapping(as_area_t *a, index_t *pfn);
extern void as_area_set_mapping(as_area_t *a, index_t vpn, index_t pfn);
extern int as_page_fault(__address page);
extern void as_install(as_t *m);
 
/kernel/trunk/generic/src/main/kinit.c
71,8 → 71,8
thread_t *t;
as_t *as;
as_area_t *a;
__address frame;
index_t pfn[1];
index_t frame, frames;
index_t pfn;
task_t *u;
 
interrupts_disable();
133,7 → 133,8
*/
if ((t = thread_create(kconsole, "kconsole", TASK, 0)))
thread_ready(t);
else panic("thread_create/kconsole\n");
else
panic("thread_create/kconsole\n");
 
interrupts_enable();
 
141,6 → 142,10
/*
* Create the first user task.
*/
if (KA2PA(config.init_addr) % FRAME_SIZE)
panic("config.init_addr is not frame aligned");
as = as_create(NULL);
if (!as)
panic("as_create\n");
153,17 → 158,19
/*
* Create the text as_area and copy the userspace code there.
*/
a = as_area_create(as, AS_AREA_TEXT, 1, UTEXT_ADDRESS);
*/
frame = KA2PA(config.init_addr) / FRAME_SIZE;
frames = config.init_size / FRAME_SIZE;
if (config.init_size % FRAME_SIZE > 0)
frames++;
a = as_area_create(as, AS_AREA_TEXT, frames, UTEXT_ADDRESS);
if (!a)
panic("as_area_create: text\n");
// FIXME: Better way to initialize static code/data
frame = frame_alloc(0, ONE_FRAME, NULL);
memcpy((void *) PA2KA(frame), (void *) config.init_addr, config.init_size < PAGE_SIZE ? config.init_size : PAGE_SIZE);
pfn[0] = frame / FRAME_SIZE;
as_area_load_mapping(a, pfn);
for (pfn = 0; pfn < frames; pfn++)
as_area_set_mapping(a, pfn, frame + pfn);
/*
* Create the data as_area.
/kernel/trunk/generic/src/mm/as.c
142,7 → 142,7
/*
* Frames will be allocated on-demand by
* as_page_fault() or preloaded by
* as_area_load_mapping().
* as_area_set_mapping().
*/
a->mapping[i] = UNALLOCATED_PFN;
}
168,23 → 168,23
*
* Initialize a->mapping.
*
* @param a Target address space area.
* @param pfn Array of frame numbers. Number of elements must match with a->mapping.
* @param a Target address space area.
* @param vpn Page number relative to area start.
* @param pfn Frame number to map.
*/
void as_area_load_mapping(as_area_t *a, index_t *pfn)
void as_area_set_mapping(as_area_t *a, index_t vpn, index_t pfn)
{
ASSERT(vpn < a->size);
ASSERT(a->mapping[vpn] == UNALLOCATED_PFN);
ASSERT(pfn != UNALLOCATED_PFN);
ipl_t ipl;
int i;
ipl = interrupts_disable();
spinlock_lock(&a->lock);
 
for (i = 0; i < a->size; i++) {
ASSERT(a->mapping[i] == UNALLOCATED_PFN);
ASSERT(pfn[i] != UNALLOCATED_PFN);
a->mapping[i] = pfn[i];
}
a->mapping[vpn] = pfn;
spinlock_unlock(&a->lock);
interrupts_restore(ipl);
}
253,9 → 253,8
memsetb(PA2KA(frame), FRAME_SIZE, 0);
area->mapping[vpn] = frame / FRAME_SIZE;
ASSERT(area->mapping[vpn] != UNALLOCATED_PFN);
} else {
} else
frame = area->mapping[vpn] * FRAME_SIZE;
}
switch (area->type) {
case AS_AREA_TEXT: