[an error occurred while processing this directive]
|
компиляеться nmake /f itimer
makefile
NAME=itimer
$(NAME).vxd: $(NAME).obj
link -vxd -def:$(NAME).def $(NAME).obj
$(NAME).obj: $(NAME).asm
ml -coff -c -Cx -DMASM -DMASM6 -DBLD_COFF -DIS_32 $(NAME).asm
itimer.asm
.386p ; for 486 CPU or above due to the use
; of the "bswap" instruction
.xlist
include vmm.inc
include vwin32.inc
include shell.inc
include ifsmgr.inc
include ifs.inc
INCLUDE VPICD.Inc;
RTC_IRQ = 8
RegCmos_A = 0ah
RegCmos_B = 0bh
RegCmos_C = 0chSecond = 00h
Minutes = 02h
Hour = 04hEnableInterrupt = 040h
HourMode24 = 02h
RTClockFreqIndex = 06h
VxD_ICODE_SEG
BeginProc ITIMER_Device_Initmov edi,offset32 IRQdesc
VxDcall VPICD_Virtualize_IRQ
jc ITIMER_Device_Init_Erorr
mov [IRQHandle],eaxmov al,regcmos_a
call read_cmos
mov [old_reg_a],almov al,regcmos_b
call read_cmos
mov [old_reg_b],al
mov al,[old_reg_a]
and al,0f0h
or al,RTClockFreqIndexmov ah,regcmos_a
call write_cmosmov al,[old_reg_b]
or al,EnableInterrupt
mov ah,regcmos_b
call write_cmos
mov al,regcmos_c
call read_cmos
mov [old_reg_c],alxor eax,eax
mov [TickCounter],eaxmov al,Second
call read_cmos
mov [prevSecond],almov eax,[IRQHandle]
VxDcall VPICD_Physically_Unmask
clc
retITIMER_Device_Init_Erorr:
stc
retEndProc ITIMER_Device_Init
VxD_ICODE_ENDSVXD_LOCKED_DATA_SEG
IRQdesc VPICD_IRQ_Descriptor <8,VPICD_OPT_CAN_SHARE, \
offset32 itimer_HW_Int_Proc, \
0, \
0, \
0, \
0, \
500, 0>;IRQdesc VPICD_IRQ_Descriptor <5,VPICD_OPT_CAN_SHARE, \
; offset32 itimer_HW_Int_Proc, \
; offset32 itimer_Virt_Int_Proc, \
; offset32 itimer_VID_EOI_Proc, \
; offset32 itimer_VID_Mask_Change_Proc, \
; offset32 itimer_VID_IRET_Proc, \
; 500, 0>
IRQHandle dd ?
old_reg_a db ?
old_reg_b db ?
old_reg_c db ?
prevSecond db ?
TickCounter dd ?;
VXD_LOCKED_DATA_ENDS
VXD_LOCKED_CODE_SEGDeclare_Virtual_Device ITIMER,1,13,ITIMER_Control,Undefined_Device_ID,Undefined_Init_Order,,
BeginProc ITIMER_Control
Control_Dispatch SYS_DYNAMIC_DEVICE_INIT, ITIMER_Device_Init
Control_Dispatch SYS_DYNAMIC_DEVICE_EXIT, ITIMER_Device_Exit
Control_Dispatch W32_DEVICEIOCONTROL, ITIMER_ioctl
clc
ret
EndProc ITIMER_ControlBeginProc ITIMER_Device_Exit
mov al,[old_reg_a]
mov ah,RegCmos_A
call write_cmos
mov al,[old_reg_b]
mov ah,RegCmos_B
call write_cmosmov eax,[IRQHANDLE]
VxDCall VPICD_Physically_Maskmov eax,[IRQHANDLE]
VxDCall VPICD_Force_Default_Behaviorclc
ret
EndProc ITIMER_Device_Exit
BeginProc ITIMER_ioctlnop
mov ecx,[esi].dwIoControlCode
mov ebx,[esi].cbInBuffer
mov eax,[esi].lpvInBuffer
mov ebx,[esi].cbOutBuffer
mov eax,[esi].lpvOutBuffer
end_ioctl:
xor eax,eax
clc
ret
EndProc ITIMER_ioctl
BeginProc itimer_HW_Int_Procinc [TickCounter]
mov al,RegCmos_A
call read_cmos
and al,80h
jnz itimer_HW_Int_Proc_Endmov al,Second
call read_cmos
mov [prevSecond],almov eax,(1024*60)
cmp [TickCounter],eax
jle itimer_HW_Int_Proc_Endxor eax,eax
mov [TickCounter],eaxnop
int 3
nopitimer_HW_Int_Proc_End:
mov al,RegCmos_C
call read_cmos
mov eax,[IRQHandle]
VxDcall VPICD_Phys_EOI
clc
ret
EndProc itimer_HW_Int_Proc
BeginProc read_cmosor al,80h
out 070h,alnop
nopin al,71h
nop
nopret
EndProc read_cmos
BeginProc write_cmospush eax
or ah,80h
mov al,ah
out 070h,al
pop eaxnop
nopout 071h,al
nop
nopret
EndProc write_cmos
VXD_LOCKED_CODE_ENDS
;VxD_CODE_ENDSend
def-file
LIBRARY ITIMER DYNAMIC
DESCRIPTION 'ITIMER'
SEGMENTS
_LPTEXT CLASS 'LCODE' PRELOAD NONDISCARDABLE
_LTEXT CLASS 'LCODE' PRELOAD NONDISCARDABLE
_LDATA CLASS 'LCODE' PRELOAD NONDISCARDABLE
_TEXT CLASS 'LCODE' PRELOAD NONDISCARDABLE
_TLS CLASS 'LCODE' PRELOAD NONDISCARDABLE
_ITEXT CLASS 'ICODE' DISCARDABLE
_IDATA CLASS 'ICODE' DISCARDABLE
_PTEXT CLASS 'PCODE' NONDISCARDABLE
_PDATA CLASS 'PDATA' NONDISCARDABLE SHARED
_STEXT CLASS 'SCODE' RESIDENT
_SDATA CLASS 'SCODE' RESIDENT
_DBOSTART CLASS 'DBOCODE' PRELOAD NONDISCARDABLE CONFORMING
_DBOCODE CLASS 'DBOCODE' PRELOAD NONDISCARDABLE CONFORMING
_DBODATA CLASS 'DBOCODE' PRELOAD NONDISCARDABLE CONFORMING
_16ICODE CLASS '16ICODE' PRELOAD DISCARDABLE
_RCODE CLASS 'RCODE'
EXPORTS
ITIMER_DDB @1
E-mail: info@telesys.ru