Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@278 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2001-08-19 12:58:36 +00:00
parent c5cb6b1cac
commit d9c11a4095
18 changed files with 383 additions and 121 deletions

View File

@ -38,6 +38,9 @@ static BYTE *buffer_hRcsId = "$Id$";
/*
* $Log$
* Revision 1.4 2001/08/19 12:58:34 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.3 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
@ -54,6 +57,7 @@ static BYTE *buffer_hRcsId = "$Id$";
#define BUFFERSIZE 512
struct buffer
{
WORD b_dummy; /* dummy self pointing word to keep MFT from crashing */
struct buffer
FAR *b_next; /* form linked list for LRU */
BYTE b_unit; /* disk for this buffer */

View File

@ -36,6 +36,9 @@ static BYTE *fnode_hRcsId = "$Id$";
/*
* $Log$
* Revision 1.8 2001/08/19 12:58:34 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.7 2001/07/09 22:19:33 bartoldeman
* LBA/FCB/FAT/SYS/Ctrl-C/ioctl fixes + memory savings
*
@ -112,6 +115,7 @@ struct f_node
BITS f_ddir:1; /* fnode is assigned to dir */
BITS f_dfull:1; /* directory is full */
BITS f_dremote:1; /* Remote Fake FNode */
BITS f_ddate:1; /* date set using setdate */
}
f_flags; /* file flags */

View File

