--
You received this message because you are subscribed to the Google Groups "µIEC Users Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uIEC-users+...@googlegroups.com.
To post to this group, send email to uIEC-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uIEC-users/CADyB93A2D1%2BAsBT0ZUT8P4qEZvE%2B6HFNDNkaoXNNdJFtOBe2YA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
a 'PWD' like function is not readily available, but it can be created in a few ways:
The 'OS' can hold onto this information, which is easiest.
Or, you can walk the "parent dir" chain to obtain
the CWD.
I'm not sure about Ingo's perspective, but I thought about adding the function, and resisted pursuing it because it will consume significant memory resources (remember, sd2iec has 2-4kB of RAM for all operations), and it could be hard to implement:
Although I have never tested it, the rename directory (r-h or rename header) command can accept absolute paths. Thus, any PWD text would have to be modified everytime the directory naming was altered. Not that the 'OS' solution above shares the same issue, but there is more space to deal with it.
I think, given the frequency of use, the 'walk the tree' approach is easiest.
Jim
-- RETRO Innovations, Contemporary Gear for Classic Systems www.go4retro.com store.go4retro.com
On June 23, 2016 at 3:46 PM Eric Christopherson <echrist...@gmail.com> wrote:OK. I just discovered each partition has an associated current directory, sort of how drive letters in DOS/Windows do; so I thought the information was available in the uIEC. Is it just that the uIEC has a sort of opaque pointer to the current directory, but it doesn't know the actual path to it?
In CMD directories, the directory is laid out similar to a normal 1541 directory, with a "header" name and such. You guessed it. sdi2iec holds a pointer to the current directory, and then when you ask for a directory listing, it just finds out the name and the contents at that time. It has no previous knowledge of the name, except a reference to the current dir
Also, what happens to files that are open in the Commodore when directory or partition is changed? Do they get closed?
changing a directory, just changes the pointer used for relative opens. So, any open file should continue to work fine.
jim
In CMD directories, the directory is laid out similar to a normal 1541 directory, with a "header" name and such. You guessed it. sdi2iec holds a pointer to the current directory, and then when you ask for a directory listing, it just finds out the name and the contents at that time. It has no previous knowledge of the name, except a reference to the current dir
--
You received this message because you are subscribed to the Google Groups "µIEC Users Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uIEC-users+...@googlegroups.com.
To post to this group, send email to uIEC-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uIEC-users/b1e5ec22-f82e-4b3f-93ca-e2c015d03aed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I think the better approach would be to mimic what worked on the CMD drives. Can you explain in steps what you did to make PWD work on the CMD drives? I can then look at adding that into the codebase. I would not think it would be tough, unless you are using a lot of reserved CMD stuff.
I can't lay claim to much (if any) of sd2iec's codebase, but my name is in there somewhere, and I think it's for the help I provided on CMD directory and partition support. I'd love to add a bit more support in.
On 7/31/2016 10:08 AM, Glenn Holmer wrote:
On Thursday, June 23, 2016 at 3:25:51 PM UTC-5, Jim Brain wrote:In CMD directories, the directory is laid out similar to a normal 1541 directory, with a "header" name and such. You guessed it. sdi2iec holds a pointer to the current directory, and then when you ask for a directory listing, it just finds out the name and the contents at that time. It has no previous knowledge of the name, except a reference to the current dir
What are the mechanics of this? Where is the pointer and what is it a pointer to? How do I get at it? (dir header? G-P command?) I implemented pwd pretty easily as a C64 program for CMD native partitions, but how would I do it on a uIEC? Do I have to navigate the FAT filesystem using DR commands?
I think the better approach would be to mimic what worked on the CMD drives. Can you explain in steps what you did to make PWD work on the CMD drives? I can then look at adding that into the codebase. I would not think it would be tough, unless you are using a lot of reserved CMD stuff.
I can't lay claim to much (if any) of sd2iec's codebase, but my name is in there somewhere, and I think it's for the help I provided on CMD directory and partition support. I'd love to add a bit more support in.
ON a sd2iec and CMD drives, the top left key on the c64/vic/sx/128 KB can be used to go back a dir.
<-
Pulling back a raw track and sector in the FAT subsystem is going to be a challenge, as the filesystem is only emulated at the highest level...
There's also the problem of reading a raw T&S in a FAT subsystem.
If I get time, I'll see if CMD allows reading "<:$" to get the parent dir header. That type of walk would be more portable and easier to implement.
--
You received this message because you are subscribed to the Google Groups "µIEC Users Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uIEC-users+...@googlegroups.com.
To post to this group, send email to uIEC-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uIEC-users/8fa798cc-668d-40f1-9f09-21db4f71e6b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hmmm, well, I was hoping for a simple option... Looks like more thought is needed.
I suspect:
repeat
dir
cd<-
until X
cd "pwd"
works (not sure what X condition is at present, but should be doable), but it's ugly and it'll unmount an image if you are in an image...
I suspect:
repeat
dir
cd<-
until X
cd "pwd"
works (not sure what X condition is at present, but should be doable), but it's ugly and it'll unmount an image if you are in an image...
b) sd2iec/uIEC returns 62 (file not found) if you issue cd<- at the root but CMD HD doesn't (!)
As for images, I don't think it's worth trying to do pwd for them. On a CMD HD, you're at the root by definition if you're in an emulation partition, and on an sd2iec/uIEC, I don't think there's a way to get the filename of a mounted disk image anyway (is there)?
I'll be showing the code (in PROMAL) at VCFMW next month.
--
You received this message because you are subscribed to the Google Groups "µIEC Users Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uIEC-users+...@googlegroups.com.
To post to this group, send email to uIEC-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uIEC-users/9beaebc7-59b2-4b0d-b653-665ce560597c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Well, I would assume that if you have the image mounted, your CMD HD version of code should work... Did you try?
How do you access the parent dir pointers on a CMD HD?
Glenn Holmer <glenn....@gmail.com> writes:
> On Saturday, August 6, 2016 at 6:06:44 AM UTC-5, Ingo Korb wrote:
>>
>> How do you access the parent dir pointers on a CMD HD?
>>
> It's in an earlier post from me on this thread. See CMD HD manual, Appendix
> C "Partition and File Formats".
Ah, so there actually is no official way to access them and you instead
resort to parsing the low-level disk layout yourself.
You can do that
with a FAT disk too if you want to, sd2iec has commands to directly read
and write sectors on the SD card.
What are the mechanics of this? Where is the pointer and what is it a pointer to? How do I get at it? (dir header? G-P command?) ... Do I have to navigate the FAT filesystem using DR commands?
On 8/5/2016 7:17 PM, Glenn Holmer wrote:
Well, I would assume that if you have the image mounted, your CMD HD version of code should work. Did you try?As for images, I don't think it's worth trying to do pwd for them. On a CMD HD, you're at the root by definition if you're in an emulation partition; and, in sd2iec, I don't think there's a way to get the filename of a mounted disk image, anyway (is there)?
On Friday, August 5, 2016 at 11:30:28 PM UTC-4, Jim Brain wrote:On 8/5/2016 7:17 PM, Glenn Holmer wrote:Well, I would assume that if you have the image mounted, your CMD HD version of code should work. Did you try?As for images, I don't think it's worth trying to do pwd for them. On a CMD HD, you're at the root by definition if you're in an emulation partition; and, in sd2iec, I don't think there's a way to get the filename of a mounted disk image, anyway (is there)?
Glen was talking about the name that is used to mount the image; that is, the name that's stored on the FAT file-system.
Where CBM-compatible file-systems are concerned, a subdirectory's file-name and its header-name are independent objects. There is no guarantee that they will match each other.
--
You received this message because you are subscribed to the Google Groups "µIEC Users Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uIEC-users+...@googlegroups.com.
To post to this group, send email to uIEC-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uIEC-users/ab1169d1-94f0-451a-9994-175f375dc96b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ah, I did not understand. Still, I'd like to see if his original CMD code will work if he's in an image.
So, if you were in:
/jim/dir/to/dnp/image/glenn.dnp
and inside the image, you were in:
/path/to/file/within/dnp/c64.prg
If you were in the "within" directory, you should be able to use your code to pull the dir, walk the T&S to get back to "path", which would contain a T&S of 0,0, which means your code would stop and think it was at the root.
There's still a fly in the ointment: You have to look at what type of device you're on, to decide whether to use the "CMD method" or the "CD<- method". If you're on an sd2iec/uIEC, you then have to know that you're inside a DNP image to trigger the switch to the "CMD method". You can tell if you're inside, e.g., a D64/D81 image by checking the partition type returned from the "G-P" command, which is reported as a 1541/1581 emulation partition (à la CMD). But, a DNP image reports itself as a native partition, just as a root FAT partition does; so, there's nothing to tell you to use the "CMD method". The only way this would work is if a DNP image reported itself as a different partition type (e.g., "CMD native emulation"), with a new numeric entry in the table.
Commenting out the device type check and running the pwd program within //SUBDIR1/SUBDIR2 inside a DNP image on a uIEC shows the path correctly, as you'd expect.
On Sun, Aug 7, 2016 at 3:45 PM, RETRO Innovations <go4r...@go4retro.com> wrote:
So, if you were in:
/jim/dir/to/dnp/image/glenn.dnp
and inside the image, you were in:
/path/to/file/within/dnp/c64.prg
If you were in the "within" directory, you should be able to use your code to pull the dir, walk the T&S to get back to "path", which would contain a T&S of 0,0, which means your code would stop and think it was at the root.
Oh, you're talking about within a DNP image.
There's still a fly in the ointment: you have to look at what type of device you're on to decide whether to use the "CMD method" or the "CD<- method". If you're on an sd2iec/uIEC, you then have to know that you're inside a DNP image to trigger the switch to the "CMD method". You can tell if you're inside e.g. a D64/D81 image by checking the partition type returned from the G-P command, which is reported as a 1541/1581 emulation partition (à la CMD). But a DNP image reports itself as a native partition, just as a root FAT partition does, so there's nothing to tell you to use the "CMD method".
The only way this would work is if a DNP image reported itself as a different partition type (e.g. "CMD native emulation"), with a new numeric entry in the table.
Commenting out the device type check and running the pwd program within //SUBDIR1/SUBDIR2 inside a DNP image on a uIEC shows the path correctly, as you'd expect.
In any case, DNP's format is "h". So, there already is no confusion there.
Also, I will take this opportunity to say that this thread shows another reason why sd2iec should keep the "$"-as-SEQ-file feature.
You don't need to use the "G-P" command; the format code should be able to tell a program what it needs to know.
On Sun, Aug 7, 2016 at 9:01 PM, Greg King <greg....@verizon.net> wrote:
You don't need to use the "G-P" command; the format code should be able to tell a program what it needs to know.
Not reliable; clever programs (like demo disks) might overwrite it. Besides, if it's been wrong for years and it's fixed, it will take years for the fix to propagate.
--
Glenn Holmer (Linux registered user #16682)
"After the vintage season came the aftermath -- and Cenbe."
--
You received this message because you are subscribed to the Google Groups "µIEC Users Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uIEC-users+...@googlegroups.com.
To post to this group, send email to uIEC-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uIEC-users/CAK4PH5Auk-y4ujvHJ25pPEe2pLyT5hAWB%3Dgbds92kpFyYcxCEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
On 8/7/2016 8:41 PM, Greg King wrote:
On Sunday, August 7, 2016 at 6:27:22 PM UTC-4, Glenn Holmer wrote:
There's still a fly in the ointment: You have to look at what type of device you're on, to decide whether to use the "CMD method" or the "CD<- method". If you're on an sd2iec/uIEC, you then have to know that you're inside a DNP image to trigger the switch to the "CMD method". You can tell if you're inside, e.g., a D64/D81 image by checking the partition type returned from the "G-P" command, which is reported as a 1541/1581 emulation partition (à la CMD). But, a DNP image reports itself as a native partition, just as a root FAT partition does; so, there's nothing to tell you to use the "CMD method". The only way this would work is if a DNP image reported itself as a different partition type (e.g., "CMD native emulation"), with a new numeric entry in the table.
You don't need to use the "G-P" command; the format code should be able to tell a program what it needs to know. Unfortunately, sd2iec has a bug in it: It uses the same format code for FAT that is used for the 1541 format! I ask Ingo (or Jim) to change FAT's format code from "a" to something like "f". (Also, the version number in the directory header should be either "0" or "1".) (I can't remember if I've mentioned it before -- it's been on my mind for many years.)
Hmm, if you have, I missed it.
I'm leery of using "f" for FAT, because if you had a different FS for the container, "F" might not be best.
I think C= Container might be best. That would work regardless of FS type (FLASH, EEPROM, etc.).
In any case, DNP's format code is "h". So, there already is no confusion there.
On 8/7/2016 9:48 PM, Glenn Holmer wrote:
Is there a way to get the same value from the PRG open?On Sun, Aug 7, 2016 at 9:01 PM, Greg King <greg....@verizon.net> wrote:
You don't need to use the "G-P" command; the format code should be able to tell a program what it needs to know.
Not reliable; clever programs (like demo disks) might overwrite it. Besides, if it's been wrong for years and it's fixed, it will take years for the fix to propagate.
On Sunday, August 7, 2016 at 10:05:51 PM UTC-4, Jim Brain wrote:On 8/7/2016 8:41 PM, Greg King wrote:Hmm, if you have, I missed it.On Sunday, August 7, 2016 at 6:27:22 PM UTC-4, Glenn Holmer wrote:
There's still a fly in the ointment: You have to look at what type of device you're on, to decide whether to use the "CMD method" or the "CD<- method". If you're on an sd2iec/uIEC, you then have to know that you're inside a DNP image to trigger the switch to the "CMD method". You can tell if you're inside, e.g., a D64/D81 image by checking the partition type returned from the "G-P" command, which is reported as a 1541/1581 emulation partition (à la CMD). But, a DNP image reports itself as a native partition, just as a root FAT partition does; so, there's nothing to tell you to use the "CMD method". The only way this would work is if a DNP image reported itself as a different partition type (e.g., "CMD native emulation"), with a new numeric entry in the table.
You don't need to use the "G-P" command; the format code should be able to tell a program what it needs to know. Unfortunately, sd2iec has a bug in it: It uses the same format code for FAT that is used for the 1541 format! I ask Ingo (or Jim) to change FAT's format code from "a" to something like "f". (Also, the version number in the directory header should be either "0" or "1".) (I can't remember if I've mentioned it before -- it's been on my mind for many years.)
I'm leery of using "f" for FAT, because if you had a different FS for the container, "F" might not be best.
That's the point. If we have a different container file-system, then reading the directory should see some other format code. Each "unique" FS should have its own unique format code that identifies it.
So, I think it should suffice as a general purpose container. Writing different code for type=F (FAT), type= E (EEPROM) and type = L? (FLASH) is triple the work, and I don't think that's the direction we should go. Create a virtual "perfect" FS and make FAT mold to it.
Jim
There's still a fly in the ointment: you have to look at what type of device you're on, to decide whether to use the "CMD method" or the "CD<- method". If you're on an sd2iec/uIEC, you then have to know that you're inside a DNP image to trigger the switch to the "CMD method". You can tell if you're inside, e.g., a D64/D81 image by checking the partition type returned from the G-P command, which is reported as a 1541/1581 emulation partition (à la CMD). But, a DNP image reports itself as a native partition, just as a root FAT partition does; so, there's nothing to tell you to use the "CMD method". The only way this would work is if a DNP image reported itself as a different partition type (e.g., "CMD native emulation"), with a new numeric entry in the table.
On 8/7/2016 10:52 PM, Greg King wrote:
On Sunday, August 7, 2016 at 10:05:51 PM UTC-4, Jim Brain wrote:On 8/7/2016 8:41 PM, Greg King wrote:Hmm, if you have, I missed it.On Sunday, August 7, 2016 at 6:27:22 PM UTC-4, Glenn Holmer wrote:
There's still a fly in the ointment: You have to look at what type of device you're on, to decide whether to use the "CMD method" or the "CD<- method". If you're on an sd2iec/uIEC, you then have to know that you're inside a DNP image to trigger the switch to the "CMD method". You can tell if you're inside, e.g., a D64/D81 image by checking the partition type returned from the "G-P" command, which is reported as a 1541/1581 emulation partition (à la CMD). But, a DNP image reports itself as a native partition, just as a root FAT partition does; so, there's nothing to tell you to use the "CMD method". The only way this would work is if a DNP image reported itself as a different partition type (e.g., "CMD native emulation"), with a new numeric entry in the table.
You don't need to use the "G-P" command; the format code should be able to tell a program what it needs to know. Unfortunately, sd2iec has a bug in it: It uses the same format code for FAT that is used for the 1541 format! I ask Ingo (or Jim) to change FAT's format code from "a" to something like "f". (Also, the version number in the directory header should be either "0" or "1".) (I can't remember if I've mentioned it before -- it's been on my mind for many years.)
I'm leery of using "f" for FAT, because if you had a different FS for the container, "F" might not be best.
That's the point. If we have a different container file-system, then reading the directory should see some other format code. Each "unique" FS should have its own unique format code that identifies it.
I disagree. The FAT FS is very agnostic, as it is:
- >16MB partition size
- support for all normal CBM file types (PRG, SEQ, REL)
- no file-size limit
So, I think it should suffice as a general-purpose container. Writing different code for type=F (FAT), type= E (EEPROM) and type = L? (FLASH) is triple the work, and I don't think that's the direction we should go. Create a virtual "perfect" FS; and, make FAT mold to it.
On August 8, 2016 at 4:23 AM Greg King <greg....@verizon.net> wrote:On Monday, August 8, 2016 at 12:30:47 AM UTC-4, Jim Brain wrote:On 8/7/2016 10:52 PM, Greg King wrote:I disagree. The FAT FS is very agnostic, as it is:That's the point. If we have a different container file-system, then reading the directory should see some other format code. Each "unique" FS should have its own unique format code that identifies it.
- >16MB partition size
- support for all normal CBM file types (PRG, SEQ, REL)
- no file-size limit
So, I think it should suffice as a general-purpose container. Writing different code for type=F (FAT), type= E (EEPROM) and type = L? (FLASH) is triple the work, and I don't think that's the direction we should go. Create a virtual "perfect" FS; and, make FAT mold to it.
But, CBM and CMD File-systems aren't agnostic! They do have size limits! That is why the FAT, EEPROM, and FLASH (or, your virtual FS) needs a format code that isn't the same as the codes of CBM and CMD FSes! sd2iec's FSes need their own format code for the same reason that each of the CBM/CMD formats has its own code.
I agree. All I am saying is that I don't want to create new codes for all the various formats from this point forward. I want to create one new format that all of the media types will implement.
It might not matter whether sd2iec's advanced FSes have different format codes from each other, or share the same code. What is important is that they don't have any code that was chosen by CBM or CMD (or Kajtar Zsolt, he chose "i" for IDE64).
I don't think I was suggesting otherwise. I am just asking that we choose 1 for the container FS (FAT, EEPROM, FLASH, etc.) and specify that this format supports
However, this virtual format does not support:
Jim
On August 8, 2016 at 9:07 AM Glenn Holmer <glenn....@gmail.com> wrote:I'm not against changing the partition type for a "native" FAT partition (although the change would be intrusive), but the partition type reported from within a DNP image should definitely not be "CMD native". It fits the pattern:D64 reports itself as 1541 emulation partitionD71 reports itself as 1571 emulation partitionDNP should report itself as an emulation partition as well, since it is *not* a CMD native partition.D81 reports itself as 1581 emulation partition
Can't we just say that NAT is a CMD Native emulation partition?
This would avoid having to run device-type detection, then checking the partition type, then deciding that if I'm on an SD device and got a result of "CMD native", it's not really CMD native after all (and you only need to know this on an SD device, so you can use the "CMD method" instead of the "CD<- method" to get the working directory).
Or, maybe we just need to improve compatibility.
I'm not sure anyone's asked this question: does anyone actually use DNP images on an sd2iec/uIEC? I don't see the point, when you have excellent subdirectory support in the native FAT partition. It's been my impression that DNP images are used mainly with VICE.
DNP images serve a great purpose in that they offer a T&S capable FS for apps that need true random access. We can't really offer that in the root FS.
Jim
I don't think I was suggesting otherwise. I am just asking that we choose 1 for the container FS (FAT, EEPROM, FLASH, etc.) and specify that this format supports
- Infinite size
- Ability to load all standard CBM file types
- File protection support
- Time and Date stamping
- 16 byte filenames
- I am sure there are others, but the list is already extensive.
On August 8, 2016 at 4:23 AM Greg King wrote:It might not matter whether sd2iec's advanced FSes have different format codes from each other, or share the same code. What is important is that they don't have any code that was chosen by CBM or CMD (or Kajtar Zsolt, he chose "i" for IDE64).
I don't think I was suggesting otherwise. I am just asking that we choose 1 for the container FS (FAT, EEPROM, FLASH, etc.); and, specify that this format supports:
- Infinite size
- Ability to load all standard CBM file-types
- File protection support
- Time and Date stamping
- 16-byte filenames
- I am sure there are others; but, the list is already extensive.
However, this virtual format does not support:
- T&S access
- Underlying access to raw file system (B-R, B-W, and friends)
On Monday, August 1, 2016 at 12:37:48 PM UTC-5, Jim Brain wrote:I suspect:
repeat
dir
cd<-
until X
cd "pwd"
works (not sure what X condition is at present, but should be doable), but it's ugly and it'll unmount an image if you are in an image...Yeah, that works:while trueget dir headercd<-if err=62 (file not found)if first time throughpath="//"return (don't have to CD at the end)elseadd a '/' to the beginning of the pathbreakelseadd current dir to beginning of path from dir header[end while]CD to path to return to itInterestingly, you can't use the same method on a CMD HD and an sd2iec/uIEC because:a) CMD HD has parent dir pointers and sd2iec/uIEC doesn'tb) sd2iec/uIEC returns 62 (file not found) if you issue cd<- at the root but CMD HD doesn't (!)As for images, I don't think it's worth trying to do pwd for them. On a CMD HD, you're at the root by definition if you're in an emulation partition, and on an sd2iec/uIEC, I don't think there's a way to get the filename of a mounted disk image anyway (is there)?I'll be showing the code (in PROMAL) at VCFMW next month.