|
tianmian
初级用户
 
积分 100
发帖 41
注册 2007-12-6
状态 离线
|
『楼 主』:
求助 关于dos网络编程(winsail)
使用 LLM 解释/回答一下
用的是bc3.1+winsail2.0;按照packet driver里面的说明文档把网卡驱动和相关的系统配置文件弄好了,在建立的工程中的config.sys也将网卡驱动开关加进去了。
但在调用socket()的时候总是返回1,查看得出错代号为2;
请问怎么解决?
Using bc3.1 + winsail2.0; followed the instructions in the packet driver's documentation to set up the network card driver and related system configuration files, and added the network card driver switch to the config.sys in the created project.
But when calling socket(), it always returns 1, and checking shows the error code is 2;
How to solve this?
|
|
2008-1-13 11:32 |
|
|
tianmian
初级用户
 
积分 100
发帖 41
注册 2007-12-6
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
我自己感觉很有可能是网卡驱动之类的没起来
I myself feel that it is very likely that the network card driver and so on have not started up
|
|
2008-1-13 11:36 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 3 楼』:
要注册TCP/IP协议栈
使用 LLM 解释/回答一下
如果要使用WinSail的TCP/IP协议栈,要有以下三个条件同时成立
(1)安装Packet网卡驱动程序,如果成功,会出现网卡的物理地址(即NIC地址)xx:xx:xx:xx:xx
(2)WinSail的配置文件Config.Sys中的NetCard段的NetCard键值配置为TRUE
NetCard = TRUE
(3)在main函数中,调用InitSystem函数之前,须向WinSail V2.0注册TCP/IP协议栈
::AfxRegisterNetcardEntry(::GlobalInitSocket, ::GlobalCloseSocket, ::EthernetEntry);
---------------------------------------------------------------------------------------------------
您可以用WinSail的演示程序Sail3000查看网络是否已经可靠运行,首先将Sail3000工程文件中的Config.Sys文件“NetCard”段的“NetCard”键值置为“TRUE”,运行Sail2000.exe文件,在桌面上有一图标“网络设置”,如果NIC地址不是“00:00:00:00:00”,那么您的Packet网卡驱动程序就已经加载成功了。
您程序的IP地址是由“Netcard”段的“My_IP”键值指定,在演示程序中,我将它配置成了169.254.82.133了。
Last edited by firstsail on 2008-1-14 at 02:52 PM ]
To use the TCP/IP stack of WinSail, the following three conditions must be met simultaneously
(1) Install the Packet network card driver. If successful, the physical address (i.e., NIC address) of the network card xx:xx:xx:xx:xx will appear
(2) The NetCard key value in the NetCard section of the configuration file Config.Sys of WinSail is configured as TRUE
NetCard = TRUE
(3) Before calling the InitSystem function in the main function, the TCP/IP stack must be registered with WinSail V2.0
::AfxRegisterNetcardEntry(::GlobalInitSocket, ::GlobalCloseSocket, ::EthernetEntry);
---------------------------------------------------------------------------------------------------
You can use the demonstration program Sail3000 of WinSail to check whether the network is running reliably. First, set the "NetCard" key value in the "NetCard" section of the Config.Sys file in the Sail3000 project file to "TRUE", run the Sail2000.exe file, there is an icon "Network Settings" on the desktop. If the NIC address is not "00:00:00:00:00", then your Packet network card driver has been successfully loaded.
The IP address of your program is specified by the "My_IP" key value in the "Netcard" section. In the demonstration program, I configured it as 169.254.82.133.
Last edited by firstsail on 2008-1-14 at 02:52 PM ]
|
|
2008-1-14 14:22 |
|
|
tianmian
初级用户
 
