I'm looking for someone to translate some Intel Architecture ASM code to Linux kernel code. I have an embedded board WAFER LX2 that came without drivers for Watchdog. I already have the skeleton code ready for driver in general, but need some help translating the part of the code that manipulates the hardware from ASM to C function.
So task is simple, translate the below ASM snippets into C functions for Linux Kernel 2.6
The task is only to translate the functions in RED to C function and buildable in Linux Kernel 2.6.x.
A BIOS function call (INT 15H) is used to control the Watchdog Timer:
AH ??" 6FH Sub-function:
* AL ??" 2: Sets the Watchdog Timer’s period.
* BL: Time-out value (Its unit-second is dependent on the item
“Watchdog Timer unit select?? in CMOS setup).
Call sub-function 2 to set the time-out period of Watchdog Timer first. If the time-out value is not zero, the Watchdog Timer starts counting down. While the timer value reaches zero, the system resets. To ensure that this reset condition does not occur, calling sub-function 2 must periodically refresh the Watchdog Timer. However, the Watchdog timer is disabled if the time-out value is set to zero.
; INITIAL TIMER PERIOD COUNTER
MOV AX, 6F02H ;setting the time-out value
MOV BL, 30 ;time-out value is 48 seconds
; ADD THE APPLICATION PROGRAM HERE
CMP EXIT_AP, 1 ;is the application over?
JNE W_LOOP ;No, restart the application
MOV AX, 6F02H ;disable Watchdog Timer
MOV BL, 0 ;
; EXIT ;