1 #include <aros/bootloader.h>
2 #include <exec/execbase.h>
3 #include <exec/memory.h>
4 #include <proto/aros.h>
5 #include <proto/bootloader.h>
6 #include <proto/exec.h>
7 #include <proto/utility.h>
11 ULONG
ExtUDivMod32(ULONG a
, ULONG b
, ULONG
*mod
)
18 void PrintNum(ULONG num
)
33 num
= ExtUDivMod32(UMult32(num
, 100) >> 10, 100, &x
);
36 x
= ExtUDivMod32(x
, 10, &xx
);
47 printf("%d.%d %s", num
, x
, fmt
);
55 ULONG
ComputeKBytes(APTR a
, APTR b
)
59 return (ULONG
)(result
>> 10);
63 char __stdiowin
[]="CON://700//ShowConfig/AUTO/CLOSE/WAIT";
73 printf("VERS:\tAROS version %d.%d, Exec version %d.%d\n", ArosBase
->lib_Version
, ArosBase
->lib_Revision
,
74 SysBase
->LibNode
.lib_Version
, SysBase
->LibNode
.lib_Revision
);
77 for (mh
= (struct MemHeader
*)SysBase
->MemList
.lh_Head
; mh
->mh_Node
.ln_Succ
; mh
= (struct MemHeader
*)mh
->mh_Node
.ln_Succ
) {
78 char *memtype
= "ROM";
80 if (mh
->mh_Attributes
& MEMF_CHIP
)
82 if (mh
->mh_Attributes
& MEMF_FAST
)
84 printf("\tNode Type 0x%X, Attributes 0x%X (%s), at %p-%p (", mh
->mh_Node
.ln_Type
, mh
->mh_Attributes
, memtype
, mh
->mh_Lower
, mh
->mh_Upper
);
85 PrintNum(ComputeKBytes(mh
->mh_Lower
, mh
->mh_Upper
));
89 BootLoaderBase
= OpenResource("bootloader.resource");
91 bootldr
= GetBootInfo(BL_LoaderName
);
94 printf("BOOTLDR:\t%s\n", bootldr
);
96 args
= GetBootInfo(BL_Args
);
99 for (n
= args
->lh_Head
; n
->ln_Succ
; n
= n
->ln_Succ
) {
100 printf("%s ", n
->ln_Name
);