Changeset 03362fbd in mainline for kernel/generic/src/main/kinit.c


Ignore:
Timestamp:
2013-02-09T23:14:45Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
22dfd38
Parents:
b5d2e57 (diff), 005b765 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Conflict resulting from bool.h → stdbool.h move and ddf structs turning opaque.
Fails to boot to shell console.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/main/kinit.c

    rb5d2e57 r03362fbd  
    6969#include <str.h>
    7070#include <sysinfo/stats.h>
     71#include <sysinfo/sysinfo.h>
    7172#include <align.h>
    7273
     
    171172#endif /* CONFIG_KCONSOLE */
    172173       
     174        /*
     175         * Store the default stack size in sysinfo so that uspace can create
     176         * stack with this default size.
     177         */
     178        sysinfo_set_item_val("default.stack_size", NULL, STACK_SIZE_USER);
     179       
    173180        interrupts_enable();
    174181       
     
    179186        program_t programs[CONFIG_INIT_TASKS];
    180187       
     188        // FIXME: do not propagate arguments through sysinfo
     189        // but pass them directly to the tasks
     190        for (i = 0; i < init.cnt; i++) {
     191                const char *arguments = init.tasks[i].arguments;
     192                if (str_length(arguments) == 0)
     193                        continue;
     194                if (str_length(init.tasks[i].name) == 0)
     195                        continue;
     196                size_t arguments_size = str_size(arguments);
     197
     198                void *arguments_copy = malloc(arguments_size, 0);
     199                if (arguments_copy == NULL)
     200                        continue;
     201                memcpy(arguments_copy, arguments, arguments_size);
     202
     203                char item_name[CONFIG_TASK_NAME_BUFLEN + 15];
     204                snprintf(item_name, CONFIG_TASK_NAME_BUFLEN + 15,
     205                    "init_args.%s", init.tasks[i].name);
     206
     207                sysinfo_set_item_data(item_name, NULL, arguments_copy, arguments_size);
     208        }
     209
    181210        for (i = 0; i < init.cnt; i++) {
    182211                if (init.tasks[i].paddr % FRAME_SIZE) {
Note: See TracChangeset for help on using the changeset viewer.