Mercurial > hg > Members > kono > nitros9-code
annotate docs/nitros9guide/chap3.chapter @ 1053:b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
capitalization and quotes (") to show what was commands, files and just
text. With today's formatting, this is not necessary, so everywhere
capitalization was used to show a command the <command> element is now
used instead, and everywhere a file is mentioned the <filename> element is used.
author | roug |
---|---|
date | Thu, 20 Mar 2003 20:19:53 +0000 |
parents | c9b63a3c0a17 |
children | 4dae346c4969 |
rev | line source |
---|---|
144 | 1 <chapter> |
2 <title>The OS-9 File System</title> | |
3 <section> | |
4 <title>Introduction to the Unified Input/Output System</title> | |
5 <para> | |
6 OS-9 has a unified input/output system in which data transfers to | |
7 ALL I/O devices are performed in almost exactly the same manner, | |
8 regardless of the particular hardware devices involved. It may seem | |
9 that the different operational characteristics of the I/O devices | |
10 might make this difficult. After all, line printers and disk drives | |
11 behave much differently. However, these differences can mostly be | |
12 overcome by defining a set of standardized | |
13 <emphasis>logical functions</emphasis> for | |
14 all devices and by making all I/O devices conform to these | |
15 conventions, using software routines to eliminate hardware | |
16 dependencies wherever possible. This produces a much simpler and | |
17 more versatile input/output system. | |
18 </para> | |
19 <para> | |
20 OS-9's unified I/O system is based upon logical entities called | |
21 "I/O paths". Paths are analogous to "software I/O channels" which | |
22 can be routed from a program to a mass-storage file, any other I/O | |
23 device, or even another program. Another way to say the same thing | |
24 is that paths are files, and all I/O devices behave as files. | |
25 </para> | |
26 <para> | |
27 Data transferred through paths may be processed by OS-9 to | |
28 conform to the hardware requirements of the specific I/O device | |
29 involved. Data transfers can be either bidirectional (read/write) | |
30 or unidirectional (read only or write only), depending on the device | |
31 and/or how the path was established. | |
32 </para> | |
33 <para> | |
34 Data transferred through a path is considered to be a stream of | |
35 8-bit binary bytes that have no specific type or value: what the | |
36 data actually represents depends on how it is used by each program. | |
37 This is important because it means that OS-9 does not require data | |
38 to have any special format or meaning. | |
39 </para> | |
40 <para> | |
41 Some of the advantages of the unified I/O system are: | |
42 </para> | |
43 <itemizedlist mark="square"> | |
44 <listitem><para> | |
45 Programs will operate correctly regardless of the particular I/O | |
46 devices selected and used when the program is actually executed. | |
47 </para></listitem> | |
48 <listitem><para> | |
49 Programs are highly portable from one computer to another, even | |
50 when the computers have different kinds of I/O devices. | |
51 </para></listitem> | |
52 <listitem><para> | |
53 I/O can be redirected to alternate files or devices when the | |
54 program is run, without having to alter the program. | |
55 </para></listitem> | |
56 <listitem><para> | |
57 New or special device driver routines can easily be created and | |
58 installed by the user. | |
59 </para></listitem> | |
60 </itemizedlist> | |
61 </section> | |
62 | |
63 <section> | |
64 <title>Pathlists: How Paths Are Named</title> | |
65 <para> | |
66 Whenever a path is established (or "opened"), OS-9 must be given | |
67 a description of the "routing" of the path. This description is | |
68 given in the form of a character string called a "pathlist". It | |
69 specifies a particular mass-storage file, directory file, or any | |
70 other I/O device. OS-9 "pathlists" are | |
71 similar to "filenames" used | |
72 by other operating systems. | |
73 </para> | |
74 <para> | |
75 The name "pathlist" is used instead | |
76 of "pathname" or "filename" | |
77 because in many cases it is a list consisting of more than one name | |
78 to specify a particular I/O device or file. In order to convey all | |
79 the information required, a pathlist may include a device name, one | |
80 or more directory file names and a data file name. Each name within | |
81 a pathlist is separated by slash "/" characters. | |
82 </para> | |
83 <para> | |
84 Names are used to describe three kinds of things: | |
85 | |
86 <itemizedlist> | |
87 <listitem><para>Names of Physical I/O Devices</para></listitem> | |
88 <listitem><para>Names of Regular Files</para></listitem> | |
89 <listitem><para>Names of Directory Files</para></listitem> | |
90 </itemizedlist> | |
91 | |
92 | |
93 Names can have one to 29 characters, all of which are used for | |
94 matching. They must becin with an upper- or lower-case letter | |
95 followed by any combination of the following characters: | |
96 </para> | |
97 | |
98 <simplelist> | |
99 <member>uppercase letters: A - Z</member> | |
100 <member>lowercase letters: a - z</member> | |
101 <member>decimal digits: 0 - 9</member> | |
102 <member>underscore: _</member> | |
103 <member>period: .</member> | |
104 </simplelist> | |
105 | |
106 <para> | |
107 Here are examples of <emphasis>legal</emphasis> names: | |
108 <informaltable frame="none"> | |
109 <tgroup cols="2"> | |
644 | 110 <colspec colwidth="2.5in"/> |
111 <colspec colwidth="2.5in"/> | |
144 | 112 <tbody> |
113 <row> | |
114 <entry>raw.data.2</entry> | |
115 <entry>projectreview.backup</entry> | |
116 </row> | |
117 <row> | |
118 <entry>reconciliation.report</entry> | |
119 <entry>X042953</entry> | |
120 </row> | |
121 <row> | |
122 <entry>RJJones</entry> | |
123 <entry>search.bin</entry> | |
124 </row> | |
125 </tbody> | |
126 </tgroup> | |
127 </informaltable> | |
128 | |
129 Here are examples of <emphasis>illegal</emphasis> names: | |
130 | |
131 <informaltable frame="none"> | |
132 <tgroup cols="2"> | |
644 | 133 <colspec colwidth="3.1in"/> |
134 <colspec colwidth="2.0in"/> | |
144 | 135 <tbody> |
136 <row> | |
137 <entry>22November</entry> | |
138 <entry>(does not start with a letter)</entry> | |
139 </row> | |
140 <row> | |
141 <entry>max*min</entry> | |
142 <entry>(* is not a legal character)</entry> | |
143 </row> | |
144 <row> | |
145 <entry>.data</entry> | |
146 <entry>(does not start with a letter)</entry> | |
147 </row> | |
148 <row> | |
149 <entry>open orders</entry> | |
150 <entry>(cannot contain a space)</entry> | |
151 </row> | |
152 <row> | |
153 <entry>this.name.obviously.has.more.than.29.characters</entry> | |
154 <entry>(too long)</entry> | |
155 </row> | |
156 </tbody> | |
157 </tgroup> | |
158 </informaltable> | |
159 </para> | |
160 </section> | |
161 | |
162 <section> | |
163 <title>I/O Device Names</title> | |
164 <para> | |
165 Each physical input/output device supported by the system must | |
166 have a unique name. The actual names used are defined when the | |
167 system is set up and cannot be changed while the system is running. | |
1011 | 168 The device names used for the &make; are: |
144 | 169 </para> |
170 <informaltable frame="none"> | |
171 <tgroup cols="2"> | |
644 | 172 <colspec colwidth="0.7in"/> |
173 <colspec colwidth="2in"/> | |
144 | 174 <tbody> |
175 <row> | |
176 <entry>TERM</entry> | |
177 <entry>Video display/keyboard</entry> | |
178 </row> | |
179 <row> | |
180 <entry>P</entry> | |
181 <entry>Printer port</entry> | |
182 </row> | |
183 <row> | |
184 <entry>D0</entry> | |
185 <entry>Disk drive unit zero</entry> | |
186 </row> | |
187 <row> | |
188 <entry>D1</entry> | |
189 <entry>Disk drive unit one</entry> | |
190 </row> | |
191 <row> | |
192 <entry>PIPE</entry> | |
193 <entry>Pipes</entry> | |
194 </row> | |
195 </tbody> | |
196 </tgroup> | |
197 </informaltable> | |
198 <para> | |
199 Device names may only be used as the first name of a pathlist, | |
200 and must be preceded by a slash "/" character to indicate that the | |
201 name is that of an I/O device. If the device is not a disk or | |
202 similar device the device name is the only name allowed. This is | |
203 true for devices such as terminals, printers, etc. Some examples of | |
204 of pathlists that refer to I/O devices are: | |
205 </para> | |
206 | |
207 <simplelist> | |
208 <member>/TERM</member> | |
209 <member>/P</member> | |
210 <member>/D1</member> | |
211 </simplelist> | |
212 | |
213 <para> | |
214 I/O device names are actually the names of the "device descriptor | |
215 modules" kept by OS-9 in an internal data structure called the | |
216 "module directory" (See the OS-9 System Programmer's manual for more | |
217 information about device driver and descriptor modules). This | |
218 directory is automatically set up during OS-9's system start up | |
219 sequence, and updated as modules are added or deleted while the | |
220 system is running. | |
221 </para> | |
222 </section> | |
223 | |
224 <section> | |
225 <title>Multifile Devices And Directory Files</title> | |
226 <para> | |
227 Multifile devices are mass storage devices (usually disk systems) | |
228 that store data organized into separate logical entities called | |
229 "files". Each file has a name which is entered in a directory file. | |
230 Every multifile device has a master directory (called the "root | |
231 directory") that includes the names of the files and sub-directories | |
232 stored on the device. The root directory is created automatically | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
233 when the disk is initialized by the <command>format</command> command. |
144 | 234 </para> |
235 <para> | |
236 Pathlists that refer to multifile devices may have more than one | |
237 name. For example, to refer to the file "mouse" whose name appears | |
238 in the root directory of device "D1" (disk drive one) the following | |
239 pathlist is used: | |
240 </para> | |
241 <para> | |
242 | |
243 /d1/mouse | |
244 | |
245 </para> | |
246 <para> | |
247 When OS-9 is asked to create a path, it uses the names in the | |
248 pathlist sequentially from left to right to search various | |
249 directories to obtain the necessary routing information. These | |
250 directories are organized as a tree-structured hierarchy. The | |
251 highest-level directory is called the "device directory", which | |
252 contains names and linkages to all the I/O devices on a given | |
253 system. If any of the devices are of a multifile type they each | |
254 have a root directory, which is the next-highest level. | |
255 </para> | |
256 <para> | |
257 The diagram below is a simplified file system tree of a typical | |
258 OS-9 system disk. Note that device and directory names are capitalized | |
259 and ordinary file names are not. This is a customary (but | |
260 not mandatory) practice which allows you to easily identify directory | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
261 files using the short form of the <command>dir</command> command. |
144 | 262 </para> |
644 | 263 <literallayout class="monospaced"> |
144 | 264 System Device Directory |
265 +---------------------------------+ | |
266 ! ! ! ! | |
267 D0 TERM P D1 | |
268 ! ! | |
269 ! ! | |
270 ! ! | |
271 D0 Root Directory D1 Root Directory | |
272 +----------------------+ +----------------------+ | |
273 ! ! ! ! ! ! | |
274 DEFS startup CMDS file1 file2 file3 | |
275 ! ! | |
276 ! ! | |
277 ! ! | |
278 --+-- +-----+----+-----+-----+ | |
279 ! ! ! ! ! ! | |
280 OS9Defs copy list dir del backup | |
281 </literallayout> | |
282 <para> | |
283 The device names in this example system are "TERM", | |
284 "P", "D0" and | |
285 "D1". The root directory of device | |
286 "D0" includes two directory | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
287 files, <filename class="directory">DEFS</filename> and <filename class="directory">CMDS</filename>, and one ordinary file "startup". Notice that |
144 | 288 device "D1" has in its root directory three ordinary files. In |
289 order to access the file "file2" on | |
290 device "d1", a pathlist having | |
291 two names must be used: | |
292 <screen> | |
293 list /d1/file2 | |
294 </screen> | |
295 To construct a pathlist to access the file "dir" on device | |
296 "d0" it is necessary to include in the pathlist the name of the | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
297 intermediate directory file <filename class="directory">CMDS</filename>. For example, to copy this file |
144 | 298 requires a pathlist having three names to describe the "from" file: |
299 <screen> | |
300 copy /d0/cmds/dir temp | |
301 </screen> | |
302 </para> | |
303 </section> | |
304 | |
305 <section> | |
306 <title>Creating and Using Directories</title> | |
307 <para> | |
308 It is possible to create a virtually unlimited number of levels | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
309 of directories on a mass storage device using the <command>makdir</command> command. |
144 | 310 Directories are a special type of file (see 3.8.1). They can be |
311 processed by the same I/O functions used to access regular files | |
312 which makes directory-related processing fairly simple. | |
313 </para> | |
314 <para> | |
315 To demonstrate how directories work, assume that the disk in | |
316 drive one ("d1") has been freshly formatted so that it has a root | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
317 directory only. The <command>build</command> command can be used to create a text file |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
318 on "d1". The <command>build</command> command will print out "?" as a prompt to |
144 | 319 indicate that it is waiting for a text line to be entered. It will |
320 place each line into the text file until an empty line with only a | |
321 carriage return is entered, as shown below: | |
322 </para> | |
323 <screen> | |
324 OS9: build /d1/file1 | |
325 ? This is the first file that | |
326 ? we created. | |
327 ? [ENTER] | |
328 </screen> | |
329 | |
330 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
331 The <command>dir</command> command will now indicate the existence of the new file: |
144 | 332 </para> |
333 | |
334 <screen> | |
335 OS9: dir /d1 | |
336 | |
337 Directory of /d1 15:45:29 | |
338 file1 | |
339 </screen> | |
340 | |
341 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
342 The <command>list</command> command can be used to display the text stored in the |
144 | 343 file: |
344 </para> | |
345 | |
346 <screen> | |
347 OS9: list /d1/file1 | |
348 | |
349 This is the first file | |
350 that we created. | |
351 </screen> | |
352 | |
353 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
354 The <command>build</command> command again is again used to create two more text |
144 | 355 files: |
356 </para> | |
357 | |
358 <screen> | |
359 OS9: build /d1/file2 | |
360 ? This is the second file | |
361 ? that we created. | |
362 ? [ENTER] | |
363 | |
364 OS9: build /d1/file3 | |
365 ? This is another file. | |
366 ? [ENTER] | |
367 </screen> | |
368 | |
369 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
370 The <command>dir</command> command will now show three file names: |
144 | 371 </para> |
372 | |
373 <screen> | |
374 OS9: dir /d1 | |
375 Directory of /D1 15:52:29 | |
376 file1 file2 file3 | |
377 </screen> | |
378 | |
379 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
380 To make a new directory in this directory, the <command>makdir</command> command is |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
381 used. The new directory will be called <filename class="directory">NEWDIR</filename>. Notice that |
144 | 382 throughout this manual directory names are always capitalized. This |
383 is <emphasis>not</emphasis> a requirement of OS-9 (see 3.1) . Rather, it is a | |
384 practice popular with many OS-9 users because it allows easy identification | |
385 of directory files at all times (assuming all other file names use | |
386 lower-case letters). | |
387 </para> | |
388 | |
389 <screen> | |
390 OS9: makdir /D1/NEWDIR | |
391 </screen> | |
392 | |
393 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
394 The directory file <filename class="directory">NEWDIR</filename> is now a file listed in D1's root |
144 | 395 directory: |
396 </para> | |
397 | |
398 <screen> | |
399 OS9: dir /D1 | |
400 | |
401 Directory of /D1 16:04:31 | |
402 file1 file2 file3 NEWDIR | |
403 </screen> | |
404 | |
405 <para> | |
406 Now we will create a new file and put in the new directory, using | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
407 the <command>copy</command> command to duplicate <filename>file1</filename>: |
144 | 408 </para> |
409 <screen> | |
1011 | 410 OS9: copy /d1/file1 /d1/newdir/file1.copy |
144 | 411 </screen> |
412 <para> | |
413 Observe that the second pathlist now has three names: the name of | |
414 the root directory ("D1"), the name of the next lower directory | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
415 (<filename class="directory">NEWDIR</filename>), then the actual file name (<filename class="directory">file1.copy</filename>). Here's what |
144 | 416 the directories look like now: |
417 </para> | |
418 <screen> | |
419 D1 Root Directory | |
420 +---------+--------+--------+ | |
421 ! ! ! ! | |
422 NEWDIR file1 file2 file3 | |
423 ! | |
424 ! | |
425 file1.copy | |
426 </screen> | |
427 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
428 The <command>dir</command> command can now show the files in the new directory: |
144 | 429 </para> |
430 <screen> | |
431 OS9: dir /D1/NEWDIR | |
432 | |
433 Directory of /D1/NEWDIR | |
434 file1.copy | |
435 </screen> | |
436 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
437 It is possible to use <command>makdir</command> to create additional new directories |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
438 within <filename class="directory">NEWDIR</filename>, and so on, limited only by available disk |
144 | 439 space. |
440 </para> | |
441 </section> | |
442 | |
443 <section> | |
444 <title>Deleting Directory Files</title> | |
445 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
446 The <command>del</command> command cannot be used to directly delete a directory |
144 | 447 file. If a directory file that still contained file names were to |
448 be deleted, OS-9 would have no way to access the files or to return | |
449 their storage to the unallocated storage pool. Therefore, the | |
450 following sequence must be performed to delete a directory file: | |
451 </para> | |
452 <para> | |
1011 | 453 1. All file names in the directory must be deleted. |
144 | 454 </para> |
455 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
456 2. The <command>attr</command> command is used to turn off the files directory |
144 | 457 attrribute (-d option), making it an ordinary file (see 3.8). |
458 </para> | |
459 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
460 3. The file may now be deleted using the <command>del</command> command. |
144 | 461 </para> |
462 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
463 A simpler alternative is to use the <command>deldir</command> command to automatically |
144 | 464 perform all these steps for you. |
465 </para> | |
466 </section> | |
467 | |
468 <section> | |
469 <title>Additional Information About Directories</title> | |
470 <para> | |
471 The OS-9 directory system is very useful because it allows each | |
472 user to privately organize files as desired (by project, function, | |
473 etc.), without affecting other files or other user's files. Another | |
474 advantage of the hierarchical directory system is that files with | |
475 identical names can be kept on the same device as long as the names | |
476 are in different directories. For example, you can have a set of | |
477 test files to check out a program using the same file names as the | |
478 program's actual working files. You can then run the program with | |
479 test data or actual data simply by switching directories. | |
480 </para> | |
481 <para> | |
482 Here are some important characteristics relating to use of directory | |
483 files: | |
484 </para> | |
485 <itemizedlist> | |
486 <listitem><para> | |
487 Directories have the same ownership and security attributes | |
1011 | 488 and rules as regular files. |
144 | 489 </para></listitem> |
490 <listitem><para> | |
491 The name of a given file appears in exactly one directory. | |
492 </para></listitem> | |
493 <listitem><para> | |
494 Files can only be added to directories when they are created. | |
495 </para></listitem> | |
496 <listitem><para> | |
497 A file and the directory in which its name is kept must reside on | |
498 the same device. | |
499 </para></listitem> | |
500 </itemizedlist> | |
501 </section> | |
502 | |
503 <section> | |
504 <title>Using and Changing Working Directories</title> | |
505 <para> | |
506 Each program (process) has two "working directories" associated | |
507 with it at all times: a "data directory" and an "execution | |
508 directory". The working directory mechanism allows the name searching | |
509 involved in pathlist processing to start at any level (subtree) | |
510 of the file system hierarchy. Any directory that the user has | |
511 permission to access (see 3.8) can be made a working directory. | |
512 </para> | |
513 <para> | |
514 The rules used to determine whether pathlists refer to the | |
515 current working directory or not are simple: | |
516 </para> | |
517 <para> | |
518 ---> When the first character of a pathlist IS a "/", | |
519 processing of the pathlist starts at the device directory, | |
520 e.g., the first name MUST be a device name. | |
521 </para> | |
522 <para> | |
523 ---> When the first character of a pathlist IS NOT a "/", | |
524 processing of the pathlist starts at the current working | |
525 directory. | |
526 </para> | |
527 <para> | |
528 Notice that pathlists starting with a "/" | |
529 <emphasis>must</emphasis> be complete, in | |
530 other words, they must have all names required to trace the pathlist | |
531 from the device directory down through all intermediate directories | |
532 (if any). For example: | |
533 </para> | |
534 <informalexample> | |
535 <para> | |
536 /d2/JOE/WORKINGFILES/testresults | |
537 </para> | |
538 </informalexample> | |
539 <para> | |
540 On the other hand, use of the current working directory allows | |
541 all names in the file hierarchy tree to be implied instead of | |
542 explicitly given. This not only makes pathlists shorter, but allows | |
543 OS-9 to locate files faster because (typically) fewer directories | |
544 need be searched. For example, if the current working directory is | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
545 <filename class="directory">/D1/PETE/GAMES</filename> and a pathlist is given such as: |
144 | 546 </para> |
547 <para> | |
548 baseball | |
549 </para> | |
550 <para> | |
551 the actual pathlist <emphasis>implied</emphasis> is: | |
552 </para> | |
553 <para> | |
554 /D1/PETE/GAMES/baseball | |
555 </para> | |
556 <para> | |
557 Pathlists using working directories can also specify additional | |
558 lower-level directories. Referring to the example above, the | |
559 pathlist: | |
560 </para> | |
561 <para> | |
562 ACTION/racing | |
563 </para> | |
564 <para> | |
565 implies the complete pathlist: | |
566 </para> | |
567 <para> | |
568 /D1/PETE/GAMES/ACTION/racing | |
569 </para> | |
570 | |
571 <section> | |
572 <title>Automatic Selection of Working Directories</title> | |
573 <para> | |
574 Recall that two working directories are referred to as the | |
575 "current execution directory" and the "current data directory". The | |
576 reason two working directories are maintained is so that files | |
577 containing | |
578 <emphasis>programs</emphasis> can be organized in different directories than | |
579 files containing <emphasis>data</emphasis>. | |
580 OS-9 automatically selects either working | |
581 directory, depending on the usage of the pathlist: | |
582 </para> | |
583 <para> | |
584 ---> OS-9 will search the execution directory when it attempts to | |
585 load files into memory assumed to be executable programs. This | |
586 means that programs to be run as commands or loaded into | |
1011 | 587 memory must be in the current execution directory. |
144 | 588 </para> |
589 <para> | |
590 ---> The data directory is used for all other file references (such | |
591 as text files, etc.) | |
592 </para> | |
593 <para> | |
594 Immediately after startup, OS-9 will set the data directory to be | |
595 (the root directory of) the system disk drive (usually "D0"), and | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
596 the working directory to be a directory called <filename class="directory">cmds</filename> on the same |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
597 drive (<filename class="directory">/D0/cmds</filename>). On timesharing systems, the <command>login</command> command |
144 | 598 selects the initial execution and data directories to the file names |
599 specified in each user's information record stored in the system | |
600 password file(ref. 5.4.2). | |
601 </para> | |
602 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
603 Here is an example of a <command>shell</command> command statement using the default |
144 | 604 working directory notation, and its equivalent expansion: |
605 </para> | |
606 <screen> | |
607 copy file1 file2 | |
608 </screen> | |
609 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
610 If the current execution directory is <filename class="directory">/D0/CMDS</filename> and the current |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
611 data directory is <filename class="directory">/D0/JONES</filename>, the same command, fully expanded to |
144 | 612 show complete pathlists implied is: |
613 </para> | |
614 <screen> | |
615 OS9: /D0/CMDS/copy /D0/JONES/filel /D0/JONES/file2 | |
616 </screen> | |
617 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
618 Notice that the first pathlist <command>copy</command> expands to the current working |
144 | 619 directory pathlist because it is assumed to be an executable program |
620 but the two other file names expand using the data directory because | |
621 they are not assumed to be executable. | |
622 </para> | |
623 </section> | |
624 | |
625 <section> | |
626 <title>Changing Current Working Directories</title> | |
627 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
628 The built-in shell commands <command>chd</command> and <command>chx</command> can be used to |
144 | 629 independently change the current working data and execution |
630 directories, respectively. These command names must be followed by | |
631 a pathlist that describes the new directory file. You must have | |
632 permission to access the directory according to normal file security | |
1011 | 633 rules. Here are some examples: |
144 | 634 </para> |
635 <screen> | |
636 OS9: chd /D1/MY.DATAFILES | |
637 | |
638 OS9: chx /D0/TESTPROGRAMS | |
639 </screen> | |
640 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
641 When using the <command>chd</command> or <command>chx</command> commands, pathlists work the same as they |
144 | 642 do for regular files, except for the last name in the pathlist must |
643 be a directory name. If the pathlist begins with a "/" , OS-9 will | |
644 begin searching in the device directory for the new working | |
1011 | 645 directory, otherwise searching will begin with the present directory. |
646 For example, the following sequence of commands set the | |
144 | 647 working directory to the same file: |
648 </para> | |
649 <screen> | |
650 OS9: CHD /D1/SARAH | |
651 OS9: CHD PROJECT1 | |
652 | |
653 OS9: CHD /D1/SARAH/PROJECT1 (same effect as above) | |
654 </screen> | |
655 </section> | |
656 | |
657 <section> | |
658 <title>Anonymous Directory Names</title> | |
659 <para> | |
660 Sometimes is useful to be able to refer to the current directory | |
661 or the next higher-level directory, but its name (full pathlist) may | |
662 not be known. Because of this, special "name substitutes" are | |
663 available. They are: | |
664 </para> | |
665 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
666 <filename class="directory">.</filename> refers to the present working directory |
144 | 667 </para> |
668 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
669 <filename class="directory">..</filename> refers to the directory that contains the name of the present |
144 | 670 directory (e.g., the next highest level directory) |
671 </para> | |
672 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
673 <filename class="directory">...</filename> refers to directory two levels up, and so on |
144 | 674 </para> |
675 <para> | |
676 These can be used in place of pathlists and/or the first name in a | |
677 pathlist. Here are some examples: | |
678 </para> | |
679 <informaltable frame="none"> | |
680 <tgroup cols="2"> | |
644 | 681 <colspec colwidth="1.5in"/> |
682 <colspec colwidth="3in"/> | |
144 | 683 <tbody> |
684 <row> | |
685 <entry>OS9: dir .</entry> | |
686 <entry>lists file names in the working data directory</entry> | |
687 </row> | |
688 <row> | |
689 <entry>OS9: dir ..</entry> | |
690 <entry>lists names in the working data directory's parent directory.</entry> | |
691 </row> | |
692 <row> | |
1011 | 693 <entry>OS9: del ../temp</entry> |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
694 <entry>deletes the file <filename>temp</filename> from the |
144 | 695 working data directory's parent directory.</entry> |
696 </row> | |
697 </tbody> | |
698 </tgroup> | |
699 </informaltable> | |
700 <para> | |
701 The substitute names refer to either the execution or data | |
1011 | 702 directories, depending on the context in which they are used. |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
703 For example, if <filename class="directory">..</filename> is used in a pathlist of a file which |
144 | 704 will be loaded and/or executed, it will represent the parent |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
705 directory of the execution directory. Likewise, if <filename class="directory">.</filename> is used in a |
144 | 706 pathlist describing a program's input file, it will represent the |
707 current data directory. | |
708 </para> | |
709 </section> | |
710 </section> | |
711 | |
712 <section> | |
713 <title>The File Security System</title> | |
714 <para> | |
715 Every file (including directory files) has properties called | |
716 <emphasis>ownership</emphasis> | |
717 and <emphasis>attributes</emphasis> which determine who may access the file and | |
718 how it many be used. | |
719 </para> | |
720 <para> | |
721 OS-9 automatically stores with each file the user number | |
722 associated with the process that created it. This user is considered | |
723 to be the "owner" of the file. | |
724 </para> | |
725 <para> | |
726 Usage and security functions are based on "attributes", which | |
727 define how and by whom the file can be accessed. There are a total | |
728 of seven attributes, each of which can be turned "off" or | |
729 "on" | |
730 independently. The "d" attribute is used to indicate (when on) that | |
731 the file is a directory file. The other six attributes control | |
732 whether the file can be read, written to, or executed, by either the | |
733 owner or by the "public" (all other users). Specifically, these six | |
734 attributes are: | |
735 </para> | |
736 <para> | |
1011 | 737 WRITE PERMISSION FOR OWNER: If on, the owner may write to the file |
144 | 738 or delete it. This permission can be used to protect important |
739 files from accidental deletion or modification. | |
740 </para> | |
741 <para> | |
742 READ PERMISSION FOR OWNER: If on, the owner is allowed to read | |
743 from the file. This can be used to prevent "binary" files from | |
1011 | 744 being used as "text" files |
144 | 745 </para> |
746 <para> | |
747 EXECUTE PERMISSION FOR OWNER: If on, the owner can load the file into memory | |
748 and execute it. Note that the file <emphasis>must</emphasis> contain one or | |
1011 | 749 more valid OS-9 format memory modules in order to actually load |
144 | 750 </para> |
751 <para> | |
752 The following "public permissions" work the same way as | |
753 the "owner permissions" above but are applied to processes having | |
754 DIFFERENT user numbers than the file's owner. | |
755 </para> | |
756 <para> | |
757 WRITE PERMISSION FOR PUBLIC - If on, any other user may write to or | |
758 delete the file. | |
759 </para> | |
760 <para> | |
761 READ PERMISSION FOR PUBLIC - If on, any other user may read (and | |
762 possibly copy) the file. | |
763 </para> | |
764 <para> | |
765 EXECUTE PERMISSION FOR PUBLIC - If on, any other user may execute | |
766 the file. | |
767 </para> | |
768 <para> | |
769 For example, if a particular file had all permissions on except | |
770 "write permit to public" and "read permit to public", the owner | |
771 would have unrestricted access to the file, but other users could | |
772 execute it, but not read, copy, delete, or alter it. | |
773 </para> | |
774 | |
775 <section> | |
776 <title>Examining and Changing File Attributes</title> | |
777 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
778 The <command>dir</command> command may be used to examine the security permissions |
144 | 779 of the files in any particular directory when the "e" option is |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
780 used. An example using the <command>dir e</command> command to show the detailed |
144 | 781 attributes of the files in the current working directory is: |
782 </para> | |
783 <screen> | |
1017 | 784 Directory of . 2003/03/04 10:20 |
144 | 785 |
1017 | 786 Owner Last Modified Attributes Sector Bytecount Name |
1011 | 787 ----- ----------------- ---------- ------ --------- ---- |
1017 | 788 1 2002/05/29 14:02 --e--e-r 47 42 file1 |
789 0 2002/10/12 02:15 ---wr-wr 48 43 file2 | |
790 3 2002/04/29 23:35 -s----wr 51 22 file3 | |
791 1 2003/01/06 16:19 d-ewrewr 6D 800 NEWDIR | |
144 | 792 </screen> |
793 | |
794 <para> | |
795 This display is fairly self-explanatory. The "attributes" column | |
796 shows which attributes are currently on by the presence or absence | |
797 of associated characters in the following format: | |
798 </para> | |
799 <para> | |
800 dsewrewr | |
801 </para> | |
802 | |
803 <para> | |
804 The character positions correspond to from left to right: directory; | |
805 sharable; public execute; public write; public read; owner execute; | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
806 owner write; owner read. The <command>attr</command> command is used to examine or |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
807 change a file's attributes. Typing <command>attr</command> followed by a file name |
144 | 808 will result in the present attributes to be displayed, for example: |
809 </para> | |
810 | |
811 <screen> | |
812 OS9: attr file2 | |
813 -s-wr-ewr | |
814 </screen> | |
815 | |
816 <para> | |
817 If the command is used with a list of one or more attribute abbreviations, | |
818 the file's attributes will be changed accordingly (if | |
819 legal). For example, the command: | |
820 </para> | |
821 <screen> | |
822 OS9: attr file2 pw pr -e -pe | |
823 </screen> | |
824 <para> | |
825 enables public write and public read permissions and removes execute | |
826 permission for both the owner and the public. | |
827 </para> | |
828 <para> | |
829 The "directory" attribute behaves somewhat differently than the | |
830 read, write, and execute permissions. This is because it would be | |
1011 | 831 quite dangerous to be able to change directory files to normal files, |
832 and creation of a directory requires special initialization. | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
833 Therefore, the <command>attr</command> command |
144 | 834 <emphasis>cannot</emphasis> be used to turn |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
835 the directory (d) attribute on (only <command>makdir</command> can), and can be used |
144 | 836 to turn it off <emphasis>only</emphasis> if the directory is empty. |
837 </para> | |
838 </section> | |
839 </section> | |
840 | |
841 <section> | |
842 <title>Reading and Writing From Files</title> | |
843 <para> | |
844 A single file type and format is used for all mass storage files. | |
845 Files store an ordered sequence of 8-bit bytes. OS-9 is not usually | |
846 sensitive to the contents of files for most functions. A given file | |
847 may store a machine language program, characters of text, or almost | |
848 anything else. Data is written to and read from files exactly as | |
849 given. The file can be any size from zero up to the maximum | |
850 capacity of the storage device, and can be expanded or shortened as | |
851 desired. | |
852 </para> | |
853 <para> | |
854 When a file is created or opened a "file pointer" is established | |
855 for it. Bytes within the file are addressed like memory, and the | |
856 file pointer holds the "address" of the next byte in the file to be | |
857 written to or read from. The OS-9 "read" and "write" service | |
858 functions always update the pointer as data transfers are performed. | |
859 Therefore, successive read or write operations will perform sequential data transfers. | |
860 </para> | |
861 <para> | |
862 Any part of a file can also be read or written in non-sequential | |
863 order by using a function called "seek" to reposition the file | |
864 pointer to any byte address in the file. This is used when random | |
865 access of the data is desired. | |
866 </para> | |
867 <para> | |
868 To expand a file, you can simply write past the previous end of | |
869 the file. Reading up to the last byte of a file will cause the next | |
870 "read" request to return an end-of-file status. | |
871 </para> | |
872 | |
873 <section> | |
874 <title>File Usage in OS-9</title> | |
875 <para> | |
876 Even though there is physically only one type of file, the logical | |
877 usage of files in OS-9 covers a broad spectrum. Because all | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
878 OS-9 files have the same physical type, commands such as <command>copy</command>, |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
879 <command>del</command>, etc., can be used with any file regardless of its logical |
144 | 880 usage. Similarly, a particular file can be treated as having a |
881 different logical usage at different times by different programs. The | |
882 main usage of files covered in this section are: | |
883 </para> | |
884 <simplelist> | |
885 <member>TEXT</member> | |
886 <member>RANDOM ACCESS DATA</member> | |
887 <member>EXECUTABLE PROGRAM MODULES</member> | |
888 <member>DIRECTORIES</member> | |
889 <member>MISCELLANEOUS</member> | |
890 </simplelist> | |
891 </section> | |
892 | |
893 <section> | |
894 <title>Text Files</title> | |
895 <para> | |
896 These files contain variable-length sequences ("lines") of ASCII | |
897 characters. Each line is terminated by a carriage return character. | |
898 Text files are used for program source code, procedure files, | |
899 messages, documentation, etc. The Text Editor operates on this file | |
900 format. | |
901 </para> | |
902 <para> | |
903 Text files are usually read sequentially, and are supported by | |
904 almost all high-level languages (such as BASIC09 READ and WRITE | |
905 statements). Even though is is possible to randomly access data at | |
906 any location within a text file, it is rarely done in practice | |
907 because each line is variable length and it is hard to locate the | |
908 beginning of each line without actually reading the data to locate | |
909 carriage return characters. | |
910 </para> | |
911 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
912 The content of text files may be examined using the <command>list</command> |
144 | 913 command. |
914 </para> | |
915 </section> | |
916 | |
917 <section> | |
918 <title>Random Access Data Files</title> | |
919 <para> | |
920 Random-access data files are created and used primarily from | |
921 within high-level languages such as Basic09, Pascal, C, and Cobol. | |
922 In Basic09 and Pascal, "GET", "PUT", and "SEEK" functions operate on | |
923 random-access files. | |
924 </para> | |
925 <para> | |
926 The file is organized as an ordered sequence of "records". Each | |
927 record has exactly the same length, so given a record's numerical | |
928 index, the record's beginning address within the file can be | |
929 computed by multiplying the record number by the number of bytes | |
930 used for each record. Thus, records can be directly accessed in any | |
931 order. | |
932 </para> | |
933 <para> | |
934 In most cases, the high-level language allows each record to be | |
935 subdivided into "fields". Each field generally has a fixed length | |
936 and usage for all records within the file. For example, the first | |
937 field of a record may be defined as being 25 text characters, the | |
938 next field may be two bytes long and used to hold 16-bit binary | |
939 numbers, etc. | |
940 </para> | |
941 <para> | |
942 It is important to understand that OS-9 itself does not directly | |
943 process or deal with records other than providing the basic file | |
944 functions required by all high-level languages to create and use | |
945 random-access files. | |
946 </para> | |
947 </section> | |
948 | |
949 <section> | |
950 <title>Executable Program Module Files</title> | |
951 <para> | |
952 These files are used to hold program modules generated by the | |
953 assembler or <emphasis>compiled</emphasis> by high-level languages. | |
954 Each file may | |
955 contain <emphasis>one or more</emphasis> program modules. | |
956 </para> | |
957 <para> | |
958 OS-9 program modules resident in memory have a standard module | |
959 format that, besides the object code, includes a "module header" and | |
960 a CRC check value. Program module(s) stored in files contain exact | |
961 binary copies of the programs as they will exist in memory, and not | |
1011 | 962 one byte more. OS-9 does not require a "load record" |
144 | 963 system commonly used by other operating systems because OS-9 |
964 programs are position-independent code and therefore do not have to | |
965 be loaded into specific memory addresses. | |
966 </para> | |
967 <para> | |
968 In order for OS-9 to load the program module(s) from a file, the | |
1011 | 969 file itself must have execute permission and each module |
144 | 970 must have a valid module header and CRC check value. If a program |
971 module has been altered in any way, either as a file or in memory, | |
972 its CRC check value will be incorrect And OS-9 will refuse to load | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
973 the module. The <command>verify</command> command can be used to check the correctness |
144 | 974 of the check values, and update them to corrected values if |
975 necessary. | |
976 </para> | |
977 <para> | |
978 On Level One systems, if a file has two or more modules, they are | |
979 treated as independent entities after loading and reside at different memory regions. | |
980 </para> | |
981 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
982 Like other files that contain "binary" data, attempts to "list" |
144 | 983 program files will result in the display of random characters on the |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
984 terminal giving strange effects. The <command>dump</command> command can be used to |
144 | 985 safely examine the contents of this kind of file in hexadecimal and |
986 controlled ASCII format. | |
987 </para> | |
988 </section> | |
989 | |
990 <section> | |
991 <title>Directory Files</title> | |
992 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
993 Directory files play a key role in the OS-9 file system. They can only be created by the <command>makdir</command> command, and |
144 | 994 can be identified by the "d" attribute being set (see 3.8.1). The |
995 file is organized into 32-byte records. Each record can be a | |
996 directory entry. The first 29 bytes of the record is a string of | |
997 characters which is the file name. The last character of the name | |
998 has its sign bit (most significant bit) set. If the record is not | |
999 in use the first character position will have the value zero. The | |
1000 last three bytes of the record is a 24-bit binary number which is | |
1001 the logical sector number where the file header record (see 3.10) is | |
1002 located. | |
1003 </para> | |
1004 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
1005 The <command>makdir</command> command initializes all records in a new directory |
144 | 1006 to be unused entries except for the first two entries. These |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
1007 entries have the names <filename class="directory">.</filename> and <filename class="directory">..</filename> along with the logical sector |
144 | 1008 numbers of the directory and its parent directory, respectively (see 3.7.3). |
1009 </para> | |
1010 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
1011 Directories cannot be copied or listed - the <command>dir</command> command is |
144 | 1012 used instead. Directories also cannot be deleted directly (see 3.5). |
1013 </para> | |
1014 </section> | |
1015 | |
1016 <section> | |
1017 <title>Miscellaneous File Usage</title> | |
1018 <para> | |
1019 OS-9's basic file functions are so versatile it is possible to | |
1020 devise an almost unlimited number of special-purpose file formats | |
1021 for particular applications, which do not fit into any of the three | |
1022 previously discussed categories. | |
1023 </para> | |
1024 <para> | |
1025 Examples of this category are COBOL Indexed Sequential (ISAM) | |
1026 files and some special word processor file formats which allow | |
1011 | 1027 random access of text lines. As discussed in Sec. |
144 | 1028 3.9.1, most OS-9 utility commands work with any file format including |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
1029 these special types. In general, the <command>dump</command> command is the preferred |
144 | 1030 method for examining the contents of unusually formatted files. |
1031 </para> | |
1032 </section> | |
1033 </section> | |
1034 | |
1035 <section> | |
1036 <title>Physical File Organization</title> | |
1037 <para> | |
1038 OS-9's file system implements a universal logical organization | |
1039 for all I/O devices that effectively eliminates most hardware-related | |
1040 considerations for most applications. This section gives | |
1041 basic information about the physical file structure used by OS-9. | |
1042 For more information, see the OS-9 System Programmer's Manual. | |
1043 </para> | |
1044 <para> | |
1045 Each OS-9 file is comprised of one or more sectors which are | |
1046 the physical storage units of the disk systems. Each sector holds | |
1047 exactly 256 data bytes, and disk is numbered sequentially starting | |
1048 with sector zero, track zero. This number is called a "logical | |
1049 sector number", or <emphasis>LSN</emphasis>. | |
1050 The mapping of logical sector numbers to | |
1051 physical track/sector numbers is done by the disk driver module. | |
1052 </para> | |
1053 <para> | |
1054 Sectors are the smallest allocatable physical unit on a disk | |
1055 system, however, to increase efficiency on some larger-capacity disk. | |
1056 systems, OS-9 uses uniform-sized groups of sectors, called | |
1057 <emphasis>clusters</emphasis>, | |
1058 as the smallest allocatable unit. Cluster sizes are always an | |
1059 integral power of two (2, 4, 8, etc.). One sector of each disk is | |
1060 used as a <emphasis>bitmap</emphasis> (usually LSN 1), | |
1061 in which each data bit corresponds | |
1062 to one cluster on the disk. The bits are set and cleared to | |
1063 indicate which clusters are in use (or defective), and which are | |
1064 free for allocation to files. | |
1065 </para> | |
1066 <para> | |
149
bb3e4d64103a
Made the word "Dragon" an entity, thereby making it replacable with "Color"
roug
parents:
144
diff
changeset
|
1067 The &make; Computer disk system uses the following format: |
144 | 1068 </para> |
1069 <itemizedlist mark="square"> | |
1070 <listitem><para> | |
1071 double density recording on one side | |
1072 </para></listitem> | |
1073 <listitem><para> | |
1074 40 tracks per disk | |
1075 </para></listitem> | |
1076 <listitem><para> | |
1077 18 sectors per track | |
1078 </para></listitem> | |
1079 <listitem><para> | |
1080 one sector per cluster | |
1081 </para></listitem> | |
1082 </itemizedlist> | |
1083 <para> | |
1084 Each file has a directory entry (see 3.9.5) which includes the | |
1085 file name and the logical sector number of the file's "file descriptor | |
1086 sector", which contains a complete description of the file | |
1087 including: | |
1088 </para> | |
1089 <itemizedlist mark="square"> | |
1090 <listitem><para> | |
1091 attributes | |
1092 </para></listitem> | |
1093 <listitem><para> | |
1094 owner | |
1095 </para></listitem> | |
1096 <listitem><para> | |
1097 date and time created | |
1098 </para></listitem> | |
1099 <listitem><para> | |
1100 size | |
1101 </para></listitem> | |
1102 <listitem><para> | |
1103 segment list (description of data sector blocks) | |
1104 </para></listitem> | |
1105 </itemizedlist> | |
1106 <para> | |
1107 Unless the file size is zero, the file will have one or more | |
1108 sectors/clusters used to store data. The data sectors are grouped | |
1109 into one or more contiguous blocks called "segments". | |
1110 </para> | |
1111 </section> | |
1112 </chapter> |