print stivale2 memmap always
This commit is contained in:
parent
d20c7723bf
commit
353adb0800
|
|
@ -25,6 +25,7 @@ struct stivale2_header header2 = {
|
|||
|
||||
void stivale2_main(struct stivale2_struct *info) {
|
||||
parse_stivale2(info);
|
||||
print_stivale2_memmap(info);
|
||||
|
||||
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
|
||||
kmain(3, argv);
|
||||
|
|
|
|||
|
|
@ -153,3 +153,22 @@ void parse_stivale2(struct stivale2_struct *info) {
|
|||
}
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
void print_stivale2_memmap(struct stivale2_struct *info) {
|
||||
struct stivale2_tag *tag = (struct stivale2_tag*)(info->tags);
|
||||
while(tag != 0) {
|
||||
switch(tag->identifier) {
|
||||
case STIVALE2_STRUCT_TAG_MEMMAP_ID: {
|
||||
struct stivale2_struct_tag_memmap *m = (struct stivale2_struct_tag_memmap *)tag;
|
||||
printf("Memmap (%d entries):\n", m->entries);
|
||||
for (size_t i = 0; i < m->entries; i++) {
|
||||
struct stivale2_mmap_entry me = m->memmap[i];
|
||||
printf("\t[%x+%h] %x\n", (size_t)me.base, (size_t)me.length, me.type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tag = (struct stivale2_tag *)tag->next;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
void print_stivale2(struct stivale2_struct *info);
|
||||
void parse_stivale2(struct stivale2_struct *info);
|
||||
void print_stivale2_memmap(struct stivale2_struct *info);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ struct stivale2_header header2 = {
|
|||
|
||||
void stivale2_main(struct stivale2_struct *info) {
|
||||
parse_stivale2(info);
|
||||
print_stivale2_memmap(info);
|
||||
|
||||
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
|
||||
kmain(3, argv);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static void printdec(size_t num) {
|
|||
|
||||
static void printhuman(size_t num) {
|
||||
const char *unit = UNITS;
|
||||
while(num >= 2048 && *(unit+1)) {
|
||||
while(num >= 10240 && *(unit+1)) {
|
||||
num /= 1024;
|
||||
unit++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue