CompuServe Thread

#How Map Log Drv to Phys

11 messages in this thread
#24323From: Jim MischelMar 1, 1990 10:38 PM
Robert Well, it's possible. After a couple hours' work, I now have a program that will tell you what physical disk a logical drive resides. Even works with ASSIGN and SUBST. The basic idea is: Capture BIOS disk interrupt (INT13) For each logical drive (A-Z) Issue a command that will cause a read from disk (for this, I do a findfirst on *.*. Seems to work) (this loop doesn't find the drives, it just issues the writes) (the new INT13 routine handles this) endfor For each logical drive output the physical device name endfor New INT13: if the call is a read then store the drive number (from DL) into the Drive table jump to the BIOS disk handler. If you'd like to see the assembly language code (about 150 lines), let me know and I'll upload it here. JIM
#24340From: Robert FunkMar 3, 1990 3:58 PM
Great to see that you have discovered a way to map logical drives to physical disks! Yes, I would definately like to see your code. This INT thing (particularly rerouting the interrupts) is all new to me. Thanks Robert
#24345From: Jim MischelMar 3, 1990 11:18 PM
Robert I've uploaded the file to LIB 0, name FD.ARC. I assume Tom will make it visible in short order. I'm working on a C-callable subroutine that will return the physical device number for a given logical disk. I'll TRY to finish it tonight or tomorrow. Have fun. If you have questions, gimme a yell. JIM
#24358From: Don E. Groves, Jr.Mar 5, 1990 12:04 AM
Jim, I would very much like to see the assemble code. Wonder if it can handle the JOIN command ?? Don
#24369From: Jim MischelMar 5, 1990 11:06 PM
Don The assembler code has been uploaded. It is probably visible as I write this. Look for FD.ARC in LIB 0. The thing doesn't handle JOIN very well. I did a JOIN A: C:\ADRIVE. Then when I ran FD, it told me that logical drive A: didn't exist (DOS said the same thing when I tried to do a DIR A:). If I get ambitious, I might dink around a little bit and see if I can backtrack — go from physical device number to logical disk. Seems like it might be a bit difficult tho…. JIM
#24405From: Don E. Groves, Jr.Mar 7, 1990 8:12 PM
Jim, After typing the below description I came to the thought that this is working from the wrong position, tell me so if its true. But maybe it will help give you and idea anyway. I don't know if this will help but an undocumented DosCall with AH = 60h DS:SI point to null terminated string "D:\path" ES:DI point to space to be filled out 66 bytes long to be safe Great for detecting a Drive letter thats been Subst for a path for it returns the drive and path it points to. If you supply it with a drive:path the points to Joined drive it returns the drive letter only. This works in PC/MS-DOS 3.1 and up. Over on PCM:Util we call it TranslateFileName Jr.
#24416From: Jim MischelMar 10, 1990 12:20 PM
Don Thanks for the info! It is working from the wrong direction, tho. I'm not about to write a program that searches the entire directory structure looking for JOINed subdirectories. An interesting DOS call tho….have any more you wanna tell me about? <grin> Better yet, is there a book somewhere that'll give me some of this information? JIM
#24459From: Don E. Groves, Jr.Mar 14, 1990 10:39 PM
JIM – YES – PC magazine's utility colum {from time to long time apart} .Jr. PS .. If you ever find a good book that Documents UnDocumented DOS functions in a useful maner be sure to tell me. {there's something strange about that statement}
#24477From: Jim MischelMar 17, 1990 11:08 AM
Don Found a great book…."DOS Programmer's Reference" 2nd edition. Que books. Written by Terry Dettmann and Jim Kyle. I'm still digging through it, but I've already found a whole bunch of neat stuff. Highly recommended. JIM
#24489From: Don E. Groves, Jr.Mar 18, 1990 9:36 PM
Jim – Thanks – I'll have to look for on my next trip to the BookStore.
#24531From: Robert FunkMar 21, 1990 8:10 PM
Jim, Hello again. I have been continuing to look for FD.ARC ever since you told me about it, and can't find it. I even sent a query to the sysop you had asked a week or so ago to post it, but got no reply. I did not save the message, so I can't recall his name. Any idea where FD.ARC is at? Any chance you could EMAIL it to me if it still hasn't been posted? Regards Robert