Read History file for Change info

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@27 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Jim Tabor 2000-05-26 19:25:19 +00:00
parent 21bb3f6923
commit edf98624fb
15 changed files with 312 additions and 237 deletions

View File

@ -1,3 +1,32 @@
2000 May 26 - Build 2020
-------- James Tabor (jimtabor@infohwy.com)
Code Clean up and Now the Release.
2000 May 26 - Build 2020
-------- James Tabor (jimtabor@infohwy.com)
+ Fixed IsDevice is used in FcbFns.c and DosFns.c. I removed IsDevice
from DosNames.c an placed it in DosFns.c. FcbFns had dup code
and it was removed. This fixed all the functions using IsDevice.
Truename works now. I consider it dangerous and brain damaged.
Note:
truename X:\DIR\con -> X:/CON, note the '/'.
truename foo*.* -> X:\DIR\FOO?????.???
truename *.*\*.*\*.* -> ????????.???\????????.???\????????.???
truename *.*\*.**\*.* -> endless Loop
I will fix this later ;^)
Found InitPSP running 3 time. On the 2'nd run the standard handles
were closed with out DosClose. Now Device Drivers can Print out
there startup info.
+ Added New IOCTL code in Dsk.c.
2000 May 26 - Build 2020
-------- James Tabor (jimtabor@infohwy.com)
+ Fix Kolyan Ksenev (7207@mx.csd.tsu.ru) (nik0la@acm.org)
found Major bugs in Task.c and chario.c.
2000 May 25 - Build 2020 2000 May 25 - Build 2020
-------- James Tabor (jimtabor@infohwy.com) -------- James Tabor (jimtabor@infohwy.com)
+ Fixed Project history. + Fixed Project history.

View File

@ -36,6 +36,9 @@ static BYTE *charioRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.4 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.3 2000/05/25 20:56:21 jimtabor * Revision 1.3 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -142,9 +145,9 @@ struct dhdr FAR *finddev(UWORD attr_mask)
/* return dev/null if no matching driver found */ /* return dev/null if no matching driver found */
return &nul_dev; return &nul_dev;
} }
/*
VOID cso(COUNT c) VOID cso(COUNT c)
{ {
BYTE buf = c; BYTE buf = c;
struct dhdr FAR *lpDevice; struct dhdr FAR *lpDevice;
@ -157,14 +160,14 @@ struct dhdr FAR *finddev(UWORD attr_mask)
lpDevice = (struct dhdr FAR *)finddev(ATTR_CONOUT)); lpDevice = (struct dhdr FAR *)finddev(ATTR_CONOUT));
if (CharReqHdr.r_status & S_ERROR) if (CharReqHdr.r_status & S_ERROR)
char_error(&CharReqHdr, lpDevice); char_error(&CharReqHdr, lpDevice);
} }
*/
VOID sto(COUNT c) VOID sto(COUNT c)
{ {
static COUNT scratch; /* make this static to save stack space */ static COUNT scratch; /* make this static to save stack space */
DosWrite(STDOUT, 1, (BYTE FAR *) & c, (COUNT FAR *) scratch); DosWrite(STDOUT, 1, (BYTE FAR *) & c, (COUNT FAR *) &scratch);
} }
VOID mod_sto(REG UCOUNT c) VOID mod_sto(REG UCOUNT c)

View File

@ -39,6 +39,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.4 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.3 2000/05/25 20:56:21 jimtabor * Revision 1.3 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -790,12 +793,12 @@ INIT static VOID Device(BYTE * pLine)
if (DosExec(3, &eb, szBuf) == SUCCESS) if (DosExec(3, &eb, szBuf) == SUCCESS)
{ {
while (FP_OFF(dhp) != 0xFFFF) /* Link in device driver and save nul_dev pointer to next */
{ next_dhp = dhp->dh_next = nul_dev.dh_next;
next_dhp = MK_FP(FP_SEG(dhp), FP_OFF(dhp->dh_next)); nul_dev.dh_next = dhp;
dhp->dh_next = nul_dev.dh_next;
link_dhdr(&nul_dev, dhp, pLine); if(init_device(dhp, pLine)){
dhp = next_dhp; nul_dev.dh_next = next_dhp; /* return orig pointer if error */
} }
} }
else else

View File

@ -28,6 +28,9 @@
; $Header$ ; $Header$
; ;
; $Log$ ; $Log$
; Revision 1.4 2000/05/26 19:25:19 jimtabor
; Read History file for Change info
;
; Revision 1.3 2000/05/25 20:56:21 jimtabor ; Revision 1.3 2000/05/25 20:56:21 jimtabor
; Fixed project history ; Fixed project history
; ;
@ -216,16 +219,16 @@ IntRetn:
iret iret
global _cso ; global _cso
_cso ;_cso
push bp ; push bp
mov bp,sp ; mov bp,sp
push ax ; push ax
mov ax,[bp+4] ; mov ax,[bp+4]
int 29h ; int 29h
pop ax ; pop ax
pop bp ; pop bp
retn ; retn
global _int29_handler global _int29_handler
_int29_handler: _int29_handler:

View File