积分 100
发帖 41
注册 2007-12-6
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
网卡驱动已经起来了,我进行了一些socket编程,用的是udp通信协议,创建socket-绑定-发送数据;然而发送数据的时候老返回错误?
请问firstsail能给一段用winsail编程的例子程序吗
The network card driver has been up. I did some socket programming, using the UDP communication protocol, creating a socket - binding - sending data; however, when sending data, it always returns an error?
May I ask if firstsail can provide a sample program for Winsock programming?
|
|
2008-1-15 19:37 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
(1)下载“ http://www.firstsail.com.cn/software.html”的WinSail V2.0
(2)解压后,运行“WinToDos”目录中的“Udp_Demo.exe”,作为UDP协议的上位机,正确填写准备与之通讯的下位机IP地址及其端口号,程序中默认下位机的IP地址是“169.254.82.133”和端口号是“6200”,最后“点击启动UDP协议按钮”启动UDP
(3)解压后将Sail3000目录拷到纯DOS环境中。
(4)进入纯DOS环境运行WinSail V2.0的演示程序Sail2000.exe,进入桌面上的图标“QQ聊天窒”,别忘了将Sail3000中的Config.Sys文件的“Netcard”段的“Netcard”键值配置为“True”.
您可以发送一些文字,看一看上位机Udp_Demo是否收到内容。
(5)下位机的UDP协议应用例子,可看Sail3000目录中的Remote_N.Cpp文件和qq.cpp两个文件
Remote_N.cpp文件实现“文件传输”、“下位机界面上传”、“鼠标键盘按钮接收”等功能。
qq.cpp文件实现“QQ聊天窒”的聊天程序
在调试WinSail的“TCP/IP”协议时,请在纯DOS环境下进行!
Last edited by firstsail on 2008-1-15 at 08:58 PM ]
(1)Download "WinSail V2.0" from " http://www.firstsail.com.cn/software.html"
(2)After decompression, run "Udp_Demo.exe" in the "WinToDos" directory as the upper computer of the UDP protocol. Correctly fill in the IP address and port number of the lower computer that you are going to communicate with. The default IP address of the lower computer in the program is "169.254.82.133" and the port number is "6200". Finally, "click the start UDP protocol button" to start UDP.
(3)After decompression, copy the Sail3000 directory to the pure DOS environment.
(4)Enter the pure DOS environment to run the demo program Sail2000.exe of WinSail V2.0, enter the icon "QQ Chat Room" on the desktop. Don't forget to configure the "Netcard" key value in the "Netcard" segment of the Config.Sys file in Sail3000 as "True".
You can send some text to see if the upper computer Udp_Demo receives the content.
(5)For the application example of the UDP protocol of the lower computer, you can view the Remote_N.Cpp file and qq.cpp file in the Sail3000 directory.
The Remote_N.cpp file implements functions such as "file transfer", "upload of lower computer interface", and "reception of mouse, keyboard, and button".
The qq.cpp file implements the chat program of "QQ Chat Room".
When debugging the "TCP/IP" protocol of WinSail, please do it in the pure DOS environment!
Last edited by firstsail on 2008-1-15 at 08:58 PM ]
|
|
2008-1-15 20:51 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 6 楼』:
请重新下载WinSail
使用 LLM 解释/回答一下
不好意思,请重新到"http://www.firstsail.com.cn/software.html"下载更新后的“Sail3000”目录和“UdpDemo.Exe”程序
I'm sorry, please re-download the updated "Sail3000" directory and "UdpDemo.Exe" program from "http://www.firstsail.com.cn/software.html"
|
|
2008-1-15 21:15 |
|
|
tianmian
初级用户
 
积分 100
发帖 41
注册 2007-12-6
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
非常感谢你的指导,我现在去试试看
Thank you very much for your guidance, I'll go and try it now
|
|
2008-1-15 21:17 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
如果还有故障,可能:
(1)您的“路由器”或“集线器”过滤了您的IP包。建议直接采用“机联机”形式调试,注意“机联机”的网络线与连接“集线器”或“路由器”的网络线是不同的。
(2)或者将下位机的IP地址改为与上位机一样的“网络”地址。
Last edited by firstsail on 2008-1-15 at 09:33 PM ]
If there are still faults, it may be:
(1) Your "router" or "hub" has filtered your IP packets. It is recommended to directly use the "machine-to-machine connection" form for debugging. Note that the network cable for "machine-to-machine connection" is different from the network cable connecting to the "hub" or "router".
(2) Or change the IP address of the lower computer to the same "network" address as the upper computer.
Last edited by firstsail on 2008-1-15 at 09:33 PM ]
|
|
2008-1-15 21:31 |
|
|
tianmian
初级用户
 
