Changeset 0f94c3d in mainline


Ignore:
Timestamp:
2009-03-01T20:51:26Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2e079b70
Parents:
0d5a50c
Message:

Read command line for multiboot modules on ia32 and copy it to task name. Other arches will need to initialize task names in the init structure to an empty string.

Location:
kernel
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/boot/boot.S

    r0d5a50c r0f94c3d  
    224224                       
    225225                        addl $16, %esi
    226                         addq $16, %rdi
     226                        addq $48, %rdi
    227227                       
    228228                        loop mods_loop
  • kernel/arch/ia32/src/boot/cboot.c

    r0d5a50c r0f94c3d  
    3939#include <config.h>
    4040#include <memstr.h>
     41#include <func.h>
    4142
    4243/* This is a symbol so the type is only dummy. Obtain the value using &. */
     
    6970                        init.tasks[i].addr = mods[i].start + 0x80000000;
    7071                        init.tasks[i].size = mods[i].end - mods[i].start;
     72
     73                        /* Copy command line, if available. */
     74                        if (mods[i].string) {
     75                                strncpy(init.tasks[i].name, mods[i].string,
     76                                    CONFIG_TASK_NAME_BUFLEN - 1);
     77                                init.tasks[i].name[CONFIG_TASK_NAME_BUFLEN - 1]
     78                                    = '\0';
     79                        } else {
     80                                init.tasks[i].name[0] = '\0';
     81                        }
    7182                }
    7283        } else {
  • kernel/generic/include/config.h

    r0d5a50c r0f94c3d  
    4141#define STACK_SIZE  PAGE_SIZE
    4242
    43 #define CONFIG_INIT_TASKS  32
     43#define CONFIG_INIT_TASKS       32
     44
     45#define CONFIG_TASK_NAME_BUFLEN 32
    4446
    4547typedef struct {
    4648        uintptr_t addr;
    4749        size_t size;
     50        char name[CONFIG_TASK_NAME_BUFLEN];
    4851} init_task_t;
    4952
  • kernel/generic/src/main/kinit.c

    r0d5a50c r0f94c3d  
    175175                        continue;
    176176                }
     177
     178                char *name = init.tasks[i].name;
     179                if (name[0] == '\0') name = "init-bin";
    177180               
    178181                int rc = program_create_from_image((void *) init.tasks[i].addr,
    179                     "init-bin", &programs[i]);
     182                    name, &programs[i]);
    180183               
    181184                if ((rc == 0) && (programs[i].task != NULL)) {
  • kernel/generic/src/proc/task.c

    r0d5a50c r0f94c3d  
    397397
    398398#ifdef __32_BITS__     
    399         printf("%-6" PRIu64 " %-10s %-3" PRIu32 " %10p %10p %9" PRIu64
     399        printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64
    400400            "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles,
    401401            suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls));
     
    403403
    404404#ifdef __64_BITS__
    405         printf("%-6" PRIu64 " %-10s %-3" PRIu32 " %18p %18p %9" PRIu64
     405        printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64
    406406            "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles,
    407407            suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls));
     
    430430        printf("taskid name       ctx address    as         "
    431431            "cycles     threads calls  callee\n");
    432         printf("------ ---------- --- ---------- ---------- "
     432        printf("------ ------------ --- ---------- ---------- "
    433433            "---------- ------- ------ ------>\n");
    434434#endif
     
    437437        printf("taskid name       ctx address            as                 "
    438438            "cycles     threads calls  callee\n");
    439         printf("------ ---------- --- ------------------ ------------------ "
     439        printf("------ ------------ --- ------------------ ------------------ "
    440440            "---------- ------- ------ ------>\n");
    441441#endif
Note: See TracChangeset for help on using the changeset viewer.