Panabit Support Board!

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5693|回复: 2

bypass功能

[复制链接]
发表于 2009-9-2 10:35:23 | 显示全部楼层 |阅读模式
搞到了一块支持bypass功能的主板,想测试bypass功能,可是不太会编程呀,看了一下文档,bypass功能倒好搞,可是watchdog功能就比较麻烦了,不是很懂。想请假老大们,能否共享一下adt_bpctrl和adt_monitor程序的源代码,我改造一下。


Set “High” sample code (Assembly):
mov dx,GPIO_Port + 38h ;GPIO_Port is 480h
in al,dx
newiodelay
or al,11000000b ;GPIO 38, 39 pull high to enable
out dx,al
Set “High” sample code (C Language):
//Set High
unsigned char dataIn;
unsigned char dataOut;
dataIn = inportb(0x480+0x38);
dataIn |= 0xc0;
outportb(dataIn, 0x480+0x38);


Watch Dog Function:
Support 1~255 second or minute selectable timeout interval.
Watch Code:
1) Enter configuration mode:
MOV DX,4EH
MOV AL,87H
OUT DX,AL
OUT DX,AL
2) Logical Device 8
MOV DX,4EH
MOV AL,07H
OUT DX,AL ;point to Logical Device Number Reg.
MOV DX,2FH
MOV AL,08H ;select Logical Device 8
OUT DX,AL
3) Enable WDTO# and set to KBRST#
MOV DX,2EH ;CR 30h: bit0 fill in 1
MOV AL,30H
OUT DX,AL
MOV DX,2FH
MOV AL,01H
OUT DX,AL
MOV DX,2EH ; CR F7h: bit4 fill in 0(clear event)
MOV AL,F7H
OUT DX,AL
MOV DX,2FH
2-19
Hardware Setup
IN DX,AL
AND AL,0F7H
OUT DX,AL
;CR F6h: bit0~7 fill in counter time
;CR F5h: bit1 fill in 1(Enable WDTO# & KBRST#)
Bit 3 (0: Second Mode,1:Minute Mode)
4) Exit configuration mode:
MOV DX,4EH
MOV AL,0AAH
OUT DX,,AL
 楼主| 发表于 2009-9-3 08:02:46 | 显示全部楼层
老大们为什么没有回答,必须专业版才能回答这些问题吗
发表于 2011-5-6 03:24:18 | 显示全部楼层
必须回帖。。。今天整了一天的c语言,一头雾水~~~前几天刚买到支持bypass的网卡。也得到了硬件代码....但是在程序编写和编译卡住了,编写完了又怎么样编译成FREEBSD下的程序?各种不懂
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|北京派网软件有限公司 ( ICP备案序号:京ICP备14008283号 )

GMT+8, 2024-11-24 18:59 , Processed in 0.065282 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表