forked from dosemu2/fdpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lfn: Implement int21/71a0 get volume information
If the volume is local then return suitable information, as either FAT or FAT32. Currently FDPP and FreeDOS don't support LFN natively, so values are chosen to reflect that. If DOSLFN is loaded then its own handler will used in preference. If the disk is remote then query the respective redirector via int2f/11a0 (an extension) for the relevant values. If the redirector dosen't support the extension, then we pretend that the kernel doesn't support int21/71a0.
- Loading branch information
1 parent
f0c415c
commit ff06a16
Showing
5 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,3 +155,35 @@ BYTE remote_getfree_11a3(void FAR *cds, void *dst) | |
udst[4] = regs.si; | ||
return SUCCESS; | ||
} | ||
|
||
BYTE remote_getvolumeinfo(UBYTE drive, UBYTE bufsiz, void *dst_r, char FAR *dst_s) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
andrewbird
Author
Owner
|
||
{ | ||
UWORD *udst = (UWORD *)dst_r; | ||
iregs regs = {}; | ||
struct xgetvolumeinfo s; | ||
struct xgetvolumeinfo FAR *p; | ||
|
||
p = MK_FAR(s); | ||
|
||
regs.a.x = 0x11a0; | ||
regs.c.x = sizeof(s); | ||
regs.d.b.l = drive; | ||
regs.d.b.h = 1; /* we'd like a version one structure returned */ | ||
regs.es = FP_SEG_OBJ(®s, p); | ||
regs.di = FP_OFF_OBJ(®s, p); | ||
|
||
regs.flags = FLG_CARRY; | ||
call_intr(0x2f, MK_FAR_SCP(regs)); | ||
if ((regs.flags & FLG_CARRY) || (regs.a.x != 0x1c01)) | ||
return DE_INVLDFUNC; | ||
|
||
if (bufsiz < s.namelen + 1) | ||
return DE_INVLDBUF; | ||
|
||
udst[0] = s.flags.std; | ||
udst[1] = s.flags.ext; | ||
udst[2] = s.maxfilenamelen; | ||
udst[3] = s.maxpathlen; | ||
n_fmemcpy(dst_s, s.name, s.namelen + 1); | ||
return SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think you can pass
struct xgetvolumeinfo *s
as an arg instead of
dst_r
, and dop = MK_FAR(*s);
Not guaranteeing, but I think this
should work.