diff --git a/Makefile b/Makefile index 82c7381..4655eea 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ PROG := a4091.device PROGU := a4091 PROGD := a4091d SRCS := device.c version.c siop.c port.c attach.c cmdhandler.c printf.c -SRCS += sd.c scsipi_base.c scsiconf.c scsimsg.c rdb_partitions.c bootmenu.c +SRCS += sd.c scsipi_base.c scsiconf.c scsimsg.c mounter.c bootmenu.c SRCS += romfile.c battmem.c ASMSRCS := reloc.S baserel.S SRCSU := a4091.c @@ -48,7 +48,7 @@ CFLAGS += -D_KERNEL -DPORT_AMIGA #CFLAGS += -DDEBUG_SCSIMSG # Debug scsimsg.c #CFLAGS += -DDEBUG_SD # Debug sd.c #CFLAGS += -DDEBUG_SIOP # Debug siop.c -#CFLAGS += -DDEBUG_RDB # Debug rdb_partitions.c +#CFLAGS += -DDEBUG_MOUNTER # Debug mounter.c #CFLAGS += -DDEBUG_BOOTMENU # Debug bootmenu.c #CFLAGS += -DNO_SERIAL_OUTPUT # Turn off serial debugging for the whole driver diff --git a/device.c b/device.c index e556663..3235e78 100644 --- a/device.c +++ b/device.c @@ -21,7 +21,7 @@ #include "device.h" #include "cmdhandler.h" #include "version.h" -#include "rdb_partitions.h" +#include "mounter.h" #include "bootmenu.h" #include "romfile.h" #include "attach.h" diff --git a/mounter.c b/mounter.c index 520d0ab..d3cb8b7 100644 --- a/mounter.c +++ b/mounter.c @@ -49,6 +49,7 @@ #include #include "ndkcompat.h" +#include "mounter.h" #define TRACE 1 #define Trace printf @@ -938,3 +939,31 @@ LONG MountDrive(struct MountStruct *ms) dbg("Exit code %"PRId32"\n", ret); return ret; } + +int mount_drives(struct ConfigDev *cd, struct Library *dev) +{ + extern char real_device_name[]; + static BOOL mounted = FALSE; + struct MountStruct ms; + int i, ret = 0; + + ULONG unitNum[] = { 7, 0, 1, 2, 3, 4, 5, 6 }; + + printf("Mounter:\n"); + if (!mounted) { + ms.deviceName = real_device_name; + ms.unitNum = unitNum; + ms.creatorName = NULL; + ms.configDev = cd; + ms.SysBase = *(struct ExecBase **)4UL; + + mounted = TRUE; + ret = MountDrive(&ms); + } + + printf("ret = %x\nunitNum = { ", ret); + for (i=0; i<8; i++) + printf("%x%s", unitNum[i], i<7?", ":" }\n"); + + return ret; +} diff --git a/mounter.h b/mounter.h index 01ad17e..55c753e 100644 --- a/mounter.h +++ b/mounter.h @@ -6,4 +6,6 @@ void W_DeleteIORequest(APTR iorequest, struct ExecBase *SysBase); struct MsgPort *W_CreateMsgPort(struct ExecBase *SysBase); void W_DeleteMsgPort(struct MsgPort *port, struct ExecBase *SysBase); +int mount_drives(struct ConfigDev *cd, struct Library *dev); + #endif diff --git a/port.h b/port.h index cd5eddf..a166a79 100644 --- a/port.h +++ b/port.h @@ -91,7 +91,6 @@ void *device_private(device_t dev); !defined(DEBUG_SCSIMSG) && \ !defined(DEBUG_SD) && \ !defined(DEBUG_SIOP) && \ - !defined(DEBUG_RDB) && \ !defined(DEBUG_BOOTMENU) && \ !defined(DEBUG_MOUNTER)) || defined(NO_SERIAL_OUTPUT) #ifdef USE_SERIAL_OUTPUT