Added a test for MUIA_Listview_SelectChange.
[AROS.git] / rom / filesys / pfs3 / fs / mount_8G.c
blob50eea063d9113e23edd168f3ccab1c92fca1ded1
1 /* $Id$ */
2 /* $Log: mount.c $
3 * Revision 10.9 1998/09/03 07:12:14 Michiel
4 * Test for 5GB
6 * Revision 10.8 1998/05/27 20:16:13 Michiel
7 * Overdue checkin
9 * Revision 10.7 1997/03/03 22:04:04 Michiel
10 * Release 16.21
12 * Revision 10.6 1995/02/15 16:43:39 Michiel
13 * Release version
14 * Using new headers (struct.h & blocks.h)
16 * Revision 10.5 1995/01/29 07:34:57 Michiel
17 * Other disk specs
19 * Revision 10.4 1995/01/18 04:29:34 Michiel
20 * Less_buffers
22 * Revision 10.3 1995/01/13 15:22:16 Michiel
23 * mounts on dh1 now
24 * bug fixed, can format while debugging now
26 * Revision 10.2 1994/11/15 17:52:30 Michiel
27 * Mounts on harddisk now
29 * Revision 10.1 1994/10/24 11:16:28 Michiel
30 * first RCS revision
31 * */
33 /* Copyright (c) 1994 Doug Walker, Raleigh, NC */
34 /* All Rights Reserved. */
35 #define __USE_SYSBASE
37 #include <dos/dos.h>
38 #include <dos/filehandler.h>
39 #include <exec/memory.h>
40 #include <exec/execbase.h>
41 #include <proto/exec.h>
42 #include <proto/dos.h>
44 #include <string.h>
46 //#include "mount.h"
47 #include "blocks.h"
48 #include "struct.h"
50 /* protos */
51 int DisMount(struct DeviceList *volume);
52 struct DeviceNode *Mount(char *name, struct MsgPort *port);
54 #define V37 (SysBase->LibNode.lib_Version > 36)
56 //static __aligned UBYTE devicename[] = {15,'o','k','t','a','g','o','n','.','d','e','v','i','c','e',0};
57 //static __aligned UBYTE devicename[] = "\0172nd.scsi.device";
58 static __aligned UBYTE devicename[] = "\013scsi.device";
60 /* Mount a volume with the given name; route all handler
61 ** messages to the given port.
63 struct DeviceNode *Mount(char *name, struct MsgPort *port)
65 struct DeviceNode *volume;
66 struct DosList *dlist;
67 struct FileSysStartupMsg *fssm = AllocVec(sizeof(struct FileSysStartupMsg), MEMF_CLEAR);
68 struct DosEnvec *dosenvec = AllocVec(sizeof(struct DosEnvec), MEMF_CLEAR);
70 if(name == NULL || port == NULL) return NULL;
72 /* make dosenvec */
73 /* test: bpt=8,hc=1250000 */
74 /* zip: bpt=8,hc=24575 */
75 dosenvec->de_TableSize = 17;
76 dosenvec->de_SizeBlock = 128;
77 dosenvec->de_Surfaces = 16; // 1; // !!
78 dosenvec->de_SectorPerBlock = 1;
79 dosenvec->de_BlocksPerTrack = 63; // 8; //555; // !!
80 dosenvec->de_Reserved = 2;
81 dosenvec->de_LowCyl = 2; // 0; // !!
82 dosenvec->de_HighCyl = 14759; // 1250000; // !!
83 dosenvec->de_NumBuffers = 350;
84 dosenvec->de_BufMemType = 0;
85 dosenvec->de_MaxTransfer = 0x1ffff;
86 dosenvec->de_Mask = 0x7ffffffe;
87 dosenvec->de_DosType = 0x6d757577; //ID_MUAF_DISK; // 0x6D754653; //ID_PFS_DISK or just fun: 0x6d757575;
88 dosenvec->de_BootBlocks = 2;
90 /* make fssm */
91 fssm->fssm_Unit = 1; // 5; // !!
92 fssm->fssm_Device = MKBADDR(devicename);
93 fssm->fssm_Environ = MKBADDR(dosenvec);
94 fssm->fssm_Flags = 0;
96 while(!(dlist = AttemptLockDosList(LDF_DEVICES|LDF_WRITE)))
98 /* Can't lock the DOS list. Wait a second and try again. */
99 Delay(50);
101 volume = (struct DeviceNode *)FindDosEntry(dlist, name, LDF_DEVICES);
102 if(volume) RemDosEntry((struct DosList *)volume);
103 UnLockDosList(LDF_DEVICES|LDF_WRITE);
105 if(!volume && !(volume = (struct DeviceNode *)MakeDosEntry(name, DLT_DEVICE)))
106 return NULL;
108 volume->dn_Startup = MKBADDR(fssm);
109 volume->dn_Lock = NULL;
110 volume->dn_GlobalVec = -1;
112 /* Now we can own the volume by giving it our msgport */
113 volume->dn_Task = port;
115 while(!(dlist = AttemptLockDosList(LDF_DEVICES|LDF_WRITE)))
117 /* Oops, can't lock DOS list. Wait 1 second and retry. */
118 Delay(50);
120 AddDosEntry((struct DosList *)volume);
121 UnLockDosList(LDF_DEVICES|LDF_WRITE);
123 return volume;