Modified the kernel and all tasks with well-formatted printout messages.

This commit is contained in:
Bahadir Balban
2009-05-12 11:25:14 +03:00
parent db0d756dfa
commit 8528e2e1ba
28 changed files with 237 additions and 285 deletions

View File

@@ -14,6 +14,7 @@
#include INC_GLUE(memlayout.h)
#include INC_ARCH(linker.h)
#include INC_ARCH(asm.h)
#include INC_API(kip.h)
/*
* These are indices into arrays with pgd_t or pmd_t sized elements,
@@ -282,7 +283,7 @@ int __remove_mapping(pmd_table_t *pmd, unsigned long vaddr)
switch (pmd->entry[pmd_i] & PMD_TYPE_MASK) {
case PMD_TYPE_FAULT:
ret = -1;
ret = -ENOENT;
break;
case PMD_TYPE_LARGE:
pmd->entry[pmd_i] = 0;
@@ -596,8 +597,9 @@ void relocate_page_tables(void)
__pt_start = pt_new;
__pt_end = pt_new + pt_area_size;
printk("Initial page table area relocated from phys 0x%x to 0x%x\n",
virt_to_phys(&kspace), virt_to_phys(TASK_PGD(current)));
printk("%s: Initial page tables moved from 0x%x to 0x%x physical\n",
__KERNELNAME__, virt_to_phys(&kspace),
virt_to_phys(TASK_PGD(current)));
}
/*
@@ -640,7 +642,7 @@ void remap_as_pages(void *vstart, void *vend)
/* Replace the direct section physical address with pmd's address */
pgd->entry[pgd_i] = (pgd_t)pmd_phys;
printk("Kernel area 0x%lx - 0x%lx remapped as %d pages\n",
printk("%s: Kernel area 0x%lx - 0x%lx remapped as %d pages\n", __KERNELNAME__,
(unsigned long)vstart, (unsigned long)vend, numpages);
}

View File

@@ -41,8 +41,9 @@ void pgalloc_add_new_cache(struct mem_cache *cache, int cidx)
void print_kmem_grant_params(grant_kmem_usage_t *params)
{
printk("Possible kmem usage on this memory grant:\n");
printk("PGDs: %lu, PMDs: %lu, TCBs: %lu, Extra: %lu bytes.\n",
printk("%s: %lu bytes physical memory granted.\n", __KERNELNAME__, params->total_size);
printk("%s: Possible kmem usage on this memory grant:\n", __KERNELNAME__);
printk("%s: PGDs: %lu, PMDs: %lu, TCBs: %lu, Extra: %lu bytes.\n", __KERNELNAME__,
params->total_pgds, params->total_pmds, params->total_tcbs,
params->extra);
}

View File

@@ -88,7 +88,6 @@ void physmem_init()
void memory_init()
{
printascii("Initialising kernel memory allocator.\n");
init_pgalloc();
}

View File

@@ -146,6 +146,7 @@ void start_vm()
: "r" (KERNEL_OFFSET)
: "r0"
);
/* At this point, execution is on virtual addresses. */
remove_section_mapping(virt_to_phys(_start_kernel));
@@ -286,7 +287,6 @@ void init_pager(char *name, struct task_ids *ids)
}
BUG_ON(!taskimg);
printk("\nInitialising %s.\n", name);
if (taskimg->phys_start & PAGE_MASK)
printk("Warning, image start address not page aligned.\n");
@@ -313,8 +313,8 @@ void init_pager(char *name, struct task_ids *ids)
add_mapping_pgd(taskimg->phys_start, INITTASK_AREA_START,
task_pages * PAGE_SIZE, MAP_USR_DEFAULT_FLAGS,
TASK_PGD(task));
printk("Mapping %d pages from 0x%x to 0x%x for %s\n", task_pages,
taskimg->phys_start, INITTASK_AREA_START, name);
//printk("Mapping %d pages from 0x%x to 0x%x for %s\n", task_pages,
// taskimg->phys_start, INITTASK_AREA_START, name);
/* Add the physical pages used by the task to the page map */
set_page_map(taskimg->phys_start, task_pages, 1);
@@ -345,6 +345,8 @@ void init_tasks()
init_ktcb_list();
init_address_space_list();
printk("%s: Initialized. Starting %s as pager.\n",
__KERNELNAME__, __PAGERNAME__);
/*
* This must come last so that other tasks can copy its pgd before it
* modifies it for its own specifics.
@@ -354,7 +356,7 @@ void init_tasks()
void start_kernel(void)
{
printascii("\nstart_kernel...\n");
printascii("\n"__KERNELNAME__": start kernel...\n");
/* Print section boundaries for kernel image */
//print_sections();
@@ -370,6 +372,8 @@ void start_kernel(void)
/* Initialise platform-specific page mappings, and peripherals */
platform_init();
printk("%s: Virtual memory enabled.\n", __KERNELNAME__);
/* Map and enable high vector page. Faults can be handled after here. */
vectors_init();