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>
9 int __nocommandline
= 1;
11 static const char *types
[] =
25 APTR KernelBase
= OpenResource("kernel.resource");
29 printf("Failed to open kernel.resource!\n");
33 tags
= KrnGetBootInfo();
36 printf("No boot information from the bootstrap!\n");
40 mmap
= (struct mb_mmap
*)GetTagData(KRN_MMAPAddress
, 0, tags
);
41 len
= GetTagData(KRN_MMAPLength
, 0, tags
);
45 printf("No memory map provided by the bootstrap!\n");
49 printf("Memory map at 0x%p, length %lu:\n", mmap
, len
);
50 while (len
>= sizeof(struct mb_mmap
))
52 unsigned int type
= mmap
->type
;
53 unsigned long long memaddr
= mmap
->addr
;
54 unsigned long long memlen
= mmap
->len
;
56 if (type
> MMAP_TYPE_ACPINVS
)
60 memaddr
|= (unsigned long long)mmap
->addr_high
<< 32;
61 memlen
|= (unsigned long long)mmap
->len_high
<< 32;
64 printf("Entry size %d type %d <%s> addr 0x%016llx len 0x%016llx\n", mmap
->size
, mmap
->type
, types
[type
], memaddr
, memlen
);
66 len
-= mmap
->size
+ 4;
67 mmap
= (struct mb_mmap
*)(mmap
->size
+ (unsigned long)mmap
+ 4);