19 lines
557 B
C
19 lines
557 B
C
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <platform/multiboot.h>
|
|
|
|
extern struct multiboot_info *multiboot_ebx;
|
|
|
|
void *MultibootFindModule(const char *name) {
|
|
if (!multiboot_ebx) return NULL;
|
|
|
|
for (uint32_t i = 0; i < multiboot_ebx->mods_count; i++) {
|
|
struct multiboot_mod_list *mod = (struct multiboot_mod_list *)(multiboot_ebx->mods_addr + i * sizeof(struct multiboot_mod_list));
|
|
if (!strcmp((char *)mod->cmdline, name)) {
|
|
return (void *)mod->mod_start;
|
|
}
|
|
}
|
|
|
|
return NULL;
|
|
} |