Changeset a35b458 in mainline for kernel/genarch/src/multiboot
- Timestamp:
- 2018-03-02T20:10:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- kernel/genarch/src/multiboot
- Files:
-
- 2 edited
-
multiboot.c (modified) (7 diffs)
-
multiboot2.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/multiboot/multiboot.c
r3061bc1 ra35b458 52 52 if (end == NULL) 53 53 end = cmd_line + str_size(cmd_line); 54 54 55 55 /* 56 56 * Find last occurence of '/' before 'end'. If found, place start at … … 59 59 const char *cp = end; 60 60 const char *start = buf; 61 61 62 62 while (cp != start) { 63 63 if (*cp == '/') { … … 67 67 cp--; 68 68 } 69 69 70 70 /* Copy the command. */ 71 71 str_ncpy(buf, size, start, (size_t) (end - start)); … … 106 106 if (init.cnt >= CONFIG_INIT_TASKS) 107 107 break; 108 108 109 109 init.tasks[init.cnt].paddr = mods[i].start; 110 110 init.tasks[init.cnt].size = mods[i].end - mods[i].start; 111 111 112 112 /* Copy command line, if available. */ 113 113 if (mods[i].string) { … … 120 120 init.tasks[init.cnt].arguments[0] = 0; 121 121 } 122 122 123 123 init.cnt++; 124 124 } … … 128 128 { 129 129 uint32_t pos = 0; 130 130 131 131 while ((pos < length) && (e820counter < MEMMAP_E820_MAX_RECORDS)) { 132 132 e820table[e820counter] = memmap->mm_info; 133 133 134 134 /* Compute address of next structure. */ 135 135 uint32_t size = sizeof(memmap->size) + memmap->size; 136 136 memmap = (multiboot_memmap_t *) ((uintptr_t) memmap + size); 137 137 pos += size; 138 138 139 139 e820counter++; 140 140 } … … 163 163 multiboot_modules(info->mods_count, 164 164 (multiboot_module_t *) MULTIBOOT_PTR(info->mods_addr)); 165 165 166 166 /* Copy memory map. */ 167 167 if ((info->flags & MULTIBOOT_INFO_FLAGS_MMAP) != 0) -
kernel/genarch/src/multiboot/multiboot2.c
r3061bc1 ra35b458 56 56 multiboot_extract_argument(init.tasks[init.cnt].arguments, 57 57 CONFIG_TASK_ARGUMENTS_BUFLEN, module->string); 58 58 59 59 init.cnt++; 60 60 } … … 66 66 ((uintptr_t) memmap + sizeof(*memmap)); 67 67 uint32_t pos = sizeof(*memmap); 68 68 69 69 while ((pos < length) && (e820counter < MEMMAP_E820_MAX_RECORDS)) { 70 70 e820table[e820counter].base_address = entry->base_address; 71 71 e820table[e820counter].size = entry->size; 72 72 e820table[e820counter].type = entry->type; 73 73 74 74 /* Compute address of next entry. */ 75 75 entry = (multiboot2_memmap_entry_t *) 76 76 ((uintptr_t) entry + memmap->entry_size); 77 77 pos += memmap->entry_size; 78 78 79 79 e820counter++; 80 80 } … … 90 90 bfb_bpp = fbinfo->bpp; 91 91 bfb_scanline = fbinfo->scanline; 92 92 93 93 bfb_red_pos = fbinfo->rgb.red_pos; 94 94 bfb_red_size = fbinfo->rgb.red_size; 95 95 96 96 bfb_green_pos = fbinfo->rgb.green_pos; 97 97 bfb_green_size = fbinfo->rgb.green_size; 98 98 99 99 bfb_blue_pos = fbinfo->rgb.blue_pos; 100 100 bfb_blue_size = fbinfo->rgb.blue_size; … … 116 116 if (signature != MULTIBOOT2_LOADER_MAGIC) 117 117 return; 118 118 119 119 const multiboot2_tag_t *tag = (const multiboot2_tag_t *) 120 120 ALIGN_UP((uintptr_t) info + sizeof(*info), MULTIBOOT2_TAG_ALIGN); 121 121 122 122 while (tag->type != MULTIBOOT2_TAG_TERMINATOR) { 123 123 switch (tag->type) { … … 135 135 break; 136 136 } 137 137 138 138 tag = (const multiboot2_tag_t *) 139 139 ALIGN_UP((uintptr_t) tag + tag->size, MULTIBOOT2_TAG_ALIGN);
Note:
See TracChangeset
for help on using the changeset viewer.
