1 #define AROS_ALMOST_COMPATIBLE
4 #include <dos/filehandler.h>
5 #include <libraries/expansionbase.h>
7 #include <proto/exec.h>
15 #define AROS_BSTR_ADDR(s) ((char *)(s << 2) + 1)
16 #define AROS_BSTR_strlen(s) *((unsigned char *)(s << 2))
19 int __nocommandline
= 1;
21 static void PrintDosType(ULONG dt
)
25 for (i
= 0; i
< 4; i
++)
27 unsigned char c
= dt
>> (24 - i
* 8);
36 static BOOL
IsMounted(struct DeviceNode
*dn
)
39 struct DosList
*dl
= LockDosList(LDF_DEVICES
|LDF_READ
);
41 while ((dl
= NextDosEntry(dl
, LDF_DEVICES
)))
43 if (dl
== (struct DosList
*)dn
)
50 UnLockDosList(LDF_DEVICES
|LDF_READ
);
57 struct ExpansionBase
*base
= (struct ExpansionBase
*)OpenLibrary("expansion.library", 0);
61 printf("Failed to open expansion.library!\n");
65 ForeachNode(&base
->MountList
, n
)
67 struct DeviceNode
*dn
= n
->bn_DeviceNode
;
69 printf("BootNode %p, Flags 0x%08X, ConfigDev %p\n", n
, n
->bn_Flags
, n
->bn_Node
.ln_Name
);
70 printf("DeviceNode %p <%s>", dn
, AROS_BSTR_ADDR(dn
->dn_Name
));
73 printf(" Handler %s", AROS_BSTR_ADDR(dn
->dn_Handler
));
77 printf("\nType %d, Task %p, SegList %p\n", (int)dn
->dn_Type
, BADDR(dn
->dn_Task
), BADDR(dn
->dn_SegList
));
81 struct FileSysStartupMsg
*fssm
= BADDR(dn
->dn_Startup
);
83 printf("FileSysStartupMsg %p", fssm
);
84 if (fssm
->fssm_Device
!= BNULL
&& AROS_BSTR_strlen(fssm
->fssm_Device
))
85 printf(" <%s unit %ld flags 0x%08X>", AROS_BSTR_ADDR(fssm
->fssm_Device
), (long)fssm
->fssm_Unit
, (unsigned int)fssm
->fssm_Flags
);
88 if (fssm
->fssm_Environ
)
90 struct DosEnvec
*de
= BADDR(fssm
->fssm_Environ
);
92 printf("DosEnvec %p DosType 0x%08lX <", de
, de
->de_DosType
);
93 PrintDosType(de
->de_DosType
);
94 printf("> BootPri %ld LowCyl %ld HighCyl %ld\n", de
->de_BootPri
, de
->de_LowCyl
, de
->de_HighCyl
);
100 CloseLibrary(&base
->LibNode
);