ZDSFS: Difference between revisions

79 bytes added ,  29 days ago
m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
mNo edit summary
m (Bot: Replace deprecated source tag with syntaxhighlight)
 
(2 intermediate revisions by 2 users not shown)
Line 8:
 
To find the sequence of format 1 entries the OS has to read 0, 0, 3. Place the first 20 bytes into a buffer then obtain the location of the format 1 DSCBs:
<sourcesyntaxhighlight lang="c">
void GetCHRFromVTOC(void *buffer) {
uint16_t cyl, head;
Line 18:
return;
}
</syntaxhighlight>
</source>
 
== Format 1 DSCB ==
Line 69:
The entries are ordered in a chain-like structure, where a formatId=0 entry denotes the end of said chain.
 
<sourcesyntaxhighlight lang="c">
// NOTE: This code assumes EBCDIC is being used
void CheckDSCB(struct DSCB1 *dscb, const char *name) {
Line 90:
}
}
</syntaxhighlight>
</source>
 
Finding the files is just a matter of reading records until reaching the end of the head, then incrementing heads and after reading the last head in the cylinder, incrementing cylinders. This also has to be done for reading files.
 
This is mostly specific to DASD devices but it's provided for clarity.
<sourcesyntaxhighlight lang="c">
// NOTE: This code assumes EBCDIC is being used
void FindFile(const char *name) {
Line 127:
}
}
</syntaxhighlight>
</source>
 
== See also ==
Line 137:
 
[[Category:S390]]
[[Category:Filesystems]]