Low Level Filesystem Access: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
== Excerpt from Inside the TRS-80 Model 100 == | |||
(Carl Oppedahl) | |||
User files reside in RAM starting at the lowest installed RAM address, with BA files at the bottom, followed by DO files and CO files. The directory is located in high memory from F962 to FA74. There is room to store sixteen filenames with eleven bytes of information each. The format of the filename information is given in table 18.1. | |||
{| class="wikitable" border="1" | |||
|+ Table 18.1 | |||
|- | |||
! Byte | |||
! Description | |||
|- | |||
| 0 | |||
| Directory flag (see table 18.2) | |||
|- | |||
| 1-2 | |||
| File start address | |||
|- | |||
| 3-10 | |||
| Eight-byte file name | |||
|} | |||
{| class="wikitable" border="1" | |||
|+ Table 18.2 | |||
|- | |||
! Bit | |||
! Description | |||
|- | |||
| 7 | |||
| 0 if a killed file | |||
|- | |||
| 6 | |||
| 1 if a DO file | |||
|- | |||
| 5 | |||
| 1 if a CO file | |||
|- | |||
| 4 | |||
| 1 if located in ROM | |||
|- | |||
| 3 | |||
| 1 for inivisible file | |||
|- | |||
| 2-1 | |||
| Reserved | |||
|- | |||
| 0 | |||
| Internal use only | |||
|} | |||
== How RAM File Creation Works == | == How RAM File Creation Works == | ||
Revision as of 16:10, 24 February 2008
Excerpt from Inside the TRS-80 Model 100
(Carl Oppedahl)
User files reside in RAM starting at the lowest installed RAM address, with BA files at the bottom, followed by DO files and CO files. The directory is located in high memory from F962 to FA74. There is room to store sixteen filenames with eleven bytes of information each. The format of the filename information is given in table 18.1.
Byte | Description |
---|---|
0 | Directory flag (see table 18.2) |
1-2 | File start address |
3-10 | Eight-byte file name |
Bit | Description |
---|---|
7 | 0 if a killed file |
6 | 1 if a DO file |
5 | 1 if a CO file |
4 | 1 if located in ROM |
3 | 1 for inivisible file |
2-1 | Reserved |
0 | Internal use only |
How RAM File Creation Works
(Steve Adolph)
There are a number of pointers in himem that are used to demarcate the area used for basic files text files the three scratchpads machine language files
These pointers need to be modified according to what you need to insert or delete. For example, if you add a .CO file, then you don't need to modify the pointers that deal with the lower file space. But, adding a .BA moves all the pointers.
To create a file you need to
- wedge open the file space at a precise location, depending on the file type and the pointer values...placement is critical because of a fundamental assumption in the directory management
- load all the appropriate data into that memory hole, representing the actual file data
- create a directory entry with the right stuff in the entry to connect with that file
- run the magic LNKFIL routine that re-assigns all the directory links and connects them to the right files again
Deleting a file is kinda similar.
The fundamental assumption is that the order of the files must be maintained within each file type. That way the linker can deduce which file directory entry is associated with a specific file.
IE the next .BA directory entry must be associated with the next found file in the .BA area. and so on.