@ -38,6 +38,9 @@ static BYTE *RcsId = "$Id$";
/*
* $Log$
* Revision 1.6 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.5 2001/04/15 03:21:50 bartoldeman
* See history.txt for the list of fixes.
*
@ -87,6 +90,7 @@ int control_break(void)
*/
void handle_break(void)
{
mod_cso(CTL_C);
CB_FLG &= ~CB_MSK; /* reset the ^Break flag */
KbdFlush(); /* Er, this is con_flush() */
if (!ErrorMode) /* within int21_handler, InDOS is not incremented */

View File

@ -36,6 +36,9 @@ static BYTE *charioRcsId = "$Id$";
/*
* $Log$
* Revision 1.11 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.10 2001/07/23 12:47:42 bartoldeman
* FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf
*
@ -168,7 +171,7 @@ struct dhdr FAR *finddev(UWORD attr_mask)
}
#endif
VOID cso(COUNT c)
VOID _cso(COUNT c)
{
if (syscon->dh_attr & ATTR_FASTCON) {
_AL = c;
@ -185,13 +188,40 @@ VOID cso(COUNT c)
char_error(&CharReqHdr, syscon);
}
VOID cso(COUNT c)
{
/* Test for hold char */
con_hold();
if (PrinterEcho)
DosWrite(STDPRN, 1, (BYTE FAR *) & c, (COUNT FAR *) &UnusedRetVal);
switch (c)
{
case CR:
scr_pos = 0;
break;
case LF:
case BELL:
break;
case BS:
if (scr_pos > 0) scr_pos--;
break;
case HT:
do _cso(' '); while ((++scr_pos) & 7);
break;
default:
scr_pos++;
}
if (c != HT) _cso(c);
}
VOID sto(COUNT c)
{
DosWrite(STDOUT, 1, (BYTE FAR *) & c, (COUNT FAR *) &UnusedRetVal);
}
VOID mod_sto(REG UCOUNT c)
VOID mod_cso(REG UCOUNT c)
{
if (c < ' ' && c != HT)
{
@ -223,19 +253,7 @@ VOID Do_DosIdle_loop(void)
}
}
UCOUNT _sti(void)
{
UBYTE c;
/*
* XXX: If there's a read error, this will just keep retrying the read until
* the error disappears. Maybe it should do something else instead. -- ror4
*/
while (GenericRead(STDIN, 1, (BYTE FAR *) & c, (COUNT FAR *) & UnusedRetVal, TRUE)
!= 1) ;
return c;
}
BOOL con_break(void)
COUNT ndread(void)
{
CharReqHdr.r_unit = 0;
CharReqHdr.r_status = 0;
@ -243,10 +261,61 @@ BOOL con_break(void)
CharReqHdr.r_length = sizeof(request);
execrh((request FAR *) & CharReqHdr, syscon);
if (CharReqHdr.r_status & S_BUSY)
return FALSE;
if (CharReqHdr.r_ndbyte == CTL_C)
return -1;
return CharReqHdr.r_ndbyte;
}
COUNT con_read(void)
{
BYTE c;
CharReqHdr.r_length = sizeof(request);
CharReqHdr.r_command = C_INPUT;
CharReqHdr.r_count = 1;
CharReqHdr.r_trans = (BYTE FAR *)&c;
CharReqHdr.r_status = 0;
execrh((request FAR *) & CharReqHdr, syscon);
if (CharReqHdr.r_status & S_ERROR)
char_error(&CharReqHdr, syscon);
if (c == CTL_C)
handle_break();
return c;
}
VOID con_hold(void)
{
UBYTE c = ndread();
if(c == CTL_S)
{
_sti();
con_read();
Do_DosIdle_loop();
/* just wait */
c = con_read();
}
if (c == CTL_C)
handle_break();
}
UCOUNT _sti(BOOL check_break)
{
UBYTE c;
/*
* XXX: If there's a read error, this will just keep retrying the read until
* the error disappears. Maybe it should do something else instead. -- ror4
*/
Do_DosIdle_loop();
if (check_break)
con_hold();
while (GenericRead(STDIN, 1, (BYTE FAR *) & c, (COUNT FAR *) & UnusedRetVal, TRUE)
!= 1) ;
return c;
}
BOOL con_break(void)
{
if (ndread() == CTL_C)
{
con_read();
return TRUE;
}
else
@ -296,7 +365,7 @@ static VOID kbfill(keyboard FAR * kp, UCOUNT c, BOOL ctlf, UWORD * vp)
kp->kb_buf[kp->kb_count++] = c;
if (!ctlf)
{
mod_sto(c);
mod_cso(c);
*vp += 2;
}
else
@ -310,13 +379,13 @@ static VOID kbfill(keyboard FAR * kp, UCOUNT c, BOOL ctlf, UWORD * vp)
}
/* return number of characters before EOF if there is one, else just the total */
UCOUNT sti(keyboard FAR * kp)
UCOUNT sti_0a(keyboard FAR * kp)
{
REG UWORD c,
cu_pos = scr_pos;
UWORD
virt_pos = scr_pos;
WORD init_count = kp->kb_count;
UWORD init_count = 0; /* kp->kb_count; */
BOOL eof = FALSE;
#ifndef NOSPCL
static BYTE local_buffer[LINESIZE];
@ -324,14 +393,11 @@ UCOUNT sti(keyboard FAR * kp)
if (kp->kb_size == 0)
return eof;
if (kp->kb_size <= kp->kb_count || kp->kb_buf[kp->kb_count] != CR)
kp->kb_count = 0;
/* if (kp->kb_size <= kp->kb_count || kp->kb_buf[kp->kb_count] != CR) */
kp->kb_count = 0;
FOREVER
{
Do_DosIdle_loop();
switch (c = _sti())
switch (c = _sti(TRUE))
{
case CTL_C:
handle_break();
@ -340,7 +406,7 @@ UCOUNT sti(keyboard FAR * kp)
#ifndef NOSPCL
case SPCL:
switch (c = _sti())
switch (c = _sti(TRUE))
{
case LEFT:
goto backspace;
@ -405,8 +471,8 @@ UCOUNT sti(keyboard FAR * kp)
if (eof)
return eof;
else
return kp->kb_count;
return kp->kb_count--;
case LF:
break;
@ -429,3 +495,17 @@ UCOUNT sti(keyboard FAR * kp)
}
}
}
UCOUNT sti(keyboard * kp)
{
UCOUNT ReadCount = sti_0a(kp);
kp->kb_count++;
if (ReadCount >= kp->kb_count && kp->kb_count < kp->kb_size)
{
kp->kb_buf[kp->kb_count++] = LF;
cso(LF);
ReadCount++;
}
return ReadCount;
}

View File

@ -75,7 +75,8 @@ extern BYTE FAR VgaSet,
extern UWORD FAR ram_top, /* How much ram in Kbytes */
FAR UMB_top,
FAR umb_start,
FAR uppermem_root;
FAR uppermem_root,
FAR LoL_nbuffers;
#ifdef VERSION_STRINGS
static BYTE *RcsId = "$Id$";
@ -89,6 +90,9 @@ static BYTE *RcsId = "$Id$";
/*
* $Log$
* Revision 1.27 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.26 2001/07/28 18:13:06 bartoldeman
* Fixes for FORMAT+SYS, FATFS, get current dir, kernel init memory situation.
*
@ -1566,6 +1570,7 @@ VOID config_init_buffers(COUNT anzBuffers)
printf("BUFFERS=%u not supported, reducing to 99\n",anzBuffers);
anzBuffers = 99;
}
LoL_nbuffers = anzBuffers;
lpTop = lpOldTop;
@ -1581,7 +1586,8 @@ VOID config_init_buffers(COUNT anzBuffers)
if (FP_SEG(pbuffer) == 0xffff) HMAcount++;
lastbuf = pbuffer;
pbuffer->b_dummy = FP_OFF(pbuffer);
pbuffer->b_unit = 0;
pbuffer->b_flag = 0;
pbuffer->b_blkno = 0;

View File

@ -37,6 +37,9 @@ static BYTE *dosfnsRcsId = "$Id$";
* /// Added SHARE support. 2000/09/04 Ron Cemer
*
* $Log$
* Revision 1.24 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.23 2001/07/28 18:13:06 bartoldeman
* Fixes for FORMAT+SYS, FATFS, get current dir, kernel init memory situation.
*
@ -374,22 +377,16 @@ UCOUNT GenericRead(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err,
else if (s->sft_flags & SFT_FCONIN)
{
kb_buf.kb_size = LINESIZE - 1;
kb_buf.kb_count = 0;
ReadCount = sti((keyboard FAR *) & kb_buf);
ReadCount = sti(&kb_buf);
if (ReadCount < kb_buf.kb_count)
s->sft_flags &= ~SFT_FEOF;
else if (kb_buf.kb_count < kb_buf.kb_size) {
kb_buf.kb_buf[kb_buf.kb_count++] = LF;
cso(LF);
ReadCount++;
}
fbcopy((BYTE FAR *) kb_buf.kb_buf, bp, kb_buf.kb_count);
*err = SUCCESS;
return ReadCount;
}
else
{
*bp = _sti();
*bp = _sti(FALSE);
*err = SUCCESS;
return 1;
}
@ -529,25 +526,8 @@ UCOUNT DosWrite(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err)
while(cnt-- != 0 && *bp != CTL_Z){
if (s->sft_flags & SFT_FCONOUT)
{
switch (*bp)
{
case CR:
scr_pos = 0;
break;
case LF:
case BELL:
break;
case BS:
scr_pos = scr_pos ? scr_pos - 1 : 0;
break;
case HT:
do cso(' '); while ((++scr_pos) & 7);
break;
default:
scr_pos++;
}
if (*bp != HT) cso(*bp);
{
cso(*bp);
}
else
{
@ -562,7 +542,7 @@ UCOUNT DosWrite(COUNT hndl, UCOUNT n, BYTE FAR * bp, COUNT FAR * err)
}
++bp;
++xfer;
if (break_ena && control_break())
if (control_break())
{
handle_break();
break;
@ -1406,7 +1386,7 @@ COUNT DosGetFtime(COUNT hndl, date FAR * dp, time FAR * tp)
return dos_getftime(s->sft_status, dp, tp);
}
COUNT DosSetFtimeSft(WORD sft_idx, date FAR * dp, time FAR * tp)
COUNT DosSetFtimeSft(WORD sft_idx, date dp, time tp)
{
/* Get the SFT block that contains the SFT */
sft FAR *s = idx_to_sft(sft_idx);
@ -1422,12 +1402,12 @@ COUNT DosSetFtimeSft(WORD sft_idx, date FAR * dp, time FAR * tp)
if (s->sft_flags & SFT_FDEVICE)
return SUCCESS;
s->sft_flags |= SFT_FDATE;
s->sft_date = dp;
s->sft_time = tp;
if (s->sft_flags & SFT_FSHARED)
{
s->sft_date = *dp;
s->sft_time = *tp;
return SUCCESS;
}
/* call file system handler */
return dos_setftime(s->sft_status, dp, tp);

View File

@ -36,6 +36,9 @@ static BYTE *fatdirRcsId = "$Id$";
/*
* $Log$
* Revision 1.22 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.21 2001/07/28 18:13:06 bartoldeman
* Fixes for FORMAT+SYS, FATFS, get current dir, kernel init memory situation.
*
@ -655,7 +658,7 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name)
/* directory and only searched for once. So we need to open */
/* the root and return only the first entry that contains the */
/* volume id bit set. */
if (attr & D_VOLID)
if (attr == D_VOLID)
{
szDirName[2] = '\\';
szDirName[3] = '\0';
@ -679,7 +682,7 @@ COUNT dos_findfirst(UCOUNT attr, BYTE *name)
fbcopy((BYTE FAR *) SearchDir.dir_name, dmp->dm_name_pat,
FNAME_SIZE + FEXT_SIZE);
if (attr & D_VOLID)
if (attr == D_VOLID)
{
/* Now do the search */
while (dir_read(fnp) == DIRENT_SIZE)
@ -799,7 +802,8 @@ COUNT dos_findnext(void)
*/
/* Test the attribute as the final step */
if (!(~dmp->dm_attr_srch & (fnp->f_dir.dir_attrib & ~(D_RDONLY|D_ARCHIVE))))
if (!(fnp->f_dir.dir_attrib & D_VOLID) &&
((~dmp->dm_attr_srch & fnp->f_dir.dir_attrib & (D_DIR | D_SYSTEM | D_HIDDEN)) == 0))
{
found = TRUE;
break;

View File

@ -47,6 +47,9 @@ BYTE *RcsId = "$Id$";
* performance killer on large drives. (~0.5 sec /dos_mkdir) TE
*
* $Log$
* Revision 1.23 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.22 2001/07/28 18:13:06 bartoldeman
* Fixes for FORMAT+SYS, FATFS, get current dir, kernel init memory situation.
*
@ -368,11 +371,14 @@ COUNT dos_close(COUNT fd)
if (fnp == (f_node_ptr)0 || fnp->f_count <= 0)
return DE_INVLDHNDL;
if (fnp->f_mode != RDONLY && fnp->f_flags.f_dmod)
if (fnp->f_flags.f_dmod)
{
fnp->f_dir.dir_attrib |= D_ARCHIVE;
fnp->f_dir.dir_time = dos_gettime();
fnp->f_dir.dir_date = dos_getdate();
if (fnp->f_flags.f_ddate == FALSE)
{
fnp->f_dir.dir_time = dos_gettime();
fnp->f_dir.dir_date = dos_getdate();
}
shrink_file(fnp); /* reduce allocated filesize in FAT */
fnp->f_dir.dir_size = fnp->f_highwater;
@ -631,6 +637,7 @@ COUNT dos_creat(BYTE * path, COUNT attrib)
fnp->f_dir.dir_date = dos_getdate();
fnp->f_flags.f_dmod = TRUE;
fnp->f_flags.f_ddate = FALSE;
fnp->f_flags.f_dnew = FALSE;
fnp->f_flags.f_ddir = TRUE;
if (dir_write(fnp) != DIRENT_SIZE)
@ -647,6 +654,7 @@ COUNT dos_creat(BYTE * path, COUNT attrib)
fnp->f_cluster = fnp->f_dir.dir_start = FREE;
fnp->f_cluster_offset = 0l; /*JPP */
fnp->f_flags.f_dmod = TRUE;
fnp->f_flags.f_ddate = FALSE;
fnp->f_flags.f_dnew = FALSE;
fnp->f_flags.f_ddir = FALSE;
@ -1037,7 +1045,7 @@ COUNT dos_getftime(COUNT fd, date FAR * dp, time FAR * tp)
/* */
/* dos_setftime for the file time */
/* */
COUNT dos_setftime(COUNT fd, date FAR * dp, time FAR * tp)
COUNT dos_setftime(COUNT fd, date dp, time tp)
{
f_node_ptr fnp;
@ -1052,8 +1060,10 @@ COUNT dos_setftime(COUNT fd, date FAR * dp, time FAR * tp)
return DE_INVLDHNDL;
/* Set the date and time from the fnode and return */
fnp->f_dir.dir_date = *dp;
fnp->f_dir.dir_time = *tp;
fnp->f_dir.dir_date = dp;
fnp->f_dir.dir_time = tp;
fnp->f_flags.f_dmod = TRUE; /* mark file as modified */
fnp->f_flags.f_ddate = TRUE; /* set this date upon closing */
return SUCCESS;
}
@ -1770,6 +1780,7 @@ UCOUNT writeblock(COUNT fd, VOID FAR * buffer, UCOUNT count, COUNT * err)
}
fnp->f_flags.f_dmod = TRUE; /* mark file as modified */
fnp->f_flags.f_ddate = FALSE; /* set date not valid any more */
/* Test that we are really about to do a data transfer. If the */
@ -2245,6 +2256,7 @@ COUNT dos_setfattr(BYTE * name, UWORD attrp)
/* set attributes that user requested */
fnp->f_dir.dir_attrib |= attrp; /* JPP */
fnp->f_flags.f_dmod = TRUE;
fnp->f_flags.f_ddate = TRUE;
dos_close(fd);
return SUCCESS;
}

View File

@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$";
/*
* $Log$
* Revision 1.16 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.15 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
@ -884,6 +887,10 @@ BOOL FcbClose(xfcb FAR * lpXfcb)
/* Convert to fcb if necessary */
lpFcb = ExtFcbToFcb(lpXfcb);
/* An already closed FCB can be closed again without error */
if (lpFcb->fcb_sftno == (BYTE)0xff)
return TRUE;
/* Get the SFT block that contains the SFT */
if ((s = idx_to_sft(lpFcb->fcb_sftno)) == (sft FAR *) - 1)
return FALSE;
@ -892,8 +899,12 @@ BOOL FcbClose(xfcb FAR * lpXfcb)
s->sft_size = lpFcb->fcb_fsize;
if (!(s->sft_flags & SFT_FSHARED))
dos_setfsize(s->sft_status, lpFcb->fcb_fsize);
DosSetFtimeSft(lpFcb->fcb_sftno, (date FAR *) &lpFcb->fcb_date, (time FAR *) &lpFcb->fcb_time);
return DosCloseSft(lpFcb->fcb_sftno) == SUCCESS;
DosSetFtimeSft(lpFcb->fcb_sftno, lpFcb->fcb_date, lpFcb->fcb_time);
if (DosCloseSft(lpFcb->fcb_sftno) == SUCCESS) {
lpFcb->fcb_sftno = (BYTE)0xff;
return TRUE;
}
return FALSE;
}
/* close all files opened by FCBs

View File

@ -36,6 +36,9 @@ static BYTE *Globals_hRcsId = "$Id$";
/*
* $Log$
* Revision 1.16 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.15 2001/07/22 01:58:58 bartoldeman
* Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX
*
@ -263,6 +266,7 @@ static BYTE *Globals_hRcsId = "$Id$";
#define HT 0x09
#define LF 0x0a
#define CR 0x0d
#define CTL_P 0x10
#define CTL_Q 0x11
#define CTL_S 0x13
#define CTL_Z 0x1a
@ -443,7 +447,12 @@ extern WORD
extern UBYTE
nblkdev, /* number of block devices */
lastdrive, /* value of last drive */
uppermem_link; /* UMB Link flag */
uppermem_link, /* UMB Link flag */
PrinterEcho; /* Printer Echo Flag */
extern UWORD
LoL_nbuffers; /* Number of buffers */
extern struct dhdr
nul_dev;
extern UBYTE

View File

@ -81,6 +81,9 @@ static BYTE *RcsId = "$Id$";
/*
* $Log$
* Revision 1.9 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.8 2001/07/28 18:13:06 bartoldeman
* Fixes for FORMAT+SYS, FATFS, get current dir, kernel init memory situation.
*
@ -407,7 +410,8 @@ VOID FAR *HMAalloc(COUNT bytesToAllocate)
HMAptr = MK_FP(0xffff, HMAFree);
HMAFree += bytesToAllocate;
/* align on 16 byte boundary */
HMAFree = (HMAFree + bytesToAllocate + 0xf) & 0xfff0;
/*printf("HMA allocated %d byte at %x\n", bytesToAllocate, HMAptr); */

View File

@ -30,6 +30,9 @@
; $Id$
;
; $Log$
; Revision 1.12 2001/08/19 12:58:36 bartoldeman
; Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
;
; Revision 1.11 2001/07/28 18:13:06 bartoldeman
; Fixes for FORMAT+SYS, FATFS, get current dir, kernel init memory situation.
;
@ -154,34 +157,155 @@ Int2f?14?1: or BYTE [bp-6], 1
Int2f?iret:
iret
FarTabRetnBX: pop bx
jmp FarTabRetn
;
;return dos data seg.
IntDosCal:
cmp al,03
jne IntDosCal_1
cmp al, 31h
ja FarTabRetn
push bx
mov bl, al
mov bh, 0
shl bx, 1
jmp [cs:bx+DosCalTbl]
DosCalTbl:
dw retff, IntDosCal_1, IntDosCal_2, IntDosCal_3, IntDosCal_4, IntDosCal_5,
dw IntDosCal_6, IntDosCal_7, IntDosCal_8, IntDosCal_9, IntDosCal_a,
dw IntDosCal_b, IntDosCal_c, IntDosCal_d, IntDosCal_e, IntDosCal_f,
dw IntDosCal_10, IntDosCal_11, IntDosCal_12, IntDosCal_13, IntDosCal_14,
dw IntDosCal_15, IntDosCal_16, IntDosCal_17, IntDosCal_18, IntDosCal_19,
dw IntDosCal_1a, IntDosCal_1b, IntDosCal_1c, IntDosCal_1d, IntDosCal_1e,
dw IntDosCal_1f, IntDosCal_20, IntDosCal_21, IntDosCal_22, IntDosCal_23,
dw IntDosCal_24, IntDosCal_25, IntDosCal_26, IntDosCal_27, IntDosCal_28,
dw IntDosCal_29, IntDosCal_2a, IntDosCal_2b, IntDosCal_2c, IntDosCal_2d,
dw IntDosCal_2e, IntDosCal_2f, IntDosCal_30, IntDosCal_31
retff: mov al,0ffh
jmp FarTabRetnBX
IntDosCal_3:
push ax
mov ax, seg _nul_dev
mov ds,ax
pop ax
clc
jmp FarTabRetn
jmp FarTabRetnBX
IntDosCal_8:
; decrease SFT reference count
dec word [es:di]
jnz .skip
dec word [es:di]
.skip:
jmp FarTabRetnBX
IntDosCal_1:
IntDosCal_2:
IntDosCal_4:
IntDosCal_5:
IntDosCal_6:
IntDosCal_7:
IntDosCal_9:
IntDosCal_a:
IntDosCal_b:
IntDosCal_c:
IntDosCal_d:
IntDosCal_e:
IntDosCal_f:
IntDosCal_10:
IntDosCal_11:
IntDosCal_13:
IntDosCal_14:
IntDosCal_15:
IntDosCal_16:
IntDosCal_17:
IntDosCal_19:
IntDosCal_1a:
IntDosCal_1c:
IntDosCal_1d:
IntDosCal_1e:
IntDosCal_1f:
IntDosCal_20:
IntDosCal_22:
IntDosCal_23:
IntDosCal_24:
IntDosCal_26:
IntDosCal_27:
IntDosCal_28:
IntDosCal_29:
IntDosCal_2b:
IntDosCal_2d:
IntDosCal_2e:
IntDosCal_2f:
IntDosCal_30:
IntDosCal_31:
jmp FarTabRetnBX
; get length of asciiz string
IntDosCal_12:
push di
push es
extern _fstrlen
call _fstrlen
add sp, byte 4
mov cx, ax
inc cx
jmp FarTabRetnBX
; get caller's registers
IntDosCal_18:
extern _user_r
lds si, [_user_r]
jmp FarTabRetnBX
; #days in February - valid until 2099.
IntDosCal_1b:
mov al, 28
test cl, 3
jnz .noleap
inc al
.noleap: jmp FarTabRetnBX
; truename
IntDosCal_21:
xor bx, bx
push bx
push es
push di
push ds
push si
extern _truename
call _truename
add sp, byte 10
jmp FarTabRetnBX
; get length of asciiz string
IntDosCal_25:
push si
push ds
call _fstrlen
add sp, byte 4
mov cx, ax
inc cx
jmp FarTabRetnBX
;
;Set FastOpen but does nothing.
IntDosCal_1:
cmp al,02ah
jne IntDosCal_2
IntDosCal_2a:
clc
jmp FarTabRetn
;
; added by James Tabor For Zip Drives
;Return Null Device Pointer
IntDosCal_2:
cmp al,02ch
jne Int2f2
IntDosCal_2c:
mov ax,_nul_dev
mov bx,seg _nul_dev
clc
jmp FarTabRetn
; Int 2F Multipurpose Remote System Calls
;

View File

@ -37,6 +37,9 @@ BYTE *RcsId = "$Id$";
/*
* $Log$
* Revision 1.30 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.29 2001/07/28 18:13:06 bartoldeman
* Fixes for FORMAT+SYS, FATFS, get current dir, kernel init memory situation.
*
@ -429,8 +432,7 @@ dispatch:
/* Read Keyboard with Echo */
case 0x01:
Do_DosIdle_loop();
r->AL = _sti();
r->AL = _sti(TRUE);
sto(r->AL);
break;
@ -474,16 +476,18 @@ dispatch:
else
{
r->FLAGS &= ~FLG_ZERO;
r->AL = _sti();
r->AL = _sti(FALSE);
}
break;
/* Direct Console Input */
case 0x07:
r->AL = _sti(FALSE);
break;
/* Read Keyboard Without Echo */
case 0x08:
Do_DosIdle_loop();
r->AL = _sti();
r->AL = _sti(TRUE);
break;
/* Display String */
@ -500,9 +504,7 @@ dispatch:
/* Buffered Keyboard Input */
case 0x0a:
((keyboard FAR *) FP_DS_DX)->kb_count = 0;
sti((keyboard FAR *) FP_DS_DX);
((keyboard FAR *) FP_DS_DX)->kb_count --;
sti_0a((keyboard FAR *) FP_DS_DX);
break;
/* Check Stdin Status */
@ -1294,8 +1296,8 @@ dispatch:
case 0x01:
rc = DosSetFtime(
(COUNT) r->BX, /* Handle */
(date FAR *) & r->DX, /* FileDate */
(time FAR *) & r->CX); /* FileTime */
(date) r->DX, /* FileDate */
(time) r->CX); /* FileTime */
if (rc < SUCCESS)
goto error_exit;
break;

View File

@ -28,6 +28,9 @@
; $Id$
;
; $Log$
; Revision 1.17 2001/08/19 12:58:36 bartoldeman
; Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
;
; Revision 1.16 2001/07/28 18:13:06 bartoldeman
; Fixes for FORMAT+SYS, FATFS, get current dir, kernel init memory situation.
;
@ -326,8 +329,8 @@ _clock dd 0 ; 0008 CLOCK$ device
_syscon dd 0 ; 000c console device
global _maxbksize
_maxbksize dw 512 ; 0010 maximum bytes/sector of any block device
global _firstbuf;
_firstbuf dd 0 ; 0012 head of buffers linked list
dw buf_info ; 0012 pointer to buffers info structure
dw seg buf_info
global _CDSp
_CDSp dd 0 ; 0016 Current Directory Structure
global _FCBp
@ -353,13 +356,16 @@ _njoined db 0 ; 0034 number of joined devices
setverPtr dw 0,0 ; 0037 setver list
dw 0 ; 003B cs offset for fix a20
dw 0 ; 003D psp of last umb exec
dw 1 ; 003F number of buffers
global _LoL_nbuffers
_LoL_nbuffers dw 1 ; 003F number of buffers
dw 1 ; 0041 size of pre-read buffer
global _BootDrive
_BootDrive db 1 ; 0043 drive we booted from
db 0 ; 0044 cpu type (1 if >=386)
dw 0 ; 0045 Extended memory in KBytes
buf_info dd 0 ; 0047 disk buffer chain
buf_info:
global _firstbuf
_firstbuf dd 0 ; 0047 disk buffer chain
dw 0 ; 004B 0 (DOS 4 = # hashing chains)
dd 0 ; 004D pre-read buffer
dw 0 ; 0051 # of sectors

View File

@ -34,6 +34,9 @@ static BYTE *Proto_hRcsId = "$Id$";
/*
* $Log$
* Revision 1.21 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.20 2001/07/24 16:56:29 bartoldeman
* fixes for FCBs, DJGPP ls, DBLBYTE, dyninit allocation (2024e).
*
@ -199,17 +202,18 @@ UWORD dskxfer(COUNT dsk, ULONG blkno, VOID FAR * buf, UWORD numblocks, COUNT mod
/* *** End of change
/* chario.c */
VOID cso(COUNT c);
VOID sto(COUNT c);
VOID mod_sto(REG UCOUNT c);
VOID cso(COUNT c);
VOID mod_cso(REG UCOUNT c);
VOID destr_bs(void);
UCOUNT _sti(void);
UCOUNT _sti(BOOL check_break);
VOID con_hold(void);
BOOL con_break(void);
BOOL StdinBusy(void);
VOID KbdFlush(void);
VOID Do_DosIdle_loop(void);
UCOUNT sti(keyboard FAR * kp);
UCOUNT sti_0a(keyboard FAR * kp);
UCOUNT sti(keyboard * kp);
sft FAR *get_sft(UCOUNT);
@ -239,7 +243,7 @@ COUNT DosChangeDir(BYTE FAR * s);
COUNT DosFindFirst(UCOUNT attr, BYTE FAR * name);
COUNT DosFindNext(void);
COUNT DosGetFtime(COUNT hndl, date FAR * dp, time FAR * tp);
COUNT DosSetFtimeSft(WORD sft_idx, date FAR * dp, time FAR * tp);
COUNT DosSetFtimeSft(WORD sft_idx, date dp, time tp);
#define DosSetFtime(hndl, dp, tp) DosSetFtimeSft(get_sft_idx(hndl), (dp), (tp))
COUNT DosGetFattr(BYTE FAR * name);
COUNT DosSetFattr(BYTE FAR * name, UWORD attrp);
@ -296,7 +300,7 @@ COUNT dos_rename(BYTE * path1, BYTE * path2);
date dos_getdate(void);
time dos_gettime(void);
COUNT dos_getftime(COUNT fd, date FAR * dp, time FAR * tp);
COUNT dos_setftime(COUNT fd, date FAR * dp, time FAR * tp);
COUNT dos_setftime(COUNT fd, date dp, time tp);
LONG dos_getcufsize(COUNT fd);
LONG dos_getfsize(COUNT fd);
BOOL dos_setfsize(COUNT fd, LONG size);
@ -478,8 +482,8 @@ COUNT DosSetTime(BYTE FAR * hp, BYTE FAR * mp, BYTE FAR * sp, BYTE FAR * hdp);
VOID DosGetDate(BYTE FAR * wdp, BYTE FAR * mp, BYTE FAR * mdp, COUNT FAR * yp);
COUNT DosSetDate(BYTE FAR * mp, BYTE FAR * mdp, COUNT FAR * yp);
WORD *is_leap_year_monthdays(int year);
WORD DaysFromYearMonthDay(WORD Year, WORD Month, WORD DayOfMonth);
UWORD *is_leap_year_monthdays(UWORD year);
UWORD DaysFromYearMonthDay(UWORD Year, UWORD Month, UWORD DayOfMonth);

View File

@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$";
/*
* $Log$
* Revision 1.8 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.7 2001/07/22 01:58:58 bartoldeman
* Support for Brian's FORMAT, DJGPP libc compilation, cleanups, MSCDEX
*
@ -119,7 +122,7 @@ VOID DayToBcd();
/* */
/* WARNING - THIS DRIVER IS NON-PORTABLE!!!! */
/* */
extern WORD days[2][13]; /* this is defined by SYSTIME.C */
extern UWORD days[2][13]; /* this is defined by SYSTIME.C */
static struct ClockRecord clk;
@ -135,8 +138,8 @@ static BYTE bcdHours;
static BYTE bcdSeconds;
static ULONG Ticks;
UWORD DaysSinceEpoch = 0;
*/
UWORD DaysSinceEpoch = 0;
BOOL ReadATClock(BYTE *, BYTE *, BYTE *, BYTE *);
@ -149,13 +152,12 @@ WORD FAR clk_driver(rqptr rp)
{
COUNT
c;
WORD *pdays;
UWORD *pdays;
BYTE bcd_days[4],
bcd_minutes,
bcd_hours,
bcd_seconds;
ULONG Ticks;
UWORD DaysSinceEpoch;
UWORD Month,
Day,
Year;

View File

@ -37,6 +37,9 @@ static BYTE *RcsId = "$Id$";
/*
* $Log$
* Revision 1.6 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.5 2001/04/15 03:21:50 bartoldeman
* See history.txt for the list of fixes.
*
@ -101,7 +104,7 @@ static BYTE *RcsId = "$Id$";
*/
WORD days[2][13] =
UWORD days[2][13] =
{
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365},
{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}
@ -114,7 +117,7 @@ extern request
return a pointer to an array with the days for that year
*/
WORD *is_leap_year_monthdays(int y)
UWORD *is_leap_year_monthdays(UWORD y)
{
/* this is correct in a strict mathematical sense
return ((y) & 3 ? days[0] : (y) % 100 ? days[1] : (y) % 400 ? days[0] : days[1]); */
@ -126,7 +129,7 @@ WORD *is_leap_year_monthdays(int y)
return days[1];
}
WORD DaysFromYearMonthDay(WORD Year, WORD Month, WORD DayOfMonth)
UWORD DaysFromYearMonthDay(UWORD Year, UWORD Month, UWORD DayOfMonth)
{
if (Year < 1980) return 0;
@ -190,9 +193,9 @@ BYTE FAR *wdp,
FAR * mdp;
COUNT FAR *yp;
{
WORD c;
WORD *pdays;
WORD Year,Month;
UWORD c;
UWORD *pdays;
UWORD Year,Month;
ExecuteClockDriverRequest(C_INPUT);
@ -234,7 +237,7 @@ BYTE FAR *mp,
FAR * mdp;
COUNT FAR *yp;
{
WORD *pdays, Month, DayOfMonth,Year;
UWORD *pdays, Month, DayOfMonth,Year;
Month = *mp;
DayOfMonth = *mdp;
Year = *yp;

View File

@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$";
/*
* $Log$
* Revision 1.17 2001/08/19 12:58:36 bartoldeman
* Time and date fixes, Ctrl-S/P, findfirst/next, FCBs, buffers, tsr unloading
*
* Revision 1.16 2001/07/23 12:47:42 bartoldeman
* FCB fixes and clean-ups, exec int21/ax=4b01, initdisk.c printf
*
@ -352,7 +355,7 @@ VOID new_psp(psp FAR * p, int psize)
/* File System parameters */
/* user stack pointer - int 21 */
p->ps_stack = (BYTE FAR *) - 1;
p->ps_stack = q->ps_stack;
/* file table - 0xff is unused */
for (i = 0; i < 20; i++)
p->ps_files[i] = 0xff;