Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset db675dd in mainline


Ignore:
Timestamp:
2012-05-31T17:33:41Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
master
Children:
4585bda, 4e5dabf
Parents:
6abb346
Message:

print more informative messages about init tasks, the loader and the RAM disk

Location:
kernel/generic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/program.h

    r6abb346 rdb675dd  
    5050        struct task *task;           /**< Program task */
    5151        struct thread *main_thread;  /**< Program main thread */
     52        unsigned int loader_status;  /**< Binary loader error status */
    5253} program_t;
    5354
  • kernel/generic/src/lib/rd.c

    r6abb346 rdb675dd  
    3838 */
    3939
     40#include <print.h>
    4041#include <lib/rd.h>
    4142#include <mm/frame.h>
     
    6667        sysinfo_set_item_val("rd.size", NULL, size);
    6768        sysinfo_set_item_val("rd.address.physical", NULL, (sysarg_t) base);
     69       
     70        printf("RAM disk at %p (size %zu bytes)\n", (void *) base, size);
    6871}
    6972
  • kernel/generic/src/main/kinit.c

    r6abb346 rdb675dd  
    201201                str_cpy(namebuf + INIT_PREFIX_LEN,
    202202                    TASK_NAME_BUFLEN - INIT_PREFIX_LEN, name);
    203 
     203               
    204204                /*
    205205                 * Create virtual memory mappings for init task images.
     
    236236                        init_rd((void *) init.tasks[i].paddr, init.tasks[i].size);
    237237                } else
    238                         printf("init[%zu]: Init binary load failed (error %d)\n", i, rc);
     238                        printf("init[%zu]: Init binary load failed "
     239                            "(error %d, loader status %u)\n", i, rc,
     240                            programs[i].loader_status);
    239241        }
    240242       
  • kernel/generic/src/proc/program.c

    r6abb346 rdb675dd  
    8080        kernel_uarg->uspace_uarg = NULL;
    8181       
     82        prg->loader_status = EE_OK;
    8283        prg->task = task_create(as, name);
    8384        if (!prg->task)
     
    111112 * executable image. The task is returned in *task.
    112113 *
    113  * @param image_addr Address of an executable program image.
    114  * @param name       Name to set for the program's task.
    115  * @param prg        Buffer for storing program info. If image_addr
    116  *                   points to a loader image, p->task will be set to
    117  *                   NULL and EOK will be returned.
     114 * @param[in]  image_addr Address of an executable program image.
     115 * @param[in]  name       Name to set for the program's task.
     116 * @param[out] prg        Buffer for storing program info.
     117 *                        If image_addr points to a loader image,
     118 *                        prg->task will be set to NULL and EOK
     119 *                        will be returned.
    118120 *
    119121 * @return EOK on success or negative error code.
     
    126128                return ENOMEM;
    127129       
    128         unsigned int rc = elf_load((elf_header_t *) image_addr, as, 0);
    129         LOG("elf_load() -> %u\n", rc);
    130         if (rc != EE_OK) {
     130        prg->loader_status = elf_load((elf_header_t *) image_addr, as, 0);
     131        if (prg->loader_status != EE_OK) {
    131132                as_destroy(as);
    132133                prg->task = NULL;
    133134                prg->main_thread = NULL;
    134135               
    135                 if (rc != EE_LOADER)
     136                if (prg->loader_status != EE_LOADER)
    136137                        return ENOTSUP;
    137138               
     
    141142               
    142143                program_loader = image_addr;
    143                 LOG("Registered program loader at %p",
    144                     (void *) image_addr);
     144                printf("Program loader at %p\n", (void *) image_addr);
    145145               
    146146                return EOK;
     
    172172        }
    173173       
    174         unsigned int rc = elf_load((elf_header_t *) program_loader, as,
     174        prg->loader_status = elf_load((elf_header_t *) program_loader, as,
    175175            ELD_F_LOADER);
    176         if (rc != EE_OK) {
     176        if (prg->loader_status != EE_OK) {
    177177                as_destroy(as);
    178                 printf("Cannot spawn loader (%s)\n", elf_error(rc));
     178                printf("Cannot spawn loader (%s)\n",
     179                    elf_error(prg->loader_status));
    179180                return ENOENT;
    180181        }
Note: See TracChangeset for help on using the changeset viewer.