mirror of https://github.com/FDOS/kernel.git
Cleanup, add and fix source.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@18 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
0359f6e0aa
commit
504c1b3c02
|
@ -1,3 +1,23 @@
|
||||||
|
2000 May 17 - Build 2020
|
||||||
|
-------- James Tabor (jimtabor@infohwy.com)
|
||||||
|
+ Fixed Delete, Rename, Mkdir, and Rmdir. Comment out isDevice. There is
|
||||||
|
a serious bug in isDevice.
|
||||||
|
+ Added Finished adding function code for disk serial number support.
|
||||||
|
+ Clean Cleaned up source and removed duplicate functions.
|
||||||
|
|
||||||
|
2000 May 14 - Build 2020
|
||||||
|
-------- James Tabor (jimtabor@infohwy.com)
|
||||||
|
+ Clean Cleaned out the remaining CR's.
|
||||||
|
|
||||||
|
2000 May 08 - Build 2020
|
||||||
|
-------- James Tabor (jimtabor@infohwy.com)
|
||||||
|
+ Update Started Update to the New CVS at Sourceforge.net. Seting source
|
||||||
|
from 2018 to 2020.
|
||||||
|
|
||||||
|
2000 May 06
|
||||||
|
-------- Jim Hall (jhall1.isd.net)
|
||||||
|
+ Import Jim Hall imported the CVS from gcfl.net to Sourceforge.net.
|
||||||
|
|
||||||
2000 Apr 28 - Build 2020
|
2000 Apr 28 - Build 2020
|
||||||
-------- James Tabor (jimtabor@infohwy.com)
|
-------- James Tabor (jimtabor@infohwy.com)
|
||||||
+ Added Dos Function calls 0x69, and 0x6C. IOCTL support in disk driver.
|
+ Added Dos Function calls 0x69, and 0x6C. IOCTL support in disk driver.
|
||||||
|
|
|
@ -4,9 +4,9 @@ Version: 1.1.20
|
||||||
Entered-date: 5 May 2000
|
Entered-date: 5 May 2000
|
||||||
Description: The FreeDOS Kernel.
|
Description: The FreeDOS Kernel.
|
||||||
Keywords: kernel freedos dos msdos
|
Keywords: kernel freedos dos msdos
|
||||||
Author: kernel@gcfl.net (developers)
|
Author: (developers)
|
||||||
Maintained-by: linux-guru@gcfl.net
|
Maintained-by: jimtabor@infohwy.com
|
||||||
Primary-site: http://www.gcfl.net/pub/FreeDOS/kernel
|
Primary-site: http://freedos.sourceforge.net
|
||||||
Alternate-site: www.freedos.org
|
Alternate-site: www.freedos.org
|
||||||
Original-site: http://www.gcfl.net/pub/FreeDOS/kernel
|
Original-site: http://www.gcfl.net/pub/FreeDOS/kernel
|
||||||
Platforms: dos dosemu
|
Platforms: dos dosemu
|
||||||
|
|
|
@ -34,9 +34,16 @@ static BYTE *dosfnsRcsId = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.2 2000/05/08 04:29:59 jimtabor
|
* Revision 1.2 2000/05/08 04:29:59 jimtabor
|
||||||
* Update CVS to 2020
|
* Update CVS to 2020
|
||||||
*
|
*
|
||||||
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.14 2000/04/02 05:01:08 jtabor
|
* Revision 1.14 2000/04/02 05:01:08 jtabor
|
||||||
* Replaced ChgDir Code
|
* Replaced ChgDir Code
|
||||||
*
|
*
|
||||||
|
@ -490,6 +497,8 @@ UCOUNT DosWrite(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err)
|
||||||
|
|
||||||
COUNT SftSeek(sft FAR *s, LONG new_pos, COUNT mode)
|
COUNT SftSeek(sft FAR *s, LONG new_pos, COUNT mode)
|
||||||
{
|
{
|
||||||
|
ULONG data;
|
||||||
|
|
||||||
/* Test for invalid mode */
|
/* Test for invalid mode */
|
||||||
if (mode < 0 || mode > 2)
|
if (mode < 0 || mode > 2)
|
||||||
return DE_INVLDFUNC;
|
return DE_INVLDFUNC;
|
||||||
|
@ -500,7 +509,9 @@ COUNT SftSeek(sft FAR *s, LONG new_pos, COUNT mode)
|
||||||
{
|
{
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
/* seek from end of file */
|
/* seek from end of file */
|
||||||
int2f_Remote_call(REM_LSEEK, 0, (UWORD) FP_SEG(new_pos), (UWORD) FP_OFF(new_pos), (VOID FAR *) s, 0, 0);
|
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;
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
if (mode == 0) {
|
if (mode == 0) {
|
||||||
|
@ -1007,7 +1018,6 @@ VOID DosGetFree(COUNT drive, COUNT FAR * spc, COUNT FAR * navc, COUNT FAR * bps,
|
||||||
COUNT DosGetCuDir(COUNT drive, BYTE FAR * s)
|
COUNT DosGetCuDir(COUNT drive, BYTE FAR * s)
|
||||||
{
|
{
|
||||||
REG struct cds FAR *cdsp;
|
REG struct cds FAR *cdsp;
|
||||||
REG WORD x;
|
|
||||||
|
|
||||||
/* next - "log" in the drive */
|
/* next - "log" in the drive */
|
||||||
drive = (drive == 0 ? default_drive : drive - 1);
|
drive = (drive == 0 ? default_drive : drive - 1);
|
||||||
|
@ -1024,8 +1034,7 @@ COUNT DosGetCuDir(COUNT drive, BYTE FAR * s)
|
||||||
return DE_INVLDDRV;
|
return DE_INVLDDRV;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = 1 + cdsp->cdsJoinOffset;
|
fsncopy((BYTE FAR *) & cdsp->cdsCurrentPath[1 + cdsp->cdsJoinOffset], s, 64);
|
||||||
fsncopy((BYTE FAR *) & cdsp->cdsCurrentPath[x], s, 64);
|
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1246,21 +1255,20 @@ 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;
|
||||||
}
|
}
|
||||||
|
result = truename(path, PriPathName, FALSE);
|
||||||
result = truename(path, PriPathName, FALSE);
|
if (result != SUCCESS) {
|
||||||
if (result != SUCCESS) {
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
current_ldt = &CDSp->cds_table[drive];
|
current_ldt = &CDSp->cds_table[drive];
|
||||||
if (CDSp->cds_table[drive].cdsFlags & CDSNETWDRV) {
|
if (CDSp->cds_table[drive].cdsFlags & CDSNETWDRV) {
|
||||||
result = int2f_Remote_call(REM_DELETE, 0, 0, 0, 0, 0, 0);
|
result = int2f_Remote_call(REM_DELETE, 0, 0, 0, 0, 0, 0);
|
||||||
result = -result;
|
result = -result;
|
||||||
|
@ -1273,20 +1281,22 @@ 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);
|
*/
|
||||||
result = truename(path1, PriPathName, FALSE);
|
drive1 = get_verify_drive(path1);
|
||||||
|
result = truename(path1, PriPathName, FALSE);
|
||||||
if (result != SUCCESS) {
|
if (result != SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
drive2 = get_verify_drive(path2);
|
drive2 = get_verify_drive(path2);
|
||||||
result = truename(path2, SecPathName, FALSE);
|
result = truename(path2, SecPathName, FALSE);
|
||||||
if (result != SUCCESS) {
|
if (result != SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if ((drive1 != drive2) || (drive1 < 0)) {
|
if ((drive1 != drive2) || (drive1 < 0)) {
|
||||||
return DE_INVLDDRV;
|
return DE_INVLDDRV;
|
||||||
}
|
}
|
||||||
current_ldt = &CDSp->cds_table[drive1];
|
current_ldt = &CDSp->cds_table[drive1];
|
||||||
|
@ -1294,7 +1304,7 @@ COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2)
|
||||||
result = int2f_Remote_call(REM_RENAME, 0, 0, 0, 0, 0, 0);
|
result = int2f_Remote_call(REM_RENAME, 0, 0, 0, 0, 0, 0);
|
||||||
result = -result;
|
result = -result;
|
||||||
} else {
|
} else {
|
||||||
result = dos_rename(path1, path2);
|
result = dos_rename(path1, path2);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1302,11 +1312,12 @@ 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;
|
||||||
}
|
}
|
||||||
|
@ -1314,7 +1325,7 @@ COUNT DosMkdir(BYTE FAR * dir)
|
||||||
if (result != SUCCESS) {
|
if (result != SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
current_ldt = &CDSp->cds_table[drive];
|
current_ldt = &CDSp->cds_table[drive];
|
||||||
if (CDSp->cds_table[drive].cdsFlags & CDSNETWDRV) {
|
if (CDSp->cds_table[drive].cdsFlags & CDSNETWDRV) {
|
||||||
result = int2f_Remote_call(REM_MKDIR, 0, 0, 0, 0, 0, 0);
|
result = int2f_Remote_call(REM_MKDIR, 0, 0, 0, 0, 0, 0);
|
||||||
result = -result;
|
result = -result;
|
||||||
|
@ -1327,11 +1338,12 @@ 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;
|
||||||
}
|
}
|
||||||
|
@ -1339,7 +1351,7 @@ COUNT DosRmdir(BYTE FAR * dir)
|
||||||
if (result != SUCCESS) {
|
if (result != SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
current_ldt = &CDSp->cds_table[drive];
|
current_ldt = &CDSp->cds_table[drive];
|
||||||
if (CDSp->cds_table[drive].cdsFlags & CDSNETWDRV) {
|
if (CDSp->cds_table[drive].cdsFlags & CDSNETWDRV) {
|
||||||
result = int2f_Remote_call(REM_RMDIR, 0, 0, 0, 0, 0, 0);
|
result = int2f_Remote_call(REM_RMDIR, 0, 0, 0, 0, 0, 0);
|
||||||
result = -result;
|
result = -result;
|
||||||
|
|
70
kernel/dsk.c
70
kernel/dsk.c
|
@ -33,6 +33,9 @@ static BYTE *dskRcsId = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.4 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.3 2000/05/11 04:26:26 jimtabor
|
* Revision 1.3 2000/05/11 04:26:26 jimtabor
|
||||||
* Added code for DOS FN 69 & 6C
|
* Added code for DOS FN 69 & 6C
|
||||||
*
|
*
|
||||||
|
@ -40,8 +43,8 @@ static BYTE *dskRcsId = "$Id$";
|
||||||
* Update CVS to 2020
|
* Update CVS to 2020
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
* Revision 1.3 2000/05/11 04:26:26 jimtabor
|
* Revision 1.4 2000/05/17 19:15:12 jimtabor
|
||||||
* Added code for DOS FN 69 & 6C
|
* Cleanup, add and fix source.
|
||||||
*
|
*
|
||||||
* Revision 1.6 2000/04/29 05:13:16 jtabor
|
* Revision 1.6 2000/04/29 05:13:16 jtabor
|
||||||
* Added new functions and clean up code
|
* Added new functions and clean up code
|
||||||
|
@ -454,7 +457,7 @@ static WORD mediachk(rqptr rp)
|
||||||
{
|
{
|
||||||
if ((result = fl_readdasd(drive)) == 2) /* if we can detect a change ... */
|
if ((result = fl_readdasd(drive)) == 2) /* if we can detect a change ... */
|
||||||
{
|
{
|
||||||
if ((result = fl_diskchanged(drive)) == 1) /* check if it has changed... */
|
if ((result = fl_diskchanged(drive)) == 1) /* check if it has changed... */
|
||||||
rp->r_mcretcode = M_CHANGED;
|
rp->r_mcretcode = M_CHANGED;
|
||||||
else if (result == 0)
|
else if (result == 0)
|
||||||
rp->r_mcretcode = M_NOT_CHANGED;
|
rp->r_mcretcode = M_NOT_CHANGED;
|
||||||
|
@ -470,12 +473,12 @@ static WORD mediachk(rqptr rp)
|
||||||
return S_DONE;
|
return S_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WORD bldbpb(rqptr rp)
|
/*
|
||||||
|
* Read Write Sector Zero or Hard Drive Dos Bpb
|
||||||
|
*/
|
||||||
|
static WORD RWzero(rqptr rp, WORD t)
|
||||||
{
|
{
|
||||||
REG retry = N_RETRY;
|
REG retry = N_RETRY;
|
||||||
ULONG count;
|
|
||||||
byteptr trans;
|
|
||||||
WORD local_word;
|
|
||||||
|
|
||||||
if (hd(miarray[rp->r_unit].mi_drive))
|
if (hd(miarray[rp->r_unit].mi_drive))
|
||||||
{
|
{
|
||||||
|
@ -493,10 +496,29 @@ static WORD bldbpb(rqptr rp)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
if (!t) /* 0 == Read */
|
||||||
|
{
|
||||||
ret = fl_read((WORD) miarray[rp->r_unit].mi_drive,
|
ret = fl_read((WORD) miarray[rp->r_unit].mi_drive,
|
||||||
(WORD) head, (WORD) track, (WORD) sector, (WORD) 1, (byteptr) & buffer);
|
(WORD) head, (WORD) track, (WORD) sector, (WORD) 1, (byteptr) & buffer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = fl_write((WORD) miarray[rp->r_unit].mi_drive,
|
||||||
|
(WORD) head, (WORD) track, (WORD) sector, (WORD) 1, (byteptr) & buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while (ret != 0 && --retry > 0);
|
while (ret != 0 && --retry > 0);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static WORD bldbpb(rqptr rp)
|
||||||
|
{
|
||||||
|
ULONG count, i;
|
||||||
|
byteptr trans;
|
||||||
|
WORD local_word;
|
||||||
|
|
||||||
|
ret = RWzero( rp, 0);
|
||||||
|
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return (dskerr(ret));
|
return (dskerr(ret));
|
||||||
|
|
||||||
|
@ -514,8 +536,15 @@ static WORD bldbpb(rqptr rp)
|
||||||
getlong(&((((BYTE *) & buffer.bytes[BT_BPB])[BPB_HIDDEN])), &bpbarray[rp->r_unit].bpb_hidden);
|
getlong(&((((BYTE *) & buffer.bytes[BT_BPB])[BPB_HIDDEN])), &bpbarray[rp->r_unit].bpb_hidden);
|
||||||
getlong(&((((BYTE *) & buffer.bytes[BT_BPB])[BPB_HUGE])), &bpbarray[rp->r_unit].bpb_huge);
|
getlong(&((((BYTE *) & buffer.bytes[BT_BPB])[BPB_HUGE])), &bpbarray[rp->r_unit].bpb_huge);
|
||||||
|
|
||||||
|
/* Needs fat32 offset code */
|
||||||
|
|
||||||
getlong(&((((BYTE *) & buffer.bytes[0x27])[0])), &fsarray[rp->r_unit].fs_serialno);
|
getlong(&((((BYTE *) & buffer.bytes[0x27])[0])), &fsarray[rp->r_unit].fs_serialno);
|
||||||
|
for(i = 0; i < 11 ;i++ )
|
||||||
|
fsarray[rp->r_unit].fs_volume[i] = buffer.bytes[0x2B + i];
|
||||||
|
for(i = 0; i < 8; i++ )
|
||||||
|
fsarray[rp->r_unit].fs_fstype[i] = buffer.bytes[0x36 + i];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DSK_DEBUG
|
#ifdef DSK_DEBUG
|
||||||
printf("BPB_NBYTE = %04x\n", bpbarray[rp->r_unit].bpb_nbyte);
|
printf("BPB_NBYTE = %04x\n", bpbarray[rp->r_unit].bpb_nbyte);
|
||||||
|
@ -570,6 +599,7 @@ static COUNT write_and_verify(WORD drive, WORD head, WORD track, WORD sector,
|
||||||
static WORD IoctlQueblk(rqptr rp)
|
static WORD IoctlQueblk(rqptr rp)
|
||||||
{
|
{
|
||||||
switch(rp->r_count){
|
switch(rp->r_count){
|
||||||
|
case 0x0846:
|
||||||
case 0x0860:
|
case 0x0860:
|
||||||
case 0x0866:
|
case 0x0866:
|
||||||
break;
|
break;
|
||||||
|
@ -628,17 +658,29 @@ static WORD Genblkdev(rqptr rp)
|
||||||
struct FS_info FAR * fs = &fsarray[rp->r_unit];
|
struct FS_info FAR * fs = &fsarray[rp->r_unit];
|
||||||
|
|
||||||
gioc->ioc_serialno = fs->fs_serialno;
|
gioc->ioc_serialno = fs->fs_serialno;
|
||||||
|
for(i = 0; i < 11 ;i++ )
|
||||||
for(i = 0; i < 12 ;i++ )
|
|
||||||
gioc->ioc_volume[i] = fs->fs_volume[i];
|
gioc->ioc_volume[i] = fs->fs_volume[i];
|
||||||
for(i = 0; i < 9; i++ )
|
for(i = 0; i < 8; i++ )
|
||||||
gioc->ioc_fstype[i] = fs->fs_fstype[i];
|
gioc->ioc_fstype[i] = fs->fs_fstype[i];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
printf("DSK_IOCTL SN %lx \n" , &fs->fs_serialno);
|
|
||||||
printf("DSK_IOCTL SN %lx \n" , &fs->fs_volume);
|
|
||||||
printf("DSK_IOCTL SN %lx \n" , &gioc->ioc_serialno);
|
|
||||||
printf("DSK_IOCTL SN %lx \n" , &gioc->ioc_volume);
|
|
||||||
|
|
||||||
|
case 0x0846: /* set volume serial number */
|
||||||
|
{
|
||||||
|
struct Gioc_media FAR * gioc = (struct Gioc_media FAR *) rp->r_trans;
|
||||||
|
struct FS_info FAR * fs = (struct FS_info FAR *) &buffer.bytes[0x27];
|
||||||
|
|
||||||
|
ret = RWzero( rp, 0);
|
||||||
|
if (ret != 0)
|
||||||
|
return (dskerr(ret));
|
||||||
|
|
||||||
|
fs->fs_serialno = gioc->ioc_serialno;
|
||||||
|
fsarray[rp->r_unit].fs_serialno = fs->fs_serialno;
|
||||||
|
|
||||||
|
ret = RWzero( rp, 1);
|
||||||
|
if (ret != 0)
|
||||||
|
return (dskerr(ret));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -36,9 +36,16 @@ static BYTE *fatdirRcsId = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
||||||
* Update CVS to 2020
|
* Update CVS to 2020
|
||||||
*
|
*
|
||||||
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.12 2000/03/31 05:40:09 jtabor
|
* Revision 1.12 2000/03/31 05:40:09 jtabor
|
||||||
* Added Eric W. Biederman Patches
|
* Added Eric W. Biederman Patches
|
||||||
*
|
*
|
||||||
|
@ -713,7 +720,17 @@ COUNT dos_findnext(void)
|
||||||
/* assign our match parameters pointer. */
|
/* assign our match parameters pointer. */
|
||||||
dmp = (dmatch FAR *) dta;
|
dmp = (dmatch FAR *) dta;
|
||||||
|
|
||||||
nDrive = dmp->dm_drive;
|
/*
|
||||||
|
* 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
|
||||||
|
* FD f61:04be, the byte set with 0xc4 = Remote/Network drive 4.
|
||||||
|
* 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".
|
||||||
|
*
|
||||||
|
* So, assume bit 6 is redirector and bit 7 is network.
|
||||||
|
* jt
|
||||||
|
*/
|
||||||
|
nDrive = dmp->dm_drive & 0x3f;
|
||||||
|
|
||||||
if (nDrive > lastdrive) {
|
if (nDrive > lastdrive) {
|
||||||
return DE_INVLDDRV;
|
return DE_INVLDDRV;
|
||||||
|
|
|
@ -30,9 +30,16 @@
|
||||||
; $Id$
|
; $Id$
|
||||||
;
|
;
|
||||||
; $Log$
|
; $Log$
|
||||||
|
; Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
; Cleanup, add and fix source.
|
||||||
|
;
|
||||||
; Revision 1.2 2000/05/08 04:30:00 jimtabor
|
; Revision 1.2 2000/05/08 04:30:00 jimtabor
|
||||||
; Update CVS to 2020
|
; Update CVS to 2020
|
||||||
;
|
;
|
||||||
|
; $Log$
|
||||||
|
; Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
; Cleanup, add and fix source.
|
||||||
|
;
|
||||||
; 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
|
||||||
;
|
;
|
||||||
|
@ -144,7 +151,9 @@ _int2f_Remote_call:
|
||||||
jne short int2f_r_2
|
jne short int2f_r_2
|
||||||
int2f_r_1:
|
int2f_r_1:
|
||||||
call int2f_call
|
call int2f_call
|
||||||
jc int2f_rfner
|
jnc short int2f_skip1
|
||||||
|
jmp int2f_rfner
|
||||||
|
int2f_skip1:
|
||||||
les di,[bp+18] ; do return data stuff
|
les di,[bp+18] ; do return data stuff
|
||||||
mov [es:di],cx
|
mov [es:di],cx
|
||||||
jmp short int2f_rfner
|
jmp short int2f_rfner
|
||||||
|
@ -184,10 +193,20 @@ int2f_r_5:
|
||||||
pop ds
|
pop ds
|
||||||
call int2f_call
|
call int2f_call
|
||||||
pop ds
|
pop ds
|
||||||
jc short int2f_rfner
|
jc short int2f_rfner
|
||||||
xor ax,ax
|
xor ax,ax
|
||||||
jmp short int2f_rfner
|
jmp short int2f_rfner
|
||||||
int2f_r_6:
|
int2f_r_6:
|
||||||
|
cmp al,021h ; Lseek from eof
|
||||||
|
jne short int2f_r_7
|
||||||
|
call int2f_call
|
||||||
|
jc short int2f_rfner
|
||||||
|
les di,[bp+18]
|
||||||
|
mov [es:di],ax
|
||||||
|
mov [es:di+2],dx
|
||||||
|
xor ax,ax
|
||||||
|
jmp short int2f_rfner
|
||||||
|
int2f_r_7:
|
||||||
;
|
;
|
||||||
; everything else goes through here.
|
; everything else goes through here.
|
||||||
;
|
;
|
||||||
|
|
|
@ -36,6 +36,9 @@ BYTE *RcsId = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.6 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.5 2000/05/11 06:14:45 jimtabor
|
* Revision 1.5 2000/05/11 06:14:45 jimtabor
|
||||||
* Removed #if statement
|
* Removed #if statement
|
||||||
*
|
*
|
||||||
|
@ -49,11 +52,8 @@ BYTE *RcsId = "$Id$";
|
||||||
* Update CVS to 2020
|
* Update CVS to 2020
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
* Revision 1.5 2000/05/11 06:14:45 jimtabor
|
* Revision 1.6 2000/05/17 19:15:12 jimtabor
|
||||||
* Removed #if statement
|
* Cleanup, add and fix source.
|
||||||
*
|
|
||||||
* Revision 1.4 2000/05/11 04:26:26 jimtabor
|
|
||||||
* Added code for DOS FN 69 & 6C
|
|
||||||
*
|
*
|
||||||
* Revision 1.24 2000/04/29 05:13:16 jtabor
|
* Revision 1.24 2000/04/29 05:13:16 jtabor
|
||||||
* Added new functions and clean up code
|
* Added new functions and clean up code
|
||||||
|
@ -1230,9 +1230,7 @@ dispatch:
|
||||||
|
|
||||||
/* Dos Rename */
|
/* Dos Rename */
|
||||||
case 0x56:
|
case 0x56:
|
||||||
rc = DosRename(
|
rc = DosRename((BYTE FAR *) MK_FP(r->DS, r->DX), (BYTE FAR *) MK_FP(r->ES, r->DI));
|
||||||
(BYTE FAR *) MK_FP(r->DS, r->DX), /* OldName */
|
|
||||||
(BYTE FAR *) MK_FP(r->ES, r->DI)); /* NewName */
|
|
||||||
if (rc < SUCCESS)
|
if (rc < SUCCESS)
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
else
|
else
|
||||||
|
@ -1595,7 +1593,7 @@ dispatch:
|
||||||
r->AL = 0xFF;
|
r->AL = 0xFF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Extended Open-Creat, not fully functional.*/
|
/* Extended Open-Creat, not fully functional.*/
|
||||||
case 0x6c:
|
case 0x6c:
|
||||||
switch(r->DL) {
|
switch(r->DL) {
|
||||||
|
@ -1683,8 +1681,8 @@ dispatch:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
goto error_invalid;
|
goto error_invalid;
|
||||||
|
}
|
||||||
}
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
|
@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.4 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.3 2000/05/11 04:26:26 jimtabor
|
* Revision 1.3 2000/05/11 04:26:26 jimtabor
|
||||||
* Added code for DOS FN 69 & 6C
|
* Added code for DOS FN 69 & 6C
|
||||||
*
|
*
|
||||||
|
@ -42,8 +45,8 @@ static BYTE *RcsId = "$Id$";
|
||||||
* Update CVS to 2020
|
* Update CVS to 2020
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
* Revision 1.3 2000/05/11 04:26:26 jimtabor
|
* Revision 1.4 2000/05/17 19:15:12 jimtabor
|
||||||
* Added code for DOS FN 69 & 6C
|
* Cleanup, add and fix source.
|
||||||
*
|
*
|
||||||
* Revision 1.4 2000/04/29 05:13:16 jtabor
|
* Revision 1.4 2000/04/29 05:13:16 jtabor
|
||||||
* Added new functions and clean up code
|
* Added new functions and clean up code
|
||||||
|
@ -155,7 +158,6 @@ COUNT DosDevIOctl(iregs FAR * r, COUNT FAR * err)
|
||||||
|
|
||||||
r->BL = ( r->BL == 0 ? default_drive : r->BL - 1);
|
r->BL = ( r->BL == 0 ? default_drive : r->BL - 1);
|
||||||
|
|
||||||
printf("IOCTL bl = %04x\n", r->BL);
|
|
||||||
|
|
||||||
if (r->BL > lastdrive)
|
if (r->BL > lastdrive)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,9 +39,16 @@ static BYTE *mainRcsId = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
||||||
* Update CVS to 2020
|
* Update CVS to 2020
|
||||||
*
|
*
|
||||||
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.14 2000/03/31 05:40:09 jtabor
|
* Revision 1.14 2000/03/31 05:40:09 jtabor
|
||||||
* Added Eric W. Biederman Patches
|
* Added Eric W. Biederman Patches
|
||||||
*
|
*
|
||||||
|
@ -176,6 +183,9 @@ INIT static VOID init_kernel(void)
|
||||||
/* Init oem hook - returns memory size in KB */
|
/* Init oem hook - returns memory size in KB */
|
||||||
ram_top = init_oem();
|
ram_top = init_oem();
|
||||||
|
|
||||||
|
/* Fake int 21h stack frame */
|
||||||
|
user_r = (iregs FAR *) DOS_PSP + 0xD0;
|
||||||
|
|
||||||
#ifndef KDB
|
#ifndef KDB
|
||||||
for (i = 0x20; i <= 0x3f; i++)
|
for (i = 0x20; i <= 0x3f; i++)
|
||||||
setvec(i, empty_handler);
|
setvec(i, empty_handler);
|
||||||
|
|
|
@ -36,9 +36,16 @@ static BYTE *RcsId = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
||||||
* Update CVS to 2020
|
* Update CVS to 2020
|
||||||
*
|
*
|
||||||
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.5 2000/03/31 05:40:09 jtabor
|
* Revision 1.5 2000/03/31 05:40:09 jtabor
|
||||||
* Added Eric W. Biederman Patches
|
* Added Eric W. Biederman Patches
|
||||||
*
|
*
|
||||||
|
@ -122,12 +129,13 @@ COUNT Remote_find(UWORD func, UWORD attrib, BYTE FAR * name, REG dmatch FAR * dm
|
||||||
printf("'\n");
|
printf("'\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
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, 0, 0, 0);
|
||||||
dta = p;
|
dta = p;
|
||||||
fsncopy((BYTE FAR *) &TempBuffer[1], &dta[1], 20);
|
fsncopy((BYTE FAR *) &TempBuffer[0], &dta[0], 21);
|
||||||
|
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
return i;
|
return i;
|
||||||
|
|
|
@ -31,9 +31,16 @@ static BYTE *mainRcsId = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
||||||
* Update CVS to 2020
|
* Update CVS to 2020
|
||||||
*
|
*
|
||||||
|
* $Log$
|
||||||
|
* Revision 1.3 2000/05/17 19:15:12 jimtabor
|
||||||
|
* Cleanup, add and fix source.
|
||||||
|
*
|
||||||
* Revision 1.8 2000/04/02 06:11:35 jtabor
|
* Revision 1.8 2000/04/02 06:11:35 jtabor
|
||||||
* Fix ChgDir Code
|
* Fix ChgDir Code
|
||||||
*
|
*
|
||||||
|
@ -208,22 +215,22 @@ COUNT get_verify_drive(char FAR *src)
|
||||||
* Added support for external and internal calls.
|
* Added support for external and internal calls.
|
||||||
* Clean buffer before use. Make the true path and expand file names.
|
* Clean buffer before use. Make the true path and expand file names.
|
||||||
* Example: *.* -> ????????.??? as in the currect way.
|
* Example: *.* -> ????????.??? as in the currect way.
|
||||||
|
* MSD returns \\D.\A.\????????.??? with SHSUCDX. So, this code is not
|
||||||
|
* compatible MSD Func 60h.
|
||||||
*/
|
*/
|
||||||
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:\\";
|
static char buf[128] = "A:\\\0\0\0\0\0\0\0\0\0";
|
||||||
char *bufp = buf + 3;
|
char *bufp = buf + 3;
|
||||||
COUNT i, n, x = 2;
|
COUNT i, n, x = 2;
|
||||||
BYTE far *test;
|
struct cds FAR *cdsp;
|
||||||
REG struct cds FAR *cdsp;
|
|
||||||
|
|
||||||
fbcopy((VOID FAR *) "A:\\\0\0\0\0\0\0\0", (VOID FAR *) buf, 10);
|
|
||||||
dest[0] = '\0';
|
dest[0] = '\0';
|
||||||
|
|
||||||
/* First, adjust the source pointer */
|
/* First, adjust the source pointer */
|
||||||
src = adjust_far(src);
|
src = adjust_far(src);
|
||||||
|
|
||||||
/* Do we have a drive? */
|
/* Do we have a drive? */
|
||||||
if (src[1] == ':')
|
if (src[1] == ':')
|
||||||
{
|
{
|
||||||
buf[0] = (src[0] | 0x20) + 'A' - 'a';
|
buf[0] = (src[0] | 0x20) + 'A' - 'a';
|
||||||
|
@ -268,24 +275,25 @@ COUNT truename(char FAR * src, char FAR * dest, COUNT t)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
src++;
|
src++;
|
||||||
|
/*
|
||||||
|
* The code here is brain dead. It works long as the calling
|
||||||
|
* function are operating with in normal parms.
|
||||||
|
* jt
|
||||||
|
*/
|
||||||
|
n = 9;
|
||||||
/* convert all forward slashes to backslashes, and uppercase all characters */
|
/* convert all forward slashes to backslashes, and uppercase all characters */
|
||||||
while (*src)
|
while (*src)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
c = *src++;
|
c = *src++;
|
||||||
|
if(!n)
|
||||||
|
return DE_PATHNOTFND; /* do this for now */
|
||||||
|
n--;
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
/* added *.*, *., * support.
|
|
||||||
*/
|
|
||||||
/* This doesn't expand cases like: foo*.* corrrectly
|
|
||||||
* disable it for now.
|
|
||||||
*/
|
|
||||||
#if 1
|
|
||||||
case '*':
|
case '*':
|
||||||
if (*src == '.')
|
if (*src == '.')
|
||||||
{
|
{
|
||||||
n = 8;
|
|
||||||
while (n--)
|
while (n--)
|
||||||
*bufp++ = '?';
|
*bufp++ = '?';
|
||||||
break;
|
break;
|
||||||
|
@ -294,25 +302,24 @@ COUNT truename(char FAR * src, char FAR * dest, COUNT t)
|
||||||
{
|
{
|
||||||
if (src[-2] == '.')
|
if (src[-2] == '.')
|
||||||
{
|
{
|
||||||
n = 3;
|
|
||||||
while (n--)
|
while (n--)
|
||||||
*bufp++ = '?';
|
*bufp++ = '?';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n = 8;
|
|
||||||
while (n--)
|
while (n--)
|
||||||
*bufp++ = '?';
|
*bufp++ = '?';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
case '/': /* convert to backslash */
|
case '/': /* convert to backslash */
|
||||||
case '\\':
|
case '\\':
|
||||||
|
|
||||||
if (bufp[-1] != '\\')
|
if (bufp[-1] != '\\'){
|
||||||
*bufp++ = '\\';
|
*bufp++ = '\\';
|
||||||
|
n = 9;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* look for '.' and '..' dir entries */
|
/* look for '.' and '..' dir entries */
|
||||||
|
@ -333,10 +340,20 @@ COUNT truename(char FAR * src, char FAR * dest, COUNT t)
|
||||||
bufp++;
|
bufp++;
|
||||||
}
|
}
|
||||||
else if (*src == '/' || *src == '\\' || *src == 0)
|
else if (*src == '/' || *src == '\\' || *src == 0)
|
||||||
--bufp;
|
break;
|
||||||
|
/* --bufp;*/
|
||||||
|
else
|
||||||
|
return DE_PATHNOTFND;
|
||||||
}
|
}
|
||||||
else
|
else if ( *src == '/' || *src == '\\' || *src == 0)
|
||||||
*bufp++ = c;
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
n = 4;
|
||||||
|
*bufp++ = c;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue