2000-05-06 21:34:20 +02:00
|
|
|
/****************************************************************/
|
|
|
|
/* */
|
|
|
|
/* globals.h */
|
|
|
|
/* DOS-C */
|
|
|
|
/* */
|
|
|
|
/* Global data structures and declarations */
|
|
|
|
/* */
|
|
|
|
/* Copyright (c) 1995, 1996 */
|
|
|
|
/* 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. */
|
|
|
|
/****************************************************************/
|
|
|
|
|
|
|
|
#ifdef VERSION_STRINGS
|
|
|
|
#ifdef MAIN
|
2001-11-18 15:01:12 +01:00
|
|
|
static BYTE *Globals_hRcsId =
|
|
|
|
"$Id$";
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "device.h"
|
|
|
|
#include "mcb.h"
|
|
|
|
#include "pcb.h"
|
|
|
|
#include "date.h"
|
|
|
|
#include "time.h"
|
|
|
|
#include "fat.h"
|
|
|
|
#include "fcb.h"
|
|
|
|
#include "tail.h"
|
|
|
|
#include "process.h"
|
|
|
|
#include "sft.h"
|
|
|
|
#include "cds.h"
|
|
|
|
#include "exe.h"
|
|
|
|
#include "fnode.h"
|
|
|
|
#include "dirmatch.h"
|
|
|
|
#include "file.h"
|
|
|
|
#include "clock.h"
|
|
|
|
#include "kbd.h"
|
|
|
|
#include "error.h"
|
|
|
|
#include "version.h"
|
|
|
|
#include "network.h"
|
2000-08-06 07:50:17 +02:00
|
|
|
#include "config.h"
|
2001-04-22 00:32:53 +02:00
|
|
|
#include "buffer.h"
|
2002-01-23 23:29:41 +01:00
|
|
|
#include "dcb.h"
|
2001-09-23 22:39:44 +02:00
|
|
|
#include "xstructs.h"
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
/* fatfs.c */
|
|
|
|
#ifdef WITHFAT32
|
|
|
|
VOID bpb_to_dpb(bpb FAR * bpbp, REG struct dpb FAR * dpbp, BOOL extended);
|
|
|
|
#else
|
|
|
|
VOID bpb_to_dpb(bpb FAR * bpbp, REG struct dpb FAR * dpbp);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITHFAT32
|
|
|
|
struct dpb FAR *GetDriveDPB(UBYTE drive, COUNT * rc);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern struct dpb
|
|
|
|
FAR * ASM DPBp; /* First drive Parameter Block */
|
|
|
|
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* JPP: for testing/debuging disk IO */
|
|
|
|
/*#define DISPLAY_GETBLOCK */
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* Convience switch for maintaining variables in a single location */
|
|
|
|
/* */
|
|
|
|
#ifdef MAIN
|
|
|
|
#define GLOBAL
|
|
|
|
#else
|
|
|
|
#define GLOBAL extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* Convience definitions of TRUE and FALSE */
|
|
|
|
/* */
|
|
|
|
#ifndef TRUE
|
|
|
|
#define TRUE (1)
|
|
|
|
#endif
|
|
|
|
#ifndef FALSE
|
|
|
|
#define FALSE (0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* Constants and macros */
|
|
|
|
/* */
|
|
|
|
/* Defaults and limits - System wide */
|
2001-04-22 00:32:53 +02:00
|
|
|
#define PARSE_MAX MAX_CDSPATH /* maximum # of bytes in path */
|
2001-11-18 15:01:12 +01:00
|
|
|
#define NAMEMAX PARSE_MAX /* Maximum path for CDS */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* internal error from failure or aborted operation */
|
|
|
|
#define ERROR -1
|
|
|
|
#define OK 0
|
|
|
|
|
|
|
|
/* internal transfer direction flags */
|
|
|
|
#define XFR_READ 1
|
|
|
|
#define XFR_WRITE 2
|
|
|
|
|
|
|
|
#define RDONLY 0
|
|
|
|
#define WRONLY 1
|
|
|
|
#define RDWR 2
|
|
|
|
|
|
|
|
/* special ascii code equates */
|
|
|
|
#define SPCL 0x00
|
|
|
|
#define CTL_C 0x03
|
|
|
|
#define CTL_F 0x06
|
|
|
|
#define BELL 0x07
|
|
|
|
#define BS 0x08
|
|
|
|
#define HT 0x09
|
|
|
|
#define LF 0x0a
|
|
|
|
#define CR 0x0d
|
2001-08-19 14:58:36 +02:00
|
|
|
#define CTL_P 0x10
|
2000-05-06 21:34:20 +02:00
|
|
|
#define CTL_Q 0x11
|
|
|
|
#define CTL_S 0x13
|
|
|
|
#define CTL_Z 0x1a
|
|
|
|
#define ESC 0x1b
|
|
|
|
#define CTL_BS 0x7f
|
|
|
|
|
2001-11-18 00:26:45 +01:00
|
|
|
#define F1 0x3b
|
2000-05-06 21:34:20 +02:00
|
|
|
#define F3 0x3d
|
|
|
|
#define LEFT 0x4b
|
|
|
|
#define RIGHT 0x4d
|
|
|
|
|
|
|
|
/* Blockio constants */
|
|
|
|
#define DSKWRITE 1 /* dskxfr function parameters */
|
|
|
|
#define DSKREAD 2
|
2001-07-10 00:19:33 +02:00
|
|
|
#define DSKWRITEINT26 3
|
|
|
|
#define DSKREADINT25 4
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* FAT cluster special flags */
|
|
|
|
#define FREE 0x000
|
|
|
|
|
2001-09-23 22:39:44 +02:00
|
|
|
#ifdef WITHFAT32
|
|
|
|
#define LONG_LAST_CLUSTER 0x0FFFFFFFl
|
|
|
|
#define LONG_BAD 0x0FFFFFF7l
|
|
|
|
#else
|
2000-05-06 21:34:20 +02:00
|
|
|
#define LONG_LAST_CLUSTER 0xFFFF
|
2001-09-23 22:39:44 +02:00
|
|
|
#define LONG_BAD 0xFFF8
|
|
|
|
#endif
|
|
|
|
#define MASK16 0xFFF8
|
|
|
|
#define BAD16 0xFFF0
|
|
|
|
#define MASK12 0xFF8
|
|
|
|
#define BAD12 0xFF0
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Keyboard buffer maximum size */
|
|
|
|
#ifdef LINESIZE
|
|
|
|
#undef LINESIZE
|
|
|
|
#endif
|
2001-04-22 00:32:53 +02:00
|
|
|
#define LINESIZE KBD_MAXLENGTH
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* NLS character table type */
|
|
|
|
typedef BYTE *UPMAP;
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* External Assembly variables */
|
|
|
|
/* */
|
|
|
|
extern struct dhdr
|
2002-01-23 23:29:41 +01:00
|
|
|
FAR ASM clk_dev, /* Clock device driver */
|
|
|
|
FAR ASM con_dev, /* Console device driver */
|
|
|
|
FAR ASM prn_dev, /* Generic printer device driver */
|
|
|
|
FAR ASM aux_dev, /* Generic aux device driver */
|
|
|
|
FAR ASM blk_dev; /* Block device (Disk) driver */
|
2001-11-18 15:01:12 +01:00
|
|
|
extern COUNT *error_tos, /* error stack */
|
2000-05-06 21:34:20 +02:00
|
|
|
disk_api_tos, /* API handler stack - disk fns */
|
|
|
|
char_api_tos; /* API handler stack - char fns */
|
2001-11-18 15:01:12 +01:00
|
|
|
extern BYTE FAR _InitTextStart; /* first available byte of ram */
|
|
|
|
extern BYTE FAR _HMATextAvailable, /* first byte of available CODE area */
|
2001-03-21 03:56:26 +01:00
|
|
|
FAR _HMATextStart[], /* first byte of HMAable CODE area */
|
|
|
|
FAR _HMATextEnd[]; /* and the last byte of it */
|
2001-11-18 15:01:12 +01:00
|
|
|
extern
|
|
|
|
BYTE DosLoadedInHMA; /* if InitHMA has moved DOS up */
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
extern struct ClockRecord
|
2002-01-23 23:29:41 +01:00
|
|
|
ASM ClkRecord;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* */
|
|
|
|
/* Global variables */
|
|
|
|
/* */
|
2001-11-18 15:01:12 +01:00
|
|
|
GLOBAL BYTE os_major, /* major version number */
|
2000-05-06 21:34:20 +02:00
|
|
|
os_minor, /* minor version number */
|
|
|
|
rev_number /* minor version number */
|
|
|
|
#ifdef MAIN
|
2001-11-18 15:01:12 +01:00
|
|
|
= REV_NUMBER,
|
2000-05-06 21:34:20 +02:00
|
|
|
#else
|
|
|
|
,
|
|
|
|
#endif
|
2001-03-30 22:11:14 +02:00
|
|
|
version_flags /* minor version number */
|
|
|
|
#ifdef MAIN
|
2001-11-18 15:01:12 +01:00
|
|
|
= 0;
|
2001-03-30 22:11:14 +02:00
|
|
|
#else
|
2001-11-18 15:01:12 +01:00
|
|
|
;
|
2001-03-30 22:11:14 +02:00
|
|
|
#endif
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
#ifdef DEBUG
|
|
|
|
GLOBAL WORD bDumpRegs
|
|
|
|
#ifdef MAIN
|
2001-11-18 15:01:12 +01:00
|
|
|
= FALSE;
|
2000-05-06 21:34:20 +02:00
|
|
|
#else
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
GLOBAL WORD bDumpRdWrParms
|
|
|
|
#ifdef MAIN
|
2001-11-18 15:01:12 +01:00
|
|
|
= FALSE;
|
2000-05-06 21:34:20 +02:00
|
|
|
#else
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
#if 0 /* defined in MAIN.C now to save low memory */
|
2001-11-04 20:47:39 +01:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
GLOBAL BYTE copyright[] =
|
2001-11-04 20:47:39 +01:00
|
|
|
"(C) Copyright 1995-2001 Pasquale J. Villani and The FreeDOS Project.\n"
|
|
|
|
"All Rights Reserved. This is free software and comes with ABSOLUTELY NO\n"
|
|
|
|
"WARRANTY; you can redistribute it and/or modify it under the terms of the\n"
|
|
|
|
"GNU General Public License as published by the Free Software Foundation;\n"
|
|
|
|
"either version 2, or (at your option) any later version.\n";
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
|
|
|
|
2002-02-03 23:40:24 +01:00
|
|
|
GLOBAL const BYTE os_release[]
|
2000-05-06 21:34:20 +02:00
|
|
|
#ifdef MAIN
|
|
|
|
#if 0
|
2001-11-18 15:01:12 +01:00
|
|
|
= "DOS-C version %d.%d Beta %d [FreeDOS Release] (Build %d).\n"
|
2001-09-23 22:39:44 +02:00
|
|
|
#endif
|
2001-11-18 15:01:12 +01:00
|
|
|
= "FreeDOS kernel version " KERNEL_VERSION_STRING
|
|
|
|
" (Build " KERNEL_BUILD_STRING ") [" __DATE__ " " __TIME__ "]\n"
|
2001-09-23 22:39:44 +02:00
|
|
|
#if 0
|
2001-11-18 15:01:12 +01:00
|
|
|
"For technical information and description of the DOS-C operating system\n\
|
2000-05-06 21:34:20 +02:00
|
|
|
consult \"FreeDOS Kernel\" by Pat Villani, published by Miller\n\
|
|
|
|
Freeman Publishing, Lawrence KS, USA (ISBN 0-87930-436-7).\n\
|
2001-04-22 00:32:53 +02:00
|
|
|
\n"
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
2001-11-18 15:01:12 +01:00
|
|
|
;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* Globally referenced variables - WARNING: ORDER IS DEFINED IN */
|
|
|
|
/* KERNAL.ASM AND MUST NOT BE CHANGED. DO NOT CHANGE ORDER BECAUSE THEY */
|
|
|
|
/* ARE DOCUMENTED AS UNDOCUMENTED (?) AND HAVE MANY PROGRAMS AND TSR'S */
|
|
|
|
/* ACCESSING THEM */
|
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern UWORD ASM NetBios;
|
|
|
|
extern BYTE * ASM net_name;
|
|
|
|
extern BYTE ASM net_set_count;
|
|
|
|
extern BYTE ASM NetDelay, ASM NetRetry;
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern UWORD ASM first_mcb, /* Start of user memory */
|
2002-02-03 23:40:24 +01:00
|
|
|
ASM uppermem_root; /* Start of umb chain (usually 9fff) */
|
2002-01-23 23:29:41 +01:00
|
|
|
extern sfttbl FAR * ASM sfthead; /* System File Table head */
|
2000-05-06 21:34:20 +02:00
|
|
|
extern struct dhdr
|
2002-01-23 23:29:41 +01:00
|
|
|
FAR * ASM clock, /* CLOCK$ device */
|
|
|
|
FAR * ASM syscon; /* console device */
|
|
|
|
extern WORD ASM maxbksize; /* Number of Drives in system */
|
2000-05-06 21:34:20 +02:00
|
|
|
extern struct buffer
|
2002-01-23 23:29:41 +01:00
|
|
|
FAR *ASM firstbuf; /* head of buffers linked list */
|
|
|
|
extern cdstbl FAR * ASM CDSp; /* Current Directory Structure */
|
2000-05-06 21:34:20 +02:00
|
|
|
extern
|
2002-01-23 23:29:41 +01:00
|
|
|
struct cds FAR * ASM current_ldt;
|
|
|
|
extern LONG ASM current_filepos; /* current file position */
|
|
|
|
extern sfttbl FAR * ASM FCBp; /* FCB table pointer */
|
|
|
|
extern WORD ASM nprotfcb; /* number of protected fcbs */
|
|
|
|
extern UBYTE ASM nblkdev, /* number of block devices */
|
|
|
|
ASM lastdrive, /* value of last drive */
|
|
|
|
ASM uppermem_link, /* UMB Link flag */
|
|
|
|
ASM PrinterEcho; /* Printer Echo Flag */
|
2001-11-18 15:01:12 +01:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern UWORD ASM LoL_nbuffers; /* Number of buffers */
|
2001-08-19 14:58:36 +02:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
extern struct dhdr
|
2002-01-23 23:29:41 +01:00
|
|
|
ASM nul_dev;
|
|
|
|
extern UBYTE ASM mem_access_mode; /* memory allocation scheme */
|
|
|
|
extern BYTE ASM ErrorMode, /* Critical error flag */
|
|
|
|
ASM InDOS, /* In DOS critical section */
|
|
|
|
ASM OpenMode, /* File Open Attributes */
|
|
|
|
ASM SAttr, /* Attrib Mask for Dir Search */
|
|
|
|
ASM dosidle_flag, ASM Server_Call, ASM CritErrLocus, ASM CritErrAction, ASM CritErrClass, VgaSet, njoined; /* number of joined devices */
|
|
|
|
|
|
|
|
extern UWORD ASM Int21AX;
|
|
|
|
extern COUNT ASM CritErrCode;
|
|
|
|
extern BYTE FAR * ASM CritErrDev;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
extern struct dirent
|
2002-01-23 23:29:41 +01:00
|
|
|
ASM SearchDir;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
extern struct {
|
2000-05-06 21:34:20 +02:00
|
|
|
COUNT nDrive;
|
|
|
|
BYTE szName[FNAME_SIZE + 1];
|
|
|
|
BYTE szExt[FEXT_SIZE + 1];
|
2002-01-23 23:29:41 +01:00
|
|
|
} ASM FcbSearchBuffer;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
extern struct /* Path name parsing buffer */
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
BYTE _PriPathName[128];
|
2002-01-23 23:29:41 +01:00
|
|
|
} ASM _PriPathBuffer;
|
2001-07-22 03:58:58 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
extern struct {
|
2001-07-22 03:58:58 +02:00
|
|
|
BYTE _fname[FNAME_SIZE];
|
2001-11-18 15:01:12 +01:00
|
|
|
BYTE _fext[FEXT_SIZE + 1]; /* space for 0 */
|
2002-01-23 23:29:41 +01:00
|
|
|
} ASM szNames;
|
2001-07-22 03:58:58 +02:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
#define PriPathName _PriPathBuffer._PriPathName
|
2001-07-22 03:58:58 +02:00
|
|
|
#define szDirName TempCDS.cdsCurrentPath
|
|
|
|
#define szFileName szNames._fname
|
|
|
|
#define szFileExt szNames._fext
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
extern struct /* Alternate path name parsing buffer */
|
2000-05-06 21:34:20 +02:00
|
|
|
{
|
|
|
|
BYTE _SecPathName[128];
|
2002-01-23 23:29:41 +01:00
|
|
|
} ASM _SecPathBuffer;
|
2001-07-22 03:58:58 +02:00
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
#define SecPathName _SecPathBuffer._SecPathName
|
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern UWORD ASM wAttr;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern BYTE ASM default_drive; /* default drive for dos */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern BYTE ASM TempBuffer[], /* Temporary general purpose buffer */
|
|
|
|
FAR ASM internal_data[], /* sda areas */
|
|
|
|
FAR ASM swap_always[], /* " " */
|
|
|
|
FAR ASM swap_indos[], /* " " */
|
|
|
|
ASM tsr, /* true if program is TSR */
|
|
|
|
ASM break_flg, /* true if break was detected */
|
2002-01-27 02:13:07 +01:00
|
|
|
ASM break_ena; /* break enabled flag */
|
|
|
|
extern BYTE FAR * ASM dta; /* Disk transfer area (kludge) */
|
2002-01-23 23:29:41 +01:00
|
|
|
extern seg ASM cu_psp; /* current psp segment */
|
|
|
|
extern iregs FAR * ASM user_r; /* User registers for int 21h call */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
extern struct dirent /* Temporary directory entry */
|
2002-01-23 23:29:41 +01:00
|
|
|
ASM DirEntBuffer;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern fcb FAR * ASM lpFcb; /* Pointer to users fcb */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern sft FAR * ASM lpCurSft;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern BYTE ASM verify_ena, /* verify enabled flag */
|
|
|
|
ASM switchar, /* switch char */
|
|
|
|
ASM return_mode, /* Process termination rets */
|
|
|
|
ASM return_code; /* " " " */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern BYTE ASM BootDrive, /* Drive we came up from */
|
|
|
|
ASM scr_pos; /* screen position for bs, ht, etc */
|
2001-11-04 20:47:39 +01:00
|
|
|
/*extern WORD
|
2001-11-18 15:01:12 +01:00
|
|
|
NumFloppies; !!*//* How many floppies we have */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2002-01-23 23:29:41 +01:00
|
|
|
extern keyboard ASM kb_buf;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
extern struct cds
|
2002-01-23 23:29:41 +01:00
|
|
|
ASM TempCDS;
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* start of uncontrolled variables */
|
2001-11-18 15:01:12 +01:00
|
|
|
GLOBAL seg RootPsp; /* Root process -- do not abort */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-06-03 16:16:18 +02:00
|
|
|
/* don't know what it should do, but its no longer in use TE
|
2000-05-06 21:34:20 +02:00
|
|
|
GLOBAL struct f_node
|
|
|
|
*pDirFileNode;
|
2001-11-18 15:01:12 +01:00
|
|
|
*/
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-06-03 16:16:18 +02:00
|
|
|
#ifdef DEBUG
|
2000-05-06 21:34:20 +02:00
|
|
|
GLOBAL iregs error_regs; /* registers for dump */
|
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
GLOBAL WORD dump_regs; /* dump registers of bad call */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-06-03 16:16:18 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
GLOBAL f_node_ptr f_nodes; /* pointer to the array */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
2001-03-30 21:30:06 +02:00
|
|
|
GLOBAL UWORD f_nodes_cnt; /* number of allocated f_nodes */
|
|
|
|
|
2000-05-06 21:34:20 +02:00
|
|
|
/* */
|
|
|
|
/* Function prototypes - automatically generated */
|
|
|
|
/* */
|
|
|
|
#include "proto.h"
|
|
|
|
|
|
|
|
/* Process related functions - not under automatic generation. */
|
|
|
|
/* Typically, these are in ".asm" files. */
|
2002-01-23 23:29:41 +01:00
|
|
|
VOID ASMCFUNC FAR cpm_entry(VOID)
|
2001-09-23 22:39:44 +02:00
|
|
|
/*INRPT FAR handle_break(VOID) */ ;
|
2001-11-18 15:01:12 +01:00
|
|
|
VOID enable(VOID), disable(VOID);
|
2002-01-23 23:29:41 +01:00
|
|
|
COUNT ASMCFUNC
|
|
|
|
CriticalError(COUNT nFlag, COUNT nDrive, COUNT nError,
|
2001-11-18 15:01:12 +01:00
|
|
|
struct dhdr FAR * lpDevice);
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
#ifdef PROTO
|
2002-01-23 23:29:41 +01:00
|
|
|
VOID ASMCFUNC FAR CharMapSrvc(VOID);
|
|
|
|
VOID ASMCFUNC FAR set_stack(VOID);
|
|
|
|
VOID ASMCFUNC FAR restore_stack(VOID);
|
2000-05-06 21:34:20 +02:00
|
|
|
/*VOID INRPT FAR handle_break(VOID); */
|
2002-05-09 00:49:35 +02:00
|
|
|
BOOL ASMCFUNC ReadATClock(BYTE *, BYTE *, BYTE *, BYTE *);
|
|
|
|
ULONG ASMCFUNC ReadPCClock(VOID);
|
|
|
|
VOID ASMCFUNC WriteATClock(BYTE *, BYTE, BYTE, BYTE);
|
|
|
|
VOID ASMCFUNC WritePCClock(ULONG);
|
2002-01-23 23:29:41 +01:00
|
|
|
BYTE FAR * ASMCFUNC device_end(VOID);
|
2001-09-23 22:39:44 +02:00
|
|
|
COUNT ASMCFUNC kb_data(VOID);
|
|
|
|
COUNT ASMCFUNC kb_input(VOID);
|
|
|
|
COUNT ASMCFUNC kb_init(VOID);
|
2002-01-23 23:29:41 +01:00
|
|
|
VOID ASMCFUNC setvec(UWORD, intvec);
|
|
|
|
intvec ASMCFUNC getvec(UWORD);
|
2000-05-06 21:34:20 +02:00
|
|
|
COUNT con(COUNT);
|
|
|
|
#else
|
|
|
|
VOID FAR CharMapSrvc();
|
|
|
|
VOID FAR set_stack();
|
|
|
|
VOID FAR restore_stack();
|
2000-06-21 20:16:46 +02:00
|
|
|
WORD execrh();
|
2000-05-06 21:34:20 +02:00
|
|
|
VOID exit();
|
|
|
|
/*VOID INRPT FAR handle_break(); */
|
|
|
|
BYTE FAR *device_end();
|
|
|
|
COUNT kb_data();
|
|
|
|
COUNT kb_input();
|
|
|
|
COUNT kb_init();
|
|
|
|
VOID setvec();
|
2002-01-23 23:29:41 +01:00
|
|
|
intvec getvec();
|
2000-05-06 21:34:20 +02:00
|
|
|
COUNT con();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* */
|
|
|
|
/* special word packing prototypes */
|
|
|
|
/* */
|
|
|
|
#ifdef NATIVE
|
2002-05-09 00:49:35 +02:00
|
|
|
#define getlong(vp) (*(UDWORD *)(vp))
|
|
|
|
#define getword(vp) (*(UWORD *)(vp))
|
|
|
|
#define getbyte(vp) (*(UBYTE *)(vp))
|
|
|
|
#define fgetlong(vp) (*(UDWORD FAR *)(vp))
|
|
|
|
#define fgetword(vp) (*(UWORD FAR *)(vp))
|
|
|
|
#define fgetbyte(vp) (*(UBYTE FAR *)(vp))
|
|
|
|
#define fputlong(vp, l) (*(UDWORD FAR *)(vp)=l)
|
|
|
|
#define fputword(vp, w) (*(UWORD FAR *)(vp)=w)
|
|
|
|
#define fputbyte(vp, b) (*(UBYTE FAR *)(vp)=b)
|
2000-05-06 21:34:20 +02:00
|
|
|
#else
|
|
|
|
#ifdef PROTO
|
2002-05-09 00:49:35 +02:00
|
|
|
WORD getword(VOID *);
|
|
|
|
BYTE getbyte(VOID *);
|
|
|
|
LONG fgetlong(VOID FAR *);
|
|
|
|
WORD fgetword(VOID FAR *);
|
|
|
|
BYTE fgetbyte(VOID FAR *);
|
|
|
|
VOID fputlong(VOID FAR *, UDWORD);
|
|
|
|
VOID fputword(VOID FAR *, UWORD);
|
|
|
|
VOID fputbyte(VOID FAR *, UBYTE);
|
2000-05-06 21:34:20 +02:00
|
|
|
#else
|
|
|
|
VOID getword();
|
|
|
|
VOID getbyte();
|
|
|
|
VOID fgetlong();
|
|
|
|
VOID fgetword();
|
|
|
|
VOID fgetbyte();
|
|
|
|
VOID fputlong();
|
|
|
|
VOID fputword();
|
|
|
|
VOID fputbyte();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef I86
|
2002-01-23 23:29:41 +01:00
|
|
|
#define setvec(n, isr) (void)(*(intvec FAR *)MK_FP(0,4 * (n)) = (isr))
|
2000-05-06 21:34:20 +02:00
|
|
|
#endif
|
2001-03-21 03:56:26 +01:00
|
|
|
/*#define is_leap_year(y) ((y) & 3 ? 0 : (y) % 100 ? 1 : (y) % 400 ? 0 : 1) */
|
2000-05-06 21:34:20 +02:00
|
|
|
|
|
|
|
/* ^Break handling */
|
2001-11-18 15:01:12 +01:00
|
|
|
void ASMCFUNC spawn_int23(void); /* procsupt.asm */
|
2000-05-06 21:34:20 +02:00
|
|
|
int control_break(void); /* break.c */
|
|
|
|
void handle_break(void); /* break.c */
|
|
|
|
|
2001-03-21 03:56:26 +01:00
|
|
|
GLOBAL BYTE ReturnAnyDosVersionExpected;
|
2001-04-22 00:32:53 +02:00
|
|
|
|
2001-11-18 15:01:12 +01:00
|
|
|
GLOBAL COUNT UnusedRetVal; /* put unused errors here (to save stack space) */
|
2001-11-18 00:26:45 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Log: globals.h,v
|
|
|
|
*
|
|
|
|
* Revision 1.17 2000/03/16 03:28:49 kernel
|
|
|
|
* *** empty log message ***
|
|
|
|
*
|
|
|
|
* Revision 1.16 2000/03/09 06:07:11 kernel
|
|
|
|
* 2017f updates by James Tabor
|
|
|
|
*
|
|
|
|
* Revision 1.15 1999/09/23 04:40:47 jprice
|
|
|
|
* *** empty log message ***
|
|
|
|
*
|
|
|
|
* Revision 1.13 1999/08/25 03:18:08 jprice
|
|
|
|
* ror4 patches to allow TC 2.01 compile.
|
|
|
|
*
|
|
|
|
* Revision 1.12 1999/08/10 18:03:43 jprice
|
|
|
|
* ror4 2011-03 patch
|
|
|
|
*
|
|
|
|
* Revision 1.11 1999/05/03 06:25:45 jprice
|
|
|
|
* Patches from ror4 and many changed of signed to unsigned variables.
|
|
|
|
*
|
|
|
|
* Revision 1.10 1999/04/16 21:43:40 jprice
|
|
|
|
* ror4 multi-sector IO
|
|
|
|
*
|
|
|
|
* Revision 1.9 1999/04/16 12:21:22 jprice
|
|
|
|
* Steffen c-break handler changes
|
|
|
|
*
|
|
|
|
* Revision 1.8 1999/04/16 00:53:33 jprice
|
|
|
|
* Optimized FAT handling
|
|
|
|
*
|
|
|
|
* Revision 1.7 1999/04/12 03:21:17 jprice
|
|
|
|
* more ror4 patches. Changes for multi-block IO
|
|
|
|
*
|
|
|
|
* Revision 1.6 1999/04/11 04:33:39 jprice
|
|
|
|
* ror4 patches
|
|
|
|
*
|
|
|
|
* Revision 1.4 1999/04/04 22:57:47 jprice
|
|
|
|
* no message
|
|
|
|
*
|
|
|
|
* Revision 1.3 1999/04/04 18:51:43 jprice
|
|
|
|
* no message
|
|
|
|
*
|
|
|
|
* Revision 1.2 1999/03/29 17:05:09 jprice
|
|
|
|
* ror4 changes
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 1999/03/29 15:40:58 jprice
|
|
|
|
* New version without IPL.SYS
|
|
|
|
*
|
|
|
|
* Revision 1.5 1999/02/08 05:55:57 jprice
|
|
|
|
* Added Pat's 1937 kernel patches
|
|
|
|
*
|
|
|
|
* 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:26:46 jprice
|
|
|
|
* Clean up; commented out copyright messages while we debug.
|
|
|
|
*
|
|
|
|
* Revision 1.2 1999/01/22 04:13:26 jprice
|
|
|
|
* Formating
|
|
|
|
*
|
|
|
|
* Revision 1.1.1.1 1999/01/20 05:51:01 jprice
|
|
|
|
* Imported sources
|
|
|
|
*
|
|
|
|
|
|
|
|
Rev 1.16 06 Dec 1998 8:45:56 patv
|
|
|
|
Expanded due to new I/O subsystem.
|
|
|
|
|
|
|
|
Rev 1.15 07 Feb 1998 20:38:00 patv
|
|
|
|
Modified stack fram to match DOS standard
|
|
|
|
|
|
|
|
Rev 1.14 02 Feb 1998 22:33:46 patv
|
|
|
|
Fixed size of default_drive. Caused failures when break_ena was not zero.
|
|
|
|
|
|
|
|
Rev 1.13 22 Jan 1998 4:09:24 patv
|
|
|
|
Fixed pointer problems affecting SDA
|
|
|
|
|
|
|
|
Rev 1.12 04 Jan 1998 23:16:22 patv
|
|
|
|
Changed Log for strip utility
|
|
|
|
|
|
|
|
Rev 1.11 03 Jan 1998 8:36:50 patv
|
|
|
|
Converted data area to SDA format
|
|
|
|
|
|
|
|
Rev 1.10 06 Feb 1997 21:57:04 patv
|
|
|
|
Changed version format string
|
|
|
|
|
|
|
|
Rev 1.9 06 Feb 1997 21:35:08 patv
|
|
|
|
Modified to support new version format
|
|
|
|
|
|
|
|
Rev 1.8 22 Jan 1997 13:17:14 patv
|
|
|
|
Changed to support version.h and pre-0.92 Svante Frey bug fixes.
|
|
|
|
|
|
|
|
Rev 1.6 16 Jan 1997 12:47:00 patv
|
|
|
|
pre-Release 0.92 feature additions
|
|
|
|
|
|
|
|
Rev 1.5 13 Sep 1996 19:26:32 patv
|
|
|
|
Fixed boot for hard drive
|
|
|
|
|
|
|
|
Rev 1.4 29 Aug 1996 13:07:22 patv
|
|
|
|
Bug fixes for v0.91b
|
|
|
|
|
|
|
|
Rev 1.3 29 May 1996 21:03:34 patv
|
|
|
|
bug fixes for v0.91a
|
|
|
|
|
|
|
|
Rev 1.2 19 Feb 1996 3:23:04 patv
|
|
|
|
Added NLS, int2f and config.sys processing
|
|
|
|
|
|
|
|
Rev 1.1 01 Sep 1995 17:54:16 patv
|
|
|
|
First GPL release.
|
|
|
|
|
|
|
|
Rev 1.0 02 Jul 1995 8:31:00 patv
|
|
|
|
Initial revision.
|
|
|
|
*/
|