『楼 主』:
[求助]RTL8100BL的网卡驱动,某些寄存器无法操作
使用 LLM 解释/回答一下
dos 版本:6.22 bc版本:3.1 硬件架构:x86
目前遇到问题:发现一些寄存器不能正常操作:例如:Transmit Configuration Register这个寄存器,按8位 16位 32位写,然后按8位读发现每次根本就写不进去数值,我的8位操作outport()函数,16位操作outportb()函数,32位用的是static void outportd(unsigned short portid, unsigned long value) //output dword to I/O port
{
asm MOV DX, portid
asm DB 0x66 //
asm MOV AX, WORD PTR value // MOV EAX,value
asm DB 0x66, 0xEF // OUT DX,EAX
}
这个函数,有一点我不是特别理解,一般的寄存器如果支持32位的写,按道理来说它可以8位写,也可以16位写,但目前我不知道我的哪块操作有问题,谁做过这方面的工作,给点建议或者意见,多谢。。。。。。
DOS version: 6.22
BC version: 3.1
Hardware architecture: x86
Current problem encountered: Found that some registers cannot be operated normally: For example, the Transmit Configuration Register. When writing in 8-bit, 16-bit, 32-bit, and then reading in 8-bit, it is found that the value cannot be written in at all each time. My 8-bit operation is the outport() function, the 16-bit operation is the outportb() function, and for 32-bit, I use the static void outportd(unsigned short portid, unsigned long value) //output dword to I/O port
{
asm MOV DX, portid
asm DB 0x66 //
asm MOV AX, WORD PTR value // MOV EAX,value
asm DB 0x66, 0xEF // OUT DX,EAX
}
There is one point I don't particularly understand. Generally, if a register supports 32-bit writing, it should be able to write in 8-bit and 16-bit as well. But currently, I don't know which part of my operation is wrong. Who has done work in this aspect, give some suggestions or opinions, thanks......
|