1 #include <aros/kernel.h>
2 #include <aros/multiboot.h>
3 #include <proto/exec.h>
4 #include <proto/kernel.h>
5 #include <proto/utility.h>
6 #include <proto/kernel.h>
10 int __nocommandline
= 1;
12 static const char *types
[] =
26 APTR KernelBase
= OpenResource("kernel.resource");
30 printf("Failed to open kernel.resource!\n");
34 tags
= KrnGetBootInfo();
37 printf("No boot information from the bootstrap!\n");
41 mmap
= (struct mb_mmap
*)GetTagData(KRN_MMAPAddress
, 0, tags
);
42 len
= GetTagData(KRN_MMAPLength
, 0, tags
);
46 printf("No memory map provided by the bootstrap!\n");
50 printf("Memory map at 0x%p, length %lu:\n", mmap
, len
);
51 while (len
>= sizeof(struct mb_mmap
))
53 unsigned int type
= mmap
->type
;
54 unsigned long long memaddr
= mmap
->addr
;
55 unsigned long long memlen
= mmap
->len
;
57 if (type
> MMAP_TYPE_ACPINVS
)
61 memaddr
|= (unsigned long long)mmap
->addr_high
<< 32;
62 memlen
|= (unsigned long long)mmap
->len_high
<< 32;
65 printf("Entry size %d type %d <%s> addr 0x%016llx len 0x%016llx\n", mmap
->size
, mmap
->type
, types
[type
], memaddr
, memlen
);
67 len
-= mmap
->size
+ 4;
68 mmap
= (struct mb_mmap
*)(mmap
->size
+ (unsigned long)mmap
+ 4);