2 #include "kernel/kernel.h"
3 #include "libopenbios/sys_info.h"
6 #ifdef CONFIG_DEBUG_BOOT
12 void collect_multiboot_info(struct sys_info *);
13 void collect_sys_info(struct sys_info *info);
15 void collect_sys_info(struct sys_info *info)
18 unsigned long long total = 0;
19 struct memrange *mmap;
21 /* Pick up paramters given by bootloader to us */
22 info->boot_type = boot_ctx->eax;
23 info->boot_data = boot_ctx->ebx;
24 info->boot_arg = boot_ctx->param[0];
25 debug("boot eax = %#lx\n", info->boot_type);
26 debug("boot ebx = %#lx\n", info->boot_data);
27 debug("boot arg = %#lx\n", info->boot_arg);
29 collect_elfboot_info(info);
30 #ifdef CONFIG_LINUXBIOS
31 collect_linuxbios_info(info);
33 #ifdef CONFIG_IMAGE_ELF_MULTIBOOT
34 collect_multiboot_info(info);
37 if (!info->memrange) {
38 printk("Can't get memory map from firmware. "
39 "Using hardcoded default.\n");
40 info->n_memranges = 2;
41 info->memrange = malloc(2 * sizeof(struct memrange));
42 info->memrange[0].base = 0;
43 info->memrange[0].size = 640*1024;
44 info->memrange[1].base = 1024*1024;
45 info->memrange[1].size = 32*1024*1024
46 - info->memrange[1].base;
51 for (i = 0; i < info->n_memranges; i++) {
52 debug("%016Lx-", mmap[i].base);
53 debug("%016Lx\n", mmap[i].base+mmap[i].size);
54 total += mmap[i].size;
56 debug("RAM %Ld MB\n", (total + 512*1024) >> 20);