fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@269 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2001-07-24 16:56:29 +00:00
parent 77e49f87c7
commit d4a9888f7b
14 changed files with 176 additions and 172 deletions

View File

@ -1,8 +1,26 @@
2001 Jul 9 - Build 2024/e
-------- Bart Oldeman (bart.oldeman@bristol.ac.uk)
+ fixes Tom
* dyninit allocation fix
* various clean ups
+ fixes Bart + fixes Bart
* #define DBLBYTE in inhndlr.c. Necessary for PQDI
* FCB corrections and cleanups (with a little help from Tom)
* cleaned up (FCB)FindFirst/FindNext a little more.
* task.c: copies default FCBs, initializes AX properly and
an int21/ax=4b01 fix. Also closes all FCB opened files upon
termination of a program.
* dosnames.c: fixed DJGPP "ls c:/" problem reported by Martin
+ fixes Victor Vlasenko
* Makefile fix for dealing with Borland make 3.6
* fix for fatfs.c shrink_file()
+ fixes Bart
* handle B: just like A: on a single floppy system. There still needs to be
user interaction like "Please put a floppy in drive B:".
* ioctl.c fix for INT21/AX=4400 + sft driveno field * ioctl.c fix for INT21/AX=4400 + sft driveno field
* various small fcb fixes * various small fcb fixes
* put file position number and pointers to Pri/SecPathName into * put file position number and pointers to Pri/SecPathName into
SDA. Now MSCDEX works as redirector SDA. Now MSCDEX works as redirector (but still not always :-()
* redirector set attribute fixes + various cleanups * redirector set attribute fixes + various cleanups
* truename+attr+ioctl fix => DJGPP libc compiles cleanly! * truename+attr+ioctl fix => DJGPP libc compiles cleanly!
+ changes Bart + changes Bart

View File

@ -5,6 +5,10 @@
/* Sector buffer structure */ /* Sector buffer structure */
/* */ /* */
/* Copyright (c) 2001 */ /* Copyright (c) 2001 */
/* Bart Oldeman */
/* */
/* Largely taken from globals.h: */
/* Copyright (c) 1995, 1996 */
/* Pasquale J. Villani */ /* Pasquale J. Villani */
/* All Rights Reserved */ /* All Rights Reserved */
/* */ /* */
@ -34,6 +38,9 @@ static BYTE *buffer_hRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.3 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.2 2001/06/03 14:16:17 bartoldeman * Revision 1.2 2001/06/03 14:16:17 bartoldeman
* BUFFERS tuning and misc bug fixes/cleanups (2024c). * BUFFERS tuning and misc bug fixes/cleanups (2024c).
* *

View File

@ -44,4 +44,4 @@ static BYTE *date_hRcsId = "$Id$";
#define REVISION_MINOR 1 #define REVISION_MINOR 1
#define REVISION_SEQ 24 #define REVISION_SEQ 24
#define BUILD 2024 #define BUILD 2024
#define SUB_BUILD "d" #define SUB_BUILD "e"

View File

@ -37,6 +37,9 @@ static BYTE *dosfnsRcsId = "$Id$";
* /// Added SHARE support. 2000/09/04 Ron Cemer * /// Added SHARE support. 2000/09/04 Ron Cemer
* *
* $Log$ * $Log$
* Revision 1.22 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.21 2001/07/23 12:47:42 bartoldeman * Revision 1.21 2001/07/23 12:47:42 bartoldeman
* FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf * FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf
* *
@ -1250,10 +1253,20 @@ COUNT DosChangeDir(BYTE FAR * s)
return result; return result;
} }
STATIC VOID pop_dmp(dmatch FAR * dmp)
{
dmp->dm_attr_fnd = (BYTE) SearchDir.dir_attrib;
dmp->dm_time = SearchDir.dir_time;
dmp->dm_date = SearchDir.dir_date;
dmp->dm_size = (LONG) SearchDir.dir_size;
ConvertName83ToNameSZ(dmp->dm_name, (BYTE FAR *)SearchDir.dir_name);
}
COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name) COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
{ {
COUNT nDrive, rc; COUNT nDrive, rc;
REG dmatch FAR *dmp = (dmatch FAR *) dta; REG dmatch FAR *dmp = (dmatch FAR *) dta;
BYTE FAR *p;
/* /// Added code here to do matching against device names. /* /// Added code here to do matching against device names.
DOS findfirst will match exact device names if the DOS findfirst will match exact device names if the
@ -1262,15 +1275,30 @@ COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
Credits: some of this code was ripped off from truename() Credits: some of this code was ripped off from truename()
in newstuff.c. in newstuff.c.
- Ron Cemer */ - Ron Cemer */
fmemset(dmp, 0, sizeof(dmatch));
if (IsDevice(name)) fmemset(dta, 0, sizeof(dmatch));
memset(&SearchDir, 0, sizeof(struct dirent));
rc = truename(name, PriPathName, FALSE);
if (rc != SUCCESS)
return rc;
if (IsDevice(PriPathName))
{ {
COUNT i;
/* Found a matching device. Hence there cannot be wildcards. */ /* Found a matching device. Hence there cannot be wildcards. */
dmp->dm_attr_fnd = D_DEVICE; SearchDir.dir_attrib = D_DEVICE;
dmp->dm_time = dos_gettime(); SearchDir.dir_time = dos_gettime();
dmp->dm_date = dos_getdate(); SearchDir.dir_date = dos_getdate();
fstrncpy(dmp->dm_name, get_root(name), FNAME_SIZE+FEXT_SIZE+1); p = get_root(PriPathName);
memset(SearchDir.dir_name, ' ', FNAME_SIZE+FEXT_SIZE);
for (i = 0; i < FNAME_SIZE && *p && *p != '.'; i++)
SearchDir.dir_name[i] = *p++;
if (*p == '.') p++;
for (i = 0; i < FEXT_SIZE && *p && *p != '.'; i++)
SearchDir.dir_ext[i] = *p++;
pop_dmp(dmp);
return SUCCESS; return SUCCESS;
} }
/* /// End of additions. - Ron Cemer ; heavily edited - Bart Oldeman */ /* /// End of additions. - Ron Cemer ; heavily edited - Bart Oldeman */
@ -1282,23 +1310,32 @@ COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
current_ldt = &CDSp->cds_table[nDrive]; current_ldt = &CDSp->cds_table[nDrive];
rc = truename(name, PriPathName, FALSE); #if defined(FIND_DEBUG)
printf("Remote Find: n='%Fs\n", PriPathName);
#endif
fmemcpy(TempBuffer, dta, 21);
p = dta;
dta = (BYTE FAR *)TempBuffer;
rc = current_ldt->cdsFlags & CDSNETWDRV ?
-int2f_Remote_call(REM_FINDFIRST, 0, 0, 0, (VOID FAR *)current_ldt, 0, 0) :
dos_findfirst(attr, PriPathName);
dta = p;
if (rc != SUCCESS) if (rc != SUCCESS)
return rc; return rc;
if (current_ldt->cdsFlags & CDSNETWDRV) fmemcpy(dta, TempBuffer, 21);
{ pop_dmp((dmatch FAR *)dta);
return -Remote_find(REM_FINDFIRST); return SUCCESS;
}
else
{
dmp->dm_drive = nDrive;
return dos_findfirst(attr, PriPathName);
}
} }
COUNT DosFindNext(void) COUNT DosFindNext(void)
{ {
COUNT rc;
BYTE FAR *p;
/* /// findnext will always fail on a device name. - Ron Cemer */ /* /// findnext will always fail on a device name. - Ron Cemer */
if (((dmatch FAR *)dta)->dm_attr_fnd == D_DEVICE) if (((dmatch FAR *)dta)->dm_attr_fnd == D_DEVICE)
@ -1325,9 +1362,21 @@ COUNT DosFindNext(void)
printf("findnext: %d\n", printf("findnext: %d\n",
((dmatch FAR *)dta)->dm_drive); ((dmatch FAR *)dta)->dm_drive);
#endif #endif
return (((dmatch FAR *)dta)->dm_drive & 0x80) ? fmemcpy(TempBuffer, dta, 21);
-Remote_find(REM_FINDNEXT) : fmemset(dta, 0, sizeof(dmatch));
p = dta;
dta = (BYTE FAR *)TempBuffer;
rc = (((dmatch *)TempBuffer)->dm_drive & 0x80) ?
-int2f_Remote_call(REM_FINDNEXT, 0, 0, 0, (VOID FAR *)current_ldt, 0, 0) :
dos_findnext(); dos_findnext();
dta = p;
if (rc != SUCCESS)
return rc;
fmemcpy(dta, TempBuffer, 21);
pop_dmp((dmatch FAR *)dta);
return SUCCESS;
} }
COUNT DosGetFtime(COUNT hndl, date FAR * dp, time FAR * tp) COUNT DosGetFtime(COUNT hndl, date FAR * dp, time FAR * tp)

