2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #define AROS_ALMOST_COMPATIBLE
9 #include <dos/filehandler.h>
10 #include <libraries/expansionbase.h>
11 #include <proto/dos.h>
12 #include <proto/exec.h>
20 #define AROS_BSTR_ADDR(s) ((char *)(s << 2) + 1)
21 #define AROS_BSTR_strlen(s) *((unsigned char *)(s << 2))
24 int __nocommandline
= 1;
26 static void PrintDosType(ULONG dt
)
30 for (i
= 0; i
< 4; i
++)
32 unsigned char c
= dt
>> (24 - i
* 8);
41 static BOOL
IsMounted(struct DeviceNode
*dn
)
44 struct DosList
*dl
= LockDosList(LDF_DEVICES
|LDF_READ
);
46 while ((dl
= NextDosEntry(dl
, LDF_DEVICES
)))
48 if (dl
== (struct DosList
*)dn
)
55 UnLockDosList(LDF_DEVICES
|LDF_READ
);
62 struct ExpansionBase
*base
= (struct ExpansionBase
*)OpenLibrary("expansion.library", 0);
66 printf("Failed to open expansion.library!\n");
70 ForeachNode(&base
->MountList
, n
)
72 struct DeviceNode
*dn
= n
->bn_DeviceNode
;
74 printf("BootNode %p, Flags 0x%08X, ConfigDev %p\n", n
, n
->bn_Flags
, n
->bn_Node
.ln_Name
);
75 printf("DeviceNode %p <%s>", dn
, AROS_BSTR_ADDR(dn
->dn_Name
));
78 printf(" Handler %s", AROS_BSTR_ADDR(dn
->dn_Handler
));
82 printf("\nType %d, Task %p, SegList %p\n", (int)dn
->dn_Type
, BADDR(dn
->dn_Task
), BADDR(dn
->dn_SegList
));
86 struct FileSysStartupMsg
*fssm
= BADDR(dn
->dn_Startup
);
88 printf("FileSysStartupMsg %p", fssm
);
89 if (fssm
->fssm_Device
!= BNULL
&& AROS_BSTR_strlen(fssm
->fssm_Device
))
90 printf(" <%s unit %ld flags 0x%08X>", AROS_BSTR_ADDR(fssm
->fssm_Device
), (long)fssm
->fssm_Unit
, (unsigned int)fssm
->fssm_Flags
);
93 if (fssm
->fssm_Environ
)
95 struct DosEnvec
*de
= BADDR(fssm
->fssm_Environ
);
97 printf("DosEnvec %p DosType 0x%08lX <", de
, de
->de_DosType
);
98 PrintDosType(de
->de_DosType
);
99 printf("> BootPri %ld LowCyl %ld HighCyl %ld\n", de
->de_BootPri
, de
->de_LowCyl
, de
->de_HighCyl
);
105 CloseLibrary(&base
->LibNode
);