Changeset 9ef1fade in mainline
- Timestamp:
- 2017-07-21T19:21:59Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3009164
- Parents:
- 9f64c1e
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/boot/multiboot2.S
r9f64c1e r9ef1fade 54 54 .word MULTIBOOT2_FLAGS_REQUIRED 55 55 .long tag_info_req_end - tag_info_req_start 56 .long MULTIBOOT2_TAG_CMDLINE 56 57 .long MULTIBOOT2_TAG_MODULE 57 58 .long MULTIBOOT2_TAG_MEMMAP -
kernel/arch/ia32/src/boot/multiboot2.S
r9f64c1e r9ef1fade 52 52 .word MULTIBOOT2_FLAGS_REQUIRED 53 53 .long tag_info_req_end - tag_info_req_start 54 .long MULTIBOOT2_TAG_CMDLINE 54 55 .long MULTIBOOT2_TAG_MODULE 55 56 .long MULTIBOOT2_TAG_MEMMAP -
kernel/genarch/include/genarch/multiboot/multiboot2.h
r9f64c1e r9ef1fade 52 52 #define MULTIBOOT2_TAG_MODULE_ALIGN 6 53 53 54 #define MULTIBOOT2_TAG_CMDLINE 1 54 55 #define MULTIBOOT2_TAG_MODULE 3 55 56 #define MULTIBOOT2_TAG_MEMMAP 6 … … 73 74 uint32_t reserved; 74 75 } __attribute__((packed)) multiboot2_info_t; 76 77 /** Multiboot2 cmdline structure */ 78 typedef struct { 79 char string[0]; 80 } __attribute__((packed)) multiboot2_cmdline_t; 75 81 76 82 /** Multiboot2 modules structure */ … … 138 144 uint32_t size; 139 145 union { 146 multiboot2_cmdline_t cmdline; 140 147 multiboot2_module_t module; 141 148 multiboot2_memmap_t memmap; -
kernel/genarch/src/multiboot/multiboot2.c
r9f64c1e r9ef1fade 41 41 42 42 #define MULTIBOOT2_TAG_ALIGN 8 43 44 static 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 } 43 64 44 65 static void multiboot2_module(const multiboot2_module_t *module) … … 117 138 while (tag->type != MULTIBOOT2_TAG_TERMINATOR) { 118 139 switch (tag->type) { 140 case MULTIBOOT2_TAG_CMDLINE: 141 multiboot2_cmdline(&tag->cmdline); 142 break; 119 143 case MULTIBOOT2_TAG_MODULE: 120 144 multiboot2_module(&tag->module);
Note:
See TracChangeset
for help on using the changeset viewer.