View File

@ -36,6 +36,9 @@ static BYTE *dosnamesRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.11 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.10 2001/07/22 01:58:58 bartoldeman * Revision 1.10 2001/07/22 01:58:58 bartoldeman
* Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX * Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX
* *
@ -234,6 +237,8 @@ COUNT ParseDosName(BYTE * lpszFileName,
lpszFileName++; lpszFileName++;
if (*lpszFileName != '\0') if (*lpszFileName != '\0')
return DE_FILENOTFND; return DE_FILENOTFND;
if (nDirCnt == 1) /* for d:\ */
return DE_NFILES;
if (pszDir) if (pszDir)
{ {
if ((lpszFileName - lpszLclFile) == 2) /* for tail DotDot */ if ((lpszFileName - lpszLclFile) == 2) /* for tail DotDot */

View File

@ -78,7 +78,7 @@ void DynFree(unsigned memory_needed)
if (memory_needed == 0) /* this is pass 0 */ if (memory_needed == 0) /* this is pass 0 */
{ {
Dyn.Allocated = 1000; /* this reserves space for initDisk */ Dyn.Allocated = NDEV*sizeof(ddt); /* this reserves space for initDisk */
Dyn.AllocMax = sizeof(Dyn.Buffer); Dyn.AllocMax = sizeof(Dyn.Buffer);
} }
else { else {

View File

@ -36,6 +36,9 @@ static BYTE *fatdirRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.20 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.19 2001/07/23 12:47:42 bartoldeman * Revision 1.19 2001/07/23 12:47:42 bartoldeman
* FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf * FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf
* *
@ -181,8 +184,6 @@ static BYTE *fatdirRcsId = "$Id$";
* Initial revision. * Initial revision.
*/ */
VOID pop_dmp(dmatch FAR *, f_node_ptr);
f_node_ptr dir_open(BYTE * dirname) f_node_ptr dir_open(BYTE * dirname)
{ {
f_node_ptr fnp; f_node_ptr fnp;
@ -591,8 +592,9 @@ VOID dir_close(REG f_node_ptr fnp)
COUNT dos_findfirst(UCOUNT attr, BYTE *name) COUNT dos_findfirst(UCOUNT attr, BYTE *name)
{ {
REG f_node_ptr fnp; REG f_node_ptr fnp;
REG dmatch FAR *dmp = (dmatch FAR *) dta; REG dmatch *dmp = (dmatch *) TempBuffer;
REG COUNT i; REG COUNT i;
COUNT nDrive;
BYTE *p; BYTE *p;
BYTE local_name[FNAME_SIZE + 1], BYTE local_name[FNAME_SIZE + 1],
@ -607,12 +609,8 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name)
/* dirmatch structure and then for every find, we will open the */ /* dirmatch structure and then for every find, we will open the */
/* current directory, do a seek and read, then close the fnode. */ /* current directory, do a seek and read, then close the fnode. */
/* Start out by initializing the dirmatch structure. */
dmp->dm_attr_srch = attr;
/* Parse out the drive, file name and file extension. */ /* Parse out the drive, file name and file extension. */
i = ParseDosName(name, NULL, &szDirName[2], local_name, local_ext, TRUE); i = ParseDosName(name, &nDrive, &szDirName[2], local_name, local_ext, TRUE);
if (i != SUCCESS) if (i != SUCCESS)
return i; return i;
/* /*
@ -643,15 +641,11 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name)
/* Convert everything to uppercase. */ /* Convert everything to uppercase. */
DosUpFMem(SearchDir.dir_name, FNAME_SIZE + FEXT_SIZE); DosUpFMem(SearchDir.dir_name, FNAME_SIZE + FEXT_SIZE);
/* Copy the raw pattern from our data segment to the DTA. */
fbcopy((BYTE FAR *) SearchDir.dir_name, dmp->dm_name_pat,
FNAME_SIZE + FEXT_SIZE);
/* Now search through the directory to find the entry... */ /* Now search through the directory to find the entry... */
/* Complete building the directory from the passed in */ /* Complete building the directory from the passed in */
/* name */ /* name */
szDirName[0] = 'A' + dmp->dm_drive; szDirName[0] = 'A' + nDrive;
szDirName[1] = ':'; szDirName[1] = ':';
/* Special handling - the volume id is only in the root */ /* Special handling - the volume id is only in the root */
@ -670,6 +664,18 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name)
if ((fnp = dir_open(szDirName)) == NULL) if ((fnp = dir_open(szDirName)) == NULL)
return DE_PATHNOTFND; return DE_PATHNOTFND;
/* Now initialize the dirmatch structure. */
nDrive=get_verify_drive(name);
if (nDrive < 0)
return nDrive;
dmp->dm_drive = nDrive;
dmp->dm_attr_srch = attr;
/* Copy the raw pattern from our data segment to the DTA. */
fbcopy((BYTE FAR *) SearchDir.dir_name, dmp->dm_name_pat,
FNAME_SIZE + FEXT_SIZE);
if ((attr & ~(D_RDONLY | D_ARCHIVE)) == D_VOLID) if ((attr & ~(D_RDONLY | D_ARCHIVE)) == D_VOLID)
{ {
/* Now do the search */ /* Now do the search */
@ -678,7 +684,9 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name)
/* Test the attribute and return first found */ /* Test the attribute and return first found */
if ((fnp->f_dir.dir_attrib & ~(D_RDONLY | D_ARCHIVE)) == D_VOLID) if ((fnp->f_dir.dir_attrib & ~(D_RDONLY | D_ARCHIVE)) == D_VOLID)
{ {
pop_dmp(dmp, fnp); dmp->dm_dirstart= fnp->f_dirstart;
dmp->dm_cluster = fnp->f_dir.dir_start; /* TE */
memcpy(&SearchDir, &fnp->f_dir, sizeof(struct dirent));
dir_close(fnp); dir_close(fnp);
return SUCCESS; return SUCCESS;
} }
@ -692,7 +700,6 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name)
/* Otherwise just do a normal find next */ /* Otherwise just do a normal find next */
else else
{ {
pop_dmp(dmp, fnp);
dmp->dm_entry = 0; dmp->dm_entry = 0;
if (!fnp->f_flags.f_droot) if (!fnp->f_flags.f_droot)
{ {
@ -719,7 +726,7 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name)
COUNT dos_findnext(void) COUNT dos_findnext(void)
{ {
REG dmatch FAR *dmp = (dmatch FAR *) dta; REG dmatch *dmp = (dmatch *) TempBuffer;
REG f_node_ptr fnp; REG f_node_ptr fnp;
BOOL found = FALSE; BOOL found = FALSE;
@ -803,21 +810,9 @@ COUNT dos_findnext(void)
/* If found, transfer it to the dmatch structure */ /* If found, transfer it to the dmatch structure */
if (found) if (found)
{ {
#if 0 dmp->dm_dirstart= fnp->f_dirstart;
extern VOID FAR *FcbFindFirstDirPtr; dmp->dm_cluster = fnp->f_dir.dir_start; /* TE */
if (FcbFindFirstDirPtr) memcpy(&SearchDir, &fnp->f_dir, sizeof(struct dirent));
{
/* this works MUCH better, then converting
83 -> ASCIIZ ->83;
specifically ".", ".."
But completely bypasses the network case!
*/
fmemcpy(FcbFindFirstDirPtr, &fnp->f_dir, 32);
}
#endif
pop_dmp(dmp, fnp);
} }
/* return the result */ /* return the result */
@ -825,25 +820,6 @@ COUNT dos_findnext(void)
return found ? SUCCESS : DE_NFILES; return found ? SUCCESS : DE_NFILES;
} }
STATIC VOID pop_dmp(dmatch FAR * dmp, f_node_ptr fnp)
{
dmp->dm_attr_fnd = fnp->f_dir.dir_attrib;
dmp->dm_time = fnp->f_dir.dir_time;
dmp->dm_date = fnp->f_dir.dir_date;
dmp->dm_size = fnp->f_dir.dir_size;
dmp->dm_cluster = fnp->f_dir.dir_start; /* TE */
dmp->dm_dirstart= fnp->f_dirstart;
/*
dmp->dm_flags.f_droot = fnp->f_flags.f_droot;
dmp->dm_flags.f_ddir = fnp->f_flags.f_ddir;
dmp->dm_flags.f_dmod = fnp->f_flags.f_dmod;
dmp->dm_flags.f_dnew = fnp->f_flags.f_dnew;
*/
ConvertName83ToNameSZ((BYTE FAR *)dmp->dm_name, (BYTE FAR *) fnp->f_dir.dir_name);
}
#endif #endif
/* /*
this receives a name in 11 char field NAME+EXT and builds this receives a name in 11 char field NAME+EXT and builds
@ -909,11 +885,4 @@ int FileName83Length(BYTE *filename83)
return strlen(buff); return strlen(buff);
} }

View File

@ -47,6 +47,9 @@ BYTE *RcsId = "$Id$";
* performance killer on large drives. (~0.5 sec /dos_mkdir) TE * performance killer on large drives. (~0.5 sec /dos_mkdir) TE
* *
* $Log$ * $Log$
* Revision 1.21 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.20 2001/07/22 01:58:58 bartoldeman * Revision 1.20 2001/07/22 01:58:58 bartoldeman
* Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX * Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX
* *
@ -2445,7 +2448,7 @@ STATIC VOID shrink_file(f_node_ptr fnp)
st = fnp->f_cluster; st = fnp->f_cluster;
if (st == FREE) /* first cluster is free, done */ if (st == FREE || st == LONG_LAST_CLUSTER) /* first cluster is free or EOC, done */
goto done; goto done;
next = next_cluster(dpbp, st); next = next_cluster(dpbp, st);

View File

@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.15 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.14 2001/07/23 12:47:42 bartoldeman * Revision 1.14 2001/07/23 12:47:42 bartoldeman
* FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf * FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf
* *
@ -149,14 +152,12 @@ fcb FAR *CommonFcbInit(xfcb FAR * lpExtFcb, BYTE * pszBuffer, COUNT * pCurDrive)
void FcbNameInit(fcb FAR * lpFcb, BYTE * pszBuffer, COUNT * pCurDrive); void FcbNameInit(fcb FAR * lpFcb, BYTE * pszBuffer, COUNT * pCurDrive);
VOID FcbNextRecord(fcb FAR * lpFcb); VOID FcbNextRecord(fcb FAR * lpFcb);
BOOL FcbCalcRec(xfcb FAR * lpXfcb); BOOL FcbCalcRec(xfcb FAR * lpXfcb);
VOID MoveDirInfo(dmatch * lpDmatch, fcb FAR * lpDir);
#else #else
fcb FAR *ExtFcbToFcb(); fcb FAR *ExtFcbToFcb();
fcb FAR *CommonFcbInit(); fcb FAR *CommonFcbInit();
void FcbNameInit(); void FcbNameInit();
VOID FcbNextRecord(); VOID FcbNextRecord();
BOOL FcbCalcRec(); BOOL FcbCalcRec();
VOID MoveDirInfo();
#endif #endif
#define TestCmnSeps(lpFileName) (strchr(":<|>+=,", *lpFileName) != NULL) #define TestCmnSeps(lpFileName) (strchr(":<|>+=,", *lpFileName) != NULL)
@ -165,9 +166,6 @@ VOID MoveDirInfo();
static dmatch Dmatch; static dmatch Dmatch;
/* VOID FAR *FcbFindFirstDirPtr = NULL; */
VOID FatGetDrvData(UCOUNT drive, COUNT FAR * spc, COUNT FAR * bps, VOID FatGetDrvData(UCOUNT drive, COUNT FAR * spc, COUNT FAR * bps,
COUNT FAR * nc, BYTE FAR ** mdp) COUNT FAR * nc, BYTE FAR ** mdp)
{ {
@ -676,7 +674,7 @@ STATIC fcb FAR *CommonFcbInit(xfcb FAR * lpExtFcb, BYTE * pszBuffer,
void FcbNameInit(fcb FAR * lpFcb, BYTE * szBuffer, COUNT * pCurDrive) void FcbNameInit(fcb FAR * lpFcb, BYTE * szBuffer, COUNT * pCurDrive)
{ {
BYTE loc_szBuffer[FNAME_SIZE+1+FEXT_SIZE+1]; BYTE loc_szBuffer[2+FNAME_SIZE+1+FEXT_SIZE+1]; /* 'A:' + '.' + '\0' */
BYTE *pszBuffer = loc_szBuffer; BYTE *pszBuffer = loc_szBuffer;
/* Build a traditional DOS file name */ /* Build a traditional DOS file name */
@ -691,7 +689,7 @@ void FcbNameInit(fcb FAR * lpFcb, BYTE * szBuffer, COUNT * pCurDrive)
{ {
*pCurDrive = default_drive + 1; *pCurDrive = default_drive + 1;
} }
ConvertName83ToNameSZ((BYTE FAR *)pszBuffer, (BYTE FAR *) lpFcb->fcb_fname); ConvertName83ToNameSZ(pszBuffer, (BYTE FAR *) lpFcb->fcb_fname);
truename(loc_szBuffer, szBuffer, FALSE); truename(loc_szBuffer, szBuffer, FALSE);
/* XXX fix truename error handling */ /* XXX fix truename error handling */
} }
@ -876,21 +874,9 @@ BOOL FcbRename(xfcb FAR * lpXfcb)
/* TE:the MoveDirInfo() is now done by simply copying the dirEntry into the FCB /* TE:the MoveDirInfo() is now done by simply copying the dirEntry into the FCB
this prevents problems with ".", ".." and saves code this prevents problems with ".", ".." and saves code
BO:use FcbParseFname: avoid redirector problems and is there anyway BO:use global SearchDir, as produced by FindFirst/Next
*/ */
VOID MoveDirInfo(dmatch * lpDmatch, fcb FAR * lpDir)
{
BYTE FAR *lpszFrom = lpDmatch->dm_name;
/* First, expand the find match into dir style */
FcbParseFname(PARSE_DFLT_DRIVE | PARSE_SEP_STOP, &lpszFrom, lpDir);
/* lpDir->dir_attrib = lpDmatch->dm_attr_fnd; XXX for extended fcb! */
lpDir->fcb_time = lpDmatch->dm_time;
lpDir->fcb_date = lpDmatch->dm_date;
lpDir->fcb_dirclst = lpDmatch->dm_cluster;
lpDir->fcb_fsize = lpDmatch->dm_size;
}
BOOL FcbClose(xfcb FAR * lpXfcb) BOOL FcbClose(xfcb FAR * lpXfcb)
{ {
sft FAR *s; sft FAR *s;
@ -923,13 +909,13 @@ VOID FcbCloseAll()
BOOL FcbFindFirst(xfcb FAR * lpXfcb) BOOL FcbFindFirst(xfcb FAR * lpXfcb)
{ {
fcb FAR *lpDir; BYTE FAR *lpDir;
COUNT FcbDrive; COUNT FcbDrive;
psp FAR *lpPsp = MK_FP(cu_psp, 0); psp FAR *lpPsp = MK_FP(cu_psp, 0);
/* First, move the dta to a local and change it around to match */ /* First, move the dta to a local and change it around to match */
/* our functions. */ /* our functions. */
lpDir = (fcb FAR *) dta; lpDir = (BYTE FAR *) dta;
dta = (BYTE FAR *) & Dmatch; dta = (BYTE FAR *) & Dmatch;
/* Next initialze local variables by moving them from the fcb */ /* Next initialze local variables by moving them from the fcb */
@ -937,28 +923,21 @@ BOOL FcbFindFirst(xfcb FAR * lpXfcb)
if (lpXfcb->xfcb_flag == 0xff) if (lpXfcb->xfcb_flag == 0xff)
{ {
wAttr = lpXfcb->xfcb_attrib; wAttr = lpXfcb->xfcb_attrib;
/* fbcopy(lpXfcb, lpDir, 7); fbcopy(lpXfcb, lpDir, 7);
lpDir += 7; lpDir += 7;
BO:WHY???
*/
} }
else else
wAttr = D_ALL; wAttr = D_ALL;
/* *lpDir++ = FcbDrive; */
/* FcbFindFirstDirPtr = lpDir; */
if (DosFindFirst(wAttr, SecPathName) != SUCCESS) if (DosFindFirst(wAttr, SecPathName) != SUCCESS)
{ {
/* FcbFindFirstDirPtr = NULL;*/
dta = lpPsp->ps_dta; dta = lpPsp->ps_dta;
return FALSE; return FALSE;
} }
/* FcbFindFirstDirPtr = NULL; */ *lpDir++ = FcbDrive;
fmemcpy(lpDir, &SearchDir, sizeof(struct dirent));
MoveDirInfo(&Dmatch, lpDir);
lpFcb->fcb_dirclst = Dmatch.dm_dirstart; lpFcb->fcb_dirclst = Dmatch.dm_dirstart;
lpFcb->fcb_strtclst = Dmatch.dm_entry; lpFcb->fcb_strtclst = Dmatch.dm_entry;
@ -980,31 +959,19 @@ BOOL FcbFindFirst(xfcb FAR * lpXfcb)
BOOL FcbFindNext(xfcb FAR * lpXfcb) BOOL FcbFindNext(xfcb FAR * lpXfcb)
{ {
fcb FAR *lpDir; BYTE FAR *lpDir;
COUNT FcbDrive; COUNT FcbDrive;
psp FAR *lpPsp = MK_FP(cu_psp, 0); psp FAR *lpPsp = MK_FP(cu_psp, 0);
/* First, move the dta to a local and change it around to match */ /* First, move the dta to a local and change it around to match */
/* our functions. */ /* our functions. */
lpDir = (fcb FAR *) dta; lpDir = (BYTE FAR *) dta;
dta = (BYTE FAR *) & Dmatch; dta = (BYTE FAR *) & Dmatch;
/* Next initialze local variables by moving them from the fcb */ /* Next initialze local variables by moving them from the fcb */
lpFcb = CommonFcbInit(lpXfcb, SecPathName, &FcbDrive); lpFcb = CommonFcbInit(lpXfcb, SecPathName, &FcbDrive);
if ((xfcb FAR *) lpFcb != lpXfcb)
{
wAttr = lpXfcb->xfcb_attrib;
/*
fbcopy(lpXfcb, lpDir, 7);
lpDir += 7;
BO:WHY???
*/
}
else
wAttr = D_ALL;
/* Reconstrct the dirmatch structure from the fcb */ /* Reconstrct the dirmatch structure from the fcb */
/* *lpDir++ = FcbDrive; */
Dmatch.dm_drive = lpFcb->fcb_sftno; Dmatch.dm_drive = lpFcb->fcb_sftno;
fbcopy(lpFcb->fcb_fname, (BYTE FAR *) Dmatch.dm_name_pat, FNAME_SIZE + FEXT_SIZE); fbcopy(lpFcb->fcb_fname, (BYTE FAR *) Dmatch.dm_name_pat, FNAME_SIZE + FEXT_SIZE);
@ -1015,18 +982,25 @@ BOOL FcbFindNext(xfcb FAR * lpXfcb)
Dmatch.dm_cluster = lpFcb->fcb_dirclst; Dmatch.dm_cluster = lpFcb->fcb_dirclst;
Dmatch.dm_dirstart= lpFcb->fcb_dirclst; Dmatch.dm_dirstart= lpFcb->fcb_dirclst;
/* FcbFindFirstDirPtr = lpDir; */ if ((xfcb FAR *) lpFcb != lpXfcb)
{
wAttr = lpXfcb->xfcb_attrib;
fbcopy(lpXfcb, lpDir, 7);
lpDir += 7;
}
else
wAttr = D_ALL;
if (DosFindNext() != SUCCESS) if (DosFindNext() != SUCCESS)
{ {
/* FcbFindFirstDirPtr = NULL; */
dta = lpPsp->ps_dta; dta = lpPsp->ps_dta;
CritErrCode = 0x12; CritErrCode = 0x12;
return FALSE; return FALSE;
} }
/*FcbFindFirstDirPtr = NULL;*/
MoveDirInfo(&Dmatch, lpDir); *lpDir++ = FcbDrive;
fmemcpy((struct dirent FAR *)lpDir, &SearchDir, sizeof(struct dirent));
lpFcb->fcb_dirclst = Dmatch.dm_dirstart; lpFcb->fcb_dirclst = Dmatch.dm_dirstart;
lpFcb->fcb_strtclst = Dmatch.dm_entry; lpFcb->fcb_strtclst = Dmatch.dm_entry;

View File

@ -37,6 +37,9 @@ BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.28 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.27 2001/07/23 12:47:42 bartoldeman * Revision 1.27 2001/07/23 12:47:42 bartoldeman
* FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf * FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf
* *
@ -369,7 +372,7 @@ VOID int21_service(iregs FAR * r)
p->ps_stack = (BYTE FAR *) r; p->ps_stack = (BYTE FAR *) r;
#ifdef DEBUG #ifdef DEBUG
if (bDumpRegs) if (bDumpRegs)
{ {
fbcopy((VOID FAR *) user_r, (VOID FAR *) & error_regs, sizeof(iregs)); fbcopy((VOID FAR *) user_r, (VOID FAR *) & error_regs, sizeof(iregs));
@ -1534,6 +1537,7 @@ dispatch:
/* UNDOCUMENTED: Double byte and korean tables */ /* UNDOCUMENTED: Double byte and korean tables */
case 0x63: case 0x63:
{ {
#define DBLBYTE
#ifdef DBLBYTE #ifdef DBLBYTE
static char dbcsTable[2] = static char dbcsTable[2] =
{ {
@ -1546,7 +1550,8 @@ dispatch:
r->AL = 0; r->AL = 0;
#else #else
/* not really supported, but will pass. */ /* not really supported, but will pass. */
r->AL = 0x00; /*jpp: according to interrupt list */ r->AL = 0x00; /*jpp: according to interrupt list */
/*Bart: fails for PQDI: use the above again */
#endif #endif
break; break;
} }

View File

@ -5,6 +5,9 @@
# #
# $Log$ # $Log$
# Revision 1.13 2001/07/24 16:56:29 bartoldeman
# fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
#
# Revision 1.12 2001/07/22 01:58:58 bartoldeman # Revision 1.12 2001/07/22 01:58:58 bartoldeman
# Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX # Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX
# #
@ -169,8 +172,9 @@ HDR=../hdr/
.c.obj: .c.obj:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
.c.asm: # Borland make 3.6 does not like this rule.
$(CC) $(CFLAGS) -S $< #.c.asm:
# $(CC) $(CFLAGS) -S $<
.cpp.obj: .cpp.obj:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<

View File

@ -36,6 +36,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.14 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.13 2001/07/22 01:58:58 bartoldeman * Revision 1.13 2001/07/22 01:58:58 bartoldeman
* Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX * Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX
* *
@ -128,40 +131,5 @@ UCOUNT Remote_RW(UWORD func, UCOUNT n, BYTE FAR * bp, sft FAR * s, COUNT FAR * e
return ((UCOUNT) rc); return ((UCOUNT) rc);
} }
#undef FIND_DEBUG
/*
*/
COUNT Remote_find(UWORD func)
{
COUNT i;
char FAR *p;
#if defined(FIND_DEBUG)
if (func == REM_FINDFIRST)
{
printf("Remote Find: n='%Fs\n", PriPathName);
}
#endif
fmemcpy(TempBuffer, dta, 21);
p = dta;
dta = (BYTE FAR *)TempBuffer;
i = int2f_Remote_call(func, 0, 0, 0, (VOID FAR *)current_ldt, 0, 0);
dta = p;
fmemcpy(dta, TempBuffer, 21);
if (i != 0)
return i;
((dmatch FAR *)dta)->dm_attr_fnd = (BYTE) SearchDir.dir_attrib;
((dmatch FAR *)dta)->dm_time = SearchDir.dir_time;
((dmatch FAR *)dta)->dm_date = SearchDir.dir_date;
((dmatch FAR *)dta)->dm_size = (LONG) SearchDir.dir_size;
ConvertName83ToNameSZ(((dmatch FAR *)dta)->dm_name, (BYTE *)SearchDir.dir_name);
return i;
}

View File

@ -34,6 +34,9 @@ static BYTE *Proto_hRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.20 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
* Revision 1.19 2001/07/23 12:47:42 bartoldeman * Revision 1.19 2001/07/23 12:47:42 bartoldeman
* FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf * FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf
* *
@ -357,7 +360,6 @@ void FcbNameInit(fcb FAR * lpFcb, BYTE * pszBuffer, COUNT * pCurDrive);
BOOL FcbOpen(xfcb FAR * lpXfcb); BOOL FcbOpen(xfcb FAR * lpXfcb);
BOOL FcbDelete(xfcb FAR * lpXfcb); BOOL FcbDelete(xfcb FAR * lpXfcb);
BOOL FcbRename(xfcb FAR * lpXfcb); BOOL FcbRename(xfcb FAR * lpXfcb);
VOID MoveDirInfo(dmatch * lpDmatch, fcb FAR * lpDir);
BOOL FcbClose(xfcb FAR * lpXfcb); BOOL FcbClose(xfcb FAR * lpXfcb);
VOID FcbCloseAll(VOID); VOID FcbCloseAll(VOID);
BOOL FcbFindFirst(xfcb FAR * lpXfcb); BOOL FcbFindFirst(xfcb FAR * lpXfcb);

View File

@ -1,6 +1,6 @@
INTRODUCTION INTRODUCTION
------------ ------------
This archive contains FreeDOS Kernel version 1.1.18, build 2018, also This archive contains the current FreeDOS Kernel, also
known as DOS-C, originally written by Pasquale J. Villani. known as DOS-C, originally written by Pasquale J. Villani.
The FreeDOS Kernel is available from http://freedos.sourceforge.net. The FreeDOS Kernel is available from http://freedos.sourceforge.net.