积分 100
发帖 41
注册 2007-12-6
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
按照你说的做了提示“程序没有加载winsail tcp/udp协议栈”
Followed your instructions and prompted "The program did not load the winsail tcp/udp protocol stack"
|
|
2008-1-15 23:00 |
|
|
tianmian
初级用户
 
积分 100
发帖 41
注册 2007-12-6
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
这个应该是在winsail系统起来之前已经注册好的,程序为什么这样提示呢
我qq是70344130,不如加我为好友吧,我向你多多学习
This should have been registered before the winsail system was up. Why does the program prompt like this?
My QQ is 70344130. Why not add me as a friend? I can learn a lot from you.
|
|
2008-1-15 23:16 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
那是您的“Packet驱动程序”没有加载成功。
请提供以下几个信息上来
(1)网卡的型号
(2)C盘根目录下Config.Sys内容
(3)C盘根目录下AutoExec.bat内容
(4)是直接使用Packet驱动程序,还是NDIS2程序转Packet驱动程序。
1:如果是直接使用Packet驱动程序,此时的驱动程序是“Com”后缀文件或“Exe”后缀文件。注意加软中断向量参数0x60,如
LH Rtspkt.com 0x60
2:如果是使用NDIS2驱动程序转Packet驱动程序,此时的驱动程序是“Dos”后缀文件。到“网站”下载“PacketDriver驱动程序”,解压后参考“说明.txt”文件
Last edited by firstsail on 2008-1-16 at 01:36 PM ]
That's because your "Packet driver" didn't load successfully.
Please provide the following information:
(1) Model of the network card
(2) Content of Config.Sys in the root directory of drive C
(3) Content of AutoExec.bat in the root directory of drive C
(4) Whether you are directly using the Packet driver or using an NDIS2 driver to convert to the Packet driver.
1: If directly using the Packet driver, the driver at this time is a file with the ".Com" suffix or the ".Exe" suffix. Note to add the soft interrupt vector parameter 0x60, such as
LH Rtspkt.com 0x60
2: If using an NDIS2 driver to convert to the Packet driver, the driver at this time is a file with the ".Dos" suffix. Download the "PacketDriver driver" from the "website", decompress it, and refer to the "Instructions.txt" file
Last edited by firstsail on 2008-1-16 at 01:36 PM ]
|
|
2008-1-16 13:27 |
|
|
tianmian
初级用户
 
积分 100
发帖 41
注册 2007-12-6
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
但是我看过了 NIC 确实不为“00:00:00:00:00”,网卡驱动是按你提供的网站上的说明加载的
config.sys 如下:device=c:\windows\himem.sys/testmem:off
device=c:\windows\emm386.exe noems novcpi
devicehigh=c:\intel\protman.dos /i:c:\intel\RTL81xx
devicehigh=c:\intel\dis_pkt.dos
devicehigh=c:\intel\RTL81xx\Rtsnd.dos
dos=high,umb
stacks=12,256
files=30
注:intel是我网卡驱动所在的文件夹
autoexec.bat :
path c:\windows;c:\windows\command
lh smartdrv
c:\intel\netbind.com
还有一个现象,我想在程序中(winsail启动之后)用printf,或者CHPrintf打印一些中间标志信息,但我发现在程序运行的时候这些根本没输出,但看程序执行流程,这些语句是肯定被执行过的
But I have checked that the NIC is indeed not "00:00:00:00:00", and the network card driver is loaded according to the instructions on the website you provided.
The config.sys is as follows:
device=c:\windows\himem.sys/testmem:off
device=c:\windows\emm386.exe noems novcpi
devicehigh=c:\intel\protman.dos /i:c:\intel\RTL81xx
devicehigh=c:\intel\dis_pkt.dos
devicehigh=c:\intel\RTL81xx\Rtsnd.dos
dos=high,umb
stacks=12,256
files=30
Note: intel is the folder where my network card driver is located.
The autoexec.bat:
path c:\windows;c:\windows\command
lh smartdrv
c:\intel\netbind.com
There is also a phenomenon. I want to use printf or CHPrintf to print some intermediate flag information in the program (after winsail starts), but I find that these are not output at all when the program is running, but looking at the program execution process, these statements are definitely executed.
|
|
2008-1-16 16:49 |
|
|
tianmian
初级用户
 
