2000-05-06 21:34:20 +02:00
|
|
|
/****************************************************************/
|
|
|
|
/* */
|
|
|
|
/* inthndlr.c */
|
|
|
|
/* */
|
|
|
|
/* Interrupt Handler and Function dispatcher for Kernel */
|
|
|
|
/* */
|
|
|
|
/* Copyright (c) 1995 */
|
|
|
|
/* Pasquale J. Villani */
|
|
|
|
/* All Rights Reserved */
|
|
|
|
/* */
|
|
|
|
/* This file is part of DOS-C. */
|
|
|
|
/* */
|
|
|
|
/* DOS-C is free software; you can redistribute it and/or */
|
|
|
|
/* modify it under the terms of the GNU General Public License */
|
|
|
|
/* as published by the Free Software Foundation; either version */
|
|
|
|
/* 2, or (at your option) any later version. */
|
|
|
|
/* */
|
|
|
|
/* DOS-C is distributed in the hope that it will be useful, but */
|
|
|
|
/* WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
|
|
|
|
/* the GNU General Public License for more details. */
|
|
|
|
/* */
|
|
|
|
/* You should have received a copy of the GNU General Public */
|
|
|
|
/* License along with DOS-C; see the file COPYING. If not, */
|
|
|
|
/* write to the Free Software Foundation, 675 Mass Ave, */
|
|
|
|
/* Cambridge, MA 02139, USA. */
|
|
|
|
/* */
|
|
|
|
/****************************************************************/
|
2001-04-15 05:21:50 +02:00
|
|
|
#define MAIN
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
#include "portab.h"
|
|
|
|
#include "globals.h"
|
2002-08-04 03:14:18 +02:00
|
|
|
#include "nls.h"
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
#ifdef VERSION_STRINGS
|
2001-11-18 15:01:12 +01:00
|
|
|
BYTE *RcsId =
|
|
|
|
"$Id$";
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TSC
|
2002-01-23 23:29:41 +01:00
|
|
|
STATIC VOID StartTrace(VOID);
|
2000-05-06 21:34:20 +02:00
|
|
|
static bTraceNext = FALSE;
|
|
|
|
#endif
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
#if 0 /* Very suspicious, passing structure by value??
|
|
|
|
Deactivated -- 2000/06/16 ska */
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Special entry for far call into the kernel */
|
|
|
|
#pragma argsused
|
|
|
|
VOID FAR int21_entry(iregs UserRegs)
|
|
|
|
{
|
|
|
|
int21_handler(UserRegs);
|
|
|
|
}
|
2000-08-06 07:50:17 +02:00
|
|
|
#endif
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-09-23 22:39:44 +02:00
|
|
|
/* Structures needed for int 25 / int 26 */
|
2001-11-18 15:01:12 +01:00
|
|
|
struct HugeSectorBlock {
|
2001-09-23 22:39:44 +02:00
|
|
|
ULONG blkno;
|
|
|
|
WORD nblks;
|
|
|
|
BYTE FAR *buf;
|
|
|
|
};
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Normal entry. This minimizes user stack usage by avoiding local */
|
|
|
|
/* variables needed for the rest of the handler. */
|
2001-03-27 22:27:43 +02:00
|
|
|
/* this here works on the users stack !! and only very few functions
|
|
|
|
are allowed */
|
2001-09-23 22:39:44 +02:00
|
|
|
VOID ASMCFUNC int21_syscall(iregs FAR * irp)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
Int21AX = irp->AX;
|
|
|
|
|
|
|
|
switch (irp->AH)
|
|
|
|
{
|
|
|
|
/* DosVars - get/set dos variables */
|
|
|
|
case 0x33:
|
|
|
|
switch (irp->AL)
|
|
|
|
{
|
|
|
|
/* Get Ctrl-C flag */
|
|
|
|
case 0x00:
|
2001-11-04 20:47:39 +01:00
|
|
|
irp->DL = break_ena;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set Ctrl-C flag */
|
|
|
|
case 0x01:
|
2001-11-04 20:47:39 +01:00
|
|
|
break_ena = irp->DL != 0;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x02: /* andrew schulman: get/set extended control break */
|
|
|
|
{
|
|
|
|
UBYTE tmp = break_ena;
|
|
|
|
irp->DL = break_ena;
|
|
|
|
break_ena = tmp != 0;
|
|
|
|
}
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Get Boot Drive */
|
|
|
|
case 0x05:
|
|
|
|
irp->DL = BootDrive;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get DOS-C version */
|
|
|
|
case 0x06:
|
|
|
|
irp->BL = os_major;
|
|
|
|
irp->BH = os_minor;
|
|
|
|
irp->DL = rev_number;
|
2001-11-18 15:01:12 +01:00
|
|
|
irp->DH = version_flags; /* bit3:runs in ROM,bit 4: runs in HMA */
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
2001-03-27 22:27:43 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x03: /* DOS 7 does not set AL */
|
|
|
|
case 0x07: /* neither here */
|
|
|
|
|
|
|
|
default: /* set AL=0xFF as error, NOT carry */
|
|
|
|
irp->AL = 0xff;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Toggle DOS-C rdwrblock trace dump */
|
|
|
|
case 0xfd:
|
|
|
|
#ifdef DEBUG
|
|
|
|
bDumpRdWrParms = !bDumpRdWrParms;
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Toggle DOS-C syscall trace dump */
|
|
|
|
case 0xfe:
|
|
|
|
#ifdef DEBUG
|
|
|
|
bDumpRegs = !bDumpRegs;
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get DOS-C release string pointer */
|
|
|
|
case 0xff:
|
|
|
|
irp->DX = FP_SEG(os_release);
|
|
|
|
irp->AX = FP_OFF(os_release);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set PSP */
|
|
|
|
case 0x50:
|
|
|
|
cu_psp = irp->BX;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get PSP */
|
|
|
|
case 0x51:
|
|
|
|
irp->BX = cu_psp;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* UNDOCUMENTED: return current psp */
|
|
|
|
case 0x62:
|
|
|
|
irp->BX = cu_psp;
|
|
|
|
break;
|
|
|
|
|
2001-03-27 22:27:43 +02:00
|
|
|
/* Normal DOS function - DO NOT ARRIVE HERE */
|
2000-05-06 21:34:20 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
#ifdef WITHFAT32
|
|
|
|
/* DOS 7.0+ FAT32 extended functions */
|
|
|
|
int int21_fat32(lregs *r)
|
|
|
|
{
|
|
|
|
COUNT rc;
|
|
|
|
|
|
|
|
switch (r->AL)
|
|
|
|
{
|
|
|
|
/* Get extended drive parameter block */
|
|
|
|
case 0x02:
|
|
|
|
{
|
|
|
|
struct dpb FAR *dpb;
|
|
|
|
struct xdpbdata FAR *xddp;
|
|
|
|
|
|
|
|
if (r->CX < sizeof(struct xdpbdata))
|
|
|
|
return DE_INVLDBUF;
|
|
|
|
|
|
|
|
dpb = GetDriveDPB(r->DL, &rc);
|
|
|
|
if (rc != SUCCESS)
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
/* hazard: no error checking! */
|
|
|
|
flush_buffers(dpb->dpb_unit);
|
|
|
|
dpb->dpb_flags = M_CHANGED; /* force reread of drive BPB/DPB */
|
|
|
|
|
|
|
|
if (media_check(dpb) < 0)
|
|
|
|
return DE_INVLDDRV;
|
|
|
|
|
|
|
|
xddp = MK_FP(r->ES, r->DI);
|
|
|
|
|
|
|
|
fmemcpy(&xddp->xdd_dpb, dpb, sizeof(struct dpb));
|
|
|
|
xddp->xdd_dpbsize = sizeof(struct dpb);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* Get extended free drive space */
|
|
|
|
case 0x03:
|
|
|
|
{
|
|
|
|
struct xfreespace FAR *xfsp = MK_FP(r->ES, r->DI);
|
|
|
|
|
|
|
|
if (r->CX < sizeof(struct xfreespace))
|
|
|
|
return DE_INVLDBUF;
|
|
|
|
|
|
|
|
rc = DosGetExtFree(MK_FP(r->DS, r->DX), xfsp);
|
|
|
|
if (rc != SUCCESS)
|
|
|
|
return rc;
|
|
|
|
xfsp->xfs_datasize = sizeof(struct xfreespace);
|
|
|
|
xfsp->xfs_version.actual = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* Set DPB to use for formatting */
|
|
|
|
case 0x04:
|
|
|
|
{
|
|
|
|
struct xdpbforformat FAR *xdffp = MK_FP(r->ES, r->DI);
|
|
|
|
struct dpb FAR *dpb;
|
|
|
|
if (r->CX < sizeof(struct xdpbforformat))
|
|
|
|
{
|
|
|
|
return DE_INVLDBUF;
|
|
|
|
}
|
|
|
|
dpb = GetDriveDPB(r->DL, &rc);
|
|
|
|
if (rc != SUCCESS)
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
xdffp->xdff_datasize = sizeof(struct xdpbforformat);
|
|
|
|
xdffp->xdff_version.actual = 0;
|
|
|
|
|
|
|
|
switch ((UWORD) xdffp->xdff_function)
|
|
|
|
{
|
|
|
|
case 0x00:
|
|
|
|
{
|
|
|
|
DWORD nfreeclst = xdffp->xdff_f.setdpbcounts.nfreeclst;
|
|
|
|
DWORD cluster = xdffp->xdff_f.setdpbcounts.cluster;
|
|
|
|
if (ISFAT32(dpb))
|
|
|
|
{
|
|
|
|
if ((dpb->dpb_xfsinfosec == 0xffff
|
|
|
|
&& (nfreeclst != 0 || cluster != 0))
|
|
|
|
|| nfreeclst == 1 || nfreeclst > dpb->dpb_xsize
|
|
|
|
|| cluster == 1 || cluster > dpb->dpb_xsize)
|
|
|
|
{
|
|
|
|
return DE_INVLDPARM;
|
|
|
|
}
|
|
|
|
dpb->dpb_xnfreeclst = nfreeclst;
|
|
|
|
dpb->dpb_xcluster = cluster;
|
|
|
|
write_fsinfo(dpb);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (nfreeclst == 1 || nfreeclst > dpb->dpb_size ||
|
|
|
|
cluster == 1 || cluster > dpb->dpb_size)
|
|
|
|
{
|
|
|
|
return DE_INVLDPARM;
|
|
|
|
}
|
|
|
|
dpb->dpb_nfreeclst = nfreeclst;
|
|
|
|
dpb->dpb_cluster = cluster;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x01:
|
|
|
|
{
|
|
|
|
ddt *pddt = getddt(r->DL);
|
|
|
|
fmemcpy(&pddt->ddt_bpb, xdffp->xdff_f.rebuilddpb.bpbp,
|
|
|
|
sizeof(bpb));
|
|
|
|
}
|
|
|
|
case 0x02:
|
|
|
|
{
|
|
|
|
rebuild_dpb:
|
|
|
|
/* hazard: no error checking! */
|
|
|
|
flush_buffers(dpb->dpb_unit);
|
|
|
|
dpb->dpb_flags = M_CHANGED;
|
|
|
|
|
|
|
|
if (media_check(dpb) < 0)
|
|
|
|
return DE_INVLDDRV;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x03:
|
|
|
|
{
|
|
|
|
struct buffer FAR *bp;
|
|
|
|
bpb FAR *bpbp;
|
|
|
|
DWORD newmirroring =
|
|
|
|
xdffp->xdff_f.setmirroring.newmirroring;
|
|
|
|
|
|
|
|
if (newmirroring != -1
|
|
|
|
&& (ISFAT32(dpb)
|
|
|
|
&& (newmirroring & ~(0xf | 0x80))))
|
|
|
|
{
|
|
|
|
return DE_INVLDPARM;
|
|
|
|
}
|
|
|
|
xdffp->xdff_f.setmirroring.oldmirroring =
|
|
|
|
(ISFAT32(dpb) ? dpb->dpb_xflags : 0);
|
|
|
|
if (newmirroring != -1 && ISFAT32(dpb))
|
|
|
|
{
|
|
|
|
bp = getblock(1, dpb->dpb_unit);
|
|
|
|
bp->b_flag &= ~(BFR_DATA | BFR_DIR | BFR_FAT);
|
|
|
|
bp->b_flag |= BFR_VALID | BFR_DIRTY;
|
|
|
|
bpbp = (bpb FAR *) & bp->b_buffer[BT_BPB];
|
|
|
|
bpbp->bpb_xflags = newmirroring;
|
|
|
|
}
|
|
|
|
goto rebuild_dpb;
|
|
|
|
}
|
|
|
|
case 0x04:
|
|
|
|
{
|
|
|
|
struct buffer FAR *bp;
|
|
|
|
bpb FAR *bpbp;
|
|
|
|
DWORD rootclst = xdffp->xdff_f.setroot.newrootclst;
|
|
|
|
if (!ISFAT32(dpb)
|
|
|
|
|| (rootclst != -1
|
|
|
|
&& (rootclst == 1
|
|
|
|
|| rootclst > dpb->dpb_xsize)))
|
|
|
|
{
|
|
|
|
return DE_INVLDPARM;
|
|
|
|
}
|
|
|
|
xdffp->xdff_f.setroot.oldrootclst = dpb->dpb_xrootclst;
|
|
|
|
if (rootclst != -1)
|
|
|
|
{
|
|
|
|
bp = getblock(1, dpb->dpb_unit);
|
|
|
|
bp->b_flag &= ~(BFR_DATA | BFR_DIR | BFR_FAT);
|
|
|
|
bp->b_flag |= BFR_VALID | BFR_DIRTY;
|
|
|
|
bpbp = (bpb FAR *) & bp->b_buffer[BT_BPB];
|
|
|
|
bpbp->bpb_xrootclst = rootclst;
|
|
|
|
}
|
|
|
|
goto rebuild_dpb;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* Extended absolute disk read/write */
|
|
|
|
/* TODO(vlp) consider using of the 13-14th bits of SI */
|
|
|
|
case 0x05:
|
|
|
|
{
|
|
|
|
struct HugeSectorBlock FAR *SectorBlock =
|
|
|
|
(struct HugeSectorBlock FAR *)MK_FP(r->DS, r->BX);
|
|
|
|
UBYTE mode;
|
|
|
|
|
|
|
|
if (r->CX != 0xffff || ((r->SI & 1) == 0 && r->SI != 0)
|
|
|
|
|| (r->SI & ~0x6001))
|
|
|
|
{
|
|
|
|
return DE_INVLDPARM;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r->DL - 1 >= lastdrive || r->DL == 0)
|
|
|
|
return -0x207;
|
|
|
|
|
|
|
|
if (r->SI == 0)
|
|
|
|
mode = DSKREADINT25;
|
|
|
|
else
|
|
|
|
mode = DSKWRITEINT26;
|
|
|
|
|
|
|
|
r->AX =
|
|
|
|
dskxfer(r->DL - 1, SectorBlock->blkno, SectorBlock->buf,
|
|
|
|
SectorBlock->nblks, mode);
|
|
|
|
|
|
|
|
if (mode == DSKWRITEINT26)
|
|
|
|
if (r->AX <= 0)
|
|
|
|
setinvld(r->DL - 1);
|
|
|
|
|
|
|
|
if (r->AX > 0)
|
|
|
|
return -0x20c;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
return DE_INVLDFUNC;
|
|
|
|
}
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-09-23 22:39:44 +02:00
|
|
|
VOID ASMCFUNC int21_service(iregs FAR * r)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
2001-11-04 20:47:39 +01:00
|
|
|
COUNT rc = 0;
|
2002-08-04 03:14:18 +02:00
|
|
|
lregs lr; /* 8 local registers (ax, bx, cx, dx, si, di, ds, es) */
|
|
|
|
|
|
|
|
#define FP_DS_DX (MK_FP(lr.DS, lr.DX))
|
|
|
|
#define FP_ES_DI (MK_FP(lr.ES, lr.DI))
|
|
|
|
|
2001-03-21 03:56:26 +01:00
|
|
|
|
|
|
|
#define CLEAR_CARRY_FLAG() r->FLAGS &= ~FLG_CARRY
|
|
|
|
#define SET_CARRY_FLAG() r->FLAGS |= FLG_CARRY
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
((psp FAR *) MK_FP(cu_psp, 0))->ps_stack = (BYTE FAR *) r;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = r->AX;
|
|
|
|
lr.BX = r->BX;
|
|
|
|
lr.CX = r->CX;
|
|
|
|
lr.DX = r->DX;
|
|
|
|
lr.SI = r->SI;
|
|
|
|
lr.DI = r->DI;
|
|
|
|
lr.DS = r->DS;
|
|
|
|
lr.ES = r->ES;
|
|
|
|
|
|
|
|
dispatch:
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
#ifdef DEBUG
|
2000-05-06 21:34:20 +02:00
|
|
|
if (bDumpRegs)
|
|
|
|
{
|
2001-11-18 00:26:45 +01:00
|
|
|
fmemcpy(&error_regs, user_r, sizeof(iregs));
|
2000-05-06 21:34:20 +02:00
|
|
|
printf("System call (21h): %02x\n", user_r->AX);
|
|
|
|
dump_regs = TRUE;
|
|
|
|
dump();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((lr.AH >= 0x38 && lr.AH <= 0x4F) || (lr.AH >= 0x56 && lr.AH <= 0x5c))
|
2001-11-18 15:01:12 +01:00
|
|
|
CLEAR_CARRY_FLAG();
|
|
|
|
/* Clear carry by default for these functions */
|
2001-04-15 05:21:50 +02:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Check for Ctrl-Break */
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AH)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
default:
|
|
|
|
if (!break_ena)
|
|
|
|
break;
|
|
|
|
case 0x01:
|
|
|
|
case 0x02:
|
|
|
|
case 0x03:
|
|
|
|
case 0x04:
|
|
|
|
case 0x05:
|
|
|
|
case 0x08:
|
|
|
|
case 0x09:
|
|
|
|
case 0x0a:
|
|
|
|
case 0x0b:
|
|
|
|
if (control_break())
|
2002-10-22 04:40:19 +02:00
|
|
|
handle_break(-1);
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The dispatch handler */
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AH)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
/* int 21h common error handler */
|
|
|
|
case 0x64:
|
2002-08-04 03:14:18 +02:00
|
|
|
goto error_invalid;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
/* case 0x00: --> Simulate a DOS-4C-00 */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Read Keyboard with Echo */
|
|
|
|
case 0x01:
|
2002-10-22 04:40:19 +02:00
|
|
|
lr.AL = read_char_stdin(TRUE);
|
|
|
|
write_char_stdin(lr.AL);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Display Character */
|
|
|
|
case 0x02:
|
2002-10-22 04:40:19 +02:00
|
|
|
write_char_stdin(lr.DL);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Auxiliary Input */
|
|
|
|
case 0x03:
|
2002-10-22 04:40:19 +02:00
|
|
|
lr.AL = read_char(get_sft_idx(STDAUX), TRUE);
|
2002-08-04 03:14:18 +02:00
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Auxiliary Output */
|
|
|
|
case 0x04:
|
2002-10-22 04:40:19 +02:00
|
|
|
write_char(get_sft_idx(STDAUX), lr.DL);
|
2002-08-04 03:14:18 +02:00
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Print Character */
|
|
|
|
case 0x05:
|
2002-10-22 04:40:19 +02:00
|
|
|
write_char(get_sft_idx(STDPRN), lr.DL);
|
2002-08-04 03:14:18 +02:00
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-04-15 05:21:50 +02:00
|
|
|
/* Direct Console I/O */
|
2000-05-06 21:34:20 +02:00
|
|
|
case 0x06:
|
2002-08-04 03:14:18 +02:00
|
|
|
if (lr.DL != 0xff)
|
2002-10-22 04:40:19 +02:00
|
|
|
write_char_stdin(lr.DL);
|
2000-05-06 21:34:20 +02:00
|
|
|
else if (StdinBusy())
|
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0x00;
|
2001-04-15 05:21:50 +02:00
|
|
|
r->FLAGS |= FLG_ZERO;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-04-15 05:21:50 +02:00
|
|
|
r->FLAGS &= ~FLG_ZERO;
|
2002-10-22 04:40:19 +02:00
|
|
|
lr.AL = read_char_stdin(FALSE);
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Direct Console Input */
|
|
|
|
case 0x07:
|
2002-10-22 04:40:19 +02:00
|
|
|
lr.AL = read_char_stdin(FALSE);
|
2001-08-19 14:58:36 +02:00
|
|
|
break;
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Read Keyboard Without Echo */
|
|
|
|
case 0x08:
|
2002-10-22 04:40:19 +02:00
|
|
|
lr.AL = read_char_stdin(TRUE);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Display String */
|
|
|
|
case 0x09:
|
2002-10-22 04:40:19 +02:00
|
|
|
{
|
|
|
|
size_t count = 0;
|
|
|
|
char FAR *bp = FP_DS_DX;
|
|
|
|
|
|
|
|
while (bp[count] != '$')
|
|
|
|
count++;
|
2002-08-04 03:14:18 +02:00
|
|
|
|
2002-10-22 04:40:19 +02:00
|
|
|
DosWrite(STDOUT, count, bp);
|
|
|
|
lr.AL = '$';
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Buffered Keyboard Input */
|
|
|
|
case 0x0a:
|
2002-10-22 04:40:19 +02:00
|
|
|
read_line(get_sft_idx(STDIN), get_sft_idx(STDOUT), FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Check Stdin Status */
|
|
|
|
case 0x0b:
|
|
|
|
if (StdinBusy())
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0x00;
|
2001-04-22 00:32:53 +02:00
|
|
|
else
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0xFF;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
2002-10-22 04:40:19 +02:00
|
|
|
/* Flush Buffer, Read Keyboard */
|
2000-05-06 21:34:20 +02:00
|
|
|
case 0x0c:
|
2002-10-22 04:40:19 +02:00
|
|
|
KbdFlush(get_sft_idx(STDIN));
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
case 0x01:
|
|
|
|
case 0x06:
|
|
|
|
case 0x07:
|
|
|
|
case 0x08:
|
|
|
|
case 0x0a:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AH = lr.AL;
|
2000-05-06 21:34:20 +02:00
|
|
|
goto dispatch;
|
|
|
|
|
|
|
|
default:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0x00;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Reset Drive */
|
|
|
|
case 0x0d:
|
|
|
|
flush();
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set Default Drive */
|
|
|
|
case 0x0e:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = DosSelectDrv(lr.DL);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x0f:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbOpen(FP_DS_DX, O_FCB | O_LEGACY | O_OPEN | O_RDWR);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x10:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbClose(FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x11:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbFindFirstNext(FP_DS_DX, TRUE);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x12:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbFindFirstNext(FP_DS_DX, FALSE);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x13:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbDelete(FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x14:
|
2002-08-04 03:14:18 +02:00
|
|
|
/* FCB read */
|
|
|
|
lr.AL = FcbReadWrite(FP_DS_DX, 0, XFR_READ);
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
case 0x15:
|
2002-08-04 03:14:18 +02:00
|
|
|
/* FCB write */
|
|
|
|
lr.AL = FcbReadWrite(FP_DS_DX, 0, XFR_WRITE);
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
case 0x16:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbOpen(FP_DS_DX, O_FCB | O_LEGACY | O_CREAT | O_TRUNC | O_RDWR);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x17:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbRename(FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
2001-03-25 19:11:54 +02:00
|
|
|
default:
|
|
|
|
#ifdef DEBUG
|
2002-08-04 03:14:18 +02:00
|
|
|
printf("Unsupported INT21 AH = 0x%x, AL = 0x%x.\n", lr.AH, lr.AL);
|
2001-03-25 19:11:54 +02:00
|
|
|
#endif
|
|
|
|
/* Fall through. */
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
/* CP/M compatibility functions */
|
2000-05-06 21:34:20 +02:00
|
|
|
case 0x18:
|
|
|
|
case 0x1d:
|
|
|
|
case 0x1e:
|
|
|
|
case 0x20:
|
|
|
|
#ifndef TSC
|
|
|
|
case 0x61:
|
|
|
|
#endif
|
2001-04-15 05:21:50 +02:00
|
|
|
case 0x6b:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get Default Drive */
|
|
|
|
case 0x19:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = default_drive;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set DTA */
|
|
|
|
case 0x1a:
|
2002-10-22 04:40:19 +02:00
|
|
|
dos_setdta(FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get Default Drive Data */
|
|
|
|
case 0x1b:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.DL = 0;
|
|
|
|
/* fall through */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Get Drive Data */
|
|
|
|
case 0x1c:
|
|
|
|
{
|
|
|
|
BYTE FAR *p;
|
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
p = FatGetDrvData(lr.DL, &lr.AX, &lr.CX, &lr.DX);
|
|
|
|
lr.DS = FP_SEG(p);
|
|
|
|
lr.BX = FP_OFF(p);
|
|
|
|
lr.CX = lr.CX;
|
|
|
|
lr.DX = lr.DX;
|
|
|
|
lr.AX = lr.AX;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get default DPB */
|
2001-07-22 03:58:58 +02:00
|
|
|
/* case 0x1f: see case 0x32 */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Random read using FCB */
|
|
|
|
case 0x21:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbRandomIO(FP_DS_DX, XFR_READ);
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Random write using FCB */
|
|
|
|
case 0x22:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbRandomIO(FP_DS_DX, XFR_WRITE);
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Get file size in records using FCB */
|
|
|
|
case 0x23:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbGetFileSize(FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set random record field in FCB */
|
|
|
|
case 0x24:
|
2001-03-21 03:56:26 +01:00
|
|
|
FcbSetRandom(FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set Interrupt Vector */
|
|
|
|
case 0x25:
|
2002-08-04 03:14:18 +02:00
|
|
|
setvec(lr.AL, FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Create New Psp */
|
|
|
|
case 0x26:
|
|
|
|
{
|
|
|
|
psp FAR *p = MK_FP(cu_psp, 0);
|
|
|
|
|
2002-10-22 04:40:19 +02:00
|
|
|
new_psp(lr.DX, p->ps_size);
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Read random record(s) using FCB */
|
|
|
|
case 0x27:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbRandomBlockIO(FP_DS_DX, lr.CX, XFR_READ);
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Write random record(s) using FCB */
|
|
|
|
case 0x28:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = FcbRandomBlockIO(FP_DS_DX, lr.CX, XFR_WRITE);
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Parse File Name */
|
|
|
|
case 0x29:
|
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
UWORD offset = FcbParseFname(&rc, MK_FP(lr.DS, lr.SI), FP_ES_DI);
|
|
|
|
lr.AL = rc;
|
|
|
|
lr.SI += offset;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get Date */
|
|
|
|
case 0x2a:
|
2002-10-22 04:40:19 +02:00
|
|
|
lr.AL = DosGetDate((struct dosdate *)&lr.CX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set Date */
|
|
|
|
case 0x2b:
|
2002-10-22 04:40:19 +02:00
|
|
|
rc = DosSetDate((struct dosdate *)&lr.CX);
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = (rc != SUCCESS ? 0xff : 0);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get Time */
|
|
|
|
case 0x2c:
|
2002-10-22 04:40:19 +02:00
|
|
|
DosGetTime((struct dostime *)&lr.CL);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set Date */
|
|
|
|
case 0x2d:
|
2002-10-22 04:40:19 +02:00
|
|
|
rc = DosSetTime((struct dostime *)&lr.CL);
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = (rc != SUCCESS ? 0xff : 0);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set verify flag */
|
|
|
|
case 0x2e:
|
2002-08-04 03:14:18 +02:00
|
|
|
verify_ena = (lr.AL ? TRUE : FALSE);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get DTA */
|
|
|
|
case 0x2f:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.ES = FP_SEG(dta);
|
|
|
|
lr.BX = FP_OFF(dta);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get DOS Version */
|
|
|
|
case 0x30:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = os_major;
|
|
|
|
lr.AH = os_minor;
|
|
|
|
lr.BH = OEM_ID;
|
|
|
|
lr.CH = REVISION_MAJOR; /* JPP */
|
|
|
|
lr.CL = REVISION_MINOR;
|
|
|
|
lr.BL = REVISION_SEQ;
|
2001-11-18 15:01:12 +01:00
|
|
|
|
|
|
|
if (ReturnAnyDosVersionExpected)
|
2001-03-21 03:56:26 +01:00
|
|
|
{
|
2001-11-18 15:01:12 +01:00
|
|
|
/* TE for testing purpose only and NOT
|
|
|
|
to be documented:
|
|
|
|
return programs, who ask for version == XX.YY
|
|
|
|
exactly this XX.YY.
|
|
|
|
this makes most MS programs more happy.
|
|
|
|
*/
|
2001-03-21 03:56:26 +01:00
|
|
|
UBYTE FAR *retp = MK_FP(r->cs, r->ip);
|
2001-11-18 15:01:12 +01:00
|
|
|
|
|
|
|
if (retp[0] == 0x3d && /* cmp ax, xxyy */
|
|
|
|
(retp[3] == 0x75 || retp[3] == 0x74)) /* je/jne error */
|
2001-03-21 03:56:26 +01:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = retp[1];
|
|
|
|
lr.AH = retp[2];
|
2001-03-21 03:56:26 +01:00
|
|
|
}
|
2001-11-18 15:01:12 +01:00
|
|
|
else if (retp[0] == 0x86 && /* xchg al,ah */
|
|
|
|
retp[1] == 0xc4 && retp[2] == 0x3d && /* cmp ax, xxyy */
|
|
|
|
(retp[5] == 0x75 || retp[5] == 0x74)) /* je/jne error */
|
2001-03-21 03:56:26 +01:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = retp[4];
|
|
|
|
lr.AH = retp[3];
|
2001-11-18 15:01:12 +01:00
|
|
|
}
|
|
|
|
|
2001-03-21 03:56:26 +01:00
|
|
|
}
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Keep Program (Terminate and stay resident) */
|
|
|
|
case 0x31:
|
2002-08-04 03:14:18 +02:00
|
|
|
DosMemChange(cu_psp, lr.DX < 6 ? 6 : lr.DX, 0);
|
2002-10-22 04:40:19 +02:00
|
|
|
return_code = lr.AL | 0x300;
|
2000-05-06 21:34:20 +02:00
|
|
|
tsr = TRUE;
|
|
|
|
return_user();
|
|
|
|
break;
|
|
|
|
|
2001-07-22 03:58:58 +02:00
|
|
|
/* Get default BPB */
|
|
|
|
case 0x1f:
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Get DPB */
|
|
|
|
case 0x32:
|
2001-07-10 00:19:33 +02:00
|
|
|
/* r->DL is NOT changed by MS 6.22 */
|
|
|
|
/* INT21/32 is documented to reread the DPB */
|
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
int drv = (lr.DL == 0 || lr.AH == 0x1f) ? default_drive : lr.DL - 1;
|
|
|
|
struct dpb FAR *dpb = get_dpb(drv);
|
|
|
|
|
|
|
|
if (dpb == NULL)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0xFF;
|
2001-11-18 15:01:12 +01:00
|
|
|
CritErrCode = 0x0f;
|
|
|
|
break;
|
|
|
|
}
|
2002-08-04 03:14:18 +02:00
|
|
|
/* hazard: no error checking! */
|
2001-11-18 15:01:12 +01:00
|
|
|
flush_buffers(dpb->dpb_unit);
|
|
|
|
dpb->dpb_flags = M_CHANGED; /* force flush and reread of drive BPB/DPB */
|
2001-07-10 00:19:33 +02:00
|
|
|
|
2001-09-23 22:39:44 +02:00
|
|
|
#ifdef WITHFAT32
|
2001-11-18 15:01:12 +01:00
|
|
|
if (media_check(dpb) < 0 || ISFAT32(dpb))
|
2001-09-23 22:39:44 +02:00
|
|
|
#else
|
2001-11-18 15:01:12 +01:00
|
|
|
if (media_check(dpb) < 0)
|
2001-09-23 22:39:44 +02:00
|
|
|
#endif
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0xff;
|
2000-06-21 20:16:46 +02:00
|
|
|
CritErrCode = 0x0f;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
2001-11-18 15:01:12 +01:00
|
|
|
}
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.DS = FP_SEG(dpb);
|
|
|
|
lr.BX = FP_OFF(dpb);
|
|
|
|
lr.AL = 0;
|
2001-07-10 00:19:33 +02:00
|
|
|
}
|
2000-06-21 20:16:46 +02:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
2001-04-15 05:21:50 +02:00
|
|
|
/*
|
|
|
|
case 0x33:
|
|
|
|
see int21_syscall
|
|
|
|
*/
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Get InDOS flag */
|
|
|
|
case 0x34:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.ES = FP_SEG(&InDOS);
|
|
|
|
lr.BX = FP_OFF(&InDOS);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get Interrupt Vector */
|
2002-08-04 03:14:18 +02:00
|
|
|
case 0x35:
|
|
|
|
{
|
|
|
|
intvec p = getvec((COUNT) lr.AL);
|
|
|
|
lr.ES = FP_SEG(p);
|
|
|
|
lr.BX = FP_OFF(p);
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Get Disk Free Space */
|
|
|
|
case 0x36:
|
2002-08-04 03:14:18 +02:00
|
|
|
DosGetFree(lr.DL, &lr.AX, &lr.BX, &lr.CX, &lr.DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Undocumented Get/Set Switchar */
|
|
|
|
case 0x37:
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
/* Get switch character */
|
|
|
|
case 0x00:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.DL = switchar;
|
|
|
|
lr.AL = 0x00;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set switch character */
|
|
|
|
case 0x01:
|
2002-08-04 03:14:18 +02:00
|
|
|
switchar = lr.DL;
|
|
|
|
lr.AL = 0x00;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
goto error_invalid;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get/Set Country Info */
|
|
|
|
case 0x38:
|
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
UWORD cntry = lr.AL;
|
2001-11-18 15:01:12 +01:00
|
|
|
|
|
|
|
if (cntry == 0)
|
|
|
|
cntry = (UWORD) - 1;
|
|
|
|
else if (cntry == 0xff)
|
2002-08-04 03:14:18 +02:00
|
|
|
cntry = lr.BX;
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
if (0xffff == lr.DX)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
|
|
|
/* Set Country Code */
|
|
|
|
if ((rc = DosSetCountry(cntry)) < 0)
|
|
|
|
goto error_invalid;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Get Country Information */
|
|
|
|
if ((rc = DosGetCountryInformation(cntry, FP_DS_DX)) < 0)
|
|
|
|
goto error_invalid;
|
|
|
|
/* HACK FIXME */
|
|
|
|
if (cntry == (UWORD) - 1)
|
|
|
|
cntry = 1;
|
|
|
|
/* END OF HACK */
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = lr.BX = cntry;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Create Directory */
|
|
|
|
case 0x39:
|
2001-03-21 03:56:26 +01:00
|
|
|
rc = DosMkdir((BYTE FAR *) FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
if (rc != SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Remove Directory */
|
|
|
|
case 0x3a:
|
2001-03-21 03:56:26 +01:00
|
|
|
rc = DosRmdir((BYTE FAR *) FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
if (rc != SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Change Directory */
|
|
|
|
case 0x3b:
|
2001-03-21 03:56:26 +01:00
|
|
|
if ((rc = DosChangeDir((BYTE FAR *) FP_DS_DX)) < 0)
|
2000-05-06 21:34:20 +02:00
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Create File */
|
|
|
|
case 0x3c:
|
2002-08-04 03:14:18 +02:00
|
|
|
{
|
|
|
|
long lrc = DosOpen(FP_DS_DX, O_LEGACY | O_RDWR | O_CREAT | O_TRUNC, lr.CL);
|
|
|
|
|
|
|
|
if (lrc < 0)
|
|
|
|
{
|
|
|
|
rc = (COUNT)lrc;
|
|
|
|
goto error_exit;
|
|
|
|
}
|
|
|
|
lr.AX = (UWORD)lrc;
|
|
|
|
break;
|
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Dos Open */
|
|
|
|
case 0x3d:
|
2002-08-04 03:14:18 +02:00
|
|
|
{
|
|
|
|
long lrc = DosOpen(FP_DS_DX, O_LEGACY | O_OPEN | lr.AL, 0);
|
|
|
|
|
|
|
|
if (lrc < 0)
|
|
|
|
{
|
|
|
|
rc = (COUNT)lrc;
|
|
|
|
goto error_exit;
|
|
|
|
}
|
|
|
|
lr.AX = (UWORD)lrc;
|
|
|
|
break;
|
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Dos Close */
|
|
|
|
case 0x3e:
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosClose(lr.BX)) < 0)
|
2000-05-06 21:34:20 +02:00
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Read */
|
2002-10-22 04:40:19 +02:00
|
|
|
case 0x3f:
|
|
|
|
{
|
|
|
|
long lrc = DosRead(lr.BX, lr.CX, FP_DS_DX);
|
|
|
|
if (lrc < SUCCESS)
|
|
|
|
{
|
|
|
|
rc = (int)lrc;
|
|
|
|
goto error_exit;
|
|
|
|
}
|
|
|
|
lr.AX = (UWORD)lrc;
|
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Write */
|
|
|
|
case 0x40:
|
2002-10-22 04:40:19 +02:00
|
|
|
{
|
|
|
|
long lrc = DosWrite(lr.BX, lr.CX, FP_DS_DX);
|
|
|
|
if (lrc < SUCCESS)
|
|
|
|
{
|
|
|
|
rc = (int)lrc;
|
|
|
|
goto error_exit;
|
|
|
|
}
|
|
|
|
lr.AX = (UWORD)lrc;
|
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Delete File */
|
|
|
|
case 0x41:
|
2002-02-16 20:20:20 +01:00
|
|
|
rc = DosDelete((BYTE FAR *) FP_DS_DX, D_ALL);
|
2000-05-06 21:34:20 +02:00
|
|
|
if (rc < 0)
|
2001-04-15 05:21:50 +02:00
|
|
|
goto error_exit;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Seek */
|
|
|
|
case 0x42:
|
2001-07-22 03:58:58 +02:00
|
|
|
{
|
2001-11-18 15:01:12 +01:00
|
|
|
ULONG lrc;
|
2002-08-04 03:14:18 +02:00
|
|
|
if (lr.AL > 2)
|
|
|
|
goto error_invalid;
|
|
|
|
lrc = DosSeek(lr.BX, (LONG)((((ULONG) (lr.CX)) << 16) | lr.DX), lr.AL);
|
|
|
|
if (lrc == (ULONG)-1)
|
|
|
|
{
|
|
|
|
rc = -DE_INVLDHNDL;
|
2001-11-18 15:01:12 +01:00
|
|
|
goto error_exit;
|
2002-08-04 03:14:18 +02:00
|
|
|
}
|
2001-11-18 15:01:12 +01:00
|
|
|
else
|
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.DX = (lrc >> 16);
|
|
|
|
lr.AX = (UWORD) lrc;
|
2001-11-18 15:01:12 +01:00
|
|
|
}
|
2001-07-22 03:58:58 +02:00
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get/Set File Attributes */
|
|
|
|
case 0x43:
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
case 0x00:
|
2001-07-22 03:58:58 +02:00
|
|
|
rc = DosGetFattr((BYTE FAR *) FP_DS_DX);
|
|
|
|
if (rc >= SUCCESS)
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.CX = rc;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x01:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = DosSetFattr((BYTE FAR *) FP_DS_DX, lr.CX);
|
2002-10-22 04:40:19 +02:00
|
|
|
if (rc >= SUCCESS)
|
|
|
|
lr.AX = lr.CX;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
goto error_invalid;
|
|
|
|
}
|
2001-07-22 03:58:58 +02:00
|
|
|
if (rc < SUCCESS)
|
2001-04-15 05:21:50 +02:00
|
|
|
goto error_exit;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Device I/O Control */
|
|
|
|
case 0x44:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = DosDevIOctl(&lr); /* can set critical error code! */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-04-15 05:21:50 +02:00
|
|
|
if (rc != SUCCESS)
|
2001-11-14 00:36:45 +01:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = -rc;
|
2001-11-14 00:36:45 +01:00
|
|
|
if (rc != DE_DEVICE && rc != DE_ACCESS)
|
|
|
|
CritErrCode = -rc;
|
2002-08-04 03:14:18 +02:00
|
|
|
goto error_carry;
|
2001-11-14 00:36:45 +01:00
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Duplicate File Handle */
|
|
|
|
case 0x45:
|
2002-08-04 03:14:18 +02:00
|
|
|
{
|
|
|
|
long lrc = DosDup(lr.BX);
|
|
|
|
if (lrc < SUCCESS)
|
|
|
|
{
|
|
|
|
rc = (COUNT)lrc;
|
|
|
|
goto error_exit;
|
|
|
|
}
|
|
|
|
lr.AX = (UWORD)lrc;
|
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Force Duplicate File Handle */
|
|
|
|
case 0x46:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = DosForceDup(lr.BX, lr.CX);
|
2000-05-06 21:34:20 +02:00
|
|
|
if (rc < SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get Current Directory */
|
|
|
|
case 0x47:
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosGetCuDir(lr.DL, MK_FP(lr.DS, lr.SI))) < 0)
|
2000-05-06 21:34:20 +02:00
|
|
|
goto error_exit;
|
|
|
|
else
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = 0x0100; /*jpp: from interrupt list */
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Allocate memory */
|
|
|
|
case 0x48:
|
2001-11-18 15:01:12 +01:00
|
|
|
if ((rc =
|
2002-08-04 03:14:18 +02:00
|
|
|
DosMemAlloc(lr.BX, mem_access_mode, &(lr.AX), &(lr.BX))) < 0)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
DosMemLargest(&(lr.BX));
|
2002-10-22 04:40:19 +02:00
|
|
|
{
|
|
|
|
if (DosMemCheck() != SUCCESS)
|
|
|
|
panic("MCB chain corrupted");
|
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
goto error_exit;
|
|
|
|
}
|
|
|
|
else
|
2002-08-04 03:14:18 +02:00
|
|
|
++(lr.AX); /* DosMemAlloc() returns seg of MCB rather than data */
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Free memory */
|
|
|
|
case 0x49:
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosMemFree((lr.ES) - 1)) < 0)
|
2002-10-22 04:40:19 +02:00
|
|
|
{
|
|
|
|
if (DosMemCheck() != SUCCESS)
|
|
|
|
panic("MCB chain corrupted");
|
|
|
|
goto error_exit;
|
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Set memory block size */
|
|
|
|
case 0x4a:
|
2002-10-22 04:40:19 +02:00
|
|
|
if (DosMemCheck() != SUCCESS)
|
|
|
|
panic("before 4a: MCB chain corrupted");
|
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosMemChange(lr.ES, lr.BX, &lr.BX)) < 0)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
#if 0
|
2002-08-04 03:14:18 +02:00
|
|
|
if (cu_psp == lr.ES)
|
|
|
|
{
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
psp FAR *p;
|
|
|
|
|
|
|
|
p = MK_FP(cu_psp, 0);
|
|
|
|
p->ps_size = lr.BX + cu_psp;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
2002-08-04 03:14:18 +02:00
|
|
|
#endif
|
2002-10-22 04:40:19 +02:00
|
|
|
if (DosMemCheck() != SUCCESS)
|
|
|
|
panic("after 4a: MCB chain corrupted");
|
2002-08-04 03:14:18 +02:00
|
|
|
goto error_exit;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
2002-08-04 03:14:18 +02:00
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Load and Execute Program */
|
|
|
|
case 0x4b:
|
|
|
|
break_flg = FALSE;
|
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosExec(lr.AL, MK_FP(lr.ES, lr.BX), FP_DS_DX)) != SUCCESS)
|
2000-05-06 21:34:20 +02:00
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Terminate Program */
|
|
|
|
case 0x00:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = 0x4c00;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* End Program */
|
|
|
|
case 0x4c:
|
2002-10-22 04:40:19 +02:00
|
|
|
if (((psp FAR *)MK_FP(cu_psp, 0))->ps_parent == cu_psp)
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
tsr = FALSE;
|
|
|
|
if (ErrorMode)
|
|
|
|
{
|
|
|
|
ErrorMode = FALSE;
|
2002-10-22 04:40:19 +02:00
|
|
|
rc = 2;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
else if (break_flg)
|
|
|
|
{
|
|
|
|
break_flg = FALSE;
|
2002-10-22 04:40:19 +02:00
|
|
|
rc = 1;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
rc = 0;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
2002-10-22 04:40:19 +02:00
|
|
|
return_code = lr.AL | (rc << 8);
|
2000-05-06 21:34:20 +02:00
|
|
|
if (DosMemCheck() != SUCCESS)
|
|
|
|
panic("MCB chain corrupted");
|
|
|
|
#ifdef TSC
|
|
|
|
StartTrace();
|
|
|
|
#endif
|
|
|
|
return_user();
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get Child-program Return Value */
|
|
|
|
case 0x4d:
|
2002-10-22 04:40:19 +02:00
|
|
|
lr.AX = return_code;
|
|
|
|
/* needs to be cleared (RBIL) */
|
|
|
|
return_code = 0;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Find First */
|
|
|
|
case 0x4e:
|
2001-04-15 05:21:50 +02:00
|
|
|
/* dta for this call is set on entry. This */
|
|
|
|
/* needs to be changed for new versions. */
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosFindFirst((UCOUNT) lr.CX, (BYTE FAR *) FP_DS_DX)) < 0)
|
2001-04-15 05:21:50 +02:00
|
|
|
goto error_exit;
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = 0;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Find Next */
|
|
|
|
case 0x4f:
|
2001-04-15 05:21:50 +02:00
|
|
|
/* dta for this call is set on entry. This */
|
|
|
|
/* needs to be changed for new versions. */
|
|
|
|
if ((rc = DosFindNext()) < 0)
|
|
|
|
goto error_exit;
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = -SUCCESS;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
2001-04-15 05:21:50 +02:00
|
|
|
/*
|
|
|
|
case 0x50:
|
|
|
|
case 0x51:
|
|
|
|
see int21_syscall
|
|
|
|
*/
|
2000-05-06 21:34:20 +02:00
|
|
|
/* ************UNDOCUMENTED************************************* */
|
|
|
|
/* Get List of Lists */
|
|
|
|
case 0x52:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.ES = FP_SEG(&DPBp);
|
|
|
|
lr.BX = FP_OFF(&DPBp);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
2001-04-15 05:21:50 +02:00
|
|
|
case 0x53:
|
|
|
|
/* DOS 2+ internal - TRANSLATE BIOS PARAMETER BLOCK TO DRIVE PARAM BLOCK */
|
2002-08-04 03:14:18 +02:00
|
|
|
bpb_to_dpb((bpb FAR *) MK_FP(lr.DS, lr.SI),
|
|
|
|
(struct dpb FAR *)MK_FP(lr.ES, r->BP)
|
2001-09-23 22:39:44 +02:00
|
|
|
#ifdef WITHFAT32
|
2002-08-04 03:14:18 +02:00
|
|
|
, (lr.CX == 0x4558 && lr.DX == 0x4152)
|
2001-09-23 22:39:44 +02:00
|
|
|
#endif
|
2001-11-18 15:01:12 +01:00
|
|
|
);
|
2001-04-15 05:21:50 +02:00
|
|
|
break;
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Get verify state */
|
|
|
|
case 0x54:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = (verify_ena ? TRUE : FALSE);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* ************UNDOCUMENTED************************************* */
|
|
|
|
/* Dos Create New Psp & set p_size */
|
|
|
|
case 0x55:
|
2002-10-22 04:40:19 +02:00
|
|
|
new_psp(lr.DX, lr.SI);
|
2002-08-04 03:14:18 +02:00
|
|
|
cu_psp = lr.DX;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Dos Rename */
|
|
|
|
case 0x56:
|
2001-11-18 15:01:12 +01:00
|
|
|
rc = DosRename((BYTE FAR *) FP_DS_DX,
|
2002-08-04 03:14:18 +02:00
|
|
|
(BYTE FAR *) FP_ES_DI);
|
2000-05-06 21:34:20 +02:00
|
|
|
if (rc < SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get/Set File Date and Time */
|
|
|
|
case 0x57:
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
case 0x00:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = DosGetFtime((COUNT) lr.BX, /* Handle */
|
|
|
|
&lr.DX, /* FileDate */
|
|
|
|
&lr.CX); /* FileTime */
|
2000-05-06 21:34:20 +02:00
|
|
|
if (rc < SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x01:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = DosSetFtime((COUNT) lr.BX, /* Handle */
|
|
|
|
(date) lr.DX, /* FileDate */
|
|
|
|
(time) lr.CX); /* FileTime */
|
2000-05-06 21:34:20 +02:00
|
|
|
if (rc < SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
goto error_invalid;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Get/Set Allocation Strategy */
|
|
|
|
case 0x58:
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
case 0x00:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = mem_access_mode;
|
|
|
|
lr.AH = 0;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x01:
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.BL)
|
2000-08-06 07:50:17 +02:00
|
|
|
{
|
2001-11-18 15:01:12 +01:00
|
|
|
case LAST_FIT:
|
|
|
|
case LAST_FIT_U:
|
|
|
|
case LAST_FIT_UO:
|
|
|
|
case BEST_FIT:
|
|
|
|
case BEST_FIT_U:
|
|
|
|
case BEST_FIT_UO:
|
|
|
|
case FIRST_FIT:
|
|
|
|
case FIRST_FIT_U:
|
|
|
|
case FIRST_FIT_UO:
|
2002-08-04 03:14:18 +02:00
|
|
|
mem_access_mode = lr.BL;
|
2000-08-06 07:50:17 +02:00
|
|
|
break;
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
default:
|
2000-08-06 07:50:17 +02:00
|
|
|
goto error_invalid;
|
|
|
|
}
|
2001-11-18 15:01:12 +01:00
|
|
|
}
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2000-06-21 20:16:46 +02:00
|
|
|
case 0x02:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = uppermem_link;
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
2000-06-21 20:16:46 +02:00
|
|
|
|
|
|
|
case 0x03:
|
2002-02-09 01:40:33 +01:00
|
|
|
if (uppermem_root != 0xffff) /* always error if not exists */
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
DosUmbLink(lr.BL);
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* else fall through */
|
2000-06-21 20:16:46 +02:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
default:
|
|
|
|
goto error_invalid;
|
|
|
|
#ifdef DEBUG
|
|
|
|
case 0xff:
|
|
|
|
show_chain();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-06-21 20:16:46 +02:00
|
|
|
/* Get Extended Error */
|
|
|
|
case 0x59:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = CritErrCode;
|
|
|
|
lr.ES = FP_SEG(CritErrDev);
|
|
|
|
lr.DI = FP_OFF(CritErrDev);
|
|
|
|
lr.CH = CritErrLocus;
|
|
|
|
lr.BH = CritErrClass;
|
|
|
|
lr.BL = CritErrAction;
|
2000-06-21 20:16:46 +02:00
|
|
|
break;
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* Create Temporary File */
|
|
|
|
case 0x5a:
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosMkTmp(FP_DS_DX, lr.CX)) < 0)
|
2000-05-06 21:34:20 +02:00
|
|
|
goto error_exit;
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = rc;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Create New File */
|
|
|
|
case 0x5b:
|
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
long lrc = DosOpen(FP_DS_DX, O_LEGACY | O_RDWR | O_CREAT, lr.CX);
|
|
|
|
if (lrc < 0)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = (COUNT)lrc;
|
|
|
|
goto error_exit;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = (UWORD)lrc;
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
|
2000-10-30 00:51:56 +01:00
|
|
|
/* /// Added for SHARE. - Ron Cemer */
|
|
|
|
/* Lock/unlock file access */
|
|
|
|
case 0x5c:
|
|
|
|
if ((rc = DosLockUnlock
|
2002-08-04 03:14:18 +02:00
|
|
|
(lr.BX,
|
|
|
|
(((unsigned long)lr.CX) << 16) | (((unsigned long)lr.DX) ),
|
|
|
|
(((unsigned long)lr.SI) << 16) | (((unsigned long)lr.DI) ),
|
|
|
|
((lr.AX & 0xff) != 0))) != 0)
|
2001-11-18 15:01:12 +01:00
|
|
|
goto error_exit;
|
2000-10-30 00:51:56 +01:00
|
|
|
break;
|
|
|
|
/* /// End of additions for SHARE. - Ron Cemer */
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* UNDOCUMENTED: server, share.exe and sda function */
|
|
|
|
case 0x5d:
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
/* Remote Server Call */
|
|
|
|
case 0x00:
|
2002-08-04 03:14:18 +02:00
|
|
|
fmemcpy(&lr, FP_DS_DX, sizeof(lr));
|
2000-05-06 21:34:20 +02:00
|
|
|
goto dispatch;
|
|
|
|
|
|
|
|
case 0x06:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.DS = FP_SEG(internal_data);
|
|
|
|
lr.SI = FP_OFF(internal_data);
|
|
|
|
lr.CX = swap_indos - internal_data;
|
|
|
|
lr.DX = swap_always - internal_data;
|
2001-03-21 03:56:26 +01:00
|
|
|
CLEAR_CARRY_FLAG();
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x07:
|
|
|
|
case 0x08:
|
|
|
|
case 0x09:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = remote_printredir(lr.DX, Int21AX);
|
2001-11-18 15:01:12 +01:00
|
|
|
if (rc != SUCCESS)
|
2001-04-15 05:21:50 +02:00
|
|
|
goto error_exit;
|
|
|
|
CLEAR_CARRY_FLAG();
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
goto error_invalid;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x5e:
|
2001-03-30 21:30:06 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
case 0x00:
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.CX = get_machine_name(FP_DS_DX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x01:
|
2002-08-04 03:14:18 +02:00
|
|
|
set_machine_name(FP_DS_DX, lr.CX);
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = remote_printset(lr.BX, lr.CX, lr.DX, (FP_ES_DI),
|
|
|
|
lr.SI, (MK_FP(lr.DS, Int21AX)));
|
2001-11-18 15:01:12 +01:00
|
|
|
if (rc != SUCCESS)
|
|
|
|
goto error_exit;
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = SUCCESS;
|
2001-04-15 05:21:50 +02:00
|
|
|
break;
|
2000-05-08 06:30:00 +02:00
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x5f:
|
2001-04-15 05:21:50 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
2002-10-22 04:40:19 +02:00
|
|
|
if (lr.AL == 7 || lr.AL == 8)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
struct cds FAR *cdsp;
|
|
|
|
if (lr.DL < lastdrive)
|
|
|
|
{
|
|
|
|
rc = DE_INVLDDRV;
|
|
|
|
goto error_exit;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cdsp = &CDSp[lr.DL];
|
|
|
|
if (lr.AL == 7)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
cdsp->cdsFlags |= 0x100;
|
2001-11-18 15:01:12 +01:00
|
|
|
}
|
2002-10-22 04:40:19 +02:00
|
|
|
else
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
cdsp->cdsFlags &= ~0x100;
|
2001-11-18 15:01:12 +01:00
|
|
|
}
|
2002-10-22 04:40:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-07-22 03:58:58 +02:00
|
|
|
/*
|
|
|
|
void int_2f_111e_call(iregs FAR *r);
|
|
|
|
int_2f_111e_call(r);
|
|
|
|
break;*/
|
|
|
|
|
2002-10-22 04:40:19 +02:00
|
|
|
rc = remote_doredirect(lr.BX, lr.CX, lr.DX,
|
2002-08-04 03:14:18 +02:00
|
|
|
(FP_ES_DI), lr.SI,
|
|
|
|
(MK_FP(lr.DS, Int21AX)));
|
2002-10-22 04:40:19 +02:00
|
|
|
/* the remote function manipulates *r directly !,
|
|
|
|
so we should not copy lr to r here */
|
|
|
|
if (rc != SUCCESS)
|
|
|
|
{
|
|
|
|
CritErrCode = -rc; /* Maybe set */
|
|
|
|
SET_CARRY_FLAG();
|
|
|
|
}
|
|
|
|
r->AX = -rc;
|
|
|
|
goto real_exit;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x60: /* TRUENAME */
|
2001-04-15 05:21:50 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosTruename(MK_FP(lr.DS, lr.SI), adjust_far(FP_ES_DI))) < SUCCESS)
|
2000-05-06 21:34:20 +02:00
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef TSC
|
|
|
|
/* UNDOCUMENTED: no-op */
|
|
|
|
/* */
|
|
|
|
/* DOS-C: tsc support */
|
|
|
|
case 0x61:
|
|
|
|
#ifdef DEBUG
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
case 0x01:
|
|
|
|
bTraceNext = TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x02:
|
|
|
|
bDumpRegs = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0x00;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
2001-04-15 05:21:50 +02:00
|
|
|
/* UNDOCUMENTED: return current psp
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x62: is in int21_syscall
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.BX = cu_psp;
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
*/
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* UNDOCUMENTED: Double byte and korean tables */
|
|
|
|
case 0x63:
|
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.DS = FP_SEG(&nlsDBCSHardcoded);
|
|
|
|
lr.SI = FP_OFF(&nlsDBCSHardcoded);
|
2001-11-04 20:47:39 +01:00
|
|
|
#if 0
|
2000-05-06 21:34:20 +02:00
|
|
|
/* not really supported, but will pass. */
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AL = 0x00; /*jpp: according to interrupt list */
|
2001-11-18 15:01:12 +01:00
|
|
|
/*Bart: fails for PQDI and WATCOM utilities:
|
|
|
|
use the above again */
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
}
|
2001-04-15 05:21:50 +02:00
|
|
|
/*
|
|
|
|
case 0x64:
|
|
|
|
see above (invalid)
|
2001-11-18 15:01:12 +01:00
|
|
|
*/
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Extended country info */
|
|
|
|
case 0x65:
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
|
|
|
case 0x20: /* upcase single character */
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.DL = DosUpChar(lr.DL);
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
case 0x21: /* upcase memory area */
|
2002-08-04 03:14:18 +02:00
|
|
|
DosUpMem(FP_DS_DX, lr.CX);
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
case 0x22: /* upcase ASCIZ */
|
|
|
|
DosUpString(FP_DS_DX);
|
|
|
|
break;
|
|
|
|
case 0xA0: /* upcase single character of filenames */
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.DL = DosUpFChar(lr.DL);
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
case 0xA1: /* upcase memory area of filenames */
|
2002-08-04 03:14:18 +02:00
|
|
|
DosUpFMem(FP_DS_DX, lr.CX);
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
case 0xA2: /* upcase ASCIZ of filenames */
|
|
|
|
DosUpFString(FP_DS_DX);
|
|
|
|
break;
|
|
|
|
case 0x23: /* check Yes/No response */
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = DosYesNo(lr.DL);
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
default:
|
2002-08-04 03:14:18 +02:00
|
|
|
if ((rc = DosGetData(lr.AL, lr.BX, lr.DX, lr.CX,
|
|
|
|
FP_ES_DI)) < 0)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2000-08-06 07:50:17 +02:00
|
|
|
#ifdef NLS_DEBUG
|
2001-11-18 15:01:12 +01:00
|
|
|
printf("DosGetData() := %d\n", rc);
|
2000-08-06 07:50:17 +02:00
|
|
|
#endif
|
2001-11-18 15:01:12 +01:00
|
|
|
goto error_exit;
|
|
|
|
}
|
2000-08-06 07:50:17 +02:00
|
|
|
#ifdef NLS_DEBUG
|
2001-11-18 15:01:12 +01:00
|
|
|
printf("DosGetData() returned successfully\n", rc);
|
2000-08-06 07:50:17 +02:00
|
|
|
#endif
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
CLEAR_CARRY_FLAG();
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Code Page functions */
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x66:
|
2002-08-04 03:14:18 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
|
|
|
switch (lr.AL)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
|
|
|
case 1:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = DosGetCodepage(&lr.BX, &lr.DX);
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = DosSetCodepage(lr.BX, lr.DX);
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
default:
|
|
|
|
goto error_invalid;
|
|
|
|
}
|
|
|
|
if (rc != SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Set Max file handle count */
|
|
|
|
case 0x67:
|
2002-08-04 03:14:18 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
|
|
|
if ((rc = SetJFTSize(lr.BX)) != SUCCESS)
|
2000-05-06 21:34:20 +02:00
|
|
|
goto error_exit;
|
|
|
|
break;
|
|
|
|
|
2002-02-16 20:20:20 +01:00
|
|
|
/* Flush file buffer -- COMMIT FILE. */
|
2000-05-06 21:34:20 +02:00
|
|
|
case 0x68:
|
2001-04-15 05:21:50 +02:00
|
|
|
case 0x6a:
|
2002-08-04 03:14:18 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
|
|
|
if ((rc = DosCommit(lr.BX)) < 0)
|
2002-01-23 23:29:41 +01:00
|
|
|
goto error_exit;
|
2000-05-06 21:34:20 +02:00
|
|
|
break;
|
2000-05-08 06:30:00 +02:00
|
|
|
|
|
|
|
/* Get/Set Serial Number */
|
|
|
|
case 0x69:
|
2002-08-04 03:14:18 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
|
|
|
rc = (lr.BL == 0 ? default_drive : lr.BL - 1);
|
2002-10-22 04:40:19 +02:00
|
|
|
if (lr.AL == 0 || lr.AL == 1)
|
2000-05-08 06:30:00 +02:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
UWORD saveCX = lr.CX;
|
2002-10-22 04:40:19 +02:00
|
|
|
if (get_cds(rc) == NULL)
|
|
|
|
rc = DE_INVLDDRV;
|
|
|
|
else if (get_dpb(rc) == NULL)
|
2000-05-11 06:26:26 +02:00
|
|
|
goto error_invalid;
|
2002-10-22 04:40:19 +02:00
|
|
|
else
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
lr.CX = lr.AL == 0 ? 0x0866 : 0x0846;
|
|
|
|
lr.AL = 0x0d;
|
|
|
|
rc = DosDevIOctl(&lr);
|
|
|
|
lr.CX = saveCX;
|
|
|
|
if (rc != SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
2000-05-08 06:30:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2002-10-22 04:40:19 +02:00
|
|
|
goto error_invalid;
|
2000-05-08 06:30:00 +02:00
|
|
|
break;
|
2001-04-15 05:21:50 +02:00
|
|
|
/*
|
|
|
|
case 0x6a: see case 0x68
|
|
|
|
case 0x6b: dummy func: return AL=0
|
2001-11-18 15:01:12 +01:00
|
|
|
*/
|
|
|
|
/* Extended Open-Creat, not fully functional. (bits 4,5,6 of BH) */
|
|
|
|
case 0x6c:
|
2001-04-16 03:45:26 +02:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
long lrc;
|
2001-04-16 03:45:26 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
2002-08-04 03:14:18 +02:00
|
|
|
|
2002-11-09 20:22:48 +01:00
|
|
|
if (lr.AL != 0 ||
|
2002-08-04 03:14:18 +02:00
|
|
|
(lr.DL & 0x0f) > 0x2 || (lr.DL & 0xf0) > 0x10)
|
|
|
|
goto error_invalid;
|
|
|
|
lrc = DosOpen(MK_FP(lr.DS, lr.SI),
|
2002-10-22 04:40:19 +02:00
|
|
|
(lr.BX & 0x70ff) | ((lr.DL & 3) << 8) |
|
2002-08-04 03:14:18 +02:00
|
|
|
((lr.DL & 0x10) << 6), lr.CL);
|
|
|
|
if (lrc < 0)
|
2001-04-16 03:45:26 +02:00
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = (COUNT)lrc;
|
|
|
|
goto error_exit;
|
2001-04-16 03:45:26 +02:00
|
|
|
}
|
2001-11-18 15:01:12 +01:00
|
|
|
else
|
2002-08-04 03:14:18 +02:00
|
|
|
{
|
|
|
|
lr.AX = (UWORD)lrc;
|
|
|
|
/* action */
|
|
|
|
lr.CX = lrc >> 16;
|
|
|
|
}
|
2001-04-16 03:45:26 +02:00
|
|
|
break;
|
|
|
|
}
|
2000-05-11 08:14:45 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
/* case 0x6d and above not implemented : see default; return AL=0 */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-09-23 22:39:44 +02:00
|
|
|
#ifdef WITHFAT32
|
2002-08-04 03:14:18 +02:00
|
|
|
/* DOS 7.0+ FAT32 extended functions */
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x73:
|
2002-08-04 03:14:18 +02:00
|
|
|
CLEAR_CARRY_FLAG();
|
|
|
|
rc = int21_fat32(&lr);
|
|
|
|
if (rc != SUCCESS)
|
|
|
|
goto error_exit;
|
|
|
|
break;
|
2001-11-14 00:36:45 +01:00
|
|
|
#endif
|
2002-08-04 03:14:18 +02:00
|
|
|
|
2001-11-14 00:36:45 +01:00
|
|
|
#ifdef WITHLFNAPI
|
|
|
|
/* FreeDOS LFN helper API functions */
|
|
|
|
case 0x74:
|
|
|
|
{
|
2002-08-04 03:14:18 +02:00
|
|
|
switch (lr.AL)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
2002-01-23 23:29:41 +01:00
|
|
|
/* Allocate LFN inode */
|
2001-11-14 00:36:45 +01:00
|
|
|
case 0x01:
|
2002-01-23 23:29:41 +01:00
|
|
|
rc = lfn_allocate_inode();
|
|
|
|
break;
|
|
|
|
/* Free LFN inode */
|
2001-11-14 00:36:45 +01:00
|
|
|
case 0x02:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = lfn_free_inode(lr.BX);
|
2002-01-23 23:29:41 +01:00
|
|
|
break;
|
|
|
|
/* Setup LFN inode */
|
2001-11-14 00:36:45 +01:00
|
|
|
case 0x03:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = lfn_setup_inode(lr.BX, ((ULONG)lr.CX << 16) | lr.DX, ((ULONG)lr.SI << 16) | lr.DI);
|
2002-01-23 23:29:41 +01:00
|
|
|
break;
|
|
|
|
/* Create LFN entries */
|
2001-11-14 00:36:45 +01:00
|
|
|
case 0x04:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = lfn_create_entries(lr.BX, (lfn_inode_ptr)FP_DS_DX);
|
2002-01-23 23:29:41 +01:00
|
|
|
break;
|
|
|
|
/* Read next LFN */
|
2001-11-14 00:36:45 +01:00
|
|
|
case 0x05:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = lfn_dir_read(lr.BX, (lfn_inode_ptr)FP_DS_DX);
|
2002-01-23 23:29:41 +01:00
|
|
|
break;
|
|
|
|
/* Write SFN pointed by LFN inode */
|
2001-11-14 00:36:45 +01:00
|
|
|
case 0x06:
|
2002-08-04 03:14:18 +02:00
|
|
|
rc = lfn_dir_write(lr.BX);
|
2002-01-23 23:29:41 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
goto error_invalid;
|
2001-11-18 15:01:12 +01:00
|
|
|
}
|
2002-08-04 03:14:18 +02:00
|
|
|
lr.AX = rc;
|
|
|
|
if (rc < 0) goto error_exit;
|
2002-01-23 23:29:41 +01:00
|
|
|
else CLEAR_CARRY_FLAG();
|
2001-11-14 00:36:45 +01:00
|
|
|
break;
|
|
|
|
}
|
2001-09-23 22:39:44 +02:00
|
|
|
#endif
|
|
|
|
}
|
2002-08-04 03:14:18 +02:00
|
|
|
goto exit_dispatch;
|
|
|
|
|
|
|
|
error_invalid:
|
|
|
|
rc = DE_INVLDFUNC;
|
|
|
|
error_exit:
|
|
|
|
lr.AX = -rc;
|
|
|
|
CritErrCode = lr.AX; /* Maybe set */
|
|
|
|
error_carry:
|
|
|
|
SET_CARRY_FLAG();
|
|
|
|
exit_dispatch:
|
|
|
|
r->AX = lr.AX;
|
|
|
|
r->BX = lr.BX;
|
|
|
|
r->CX = lr.CX;
|
|
|
|
r->DX = lr.DX;
|
|
|
|
r->SI = lr.SI;
|
|
|
|
r->DI = lr.DI;
|
|
|
|
r->DS = lr.DS;
|
|
|
|
r->ES = lr.ES;
|
|
|
|
real_exit:
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
#ifdef DEBUG
|
|
|
|
if (bDumpRegs)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
|
|
|
fmemcpy(&error_regs, user_r, sizeof(iregs));
|
|
|
|
dump_regs = TRUE;
|
|
|
|
dump();
|
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
2002-08-04 03:14:18 +02:00
|
|
|
return;
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
2001-11-18 15:01:12 +01:00
|
|
|
/* No kernel INT-23 handler required no longer -- 1999/04/15 ska */
|
2000-05-06 21:34:20 +02:00
|
|
|
/* ctrl-Break handler */
|
|
|
|
#pragma argsused
|
2001-11-18 15:01:12 +01:00
|
|
|
VOID INRPT FAR int23_handler(int es, int ds, int di, int si, int bp,
|
|
|
|
int sp, int bx, int dx, int cx, int ax,
|
|
|
|
int ip, int cs, int flags)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
tsr = FALSE;
|
|
|
|
return_mode = 1;
|
|
|
|
return_code = -1;
|
|
|
|
mod_sto(CTL_C);
|
|
|
|
DosMemCheck();
|
|
|
|
#ifdef TSC
|
|
|
|
StartTrace();
|
|
|
|
#endif
|
|
|
|
return_user();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
struct int25regs {
|
|
|
|
UWORD es, ds;
|
|
|
|
UWORD di, si, bp, sp;
|
|
|
|
UWORD bx, dx, cx, ax;
|
|
|
|
UWORD flags, ip, cs;
|
2000-05-06 21:34:20 +02:00
|
|
|
};
|
|
|
|
|
2001-03-27 22:27:43 +02:00
|
|
|
/*
|
|
|
|
this function is called from an assembler wrapper function
|
2001-03-21 03:56:26 +01:00
|
|
|
*/
|
2001-09-23 22:39:44 +02:00
|
|
|
VOID ASMCFUNC int2526_handler(WORD mode, struct int25regs FAR * r)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
ULONG blkno;
|
|
|
|
UWORD nblks;
|
2001-11-18 15:01:12 +01:00
|
|
|
BYTE FAR *buf;
|
2001-03-27 22:27:43 +02:00
|
|
|
UBYTE drv;
|
2001-11-18 15:01:12 +01:00
|
|
|
|
|
|
|
if (mode == 0x26)
|
|
|
|
mode = DSKWRITEINT26;
|
|
|
|
else
|
|
|
|
mode = DSKREADINT25;
|
|
|
|
|
2001-03-27 22:27:43 +02:00
|
|
|
drv = r->ax;
|
|
|
|
|
2001-03-31 00:27:42 +02:00
|
|
|
if (drv >= lastdrive)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
2001-07-10 00:19:33 +02:00
|
|
|
r->ax = 0x201;
|
2000-05-06 21:34:20 +02:00
|
|
|
r->flags |= FLG_CARRY;
|
|
|
|
return;
|
|
|
|
}
|
2001-09-23 22:39:44 +02:00
|
|
|
|
|
|
|
#ifdef WITHFAT32
|
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
struct dpb FAR *dpbp = get_dpb(drv);
|
|
|
|
if (dpbp != NULL && ISFAT32(dpbp))
|
|
|
|
{
|
|
|
|
r->ax = 0x207;
|
|
|
|
r->flags |= FLG_CARRY;
|
|
|
|
return;
|
|
|
|
}
|
2001-09-23 22:39:44 +02:00
|
|
|
}
|
2001-11-18 15:01:12 +01:00
|
|
|
#endif
|
2001-03-21 03:56:26 +01:00
|
|
|
|
|
|
|
nblks = r->cx;
|
|
|
|
blkno = r->dx;
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2001-03-21 03:56:26 +01:00
|
|
|
buf = MK_FP(r->ds, r->bx);
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2001-03-27 22:27:43 +02:00
|
|
|
if (nblks == 0xFFFF)
|
|
|
|
{
|
2001-11-18 15:01:12 +01:00
|
|
|
/*struct HugeSectorBlock FAR *lb = MK_FP(r->ds, r->bx); */
|
2001-03-27 22:27:43 +02:00
|
|
|
blkno = ((struct HugeSectorBlock FAR *)buf)->blkno;
|
|
|
|
nblks = ((struct HugeSectorBlock FAR *)buf)->nblks;
|
2001-11-18 15:01:12 +01:00
|
|
|
buf = ((struct HugeSectorBlock FAR *)buf)->buf;
|
2001-03-27 22:27:43 +02:00
|
|
|
}
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
InDOS++;
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
r->ax = dskxfer(drv, blkno, buf, nblks, mode);
|
2001-03-27 22:27:43 +02:00
|
|
|
|
|
|
|
if (mode == DSKWRITE)
|
|
|
|
if (r->ax <= 0)
|
2001-11-18 15:01:12 +01:00
|
|
|
setinvld(drv);
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2000-10-30 01:21:15 +01:00
|
|
|
if (r->ax > 0)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
r->flags |= FLG_CARRY;
|
2000-10-30 01:21:15 +01:00
|
|
|
--InDOS;
|
2000-05-06 21:34:20 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->ax = 0;
|
|
|
|
r->flags &= ~FLG_CARRY;
|
|
|
|
--InDOS;
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
}
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2001-03-27 22:27:43 +02:00
|
|
|
/*
|
2001-03-21 03:56:26 +01:00
|
|
|
VOID int25_handler(struct int25regs FAR * r) { int2526_handler(DSKREAD,r); }
|
|
|
|
VOID int26_handler(struct int25regs FAR * r) { int2526_handler(DSKWRITE,r); }
|
2001-03-27 22:27:43 +02:00
|
|
|
*/
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
#ifdef TSC
|
2002-01-23 23:29:41 +01:00
|
|
|
STATIC VOID StartTrace(VOID)
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
if (bTraceNext)
|
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
bDumpRegs = TRUE;
|
|
|
|
#endif
|
|
|
|
bTraceNext = FALSE;
|
|
|
|
}
|
|
|
|
#ifdef DEBUG
|
|
|
|
else
|
|
|
|
bDumpRegs = FALSE;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-09-23 22:39:44 +02:00
|
|
|
/*
|
|
|
|
this function is called from an assembler wrapper function
|
|
|
|
and serves the internal dos calls - int2f/12xx
|
|
|
|
*/
|
2001-11-18 15:01:12 +01:00
|
|
|
struct int2f12regs {
|
2002-10-22 04:40:19 +02:00
|
|
|
#ifdef I386
|
|
|
|
#ifdef __WATCOMC__
|
|
|
|
/* UWORD gs, fs; ** GS/FS are protected through SI/DI */
|
|
|
|
#else
|
|
|
|
UWORD high_edx, high_ecx, high_ebx, high_eax;
|
|
|
|
#endif
|
|
|
|
#endif
|
2001-11-18 15:01:12 +01:00
|
|
|
UWORD es, ds;
|
|
|
|
UWORD di, si, bp, bx, dx, cx, ax;
|
|
|
|
UWORD ip, cs, flags;
|
|
|
|
UWORD callerARG1; /* used if called from INT2F/12 */
|
2001-09-23 22:39:44 +02:00
|
|
|
};
|
|
|
|
|
2002-10-22 04:40:19 +02:00
|
|
|
VOID ASMCFUNC int2F_12_handler(struct int2f12regs r)
|
2001-11-18 15:01:12 +01:00
|
|
|
{
|
|
|
|
UWORD function = r.ax & 0xff;
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
if (function > 0x31)
|
|
|
|
return;
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
switch (function)
|
|
|
|
{
|
|
|
|
case 0x00: /* installation check */
|
|
|
|
r.ax |= 0x00ff;
|
|
|
|
break;
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x03: /* get DOS data segment */
|
|
|
|
r.ds = FP_SEG(&nul_dev);
|
|
|
|
break;
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x06: /* invoke critical error */
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
/* code, drive number, error, device header */
|
|
|
|
r.ax &= 0xff00;
|
|
|
|
r.ax |= CriticalError(r.callerARG1 >> 8,
|
|
|
|
(r.callerARG1 & (EFLG_CHAR << 8)) ? 0 : r.
|
|
|
|
callerARG1 & 0xff, r.di, MK_FP(r.bp, r.si));
|
|
|
|
break;
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x08: /* decrease SFT reference count */
|
|
|
|
{
|
|
|
|
sft FAR *p = MK_FP(r.es, r.di);
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
r.ax = p->sft_count;
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
if (--p->sft_count == 0)
|
|
|
|
--p->sft_count;
|
|
|
|
}
|
|
|
|
break;
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x0c: /* perform "device open" for device, set owner for FCB */
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
if (lpCurSft->sft_flags & SFT_FDEVICE)
|
|
|
|
{
|
|
|
|
request rq;
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
rq.r_unit = 0;
|
|
|
|
rq.r_status = 0;
|
|
|
|
rq.r_command = C_OPEN;
|
|
|
|
rq.r_length = sizeof(request);
|
|
|
|
execrh((request FAR *) & rq, lpCurSft->sft_dev);
|
|
|
|
}
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
/* just do it always, not just for FCBs */
|
|
|
|
lpCurSft->sft_psp = cu_psp;
|
|
|
|
break;
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x0d: /* get dos date/time */
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
r.ax = dos_getdate();
|
|
|
|
r.dx = dos_gettime();
|
|
|
|
break;
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x12: /* get length of asciiz string */
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
r.cx = fstrlen(MK_FP(r.es, r.di)) + 1;
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
break;
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2002-10-22 04:40:19 +02:00
|
|
|
case 0x13:
|
|
|
|
/* uppercase character */
|
|
|
|
/* for now, ASCII only because nls.c cannot handle DS!=SS */
|
|
|
|
r.ax = (unsigned char)r.callerARG1;
|
|
|
|
if (r.ax >= 'a' && r.ax <= 'z')
|
|
|
|
r.ax -= 'a' - 'A';
|
|
|
|
break;
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x16: /* get address of system file table entry - used by NET.EXE
|
|
|
|
BX system file table entry number ( such as returned from 2F/1220)
|
|
|
|
returns
|
|
|
|
ES:DI pointer to SFT entry */
|
|
|
|
{
|
|
|
|
sft FAR *p = get_sft(r.bx);
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
r.es = FP_SEG(p);
|
|
|
|
r.di = FP_OFF(p);
|
|
|
|
break;
|
|
|
|
}
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
case 0x17: /* get current directory structure for drive - used by NET.EXE
|
|
|
|
STACK: drive (0=A:,1=B,...)
|
|
|
|
; returns
|
|
|
|
; CF set if error
|
|
|
|
; DS:SI pointer to CDS for drive
|
|
|
|
;
|
|
|
|
; called like
|
|
|
|
; push 2 (c-drive)
|
|
|
|
; mov ax,1217
|
|
|
|
; int 2f
|
|
|
|
;
|
|
|
|
; probable use: get sizeof(CDSentry)
|
|
|
|
*/
|
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
struct cds FAR *cdsp = get_cds(r.callerARG1 & 0xff);
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2002-10-22 04:40:19 +02:00
|
|
|
if (cdsp == NULL)
|
2001-11-18 15:01:12 +01:00
|
|
|
r.flags |= FLG_CARRY;
|
|
|
|
else
|
|
|
|
{
|
2002-10-22 04:40:19 +02:00
|
|
|
r.ds = FP_SEG(cdsp);
|
|
|
|
r.si = FP_OFF(cdsp);
|
2001-11-18 15:01:12 +01:00
|
|
|
r.flags &= ~FLG_CARRY;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x18: /* get caller's registers */
|
|
|
|
|
|
|
|
r.ds = FP_SEG(user_r);
|
|
|
|
r.si = FP_OFF(user_r);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x1b: /* #days in February - valid until 2099. */
|
|
|
|
|
|
|
|
r.ax = (r.ax & 0xff00) | (r.cx & 3 ? 28 : 29);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x21: /* truename */
|
|
|
|
|
2002-08-04 03:14:18 +02:00
|
|
|
DosTruename(MK_FP(r.ds, r.si), MK_FP(r.es, r.di));
|
2001-11-18 15:01:12 +01:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x23: /* check if character device */
|
|
|
|
{
|
|
|
|
struct dhdr FAR *dhp;
|
|
|
|
|
|
|
|
dhp = IsDevice((BYTE FAR *) DirEntBuffer.dir_name);
|
|
|
|
|
|
|
|
if (dhp)
|
|
|
|
{
|
|
|
|
r.bx = (r.bx & 0xff) | (dhp->dh_attr << 8);
|
|
|
|
r.flags &= ~FLG_CARRY;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r.flags |= FLG_CARRY;
|
|
|
|
}
|
2001-09-23 22:39:44 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x25: /* get length of asciiz string */
|
|
|
|
|
|
|
|
r.cx = fstrlen(MK_FP(r.ds, r.si)) + 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x2a: /* Set FastOpen but does nothing. */
|
|
|
|
|
|
|
|
r.flags &= ~FLG_CARRY;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x2c: /* added by James Tabor For Zip Drives
|
|
|
|
Return Null Device Pointer */
|
|
|
|
/* by UDOS+RBIL: get header of SECOND device driver in device chain,
|
|
|
|
omitting the NUL device TE */
|
|
|
|
r.bx = FP_SEG(nul_dev.dh_next);
|
|
|
|
r.ax = FP_OFF(nul_dev.dh_next);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x2e: /* GET or SET error table addresse - ignored
|
|
|
|
called by MS debug with DS != DOSDS, printf
|
|
|
|
doesn't work!! */
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2002-10-22 04:40:19 +02:00
|
|
|
put_string("unimplemented internal dos function INT2F/12");
|
|
|
|
put_unsigned(function, 16, 2);
|
|
|
|
put_string("\n");
|
2001-11-18 15:01:12 +01:00
|
|
|
r.flags |= FLG_CARRY;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
2001-09-23 22:39:44 +02:00
|
|
|
|
|
|
|
}
|
2001-11-18 00:26:45 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 2000/09/04 Brian Reifsnyder
|
|
|
|
* Modified interrupts 0x25 & 0x26 to return more accurate error codes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Log: inthndlr.c,v - see "cvs log inthndlr.c" for newer entries.
|
|
|
|
*
|
|
|
|
* Revision 1.10 2000/10/29 23:51:56 jimtabor
|
|
|
|
* Adding Share Support by Ron Cemer
|
|
|
|
*
|
|
|
|
* Revision 1.9 2000/08/06 05:50:17 jimtabor
|
|
|
|
* Add new files and update cvs with patches and changes
|
|
|
|
*
|
|
|
|
* Revision 1.8 2000/06/21 18:16:46 jimtabor
|
|
|
|
* Add UMB code, patch, and code fixes
|
|
|
|
*
|
|
|
|
* Revision 1.7 2000/05/25 20:56:21 jimtabor
|
|
|
|
* Fixed project history
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Removed #if statement
|
|
|
|
*
|
|
|
|
* Revision 1.4 2000/05/11 04:26:26 jimtabor
|
|
|
|
* Added code for DOS FN 69 & 6C
|
|
|
|
*
|
|
|
|
* Revision 1.3 2000/05/09 00:30:11 jimtabor
|
|
|
|
* Clean up and Release
|
|
|
|
*
|
|
|
|
* Revision 1.2 2000/05/08 04:30:00 jimtabor
|
|
|
|
* Update CVS to 2020
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 2000/05/06 19:34:53 jhall1
|
|
|
|
* The FreeDOS Kernel. A DOS kernel that aims to be 100% compatible with
|
|
|
|
* MS-DOS. Distributed under the GNU GPL.
|
|
|
|
*
|
|
|
|
* Revision 1.24 2000/04/29 05:13:16 jtabor
|
|
|
|
* Added new functions and clean up code
|
|
|
|
*
|
|
|
|
* Revision 1.22 2000/03/17 22:59:04 kernel
|
|
|
|
* Steffen Kaiser's NLS changes
|
|
|
|
*
|
|
|
|
* Revision 1.21 2000/03/17 05:00:11 kernel
|
|
|
|
* Fixed Func 0x32
|
|
|
|
*
|
|
|
|
* Revision 1.20 2000/03/16 03:28:49 kernel
|
|
|
|
* *** empty log message ***
|
|
|
|
*
|
|
|
|
* Revision 1.19 2000/03/09 06:07:11 kernel
|
|
|
|
* 2017f updates by James Tabor
|
|
|
|
*
|
|
|
|
* Revision 1.18 1999/09/23 04:40:47 jprice
|
|
|
|
* *** empty log message ***
|
|
|
|
*
|
|
|
|
* Revision 1.13 1999/09/14 01:18:36 jprice
|
|
|
|
* ror4: fix int25 & 26 are not cached.
|
|
|
|
*
|
|
|
|
* Revision 1.12 1999/09/13 22:16:47 jprice
|
|
|
|
* Fix 210B function
|
|
|
|
*
|
|
|
|
* Revision 1.11 1999/08/25 03:18:08 jprice
|
|
|
|
* ror4 patches to allow TC 2.01 compile.
|
|
|
|
*
|
|
|
|
* Revision 1.10 1999/08/10 18:07:57 jprice
|
|
|
|
* ror4 2011-04 patch
|
|
|
|
*
|
|
|
|
* Revision 1.9 1999/08/10 18:03:43 jprice
|
|
|
|
* ror4 2011-03 patch
|
|
|
|
*
|
|
|
|
* Revision 1.8 1999/05/03 06:25:45 jprice
|
|
|
|
* Patches from ror4 and many changed of signed to unsigned variables.
|
|
|
|
*
|
|
|
|
* Revision 1.7 1999/04/23 04:24:39 jprice
|
|
|
|
* Memory manager changes made by ska
|
|
|
|
*
|
|
|
|
* Revision 1.6 1999/04/16 12:21:22 jprice
|
|
|
|
* Steffen c-break handler changes
|
|
|
|
*
|
|
|
|
* Revision 1.5 1999/04/11 04:33:39 jprice
|
|
|
|
* ror4 patches
|
|
|
|
*
|
|
|
|
* Revision 1.3 1999/04/04 22:57:47 jprice
|
|
|
|
* no message
|
|
|
|
*
|
|
|
|
* Revision 1.2 1999/04/04 18:51:43 jprice
|
|
|
|
* no message
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 1999/03/29 15:41:04 jprice
|
|
|
|
* New version without IPL.SYS
|
|
|
|
*
|
|
|
|
* Revision 1.9 1999/03/23 23:38:49 jprice
|
|
|
|
* Now sets carry when we don't support a function
|
|
|
|
*
|
|
|
|
* Revision 1.8 1999/03/02 07:02:55 jprice
|
|
|
|
* Added some comments. Fixed some minor bugs.
|
|
|
|
*
|
|
|
|
* Revision 1.7 1999/03/01 05:45:08 jprice
|
|
|
|
* Added some DEBUG ifdef's so that it will compile without DEBUG defined.
|
|
|
|
*
|
|
|
|
* Revision 1.6 1999/02/08 05:55:57 jprice
|
|
|
|
* Added Pat's 1937 kernel patches
|
|
|
|
*
|
|
|
|
* Revision 1.5 1999/02/04 03:11:07 jprice
|
|
|
|
* Formating
|
|
|
|
*
|
|
|
|
* Revision 1.4 1999/02/01 01:48:41 jprice
|
|
|
|
* Clean up; Now you can use hex numbers in config.sys. added config.sys screen function to change screen mode (28 or 43/50 lines)
|
|
|
|
*
|
|
|
|
* Revision 1.3 1999/01/30 08:28:11 jprice
|
|
|
|
* Clean up; Fixed bug with set attribute function.
|
|
|
|
*
|
|
|
|
* Revision 1.2 1999/01/22 04:13:26 jprice
|
|
|
|
* Formating
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 1999/01/20 05:51:00 jprice
|
|
|
|
* Imported sources
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Rev 1.14 06 Dec 1998 8:47:38 patv
|
|
|
|
* Expanded due to improved int 21h handler code.
|
|
|
|
*
|
|
|
|
* Rev 1.13 07 Feb 1998 20:38:46 patv
|
|
|
|
* Modified stack fram to match DOS standard
|
|
|
|
*
|
|
|
|
* Rev 1.12 22 Jan 1998 4:09:26 patv
|
|
|
|
* Fixed pointer problems affecting SDA
|
|
|
|
*
|
|
|
|
* Rev 1.11 06 Jan 1998 20:13:18 patv
|
|
|
|
* Broke apart int21_system from int21_handler.
|
|
|
|
*
|
|
|
|
* Rev 1.10 04 Jan 1998 23:15:22 patv
|
|
|
|
* Changed Log for strip utility
|
|
|
|
*
|
|
|
|
* Rev 1.9 04 Jan 1998 17:26:16 patv
|
|
|
|
* Corrected subdirectory bug
|
|
|
|
*
|
|
|
|
* Rev 1.8 03 Jan 1998 8:36:48 patv
|
|
|
|
* Converted data area to SDA format
|
|
|
|
*
|
|
|
|
* Rev 1.7 01 Aug 1997 2:00:10 patv
|
|
|
|
* COMPATIBILITY: Added return '$' in AL for function int 21h fn 09h
|
|
|
|
*
|
|
|
|
* Rev 1.6 06 Feb 1997 19:05:54 patv
|
|
|
|
* Added hooks for tsc command
|
|
|
|
*
|
|
|
|
* Rev 1.5 22 Jan 1997 13:18:32 patv
|
|
|
|
* pre-0.92 Svante Frey bug fixes.
|
|
|
|
*
|
|
|
|
* Rev 1.4 16 Jan 1997 12:46:46 patv
|
|
|
|
* pre-Release 0.92 feature additions
|
|
|
|
*
|
|
|
|
* Rev 1.3 29 May 1996 21:03:40 patv
|
|
|
|
* bug fixes for v0.91a
|
|
|
|
*
|
|
|
|
* Rev 1.2 19 Feb 1996 3:21:48 patv
|
|
|
|
* Added NLS, int2f and config.sys processing
|
|
|
|
*
|
|
|
|
* Rev 1.1 01 Sep 1995 17:54:20 patv
|
|
|
|
* First GPL release.
|
|
|
|
*
|
|
|
|
* Rev 1.0 02 Jul 1995 8:33:34 patv
|
|
|
|
* Initial revision.
|
|
|
|
*/
|