Compare commits
2 Commits
94edee626a
...
353adb0800
| Author | SHA1 | Date |
|---|---|---|
|
|
353adb0800 | |
|
|
d20c7723bf |
3
Makefile
3
Makefile
|
|
@ -17,7 +17,8 @@ run: $(KERNEL_HDD)
|
||||||
-drive file=$(KERNEL_HDD),format=raw \
|
-drive file=$(KERNEL_HDD),format=raw \
|
||||||
-smp 2 \
|
-smp 2 \
|
||||||
-enable-kvm \
|
-enable-kvm \
|
||||||
-debugcon stdio
|
-debugcon stdio \
|
||||||
|
$(QEMUFLAGS)
|
||||||
|
|
||||||
bochs: $(KERNEL_HDD) ext/bochsrc
|
bochs: $(KERNEL_HDD) ext/bochsrc
|
||||||
rm -f $(KERNEL_HDD).lock
|
rm -f $(KERNEL_HDD).lock
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ struct stivale2_header header2 = {
|
||||||
|
|
||||||
void stivale2_main(struct stivale2_struct *info) {
|
void stivale2_main(struct stivale2_struct *info) {
|
||||||
parse_stivale2(info);
|
parse_stivale2(info);
|
||||||
|
print_stivale2_memmap(info);
|
||||||
|
|
||||||
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
|
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
|
||||||
kmain(3, argv);
|
kmain(3, argv);
|
||||||
|
|
|
||||||
|
|
@ -153,3 +153,22 @@ void parse_stivale2(struct stivale2_struct *info) {
|
||||||
}
|
}
|
||||||
putchar('\n');
|
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 print_stivale2(struct stivale2_struct *info);
|
||||||
void parse_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) {
|
void stivale2_main(struct stivale2_struct *info) {
|
||||||
parse_stivale2(info);
|
parse_stivale2(info);
|
||||||
|
print_stivale2_memmap(info);
|
||||||
|
|
||||||
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
|
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
|
||||||
kmain(3, argv);
|
kmain(3, argv);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ static void printdec(size_t num) {
|
||||||
|
|
||||||
static void printhuman(size_t num) {
|
static void printhuman(size_t num) {
|
||||||
const char *unit = UNITS;
|
const char *unit = UNITS;
|
||||||
while(num >= 2048 && *(unit+1)) {
|
while(num >= 10240 && *(unit+1)) {
|
||||||
num /= 1024;
|
num /= 1024;
|
||||||
unit++;
|
unit++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue