2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
7 #include <proto/exec.h>
8 #include <dos/dosextens.h>
9 #include <dos/filesystem.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
15 #include <proto/dos.h>
17 AROS_LH3(BOOL
, Format
,
20 AROS_LHA(CONST_STRPTR
, devicename
, D1
),
21 AROS_LHA(CONST_STRPTR
, volumename
, D2
),
22 AROS_LHA(ULONG
, dostype
, D3
),
25 struct DosLibrary
*, DOSBase
, 119, Dos
)
28 Initialise a filesystem for use by the system. This instructs
29 a filesystem to write out the data that it uses to describe the
32 The device should already have been formatted.
35 devicename - Name of the device to format.
36 volumename - The name you wish the volume to be called.
37 dostype - The DOS type you wish on the disk.
40 != 0 if the format was successful, 0 otherwise.
52 *****************************************************************************/
55 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
59 /* Get space for I/O request. Use stackspace for now. */
60 struct IOFileSys iofs
;
62 /* Prepare I/O request. */
63 InitIOFS(&iofs
, FSA_FORMAT
, DOSBase
);
65 iofs
.IOFS
.io_Device
= GetDevice(devicename
, &iofs
.IOFS
.io_Unit
,
68 if (iofs
.IOFS
.io_Device
== NULL
)
73 iofs
.io_Union
.io_FORMAT
.io_VolumeName
= volumename
;
74 iofs
.io_Union
.io_FORMAT
.io_DosType
= dostype
;
76 /* Send the request. */
80 if (iofs
.io_DosError
== 0)
86 SetIoErr(iofs
.io_DosError
);