@ -34,6 +34,9 @@ static BYTE *dosfnsRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.5 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.4 2000/05/25 20:56:21 jimtabor * Revision 1.4 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -134,9 +137,7 @@ static BYTE *dosfnsRcsId = "$Id$";
sft FAR *get_sft(COUNT); sft FAR *get_sft(COUNT);
WORD get_free_hndl(VOID); WORD get_free_hndl(VOID);
sft FAR *get_free_sft(WORD FAR *); sft FAR *get_free_sft(WORD FAR *);
BYTE FAR *get_root(BYTE FAR *);
BOOL cmatch(COUNT, COUNT, COUNT); BOOL cmatch(COUNT, COUNT, COUNT);
BOOL fnmatch(BYTE FAR *, BYTE FAR *, COUNT, COUNT);
struct f_node FAR *xlt_fd(COUNT); struct f_node FAR *xlt_fd(COUNT);
@ -338,6 +339,7 @@ UCOUNT DosWrite(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err)
*err = DE_ACCESS; *err = DE_ACCESS;
return 0; return 0;
} }
if (s->sft_flags & SFT_FSHARED) if (s->sft_flags & SFT_FSHARED)
{ {
WriteCount = Remote_RW(REM_WRITE, n, bp, s, err); WriteCount = Remote_RW(REM_WRITE, n, bp, s, err);
@ -510,13 +512,30 @@ COUNT SftSeek(sft FAR *s, LONG new_pos, COUNT mode)
if (s->sft_flags & SFT_FSHARED) if (s->sft_flags & SFT_FSHARED)
{ {
if (mode == 2) {
/* seek from end of file */ /* seek from end of file */
if (mode == 2) {
/*
* RB list has it as Note:
* this function is called by the DOS 3.1+ kernel, but only when seeking
* from the end of a file opened with sharing modes set in such a manner
* that another process is able to change the size of the file while it
* is already open
* Tested this with Shsucdx ver 0.06 and 1.0. Both now work.
* Lredir via mfs.c from DosEMU works when writing appended files.
* Mfs.c looks for these mode bits set, so here is my best guess.;^)
*/
if ((s->sft_mode & SFT_MDENYREAD) || (s->sft_mode & SFT_MDENYNONE))
{
int2f_Remote_call(REM_LSEEK, 0, (UWORD) FP_SEG(new_pos), (UWORD) FP_OFF(new_pos), (VOID FAR *) s, 0, (VOID FAR *)&data); int2f_Remote_call(REM_LSEEK, 0, (UWORD) FP_SEG(new_pos), (UWORD) FP_OFF(new_pos), (VOID FAR *) s, 0, (VOID FAR *)&data);
s->sft_posit = data; s->sft_posit = data;
return SUCCESS; return SUCCESS;
} }
else
{
s->sft_posit = s->sft_size - new_pos;
return SUCCESS;
}
}
if (mode == 0) { if (mode == 0) {
s->sft_posit = new_pos; s->sft_posit = new_pos;
return SUCCESS; return SUCCESS;
@ -603,7 +622,7 @@ static sft FAR *get_free_sft(WORD FAR * sft_idx)
return (sft FAR *) - 1; return (sft FAR *) - 1;
} }
static BYTE FAR *get_root(BYTE FAR * fname) BYTE FAR *get_root(BYTE FAR * fname)
{ {
BYTE FAR *froot; BYTE FAR *froot;
REG WORD length; REG WORD length;
@ -629,7 +648,7 @@ static BOOL cmatch(COUNT s, COUNT d, COUNT mode)
return s == d; return s == d;
} }
static BOOL fnmatch(BYTE FAR * s, BYTE FAR * d, COUNT n, COUNT mode) BOOL fnmatch(BYTE FAR * s, BYTE FAR * d, COUNT n, COUNT mode)
{ {
while (n--) while (n--)
{ {
@ -658,24 +677,8 @@ COUNT DosCreat(BYTE FAR * fname, COUNT attrib)
return DE_TOOMANY; return DE_TOOMANY;
/* check for a device */ /* check for a device */
froot = get_root(fname); dhp = IsDevice(fname);
for (i = 0; i < FNAME_SIZE; i++) if ( dhp )
{
if (*froot != '\0' && *froot != '.')
PriPathName[i] = *froot++;
else
break;
}
for (; i < FNAME_SIZE; i++)
PriPathName[i] = ' ';
/* if we have an extension, can't be a device */
if (*froot != '.')
{
for (dhp = (struct dhdr FAR *)&nul_dev; dhp != (struct dhdr FAR *)-1; dhp = dhp->dh_next)
{
if (fnmatch((BYTE FAR *) PriPathName, (BYTE FAR *) dhp->dh_name, FNAME_SIZE, FALSE))
{ {
sftp->sft_count += 1; sftp->sft_count += 1;
sftp->sft_mode = SFT_MRDWR; sftp->sft_mode = SFT_MRDWR;
@ -683,13 +686,11 @@ COUNT DosCreat(BYTE FAR * fname, COUNT attrib)
sftp->sft_flags = sftp->sft_flags =
((dhp->dh_attr & ~SFT_MASK) & ~SFT_FSHARED) | SFT_FDEVICE | SFT_FEOF; ((dhp->dh_attr & ~SFT_MASK) & ~SFT_FSHARED) | SFT_FDEVICE | SFT_FEOF;
sftp->sft_psp = cu_psp; sftp->sft_psp = cu_psp;
fbcopy((BYTE FAR *) PriPathName, sftp->sft_name, FNAME_SIZE + FEXT_SIZE); fbcopy((BYTE FAR *) SecPathName, sftp->sft_name, FNAME_SIZE + FEXT_SIZE);
sftp->sft_dev = dhp; sftp->sft_dev = dhp;
p->ps_filetab[hndl] = sft_idx; p->ps_filetab[hndl] = sft_idx;
return hndl; return hndl;
} }
}
}
drive = get_verify_drive(fname); drive = get_verify_drive(fname);
if(drive < 0) { if(drive < 0) {
@ -834,24 +835,8 @@ COUNT DosOpen(BYTE FAR * fname, COUNT mode)
return DE_TOOMANY; return DE_TOOMANY;
/* check for a device */ /* check for a device */
froot = get_root(fname); dhp = IsDevice(fname);
for (i = 0; i < FNAME_SIZE; i++) if ( dhp )
{
if (*froot != '\0' && *froot != '.')
PriPathName[i] = *froot++;
else
break;
}
for (; i < FNAME_SIZE; i++)
PriPathName[i] = ' ';
/* if we have an extension, can't be a device */
if (*froot != '.')
{
for (dhp = (struct dhdr FAR *)&nul_dev; dhp != (struct dhdr FAR *)-1; dhp = dhp->dh_next)
{
if (fnmatch((BYTE FAR *) PriPathName, (BYTE FAR *) dhp->dh_name, FNAME_SIZE, FALSE))
{ {
sftp->sft_count += 1; sftp->sft_count += 1;
sftp->sft_mode = mode; sftp->sft_mode = mode;
@ -859,15 +844,12 @@ COUNT DosOpen(BYTE FAR * fname, COUNT mode)
sftp->sft_flags = sftp->sft_flags =
((dhp->dh_attr & ~SFT_MASK) & ~SFT_FSHARED) | SFT_FDEVICE | SFT_FEOF; ((dhp->dh_attr & ~SFT_MASK) & ~SFT_FSHARED) | SFT_FDEVICE | SFT_FEOF;
sftp->sft_psp = cu_psp; sftp->sft_psp = cu_psp;
fbcopy((BYTE FAR *) PriPathName, sftp->sft_name, FNAME_SIZE + FEXT_SIZE); fbcopy((BYTE FAR *) SecPathName, sftp->sft_name, FNAME_SIZE + FEXT_SIZE);
sftp->sft_dev = dhp; sftp->sft_dev = dhp;
sftp->sft_date = dos_getdate(); sftp->sft_date = dos_getdate();
sftp->sft_time = dos_gettime(); sftp->sft_time = dos_gettime();
p->ps_filetab[hndl] = sft_idx; p->ps_filetab[hndl] = sft_idx;
return hndl; return hndl;
}
}
} }
drive = get_verify_drive(fname); drive = get_verify_drive(fname);
@ -1067,7 +1049,7 @@ COUNT DosChangeDir(BYTE FAR * s)
{ {
#if defined(CHDIR_DEBUG) #if defined(CHDIR_DEBUG)
printf("Remote Chdir: n='"); printf("Remote Chdir: n='");
p = s; while(*p) print("%c", *p++); p = s; while(*p) printf("%c", *p++);
printf("' p='"); printf("' p='");
p = PriPathName; while(*p) printf("%c", *p++); p = PriPathName; while(*p) printf("%c", *p++);
printf("'\n"); printf("'\n");
@ -1076,7 +1058,7 @@ COUNT DosChangeDir(BYTE FAR * s)
#if defined(CHDIR_DEBUG) #if defined(CHDIR_DEBUG)
printf("status = %04x, new_path='", result); printf("status = %04x, new_path='", result);
p = cdsd->cdsCurrentPath; while(p) printf("%c", *p++) p = cdsd->cdsCurrentPath; while(p) printf("%c", *p++)
print("'\n"); printf("'\n");
#endif #endif
result = -result; result = -result;
if (result != SUCCESS) { if (result != SUCCESS) {
@ -1103,7 +1085,6 @@ COUNT DosChangeDir(BYTE FAR * s)
COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name) COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name)
{ {
SAttr = (BYTE) attr;
return dos_findfirst(attr, name); return dos_findfirst(attr, name);
} }
@ -1180,11 +1161,9 @@ COUNT DosGetFattr(BYTE FAR * name, UWORD FAR * attrp)
struct cds FAR *last_cds; struct cds FAR *last_cds;
BYTE FAR * p; BYTE FAR * p;
#if 0
if (IsDevice(name)) { if (IsDevice(name)) {
return DE_PATHNOTFND; return DE_PATHNOTFND;
} }
#endif
drive = get_verify_drive(name); drive = get_verify_drive(name);
if (drive < 0) { if (drive < 0) {
@ -1216,11 +1195,11 @@ COUNT DosSetFattr(BYTE FAR * name, UWORD FAR * attrp)
struct cds FAR *last_cds; struct cds FAR *last_cds;
BYTE FAR *p; BYTE FAR *p;
#if 0 if (IsDevice(name) ) {
if (IsDevice(name)) { printf("SetAtt\n");
return DE_PATHNOTFND; return DE_PATHNOTFND;
} }
#endif
drive = get_verify_drive(name); drive = get_verify_drive(name);
if (drive < 0) { if (drive < 0) {
return drive; return drive;
@ -1258,11 +1237,11 @@ BYTE DosSelectDrv(BYTE drv)
COUNT DosDelete(BYTE FAR *path) COUNT DosDelete(BYTE FAR *path)
{ {
COUNT result, drive; COUNT result, drive;
/*
if (IsDevice(path)) { if (IsDevice(path)) {
return DE_PATHNOTFND; return DE_PATHNOTFND;
} }
*/
drive = get_verify_drive(path); drive = get_verify_drive(path);
if (drive < 0) { if (drive < 0) {
return drive; return drive;
@ -1284,11 +1263,11 @@ COUNT DosDelete(BYTE FAR *path)
COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2) COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2)
{ {
COUNT result, drive1, drive2; COUNT result, drive1, drive2;
/*
if (IsDevice(path1) || IsDevice(path2)) { if (IsDevice(path1) || IsDevice(path2)) {
return DE_PATHNOTFND; return DE_PATHNOTFND;
} }
*/
drive1 = get_verify_drive(path1); drive1 = get_verify_drive(path1);
result = truename(path1, PriPathName, FALSE); result = truename(path1, PriPathName, FALSE);
if (result != SUCCESS) { if (result != SUCCESS) {
@ -1315,11 +1294,11 @@ COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2)
COUNT DosMkdir(BYTE FAR * dir) COUNT DosMkdir(BYTE FAR * dir)
{ {
COUNT result, drive; COUNT result, drive;
/*
if (IsDevice(dir)) { if (IsDevice(dir)) {
return DE_PATHNOTFND; return DE_PATHNOTFND;
} }
*/
drive = get_verify_drive(dir); drive = get_verify_drive(dir);
if (drive < 0) { if (drive < 0) {
return drive; return drive;
@ -1341,11 +1320,11 @@ COUNT DosMkdir(BYTE FAR * dir)
COUNT DosRmdir(BYTE FAR * dir) COUNT DosRmdir(BYTE FAR * dir)
{ {
COUNT result, drive; COUNT result, drive;
/*
if (IsDevice(dir)) { if (IsDevice(dir)) {
return DE_PATHNOTFND; return DE_PATHNOTFND;
} }
*/
drive = get_verify_drive(dir); drive = get_verify_drive(dir);
if (drive < 0) { if (drive < 0) {
return drive; return drive;
@ -1363,3 +1342,42 @@ COUNT DosRmdir(BYTE FAR * dir)
} }
return result; return result;
} }
/*
* This seems to work well.
*/
struct dhdr FAR * IsDevice(BYTE FAR * fname)
{
struct dhdr FAR *dhp;
BYTE FAR *froot;
WORD i;
/* check for a device */
froot = get_root(fname);
for (i = 0; i < FNAME_SIZE; i++)
{
if (*froot != '\0' && *froot != '.')
SecPathName[i] = *froot++;
else
break;
}
for (; i < FNAME_SIZE; i++)
SecPathName[i] = ' ';
SecPathName[i] = 0;
/* if we have an extension, can't be a device */
if (*froot != '.')
{
for (dhp = (struct dhdr FAR *)&nul_dev; dhp != (struct dhdr FAR *)-1; dhp = dhp->dh_next)
{
if (fnmatch((BYTE FAR *) SecPathName, (BYTE FAR *) dhp->dh_name, FNAME_SIZE, FALSE))
{
return dhp;
}
}
}
return (struct dhdr FAR *)0;
}

View File

@ -36,6 +36,9 @@ static BYTE *dosnamesRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.4 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.3 2000/05/25 20:56:21 jimtabor * Revision 1.3 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -46,6 +49,9 @@ static BYTE *dosnamesRcsId = "$Id$";
* The FreeDOS Kernel. A DOS kernel that aims to be 100% compatible with * The FreeDOS Kernel. A DOS kernel that aims to be 100% compatible with
* MS-DOS. Distributed under the GNU GPL. * MS-DOS. Distributed under the GNU GPL.
* *
* Revision 1.2 2000/05/08 04:29:59 jimtabor
* Update CVS to 2020
*
* Revision 1.4 2000/03/31 05:40:09 jtabor * Revision 1.4 2000/03/31 05:40:09 jtabor
* Added Eric W. Biederman Patches * Added Eric W. Biederman Patches
* *
@ -339,44 +345,6 @@ COUNT ParseDosPath(BYTE FAR * lpszFileName,
return SUCCESS; return SUCCESS;
} }
BOOL IsDevice(BYTE FAR * pszFileName)
{
REG struct dhdr FAR *dhp = (struct dhdr FAR *)&nul_dev;
BYTE szName[FNAME_SIZE];
/* break up the name first */
if (ParseDosName(pszFileName,
(COUNT *) 0, TempBuffer, szName, (BYTE *) 0, FALSE)
!= SUCCESS)
return FALSE;
SpacePad(szName, FNAME_SIZE);
/* Test 1 - does it start with a \dev or /dev */
if ((strcmp(szName, "/dev") == 0)
|| (strcmp(szName, "\\dev") == 0))
return TRUE;
/* Test 2 - is it on the device chain? */
for (; -1l != (LONG) dhp; dhp = dhp->dh_next)
{
COUNT nIdx;
/* Skip if not char device */
if (!(dhp->dh_attr & ATTR_CHAR))
continue;
/* now compare */
for (nIdx = 0; nIdx < FNAME_SIZE; ++nIdx)
{
if (dhp->dh_name[nIdx] != szName[nIdx])
break;
}
if (nIdx >= FNAME_SIZE)
return TRUE;
}
return FALSE;
}
VOID DosTrimPath(BYTE FAR * lpszPathNamep) VOID DosTrimPath(BYTE FAR * lpszPathNamep)
{ {

View File

@ -33,6 +33,9 @@ static BYTE *dskRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.6 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.5 2000/05/25 20:56:21 jimtabor * Revision 1.5 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -160,6 +163,12 @@ static struct FS_info
BYTE fs_fstype[8]; BYTE fs_fstype[8];
}; };
static struct Access_info
{
BYTE AI_spec;
BYTE AI_Flag;
};
static struct media_info miarray[NDEV]; /* Internal media info structs */ static struct media_info miarray[NDEV]; /* Internal media info structs */
static struct FS_info fsarray[NDEV]; static struct FS_info fsarray[NDEV];
static bpb bpbarray[NDEV]; /* BIOS parameter blocks */ static bpb bpbarray[NDEV]; /* BIOS parameter blocks */
@ -603,8 +612,10 @@ static WORD IoctlQueblk(rqptr rp)
{ {
switch(rp->r_count){ switch(rp->r_count){
case 0x0846: case 0x0846:
case 0x0847:
case 0x0860: case 0x0860:
case 0x0866: case 0x0866:
case 0x0867:
break; break;
default: default:
return S_ERROR; return S_ERROR;
@ -667,8 +678,6 @@ static WORD Genblkdev(rqptr rp)
gioc->ioc_fstype[i] = fs->fs_fstype[i]; gioc->ioc_fstype[i] = fs->fs_fstype[i];
} }
break; break;
case 0x0846: /* set volume serial number */ case 0x0846: /* set volume serial number */
{ {
struct Gioc_media FAR * gioc = (struct Gioc_media FAR *) rp->r_trans; struct Gioc_media FAR * gioc = (struct Gioc_media FAR *) rp->r_trans;
@ -686,6 +695,14 @@ static WORD Genblkdev(rqptr rp)
return (dskerr(ret)); return (dskerr(ret));
} }
break; break;
case 0x0867: /* get access flag, always on*/
{
struct Access_info FAR * ai = (struct Access_info FAR *) rp->r_trans;
ai->AI_Flag = 1;
}
break;
case 0x0847: /* set access flag, no real use*/
break;
default: default:
return S_ERROR; return S_ERROR;
} }

View File

@ -36,6 +36,9 @@ static BYTE *fatdirRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.5 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.4 2000/05/25 20:56:21 jimtabor * Revision 1.4 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -198,11 +201,14 @@ struct f_node FAR *dir_open(BYTE FAR * dirname)
/* Generate full path name */ /* Generate full path name */
ParseDosPath(dirname, (COUNT *) 0, pszPath, (BYTE FAR *) & cdsp->cdsCurrentPath[x]); ParseDosPath(dirname, (COUNT *) 0, pszPath, (BYTE FAR *) & cdsp->cdsCurrentPath[x]);
/* for testing only for now */
#if 0
if ((cdsp->cdsFlags & CDSNETWDRV)) if ((cdsp->cdsFlags & CDSNETWDRV))
{ {
printf("FailSafe %x \n", Int21AX); printf("FailSafe %x \n", Int21AX);
return fnp; return fnp;
} }
#endif
if (TempCDS.cdsDpb == 0) if (TempCDS.cdsDpb == 0)
{ {
@ -210,12 +216,6 @@ struct f_node FAR *dir_open(BYTE FAR * dirname)
return NULL; return NULL;
} }
/* if (drive > lastdrive)
{
release_f_node(fnp);
return NULL;
}
*/
fnp->f_dpb = (struct dpb *)TempCDS.cdsDpb; fnp->f_dpb = (struct dpb *)TempCDS.cdsDpb;
/* Perform all directory common handling after all special */ /* Perform all directory common handling after all special */
@ -565,7 +565,6 @@ COUNT dos_findfirst(UCOUNT attr, BYTE FAR * name)
REG COUNT i; REG COUNT i;
COUNT nDrive; COUNT nDrive;
BYTE *p; BYTE *p;
struct cds FAR *cdsp;
BYTE FAR *ptr; BYTE FAR *ptr;
static BYTE local_name[FNAME_SIZE + 1], static BYTE local_name[FNAME_SIZE + 1],
@ -600,9 +599,10 @@ COUNT dos_findfirst(UCOUNT attr, BYTE FAR * name)
if (nDrive > lastdrive) { if (nDrive > lastdrive) {
return DE_INVLDDRV; return DE_INVLDDRV;
} }
cdsp = &CDSp->cds_table[nDrive]; current_ldt = &CDSp->cds_table[nDrive];
SAttr = (BYTE) attr;
if (cdsp->cdsFlags & CDSNETWDRV) if (current_ldt->cdsFlags & CDSNETWDRV)
{ {
if (Remote_find(REM_FINDFIRST, attr, name, dmp) != 0) if (Remote_find(REM_FINDFIRST, attr, name, dmp) != 0)
return DE_FILENOTFND; return DE_FILENOTFND;
@ -718,7 +718,6 @@ COUNT dos_findnext(void)
BYTE FAR *p; BYTE FAR *p;
BYTE FAR *q; BYTE FAR *q;
COUNT nDrive; COUNT nDrive;
struct cds FAR *cdsp;
/* assign our match parameters pointer. */ /* assign our match parameters pointer. */
dmp = (dmatch FAR *) dta; dmp = (dmatch FAR *) dta;
@ -726,26 +725,27 @@ COUNT dos_findnext(void)
/* /*
* The new version of SHSUCDX 1.0 looks at the dm_drive byte to * The new version of SHSUCDX 1.0 looks at the dm_drive byte to
* test 40h. I used RamView to see location MSD 116:04be and * test 40h. I used RamView to see location MSD 116:04be and
* FD f61:04be, the byte set with 0xc4 = Remote/Network drive 4. * FD f??:04be, the byte set with 0xc4 = Remote/Network drive 4.
* Ralf Brown docs for dos 4eh say bit 7 set == remote so what is * Ralf Brown docs for dos 4eh say bit 7 set == remote so what is
* bit 6 for? SHSUCDX Mod info say "test redir not network bit". * bit 6 for? SHSUCDX Mod info say "test redir not network bit".
* Just to confuse the rest, MSCDEX sets bit 5 too.
* *
* So, assume bit 6 is redirector and bit 7 is network. * So, assume bit 6 is redirector and bit 7 is network.
* jt * jt
*/ */
nDrive = dmp->dm_drive & 0x3f; nDrive = dmp->dm_drive & 0x1f;
if (nDrive > lastdrive) { if (nDrive > lastdrive) {
return DE_INVLDDRV; return DE_INVLDDRV;
} }
cdsp = &CDSp->cds_table[nDrive]; current_ldt = &CDSp->cds_table[nDrive];
#if 0 #if 0
printf("findnext: %c %s\n", printf("findnext: %c %s\n",
nDrive + 'A', (cdsp->cdsFlags & CDSNETWDRV)?"remote":"local"); nDrive + 'A', (cdsp->cdsFlags & CDSNETWDRV)?"remote":"local");
#endif #endif
if (cdsp->cdsFlags & CDSNETWDRV) if (current_ldt->cdsFlags & CDSNETWDRV)
{ {
if (Remote_find(REM_FINDNEXT, 0, 0, dmp) != 0) if (Remote_find(REM_FINDNEXT, 0, 0, dmp) != 0)
return DE_FILENOTFND; return DE_FILENOTFND;

View File

@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.4 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.3 2000/05/25 20:56:21 jimtabor * Revision 1.3 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -117,8 +120,6 @@ void FcbNameInit(fcb FAR * lpFcb, BYTE * pszBuffer, COUNT * pCurDrive);
sft FAR *FcbGetSft(COUNT SftIndex); sft FAR *FcbGetSft(COUNT SftIndex);
VOID FcbNextRecord(fcb FAR * lpFcb); VOID FcbNextRecord(fcb FAR * lpFcb);
sft FAR *FcbGetFreeSft(WORD FAR * sft_idx); sft FAR *FcbGetFreeSft(WORD FAR * sft_idx);
BOOL FcbFnameMatch(BYTE FAR * s, BYTE FAR * d, COUNT n, COUNT mode);
BOOL FcbCharMatch(COUNT s, COUNT d, COUNT mode);
BOOL FcbCalcRec(xfcb FAR * lpXfcb); BOOL FcbCalcRec(xfcb FAR * lpXfcb);
VOID MoveDirInfo(dmatch FAR * lpDmatch, struct dirent FAR * lpDir); VOID MoveDirInfo(dmatch FAR * lpDmatch, struct dirent FAR * lpDir);
#else #else
@ -128,8 +129,6 @@ void FcbNameInit();
sft FAR *FcbGetSft(); sft FAR *FcbGetSft();
VOID FcbNextRecord(); VOID FcbNextRecord();
sft FAR *FcbGetFreeSft(); sft FAR *FcbGetFreeSft();
BOOL FcbFnameMatch();
BOOL FcbCharMatch();
BOOL FcbCalcRec(); BOOL FcbCalcRec();
VOID MoveDirInfo(); VOID MoveDirInfo();
#endif #endif
@ -644,11 +643,8 @@ BOOL FcbCreate(xfcb FAR * lpXfcb)
/* check for a device */ /* check for a device */
/* if we have an extension, can't be a device */ /* if we have an extension, can't be a device */
if (IsDevice(PriPathName)) dhp = IsDevice(PriPathName);
{ if (dhp)
for (dhp = (struct dhdr FAR *)&nul_dev; dhp != (struct dhdr FAR *)-1; dhp = dhp->dh_next)
{
if (FcbFnameMatch((BYTE FAR *) PriPathName, (BYTE FAR *) dhp->dh_name, FNAME_SIZE, FALSE))
{ {
sftp->sft_count += 1; sftp->sft_count += 1;
sftp->sft_mode = O_RDWR; sftp->sft_mode = O_RDWR;
@ -667,8 +663,6 @@ BOOL FcbCreate(xfcb FAR * lpXfcb)
lpFcb->fcb_rndm = 0; lpFcb->fcb_rndm = 0;
return TRUE; return TRUE;
} }
}
}
sftp->sft_status = dos_creat(PriPathName, 0); sftp->sft_status = dos_creat(PriPathName, 0);
if (sftp->sft_status >= 0) if (sftp->sft_status >= 0)
{ {
@ -769,28 +763,6 @@ void FcbNameInit(fcb FAR * lpFcb, BYTE * pszBuffer, COUNT * pCurDrive)
pszBuffer[nDrvIdx + nFnameIdx + nFextIdx] = '\0'; pszBuffer[nDrvIdx + nFnameIdx + nFextIdx] = '\0';
} }
/* Ascii only file name match routines */
static BOOL FcbCharMatch(COUNT s, COUNT d, COUNT mode)
{
if (s >= 'a' && s <= 'z')
s -= 'a' - 'A';
if (d >= 'a' && d <= 'z')
d -= 'a' - 'A';
if (mode && s == '?' && (d >= 'A' && s <= 'Z'))
return TRUE;
return s == d;
}
static BOOL FcbFnameMatch(BYTE FAR * s, BYTE FAR * d, COUNT n, COUNT mode)
{
while (n--)
{
if (!FcbCharMatch(*s++, *d++, mode))
return FALSE;
}
return TRUE;
}
BOOL FcbOpen(xfcb FAR * lpXfcb) BOOL FcbOpen(xfcb FAR * lpXfcb)
{ {
WORD sft_idx; WORD sft_idx;
@ -807,11 +779,8 @@ BOOL FcbOpen(xfcb FAR * lpXfcb)
/* check for a device */ /* check for a device */
/* if we have an extension, can't be a device */ /* if we have an extension, can't be a device */
if (IsDevice(PriPathName)) dhp = IsDevice(PriPathName);
{ if (dhp )
for (dhp = (struct dhdr FAR *)&nul_dev; dhp != (struct dhdr FAR *)-1; dhp = dhp->dh_next)
{
if (FcbFnameMatch((BYTE FAR *) PriPathName, (BYTE FAR *) dhp->dh_name, FNAME_SIZE, FALSE))
{ {
sftp->sft_count += 1; sftp->sft_count += 1;
sftp->sft_mode = O_RDWR; sftp->sft_mode = O_RDWR;
@ -830,8 +799,6 @@ BOOL FcbOpen(xfcb FAR * lpXfcb)
lpFcb->fcb_rndm = 0; lpFcb->fcb_rndm = 0;
return TRUE; return TRUE;
} }
}
}
fbcopy((BYTE FAR *) & lpFcb->fcb_fname, (BYTE FAR *) & sftp->sft_name, FNAME_SIZE + FEXT_SIZE); fbcopy((BYTE FAR *) & lpFcb->fcb_fname, (BYTE FAR *) & sftp->sft_name, FNAME_SIZE + FEXT_SIZE);
if ((FcbDrive < 0) || (FcbDrive > lastdrive)) { if ((FcbDrive < 0) || (FcbDrive > lastdrive)) {
return DE_INVLDDRV; return DE_INVLDDRV;

View File

@ -28,6 +28,9 @@
; $Header$ ; $Header$
; ;
; $Log$ ; $Log$
; Revision 1.4 2000/05/26 19:25:19 jimtabor
; Read History file for Change info
;
; Revision 1.3 2000/05/25 20:56:21 jimtabor ; Revision 1.3 2000/05/25 20:56:21 jimtabor
; Fixed project history ; Fixed project history
; ;
@ -190,7 +193,7 @@ _clk_dev equ $
global _blk_dev global _blk_dev
_blk_dev equ $ _blk_dev equ $
dd -1 dd -1
dw 0000h ; block device dw 00c2h ; block device with ioctl
dw GenStrategy dw GenStrategy
dw blk_entry dw blk_entry
global _nblk_rel global _nblk_rel

View File

@ -39,6 +39,9 @@ static BYTE *mainRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.5 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.4 2000/05/25 20:56:21 jimtabor * Revision 1.4 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -189,6 +192,9 @@ INIT static VOID init_kernel(void)
/* Fake int 21h stack frame */ /* Fake int 21h stack frame */
user_r = (iregs FAR *) DOS_PSP + 0xD0; user_r = (iregs FAR *) DOS_PSP + 0xD0;
/* Set Init DTA to Tempbuffer */
dta = (BYTE FAR *) &TempBuffer;
#ifndef KDB #ifndef KDB
for (i = 0x20; i <= 0x3f; i++) for (i = 0x20; i <= 0x3f; i++)
setvec(i, empty_handler); setvec(i, empty_handler);
@ -425,7 +431,7 @@ extern BYTE FAR *lpBase;
/* If cmdLine is NULL, this is an internal driver */ /* If cmdLine is NULL, this is an internal driver */
VOID init_device(struct dhdr FAR * dhp, BYTE FAR * cmdLine) BOOL init_device(struct dhdr FAR * dhp, BYTE FAR * cmdLine)
{ {
request rq; request rq;
ULONG memtop = ((ULONG) ram_top) << 10; ULONG memtop = ((ULONG) ram_top) << 10;
@ -443,6 +449,11 @@ VOID init_device(struct dhdr FAR * dhp, BYTE FAR * cmdLine)
rq.r_firstunit = nblkdev; rq.r_firstunit = nblkdev;
execrh((request FAR *) & rq, dhp); execrh((request FAR *) & rq, dhp);
/*
* Added needed Error handle
*/
if (rq.r_status & S_ERROR)
return TRUE;
if (cmdLine) if (cmdLine)
lpBase = rq.r_endaddr; lpBase = rq.r_endaddr;
@ -471,14 +482,9 @@ VOID init_device(struct dhdr FAR * dhp, BYTE FAR * cmdLine)
} }
} }
DPBp = &blk_devices[0]; DPBp = &blk_devices[0];
return FALSE;
} }
struct dhdr FAR *link_dhdr(struct dhdr FAR * lp, struct dhdr FAR * dhp, BYTE FAR * cmdLine)
{
lp->dh_next = dhp;
init_device(dhp, cmdLine);
return dhp;
}
INIT static void InitIO(void) INIT static void InitIO(void)
{ {

View File

@ -36,6 +36,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.5 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.4 2000/05/25 20:56:21 jimtabor * Revision 1.4 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -109,17 +112,16 @@ UCOUNT Remote_RW(UWORD func, UCOUNT n, BYTE FAR * bp, sft FAR * s, COUNT FAR * e
/* /*
*/ */
COUNT Remote_find(UWORD func, UWORD attrib, BYTE FAR * name, REG dmatch FAR * dmp) COUNT Remote_find(UWORD func, UWORD attrib, BYTE FAR * name, REG dmatch FAR * dmp )
{ {
COUNT i, COUNT i, x;
x; char FAR *p, *q;
char FAR *p, VOID FAR * test;
*q;
struct dirent FAR *SDp = (struct dirent FAR *) &SearchDir; struct dirent FAR *SDp = (struct dirent FAR *) &SearchDir;
if (func == REM_FINDFIRST) if (func == REM_FINDFIRST)
{ {
SAttr = (BYTE) attrib; test = (VOID FAR *) current_ldt;
i = truename(name, PriPathName, FALSE); i = truename(name, PriPathName, FALSE);
if (i != SUCCESS) { if (i != SUCCESS) {
return i; return i;
@ -132,11 +134,13 @@ COUNT Remote_find(UWORD func, UWORD attrib, BYTE FAR * name, REG dmatch FAR * dm
printf("'\n"); printf("'\n");
#endif #endif
} }
else
test = (VOID FAR *) &TempBuffer;
fsncopy(dta, (BYTE FAR *) &TempBuffer, 21); fsncopy(dta, (BYTE FAR *) &TempBuffer, 21);
p = dta; p = dta;
dta = (BYTE FAR *) &TempBuffer; dta = (BYTE FAR *) &TempBuffer;
i = int2f_Remote_call(func, 0, 0, 0, 0, 0, 0); i = int2f_Remote_call(func, 0, 0, 0, test, 0, 0);
dta = p; dta = p;
fsncopy((BYTE FAR *) &TempBuffer[0], &dta[0], 21); fsncopy((BYTE FAR *) &TempBuffer[0], &dta[0], 21);

View File

@ -31,6 +31,9 @@ static BYTE *mainRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.5 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.4 2000/05/25 20:56:21 jimtabor * Revision 1.4 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -224,9 +227,13 @@ COUNT get_verify_drive(char FAR *src)
COUNT truename(char FAR * src, char FAR * dest, COUNT t) COUNT truename(char FAR * src, char FAR * dest, COUNT t)
{ {
static char buf[128] = "A:\\\0\0\0\0\0\0\0\0\0"; static char buf[128] = "A:\\\0\0\0\0\0\0\0\0\0";
static char Name[8] = " ";
char *bufp = buf + 3; char *bufp = buf + 3;
COUNT i, n, x = 2; COUNT i, n, x = 2;
struct cds FAR *cdsp; struct cds FAR *cdsp;
struct dhdr FAR *dhp;
BYTE FAR *froot;
WORD d;
dest[0] = '\0'; dest[0] = '\0';
@ -247,6 +254,37 @@ COUNT truename(char FAR * src, char FAR * dest, COUNT t)
buf[0] = default_drive + 'A'; buf[0] = default_drive + 'A';
i = buf[0] - 'A'; i = buf[0] - 'A';
/*
Code repoff from dosfns.c
MSD returns X:/CON for truename con. Not X:\CON
*/
/* check for a device */
froot = get_root(src);
for (d = 0; d < FNAME_SIZE; d++)
{
if (*froot != '\0' && *froot != '.')
Name[d] = *froot++;
else
break;
}
for (; d < FNAME_SIZE; d++)
Name[d] = ' ';
/* if we have an extension, can't be a device */
if (*froot != '.')
{
for (dhp = (struct dhdr FAR *)&nul_dev; dhp != (struct dhdr FAR *)-1; dhp = dhp->dh_next)
{
if (fnmatch((BYTE FAR *) &Name, (BYTE FAR *) dhp->dh_name, FNAME_SIZE, FALSE))
{
buf[2] ='/';
for (d = 0; d < FNAME_SIZE || Name[d] == ' '; d++)
*bufp++ = Name[d];
goto exit_tn;
}
}
}
cdsp = &CDSp->cds_table[i]; cdsp = &CDSp->cds_table[i];
current_ldt = cdsp; current_ldt = cdsp;
@ -278,6 +316,8 @@ COUNT truename(char FAR * src, char FAR * dest, COUNT t)
} }
else else
src++; src++;
move_name:
/* /*
* The code here is brain dead. It works long as the calling * The code here is brain dead. It works long as the calling
* function are operating with in normal parms. * function are operating with in normal parms.
@ -371,6 +411,8 @@ COUNT truename(char FAR * src, char FAR * dest, COUNT t)
if (bufp == buf + 2) if (bufp == buf + 2)
++bufp; ++bufp;
exit_tn:
*bufp++ = 0; *bufp++ = 0;
/* finally, uppercase everything */ /* finally, uppercase everything */

View File

@ -34,6 +34,9 @@ static BYTE *Proto_hRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.4 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.3 2000/05/25 20:56:21 jimtabor * Revision 1.3 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -186,6 +189,8 @@ INIT VOID mcb_init(mcb FAR * mcbp, UWORD size);
INIT VOID strcat(REG BYTE * d, REG BYTE * s); INIT VOID strcat(REG BYTE * d, REG BYTE * s);
/* dosfns.c */ /* dosfns.c */
BYTE FAR *get_root(BYTE FAR *);
BOOL fnmatch(BYTE FAR *, BYTE FAR *, COUNT, COUNT);
BOOL check_break(void); BOOL check_break(void);
UCOUNT GenericRead(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err, UCOUNT GenericRead(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err,
BOOL force_binary); BOOL force_binary);
@ -213,6 +218,7 @@ COUNT DosDelete(BYTE FAR *path);
COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2); COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2);
COUNT DosMkdir(BYTE FAR * dir); COUNT DosMkdir(BYTE FAR * dir);
COUNT DosRmdir(BYTE FAR * dir); COUNT DosRmdir(BYTE FAR * dir);
struct dhdr FAR * IsDevice(BYTE FAR * FileName);
/*dosidle.asm */ /*dosidle.asm */
VOID DosIdle_int(void); VOID DosIdle_int(void);
@ -221,7 +227,6 @@ VOID DosIdle_int(void);
VOID SpacePad(BYTE *, COUNT); VOID SpacePad(BYTE *, COUNT);
COUNT ParseDosName(BYTE FAR *, COUNT *, BYTE *, BYTE *, BYTE *, BOOL); COUNT ParseDosName(BYTE FAR *, COUNT *, BYTE *, BYTE *, BYTE *, BOOL);
COUNT ParseDosPath(BYTE FAR *, COUNT *, BYTE *, BYTE FAR *); COUNT ParseDosPath(BYTE FAR *, COUNT *, BYTE *, BYTE FAR *);
BOOL IsDevice(BYTE FAR * FileName);
/* dsk.c */ /* dsk.c */
COUNT blk_driver(rqptr rp); COUNT blk_driver(rqptr rp);
@ -349,8 +354,7 @@ COUNT DosDevIOctl(iregs FAR * r, COUNT FAR * err);
/* main.c */ /* main.c */
INIT VOID main(void); INIT VOID main(void);
INIT VOID init_device(struct dhdr FAR * dhp, BYTE FAR * cmdLine); INIT BOOL init_device(struct dhdr FAR * dhp, BYTE FAR * cmdLine);
INIT struct dhdr FAR *link_dhdr(struct dhdr FAR * lp, struct dhdr FAR * dhp, BYTE FAR * cmdLine);
/* memmgr.c */ /* memmgr.c */
seg far2para(VOID FAR * p); seg far2para(VOID FAR * p);

View File

@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.4 2000/05/26 19:25:19 jimtabor
* Read History file for Change info
*
* Revision 1.3 2000/05/25 20:56:21 jimtabor * Revision 1.3 2000/05/25 20:56:21 jimtabor
* Fixed project history * Fixed project history
* *
@ -890,6 +893,11 @@ COUNT FAR init_call_DosExec(COUNT mode, exec_blk FAR * ep, BYTE FAR * lp)
VOID InitPSP(VOID) VOID InitPSP(VOID)
{ {
psp FAR *p = MK_FP(DOS_PSP, 0); psp FAR *p = MK_FP(DOS_PSP, 0);
/*
Fixed Device Driver Print output.
*/
if(p->ps_exit == 0x000020cd)
return;
new_psp(p, 0); new_psp(p, 0);
} }