积分 100
发帖 41
注册 2007-12-6
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
对了,在autoexec.bat中系统好像自动在c:\intel\netbind.com加上了
rem - By Windows 98 Network - c:\intel\netbind.com
By the way, in autoexec.bat, the system seems to have automatically added rem - By Windows 98 Network - c:\intel\netbind.com
|
|
2008-1-16 16:52 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
有没有加载成功“Packet Driver”最简单的方法就是用debug程序查看60H中断向量的内容有没有"PKT DRVR"的字符串
(1)第一步,在DOS命令行下执行“Debug”
(2)第二步,键入“d180”后回车,
(3)第三步,注意D180指示的连续四个字节jj kk mm nn,如果是00 00 00 00,则没有加载成功,否则第四步
(4)第四步,键入d nnmm:kkjj回车(注:nn mm kk jj是第三步时的结果)
(5)第五步,查看在屏幕右边有没有"PKT DRVR"的字符串,如果有则加载成功了,否则没有加载成功
Last edited by firstsail on 2008-1-16 at 07:16 PM ]
Is there a simplest way to load "Packet Driver" is to use the debug program to check whether the content of the 60H interrupt vector has the string "PKT DRVR"
(1) The first step, execute "Debug" under the DOS command line
(2) The second step, type "d180" and press Enter,
(3) The third step, pay attention to the consecutive four bytes jj kk mm nn indicated by D180. If it is 00 00 00 00, it is not loaded successfully, otherwise the fourth step
(4) The fourth step, type d nnmm:kkjj and press Enter (note: nn mm kk jj is the result of the third step)
(5) The fifth step, check whether there is the string "PKT DRVR" on the right side of the screen. If there is, it is loaded successfully, otherwise it is not loaded successfully
Last edited by firstsail on 2008-1-16 at 07:16 PM ]
|
|
2008-1-16 18:12 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
Originally posted by tianmian at 2008-1-16 16:52:
对了,在autoexec.bat中系统好像自动在c:\intel\netbind.com加上了
rem - By Windows 98 Network - c:\intel\netbind.com
(1)改回“c:\intel\netbind.com”
(2)Win98启动时迅速按住“F8”功能键,会弹出“Win98”菜单,共有6个菜单项,选择第“5”项进入“纯DOS”,即DOS7.0,或者将C盘根目录下的MsDos.Sys文件的“BootMenu”设置为“1”后重启动Win98,等到自动弹出菜单后执行第“5”项进入DOS7.0。修改msdos.sys文件前要先去掉文件的“只读”属性
BootMulti=0
BootMenu=1
BootWin=0
BootGui=0
(3)请将Protocol.ini文件贴进来看一下
Last edited by firstsail on 2008-1-16 at 07:03 PM ]
Originally posted by tianmian at 2008-1-16 16:52:
By the way, in autoexec.bat, the system seems to have automatically added c:\intel\netbind.com
rem - By Windows 98 Network - c:\intel\netbind.com
(1) Change back to "c:\intel\netbind.com"
(2) When Win98 starts, quickly press the "F8" function key, and a "Win98" menu will pop up, with a total of 6 menu items. Select item "5" to enter "Pure DOS", which is DOS7.0, or set the "BootMenu" in the MsDos.Sys file in the root directory of drive C to "1" and then restart Win98. Wait until the menu pops up automatically and then execute item "5" to enter DOS7.0. Before modifying the msdos.sys file, you need to remove the "Read-only" attribute of the file
BootMulti=0
BootMenu=1
BootWin=0
BootGui=0
(3) Please paste the Protocol.ini file for me to take a look
Last edited by firstsail on 2008-1-16 at 07:03 PM ]
|
|
2008-1-16 18:16 |
|