flat assembler
Message board for the users of flat assembler.
Index
> Windows > device driver with fasm |
Author |
|
Kevin_Zheng 28 Sep 2003, 15:06
Hi,Wolf:
Please see the link, I think that it will answer your question. http://board.flatassembler.net/topic.php?t=256&start=30 |
|||
28 Sep 2003, 15:06 |
|
wolf 12 Oct 2003, 10:43
Thanks a lot Kevin_Zheng - I've rewritten the beep routine a bit:
Timer frequency is in low word and beep duration in milliseconds is in high word of BeepParam Code: invoke PsCreateSystemThread,ThreadHandle,THREAD_ALL_ACCESS,0,0,0,BeepThread,02000400h ... proc BeepThread,BeepParam .Interval dq ? enter invoke KeGetCurrentThread invoke KeSetPriorityThread,eax,LOW_REALTIME_PRIORITY + 1 mov al,0B6h out 43h,al mov eax,[BeepParam] out 42h,al mov al,ah out 42h,al in al,61h or al,3 out 61h,al shr eax,16 btr eax,15 mov ecx,10000 ; 1 millisecond = 10000*100 nanoseconds xor edx,edx mul ecx neg eax sbb edx,0 lea ecx,[.Interval] ; .Interval must be a 64 bit integer value mov dword[ecx],eax mov dword[ecx+4],edx invoke KeDelayExecutionThread,0,0,ecx in al,61h and al,0FCh out 61h,al invoke PsTerminateSystemThread,STATUS_SUCCESS return I put in a zero or a one, both worked. But I didn't find any definition for that in ntddk.h - does anybody know where the definition can be found? Another matter I'm still trying to figure out: Is it possible to intercept the timer interrupt with an Interrupt Service Routine in order to get a more precice timing if necessary? I found out that the thread delay is not really exact. It varies at about 20% of the given value. wolf |
|||
12 Oct 2003, 10:43 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.