- struct multiboot_mod_list* mod = &mods[i];
- modents[i] = (struct boot_modent){ .start = mod->mod_start,
- .end = mod->mod_end,
- .str = (char*)mod_str_ptr };
-
- mod_str_ptr += mb_strcpy((char*)mod_str_ptr,
- (char*)__ptr(mod->cmdline));
+ mod = &mods[i];
+ cmd = (char*)__ptr(mod->cmdline);
+ name_len = strlen(cmd);
+ mod_name = bootmem_alloc(name_len + 1);
+
+ modents[i] = (struct boot_modent){
+ .start = mod->mod_start,
+ .end = mod->mod_end,
+ .str = mod_name
+ };
+
+ strncpy(mod_name, cmd, name_len);