2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/kernel.h>
7 #include <aros/multiboot.h>
8 #include <proto/exec.h>
9 #include <proto/kernel.h>
10 #include <proto/utility.h>
11 #include <proto/kernel.h>
15 int __nocommandline
= 1;
17 static const char *types
[] =
31 APTR KernelBase
= OpenResource("kernel.resource");
35 printf("Failed to open kernel.resource!\n");
39 tags
= KrnGetBootInfo();
42 printf("No boot information from the bootstrap!\n");
46 mmap
= (struct mb_mmap
*)GetTagData(KRN_MMAPAddress
, 0, tags
);
47 len
= GetTagData(KRN_MMAPLength
, 0, tags
);
51 printf("No memory map provided by the bootstrap!\n");
55 printf("Memory map at 0x%p, length %lu:\n", mmap
, len
);
56 while (len
>= sizeof(struct mb_mmap
))
58 unsigned int type
= mmap
->type
;
59 unsigned long long memaddr
= mmap
->addr
;
60 unsigned long long memlen
= mmap
->len
;
62 if (type
> MMAP_TYPE_ACPINVS
)
66 memaddr
|= (unsigned long long)mmap
->addr_high
<< 32;
67 memlen
|= (unsigned long long)mmap
->len_high
<< 32;
70 printf("Entry size %d type %d <%s> addr 0x%016llx len 0x%016llx\n", mmap
->size
, mmap
->type
, types
[type
], memaddr
, memlen
);
72 len
-= mmap
->size
+ 4;
73 mmap
= (struct mb_mmap
*)(mmap
->size
+ (unsigned long)mmap
+ 4);