aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/multiboot.c
blob: a8fdc3c66b93971fd4df06283ef340e52bc9d0dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <stdint.h>
#include <kernel/system.h>
#include <kernel/multiboot.h>
#include <kernel/lib/lib.h>
#include <kernel/lib/stdio.h>

void multiboot_parse(uint32_t multiboot_address)
{
	struct multiboot_tag *tag;

	for (tag = (struct multiboot_tag *)(multiboot_address + 8);
	     tag->type != MULTIBOOT_TAG_TYPE_END;
	     tag = (struct multiboot_tag *)((multiboot_uint8_t *)tag + ((tag->size + 7) & ~7))) {
		//log("Tag 0x%x, Size 0x%x", tag->type, tag->size);
		switch (tag->type) {
		case MULTIBOOT_TAG_TYPE_CMDLINE:
			//info("Command line: %s", ((struct multiboot_tag_string *)tag)->string);
			break;
		case MULTIBOOT_TAG_TYPE_BOOT_LOADER_NAME:
			//info("Bootloader name: %s", ((struct multiboot_tag_string *)tag)->string);
			break;
		case MULTIBOOT_TAG_TYPE_MODULE:
			break;
		case MULTIBOOT_TAG_TYPE_BASIC_MEMINFO:
			log("YAY");
			memory_init((struct multiboot_tag_basic_meminfo *)tag);
			break;
		case MULTIBOOT_TAG_TYPE_BOOTDEV:
			break;
		case MULTIBOOT_TAG_TYPE_MMAP:
			break;
		case MULTIBOOT_TAG_TYPE_VBE:
			break;
		case MULTIBOOT_TAG_TYPE_FRAMEBUFFER:
			break;
		case MULTIBOOT_TAG_TYPE_APM:
			break;
		case MULTIBOOT_TAG_TYPE_EFI32:
			break;
		case MULTIBOOT_TAG_TYPE_ACPI_OLD:
			break;
		case MULTIBOOT_TAG_TYPE_ACPI_NEW:
			break;
		case MULTIBOOT_TAG_TYPE_NETWORK:
			break;
		case MULTIBOOT_TAG_TYPE_EFI_MMAP:
			break;
		case MULTIBOOT_TAG_TYPE_EFI_BS:
			break;
		case MULTIBOOT_TAG_TYPE_EFI32_IH:
			break;
		case MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR:
			break;
		}
	}
}