1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-27 11:24:34 -05:00

Display more info

This commit is contained in:
Braiden Vasco 2017-11-04 12:12:20 +00:00
parent 9236066450
commit b8ddb9b871
3 changed files with 25 additions and 0 deletions

View file

@ -5,6 +5,7 @@
// Defined in linker script // Defined in linker script
extern char _kernel_offset; extern char _kernel_offset;
extern char _kernel_size;
extern char _kernel_phys_base; extern char _kernel_phys_base;
extern char _kernel_virt_base; extern char _kernel_virt_base;
@ -23,9 +24,13 @@ const struct KernelMQ_Info *init(unsigned long multiboot_magic, unsigned long mu
} }
kinfo.kernel_offset = (unsigned long)&_kernel_offset; kinfo.kernel_offset = (unsigned long)&_kernel_offset;
kinfo.kernel_size = (unsigned long)&_kernel_size;
kinfo.kernel_phys_base = (unsigned long)&_kernel_phys_base; kinfo.kernel_phys_base = (unsigned long)&_kernel_phys_base;
kinfo.kernel_virt_base = (unsigned long)&_kernel_virt_base; kinfo.kernel_virt_base = (unsigned long)&_kernel_virt_base;
kinfo.kernel_phys_limit = kinfo.kernel_phys_base + kinfo.kernel_size - 1;
kinfo.kernel_virt_limit = kinfo.kernel_virt_base + kinfo.kernel_size - 1;
return &kinfo; return &kinfo;
} }

View file

@ -31,4 +31,6 @@ SECTIONS
*(COMMON) *(COMMON)
*(.bss) *(.bss)
} }
_kernel_size = .;
} }

View file

@ -25,6 +25,24 @@ void main(const struct KernelMQ_Info *const kinfo_ptr)
kprintf("Kernel command line: %s\n", kinfo.cmdline); kprintf("Kernel command line: %s\n", kinfo.cmdline);
kprintf(
"Kernel phys base 0x%x, limit 0x%x\n",
kinfo.kernel_phys_base,
kinfo.kernel_phys_limit
);
kprintf(
"Kernel virt base 0x%x, limit 0x%x\n",
kinfo.kernel_virt_base,
kinfo.kernel_virt_limit
);
kprintf(
"Kernel size 0x%x, offset 0x%x\n",
kinfo.kernel_size,
kinfo.kernel_offset
);
for (unsigned int i = 0; i < kinfo.modules_count; ++i) { for (unsigned int i = 0; i < kinfo.modules_count; ++i) {
struct KernelMQ_Info_Module *module = &kinfo.modules[i]; struct KernelMQ_Info_Module *module = &kinfo.modules[i];