Ignore:
Timestamp:
2017-07-21T19:21:59Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3009164
Parents:
9f64c1e
Message:

Support boot_args also for multiboot2 boots

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/multiboot/multiboot2.c

    r9f64c1e r9ef1fade  
    4141
    4242#define MULTIBOOT2_TAG_ALIGN  8
     43
     44static void multiboot2_cmdline(const multiboot2_cmdline_t *module)
     45{
     46        /*
     47         * GRUB passes the command line in an escaped form.
     48         */
     49        for (size_t i = 0, j = 0;
     50            module->string[i] && j < CONFIG_BOOT_ARGUMENTS_BUFLEN;
     51            i++, j++) {
     52                if (module->string[i] == '\\') {
     53                        switch (module->string[i + 1]) {
     54                        case '\\':
     55                        case '\'':
     56                        case '\"':
     57                                i++;
     58                                break;
     59                        }
     60                }
     61                bargs[j] = module->string[i];
     62        }
     63}
    4364
    4465static void multiboot2_module(const multiboot2_module_t *module)
     
    117138        while (tag->type != MULTIBOOT2_TAG_TERMINATOR) {
    118139                switch (tag->type) {
     140                case MULTIBOOT2_TAG_CMDLINE:
     141                        multiboot2_cmdline(&tag->cmdline);
     142                        break;
    119143                case MULTIBOOT2_TAG_MODULE:
    120144                        multiboot2_module(&tag->module);
Note: See TracChangeset for help on using the changeset viewer.