xref: /xnu-10063.141.1/bsd/sys/loadable_fs.h (revision d8b80295118ef25ac3a784134bcf95cd8e88109f)
1*d8b80295SApple OSS Distributions /*
2*d8b80295SApple OSS Distributions  * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3*d8b80295SApple OSS Distributions  *
4*d8b80295SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*d8b80295SApple OSS Distributions  *
6*d8b80295SApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7*d8b80295SApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8*d8b80295SApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9*d8b80295SApple OSS Distributions  * compliance with the License. The rights granted to you under the License
10*d8b80295SApple OSS Distributions  * may not be used to create, or enable the creation or redistribution of,
11*d8b80295SApple OSS Distributions  * unlawful or unlicensed copies of an Apple operating system, or to
12*d8b80295SApple OSS Distributions  * circumvent, violate, or enable the circumvention or violation of, any
13*d8b80295SApple OSS Distributions  * terms of an Apple operating system software license agreement.
14*d8b80295SApple OSS Distributions  *
15*d8b80295SApple OSS Distributions  * Please obtain a copy of the License at
16*d8b80295SApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*d8b80295SApple OSS Distributions  *
18*d8b80295SApple OSS Distributions  * The Original Code and all software distributed under the License are
19*d8b80295SApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*d8b80295SApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*d8b80295SApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*d8b80295SApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*d8b80295SApple OSS Distributions  * Please see the License for the specific language governing rights and
24*d8b80295SApple OSS Distributions  * limitations under the License.
25*d8b80295SApple OSS Distributions  *
26*d8b80295SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*d8b80295SApple OSS Distributions  */
28*d8b80295SApple OSS Distributions /*	@(#)loadable_fs.h	2.0	26/06/90	(c) 1990 NeXT	*/
29*d8b80295SApple OSS Distributions 
30*d8b80295SApple OSS Distributions /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
31*d8b80295SApple OSS Distributions  *
32*d8b80295SApple OSS Distributions  * W I L L    D R A S T I C A L L Y   C H A N G E   S O O N
33*d8b80295SApple OSS Distributions  * U S E   A T  Y O U R   O W N  R I S K
34*d8b80295SApple OSS Distributions  *
35*d8b80295SApple OSS Distributions  * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
36*d8b80295SApple OSS Distributions 
37*d8b80295SApple OSS Distributions 
38*d8b80295SApple OSS Distributions /*
39*d8b80295SApple OSS Distributions  * loadable_fs.h - message struct for loading and initializing loadable
40*d8b80295SApple OSS Distributions  *		   file systems.
41*d8b80295SApple OSS Distributions  */
42*d8b80295SApple OSS Distributions 
43*d8b80295SApple OSS Distributions #ifndef _SYS_LOADABLE_FS_
44*d8b80295SApple OSS Distributions #define _SYS_LOADABLE_FS_
45*d8b80295SApple OSS Distributions 
46*d8b80295SApple OSS Distributions 
47*d8b80295SApple OSS Distributions /*
48*d8b80295SApple OSS Distributions  * Constants for Loadable FS Utilities (in "/System/Library/Filesystems")
49*d8b80295SApple OSS Distributions  *
50*d8b80295SApple OSS Distributions  * Example of a /usr/filesystems directory
51*d8b80295SApple OSS Distributions  *
52*d8b80295SApple OSS Distributions  * /usr/filesystems/dos.fs/dos.util		utility with which WSM
53*d8b80295SApple OSS Distributions  *							communicates
54*d8b80295SApple OSS Distributions  * /usr/filesystems/dos.fs/dos.name             "DOS Floppy"
55*d8b80295SApple OSS Distributions  * /usr/filesystems/dos.fs/dos_reloc		actual loadable filesystem
56*d8b80295SApple OSS Distributions  * /usr/filesystems/dos.fs/dos.openfs.tiff	"open folder" icon
57*d8b80295SApple OSS Distributions  * /usr/filesystems/dos.fs/dos.fs.tiff		"closed folder" icon
58*d8b80295SApple OSS Distributions  */
59*d8b80295SApple OSS Distributions #define FS_DIR_LOCATION         "/System/Library/Filesystems"
60*d8b80295SApple OSS Distributions #define FS_DIR_SUFFIX           ".fs"
61*d8b80295SApple OSS Distributions #define FS_UTIL_SUFFIX          ".util"
62*d8b80295SApple OSS Distributions 
63*d8b80295SApple OSS Distributions /*
64*d8b80295SApple OSS Distributions  * .util program commands - all sent in the form "-p" or "-m" ... as argv[1].
65*d8b80295SApple OSS Distributions  */
66*d8b80295SApple OSS Distributions #define FSUC_PROBE              'p'     /* probe FS for mount or init */
67*d8b80295SApple OSS Distributions /* example usage: foo.util -p fd0 removable writable */
68*d8b80295SApple OSS Distributions 
69*d8b80295SApple OSS Distributions #define FSUC_PROBEFORINIT       'P'     /* probe FS for init only */
70*d8b80295SApple OSS Distributions /* example usage: foo.util -P fd0 removable */
71*d8b80295SApple OSS Distributions 
72*d8b80295SApple OSS Distributions #define FSUC_MOUNT              'm'     /* mount FS */
73*d8b80295SApple OSS Distributions /* example usage: foo.util -m fd0 /bar removable writable */
74*d8b80295SApple OSS Distributions 
75*d8b80295SApple OSS Distributions #define FSUC_REPAIR             'r'     /* repair ('fsck') FS */
76*d8b80295SApple OSS Distributions /* example usage: foo.util -r fd0 removable */
77*d8b80295SApple OSS Distributions 
78*d8b80295SApple OSS Distributions #define FSUC_UNMOUNT            'u'     /* unmount FS */
79*d8b80295SApple OSS Distributions /* example usage: foo.util -u fd0 /bar */
80*d8b80295SApple OSS Distributions 
81*d8b80295SApple OSS Distributions /* The following is not used by Workspace Manager */
82*d8b80295SApple OSS Distributions #define FSUC_MOUNT_FORCE        'M'     /* like FSUC_MOUNT, but proceed even on
83*d8b80295SApple OSS Distributions 	                                 * error. */
84*d8b80295SApple OSS Distributions /*
85*d8b80295SApple OSS Distributions  * Return codes from .util program
86*d8b80295SApple OSS Distributions  */
87*d8b80295SApple OSS Distributions #define FSUR_RECOGNIZED         (-1)    /* response to FSUC_PROBE; implies that
88*d8b80295SApple OSS Distributions 	                                 * a mount is possible */
89*d8b80295SApple OSS Distributions #define FSUR_UNRECOGNIZED       (-2)    /* negative response to FSUC_PROBE */
90*d8b80295SApple OSS Distributions #define FSUR_IO_SUCCESS         (-3)    /* mount, unmount, repair succeeded */
91*d8b80295SApple OSS Distributions #define FSUR_IO_FAIL            (-4)    /* unrecoverable I/O error */
92*d8b80295SApple OSS Distributions #define FSUR_IO_UNCLEAN         (-5)    /* mount failed, file system not clean
93*d8b80295SApple OSS Distributions 	                                 */
94*d8b80295SApple OSS Distributions #define FSUR_INVAL              (-6)    /* invalid argument */
95*d8b80295SApple OSS Distributions #define FSUR_LOADERR            (-7)    /* kern_loader error */
96*d8b80295SApple OSS Distributions #define FSUR_INITRECOGNIZED     (-8)    /* response to FSUC_PROBE or
97*d8b80295SApple OSS Distributions 	                                 * FSUC_PROBEFORINIT, implies that
98*d8b80295SApple OSS Distributions 	                                 * initialization is possible */
99*d8b80295SApple OSS Distributions 
100*d8b80295SApple OSS Distributions /*
101*d8b80295SApple OSS Distributions  *	mount parameters passed from WSM to the .util program.
102*d8b80295SApple OSS Distributions  */
103*d8b80295SApple OSS Distributions #define DEVICE_READONLY         "readonly"
104*d8b80295SApple OSS Distributions #define DEVICE_WRITABLE         "writable"
105*d8b80295SApple OSS Distributions 
106*d8b80295SApple OSS Distributions #define DEVICE_REMOVABLE        "removable"
107*d8b80295SApple OSS Distributions #define DEVICE_FIXED            "fixed"
108*d8b80295SApple OSS Distributions 
109*d8b80295SApple OSS Distributions #endif  /* _SYS_LOADABLE_FS_ */
110