From d4a9888f7b74e6d1f5878a362527fc5243ded21d Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Tue, 24 Jul 2001 16:56:29 +0000 Subject: [PATCH] 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 --- docs/history.txt | 20 ++++++++++- hdr/buffer.h | 7 ++++ hdr/version.h | 2 +- kernel/dosfns.c | 85 +++++++++++++++++++++++++++++++++++++---------- kernel/dosnames.c | 5 +++ kernel/dyninit.c | 2 +- kernel/fatdir.c | 85 +++++++++++++++-------------------------------- kernel/fatfs.c | 5 ++- kernel/fcbfns.c | 76 ++++++++++++++---------------------------- kernel/inthndlr.c | 9 +++-- kernel/kernel.mak | 8 +++-- kernel/network.c | 38 ++------------------- kernel/proto.h | 4 ++- readme.txt | 2 +- 14 files changed, 176 insertions(+), 172 deletions(-) diff --git a/docs/history.txt b/docs/history.txt index 1d46ca0..518deb4 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -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 + * #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 * various small fcb fixes * 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 * truename+attr+ioctl fix => DJGPP libc compiles cleanly! + changes Bart diff --git a/hdr/buffer.h b/hdr/buffer.h index c876223..8662fe8 100644 --- a/hdr/buffer.h +++ b/hdr/buffer.h @@ -5,6 +5,10 @@ /* Sector buffer structure */ /* */ /* Copyright (c) 2001 */ +/* Bart Oldeman */ +/* */ +/* Largely taken from globals.h: */ +/* Copyright (c) 1995, 1996 */ /* Pasquale J. Villani */ /* All Rights Reserved */ /* */ @@ -34,6 +38,9 @@ static BYTE *buffer_hRcsId = "$Id$"; /* * $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 * BUFFERS tuning and misc bug fixes/cleanups (2024c). * diff --git a/hdr/version.h b/hdr/version.h index 31cfec1..656bd78 100644 --- a/hdr/version.h +++ b/hdr/version.h @@ -44,4 +44,4 @@ static BYTE *date_hRcsId = "$Id$"; #define REVISION_MINOR 1 #define REVISION_SEQ 24 #define BUILD 2024 -#define SUB_BUILD "d" +#define SUB_BUILD "e" diff --git a/kernel/dosfns.c b/kernel/dosfns.c index 4e522e4..453c843 100644 --- a/kernel/dosfns.c +++ b/kernel/dosfns.c @@ -37,6 +37,9 @@ static BYTE *dosfnsRcsId = "$Id$"; * /// Added SHARE support. 2000/09/04 Ron Cemer * * $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 * FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf * @@ -1250,10 +1253,20 @@ COUNT DosChangeDir(BYTE FAR * s) 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 nDrive, rc; REG dmatch FAR *dmp = (dmatch FAR *) dta; + BYTE FAR *p; /* /// Added code here to do matching against device names. 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() in newstuff.c. - 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. */ - dmp->dm_attr_fnd = D_DEVICE; - dmp->dm_time = dos_gettime(); - dmp->dm_date = dos_getdate(); - fstrncpy(dmp->dm_name, get_root(name), FNAME_SIZE+FEXT_SIZE+1); + SearchDir.dir_attrib = D_DEVICE; + SearchDir.dir_time = dos_gettime(); + SearchDir.dir_date = dos_getdate(); + 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; } /* /// 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]; - 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) return rc; - if (current_ldt->cdsFlags & CDSNETWDRV) - { - return -Remote_find(REM_FINDFIRST); - } - else - { - dmp->dm_drive = nDrive; - return dos_findfirst(attr, PriPathName); - } + fmemcpy(dta, TempBuffer, 21); + pop_dmp((dmatch FAR *)dta); + return SUCCESS; } COUNT DosFindNext(void) { + COUNT rc; + BYTE FAR *p; /* /// findnext will always fail on a device name. - Ron Cemer */ if (((dmatch FAR *)dta)->dm_attr_fnd == D_DEVICE) @@ -1325,9 +1362,21 @@ COUNT DosFindNext(void) printf("findnext: %d\n", ((dmatch FAR *)dta)->dm_drive); #endif - return (((dmatch FAR *)dta)->dm_drive & 0x80) ? - -Remote_find(REM_FINDNEXT) : + fmemcpy(TempBuffer, dta, 21); + 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(); + + 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) diff --git a/kernel/dosnames.c b/kernel/dosnames.c index c7f172b..b513204 100644 --- a/kernel/dosnames.c +++ b/kernel/dosnames.c @@ -36,6 +36,9 @@ static BYTE *dosnamesRcsId = "$Id$"; /* * $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 * Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX * @@ -234,6 +237,8 @@ COUNT ParseDosName(BYTE * lpszFileName, lpszFileName++; if (*lpszFileName != '\0') return DE_FILENOTFND; + if (nDirCnt == 1) /* for d:\ */ + return DE_NFILES; if (pszDir) { if ((lpszFileName - lpszLclFile) == 2) /* for tail DotDot */ diff --git a/kernel/dyninit.c b/kernel/dyninit.c index fd2c127..9ff45a1 100644 --- a/kernel/dyninit.c +++ b/kernel/dyninit.c @@ -78,7 +78,7 @@ void DynFree(unsigned memory_needed) 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); } else { diff --git a/kernel/fatdir.c b/kernel/fatdir.c index 5c13261..c26279d 100644 --- a/kernel/fatdir.c +++ b/kernel/fatdir.c @@ -36,6 +36,9 @@ static BYTE *fatdirRcsId = "$Id$"; /* * $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 * FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf * @@ -181,8 +184,6 @@ static BYTE *fatdirRcsId = "$Id$"; * Initial revision. */ -VOID pop_dmp(dmatch FAR *, f_node_ptr); - f_node_ptr dir_open(BYTE * dirname) { f_node_ptr fnp; @@ -591,8 +592,9 @@ VOID dir_close(REG f_node_ptr fnp) COUNT dos_findfirst(UCOUNT attr, BYTE *name) { REG f_node_ptr fnp; - REG dmatch FAR *dmp = (dmatch FAR *) dta; + REG dmatch *dmp = (dmatch *) TempBuffer; REG COUNT i; + COUNT nDrive; BYTE *p; 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 */ /* 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. */ - 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) return i; /* @@ -643,15 +641,11 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name) /* Convert everything to uppercase. */ 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... */ /* Complete building the directory from the passed in */ /* name */ - szDirName[0] = 'A' + dmp->dm_drive; + szDirName[0] = 'A' + nDrive; szDirName[1] = ':'; /* 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) 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) { /* Now do the search */ @@ -678,7 +684,9 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name) /* Test the attribute and return first found */ 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); return SUCCESS; } @@ -692,7 +700,6 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name) /* Otherwise just do a normal find next */ else { - pop_dmp(dmp, fnp); dmp->dm_entry = 0; if (!fnp->f_flags.f_droot) { @@ -719,7 +726,7 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name) COUNT dos_findnext(void) { - REG dmatch FAR *dmp = (dmatch FAR *) dta; + REG dmatch *dmp = (dmatch *) TempBuffer; REG f_node_ptr fnp; BOOL found = FALSE; @@ -803,21 +810,9 @@ COUNT dos_findnext(void) /* If found, transfer it to the dmatch structure */ if (found) { -#if 0 - extern VOID FAR *FcbFindFirstDirPtr; - if (FcbFindFirstDirPtr) - { - /* 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); + dmp->dm_dirstart= fnp->f_dirstart; + dmp->dm_cluster = fnp->f_dir.dir_start; /* TE */ + memcpy(&SearchDir, &fnp->f_dir, sizeof(struct dirent)); } /* return the result */ @@ -825,25 +820,6 @@ COUNT dos_findnext(void) 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 /* this receives a name in 11 char field NAME+EXT and builds @@ -909,11 +885,4 @@ int FileName83Length(BYTE *filename83) return strlen(buff); -} - - - - - - - +} diff --git a/kernel/fatfs.c b/kernel/fatfs.c index db7d73d..96c7322 100644 --- a/kernel/fatfs.c +++ b/kernel/fatfs.c @@ -47,6 +47,9 @@ BYTE *RcsId = "$Id$"; * performance killer on large drives. (~0.5 sec /dos_mkdir) TE * * $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 * 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; - if (st == FREE) /* first cluster is free, done */ + if (st == FREE || st == LONG_LAST_CLUSTER) /* first cluster is free or EOC, done */ goto done; next = next_cluster(dpbp, st); diff --git a/kernel/fcbfns.c b/kernel/fcbfns.c index b510188..6c9f5f9 100644 --- a/kernel/fcbfns.c +++ b/kernel/fcbfns.c @@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$"; /* * $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 * 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 FcbNextRecord(fcb FAR * lpFcb); BOOL FcbCalcRec(xfcb FAR * lpXfcb); -VOID MoveDirInfo(dmatch * lpDmatch, fcb FAR * lpDir); #else fcb FAR *ExtFcbToFcb(); fcb FAR *CommonFcbInit(); void FcbNameInit(); VOID FcbNextRecord(); BOOL FcbCalcRec(); -VOID MoveDirInfo(); #endif #define TestCmnSeps(lpFileName) (strchr(":<|>+=,", *lpFileName) != NULL) @@ -165,9 +166,6 @@ VOID MoveDirInfo(); static dmatch Dmatch; -/* VOID FAR *FcbFindFirstDirPtr = NULL; */ - - VOID FatGetDrvData(UCOUNT drive, COUNT FAR * spc, COUNT FAR * bps, 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) { - 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; /* Build a traditional DOS file name */ @@ -691,7 +689,7 @@ void FcbNameInit(fcb FAR * lpFcb, BYTE * szBuffer, COUNT * pCurDrive) { *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); /* 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 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) { sft FAR *s; @@ -923,13 +909,13 @@ VOID FcbCloseAll() BOOL FcbFindFirst(xfcb FAR * lpXfcb) { - fcb FAR *lpDir; + BYTE FAR *lpDir; COUNT FcbDrive; psp FAR *lpPsp = MK_FP(cu_psp, 0); /* First, move the dta to a local and change it around to match */ /* our functions. */ - lpDir = (fcb FAR *) dta; + lpDir = (BYTE FAR *) dta; dta = (BYTE FAR *) & Dmatch; /* Next initialze local variables by moving them from the fcb */ @@ -937,28 +923,21 @@ BOOL FcbFindFirst(xfcb FAR * lpXfcb) if (lpXfcb->xfcb_flag == 0xff) { wAttr = lpXfcb->xfcb_attrib; - /* fbcopy(lpXfcb, lpDir, 7); - lpDir += 7; - BO:WHY??? - */ + fbcopy(lpXfcb, lpDir, 7); + lpDir += 7; } else wAttr = D_ALL; - /* *lpDir++ = FcbDrive; */ - - /* FcbFindFirstDirPtr = lpDir; */ - if (DosFindFirst(wAttr, SecPathName) != SUCCESS) { - /* FcbFindFirstDirPtr = NULL;*/ dta = lpPsp->ps_dta; return FALSE; } - /* FcbFindFirstDirPtr = NULL; */ + *lpDir++ = FcbDrive; + fmemcpy(lpDir, &SearchDir, sizeof(struct dirent)); - MoveDirInfo(&Dmatch, lpDir); lpFcb->fcb_dirclst = Dmatch.dm_dirstart; lpFcb->fcb_strtclst = Dmatch.dm_entry; @@ -980,31 +959,19 @@ BOOL FcbFindFirst(xfcb FAR * lpXfcb) BOOL FcbFindNext(xfcb FAR * lpXfcb) { - fcb FAR *lpDir; + BYTE FAR *lpDir; COUNT FcbDrive; psp FAR *lpPsp = MK_FP(cu_psp, 0); /* First, move the dta to a local and change it around to match */ /* our functions. */ - lpDir = (fcb FAR *) dta; + lpDir = (BYTE FAR *) dta; dta = (BYTE FAR *) & Dmatch; /* Next initialze local variables by moving them from the fcb */ 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 */ - /* *lpDir++ = FcbDrive; */ Dmatch.dm_drive = lpFcb->fcb_sftno; 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_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) { - /* FcbFindFirstDirPtr = NULL; */ dta = lpPsp->ps_dta; CritErrCode = 0x12; 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_strtclst = Dmatch.dm_entry; diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index 4351550..495692b 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -37,6 +37,9 @@ BYTE *RcsId = "$Id$"; /* * $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 * 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; -#ifdef DEBUG +#ifdef DEBUG if (bDumpRegs) { fbcopy((VOID FAR *) user_r, (VOID FAR *) & error_regs, sizeof(iregs)); @@ -1534,6 +1537,7 @@ dispatch: /* UNDOCUMENTED: Double byte and korean tables */ case 0x63: { +#define DBLBYTE #ifdef DBLBYTE static char dbcsTable[2] = { @@ -1546,7 +1550,8 @@ dispatch: r->AL = 0; #else /* 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 break; } diff --git a/kernel/kernel.mak b/kernel/kernel.mak index 942f552..b477135 100644 --- a/kernel/kernel.mak +++ b/kernel/kernel.mak @@ -5,6 +5,9 @@ # # $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 # Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX # @@ -169,8 +172,9 @@ HDR=../hdr/ .c.obj: $(CC) $(CFLAGS) -c $< -.c.asm: - $(CC) $(CFLAGS) -S $< +# Borland make 3.6 does not like this rule. +#.c.asm: +# $(CC) $(CFLAGS) -S $< .cpp.obj: $(CC) $(CFLAGS) -c $< diff --git a/kernel/network.c b/kernel/network.c index b0d52da..e941e7f 100644 --- a/kernel/network.c +++ b/kernel/network.c @@ -36,6 +36,9 @@ static BYTE *RcsId = "$Id$"; /* * $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 * 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); } -#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; -} - diff --git a/kernel/proto.h b/kernel/proto.h index 0b2ecbb..1e3f915 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -34,6 +34,9 @@ static BYTE *Proto_hRcsId = "$Id$"; /* * $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 * 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 FcbDelete(xfcb FAR * lpXfcb); BOOL FcbRename(xfcb FAR * lpXfcb); -VOID MoveDirInfo(dmatch * lpDmatch, fcb FAR * lpDir); BOOL FcbClose(xfcb FAR * lpXfcb); VOID FcbCloseAll(VOID); BOOL FcbFindFirst(xfcb FAR * lpXfcb); diff --git a/readme.txt b/readme.txt index 42bde4a..43048a5 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,6 @@ 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. The FreeDOS Kernel is available from http://freedos.sourceforge.net.