cj7hawk
Veteran Member
I'm just looking to program up some code to add directories to my CP/M implementation and was wondering of the best considered methods, and ideas from the past.
I was thinking to make a file "filename.dir" with the DIR extension, then either add in the change functions into the BDOS or implement as a command that can "mount" a directory as a root disk - eg, A:FILENAME.DIR becomes E:
To avoid file allocation issues, I'll need to "hook" a routine for each directory that remains resident and is called when the directory changes, which I can store in extended memory space using paging, so it won't consume space in the TPA, since for each iteration of directory, I need to update all above-level allocations when writes occur - which will get a little problematic if too many are nested, or I could limit nesting (eg, 1 or 2 directory levels deep ) or alternately, I could just allow it to extend while memory is available.
The nice thing about this approach is that it means directories can be treated as files, meaning rename and copy work just file and directories can be renamed, moved between drives or copied using existing CCP commands, and it retains compatability with CP/M.
It's also possible to use the user number to extend directory structures, but that denies the possibility to reduce the allocation size with new directory and requires that all filenames or implement directories that don't directly work with CP/M, which is also pretty valid.
So what are some of the better directory structure ideas for CP/M? What worked well and didn't work so well in the past? My preference is to extend on the CP/M file system rather than adapt FAT or similar to CP/M.
All input appreciated -
Thanks
David
I was thinking to make a file "filename.dir" with the DIR extension, then either add in the change functions into the BDOS or implement as a command that can "mount" a directory as a root disk - eg, A:FILENAME.DIR becomes E:
To avoid file allocation issues, I'll need to "hook" a routine for each directory that remains resident and is called when the directory changes, which I can store in extended memory space using paging, so it won't consume space in the TPA, since for each iteration of directory, I need to update all above-level allocations when writes occur - which will get a little problematic if too many are nested, or I could limit nesting (eg, 1 or 2 directory levels deep ) or alternately, I could just allow it to extend while memory is available.
The nice thing about this approach is that it means directories can be treated as files, meaning rename and copy work just file and directories can be renamed, moved between drives or copied using existing CCP commands, and it retains compatability with CP/M.
It's also possible to use the user number to extend directory structures, but that denies the possibility to reduce the allocation size with new directory and requires that all filenames or implement directories that don't directly work with CP/M, which is also pretty valid.
So what are some of the better directory structure ideas for CP/M? What worked well and didn't work so well in the past? My preference is to extend on the CP/M file system rather than adapt FAT or similar to CP/M.
All input appreciated -
Thanks
David