[comp.sys.ibm.pc] DOS 3.20 bug

jsa@kolvi.UUCP (03/25/87)

I noticed a really silly bug in MS-DOS 3.20 (maybe in PC-DOS 3.2 too).

DOS doesn't change date after midnight !!!!!!!!
-----------------------------------------------

And this is why:

Code to read time (in DOS CLOCK$ device driver in IO.SYS)
	XOR AH,AH		; read Time-of-day from BIOS
	INT 1Ah
	MOV BX,DX		; Note! Timer-overflow-flag in AL is LOST !
	MOV AX,CX
		... some code to calculate time
	MOV AX,CS:[0E53]	; read OLD DATE !
	STOSW			; and store date to buffer

However, few bytes later in drive device driver in the same IO.SYS
is the correct version to handle the same interrupt:

	XOR AH,AH
	INT 1Ah
	OR AL,AL		; check if timer overflow has occurred
	JZ over			; if not, skip date updating
	INC WORD PTR CS:[0E53]	; Update date
over:	...

So, if the first command you're giving just after midnight has something
to do with time ('dir', file saving etc.), the date update is lost.
BUT, if you change drive or give command like 'dir a:' when A: is empty,
the date is updated correctly !!!!!

That bug was NOT in DOS 3.1, so it seems that Microsoft has done
a good job bugging DOS 3.2 (remember all those other bugs in 3.2 :-).

While waiting update, we should

	a) never work "Round Midnight" :-)

	b) reboot our systems at midnight (cause this bug in DOS does
	   not affect to real time clocks)

	c) write a new clock device driver for DOS 3.2

I think I'll choose c) !

					Jari

-- 
Jari Salminen                          !   UUCP:  jsa@kolvi.UUCP
Helsinki University of Technology      !
Otakaari 5 A                           !
SF-02150 Espoo,  Finland               !   tel:   +358 0 4512918