SoFunction
Updated on 2025-04-11

How to get Linux to work in conjunction with Windows CE

 

Background introduction

Linux is an operating system similar to UNIX. It originated from a Finnish hobby called Linus Torvalds, but is now the most popular free operating system. Ordinary users work on Linux, browse websites, send emails and play games, and many universities and research institutions also complete daily computing tasks through Linux. In the commercial field, due to the low price, high security performance and very stable Linux system, many companies build their own servers on Linux. According to statistics from International Commercial Data Corporation (IDC), about one-third of the world's website servers use Linux as their operating system.

Windows CE, according to Microsoft's definition in Windows CE and Pocket PC: FAQ, is a series of components used by operating system developers to build proprietary operating systems. Original equipment manufacturers (OEMs) can purchase an integrated development environment from Microsoft called the "Windows CE Platform Development System" and use the system to assemble and compile a Windows CE-based operating system that includes a series of Windows CE-based components and developer applications or device drivers. Because Windows CE-based operating systems have a similar user interface to Microsoft's Windows family of operating systems, they are favored by many end users and developers. Currently, Windows CE has been widely used in portable devices such as mobile phones, handheld computers, personal digital assistants, fast translation communications, and electronic dictionaries.

For a long time, users of Windows CE devices also need to have a Windows 9x/2000/NT-based host for exchanging data with Windows CE devices. Run the Windows CE service software provided by Microsoft on this host. The software establishes a point-to-point connection with the Windows CE device through an RS-232 data cable. Users can access the Windows CE device through this service software, but other computers in the LAN cannot access the Windows CE device. If it is necessary to enable other computers in the LAN to access the device, it is necessary to install expensive dedicated network cards and related access devices for the device, which is a very uneconomical solution.

This article uses the PPP server owned by the Red Hat Linux 7.2 operating system to establish a TCP/IP connection between the Windows CE device, and then runs an FTP server on the Windows CE device so that the Linux host can access resources on the Windows CE device. Since this method is based on the RS-232 data cable that comes with Windows CE devices, it does not require purchasing any additional equipment, so it is a economical and practical solution. In addition, the solution described in this article is also applicable to Windows 9x/2000/NT hosts.

Connect Linux and Windows CE

Point to Point Protocol (PPP) is a protocol that transmits IP packets online through a serial port. Using the PPP protocol, a computer can log in to a remote host through communication devices such as serial port lines and telephone lines and utilize the resources of the host or the network where the host is located. In point-to-point communication, there are two parts: server and client, where the client requests network connection from the server, and the server receives the client's request to establish a network connection and allocates it to the client's corresponding network resources. When the network connection is established, the server and the client are strictly peer-to-peer. Since Linux operating systems usually come with PPP servers and client programs, while Windows CE operating systems usually only come with PPP client programs, we use Linux hosts as PPP servers and Windows CE devices as PPP clients.

In order to use the Linux host as the PPP server, we must first confirm whether the PPP server program pppd is already installed on the host. Usually the program is installed in the /usr/sbin directory. We can use the following command to find out whether this file exists in the directory:

ls /usr/sbin/pppd

Recently officially released Linux operating systems (such as Red Hat Linux/) are usually pre-installed with PPP server programs. If the Linux host has not installed the PPP server, then we should first download and install a PPP server program, such as pppd2.3.4. Installing this package may also require support for other packages. Since the installation of the application has exceeded the scope of this article, interested readers are advised to refer to other relevant materials for themselves.

After confirming that the PPP server is installed on the Linux host, we need to make some necessary configurations for the Linux host. In order to perform these configurations, we need to have root permissions.

Create the file /etc/ppp/peers/wince, the content is as follows:

       /dev/ttyS0 115200 crtscts

connect '/usr/sbin/chat -v -f /etc/ppp/'

noauth

local

90.0.0.1:90.0.0.2



Create a file /etc/ppp/, with the following content:

       TIMEOUT 3600

"CLIENT" "CLIENT\c"

"" "SERVER\c"



In the above two configuration files, using wince as the file name is only used to indicate that this configuration file is for a Windows CE device. Readers can also choose other file names themselves, such as palm or handheld, etc., but they must ensure that the two file names are consistent.

The configuration file /etc/ppp/peers/wince specifies that the serial port ttyS0 is used to establish a connection with the client device at a rate of 115,200 bps. The noauth parameter indicates that identity authentication is not required when the client requests a connection. In this peer connection, the IP of the server (Linux host) is 90.0.0.1 and the IP of the client (Windows Ce device) is 90.0.0.2. The TIMEOUT parameter in the configuration file /etc/ppp/ specifies the server's waiting time. If the client's connection request is still not received after this time, the current server program will be terminated. If any readers need to further understand the relevant configuration, please refer to the relevant documents of chat and pppd.

The configuration required on the Windows CE device is relatively simple. Since the default automatic connection function of Windows CE occupies the serial port of the device, we first need to stop using this function. Select "Settings->Communication->PC Connection" in the Start menu and set it to not enable connection to the PC to stop the function. Then we re-establish a connection, select "Program->Communication->Connection Manager" in the Start menu, then click the "New Connection" icon, name the new connection to Linux and specify the connection type to "Line Connection". In the next step, specify using COM1 to connect and set its communication rate to 115,200, and in the TCP/IP settings, specify that the IP of the device is 90.0.0.2. After clicking OK to save the disk, the connection will appear in the "Program->Communication" menu.

Use the following command to start the PPP server on the Linux host:

pppd call wince

After starting the newly created connection (Programs->Communications->Linux) on the Windows CE device, the network connection diagram will appear on the taskbar of the Windows CE device. The Linux host displays the following information to indicate that the connection has been successfully established with the Windows CE device:

       Serial connection established.

Using interface ppp0

Connect: ppp0 <--> ttyS0

found interface eth0 for proxy arp

local IP address 90.0.0.1

remote IP address 90.0.0.2



We can also use the ping command provided by the Linux host to verify that the connection has been successfully established with the Windows CE device:

ping 90.0.0.2

If the Linux host has successfully established a connection to a Windows CE device, we should be able to see information similar to the following:

       PING 90.0.0.2 (90.0.0.2) from 90.0.0.1 : 56(84) bytes of data.

64 bytes from 90.0.0.2: icmp_seq=0 ttl=32 time=26.587 msec

64 bytes from 90.0.0.2: icmp_seq=1 ttl=32 time=19.928 msec

64 bytes from 90.0.0.2: icmp_seq=2 ttl=32 time=19.939 msec

64 bytes from 90.0.0.2: icmp_seq=3 ttl=32 time=19.947 msec



FTP software based on Windows CE

After we successfully establish a PPP connection between the Linux host and the Windows CE device, what should we do next? Of course, we need some suitable programs for file exchange between a Linux host and a Windows CE device. We are now able to use the TCP/IP protocol to transfer data between Linux hosts and Windows CE devices, and it is obvious that the FTP program is a suitable choice.

FTP (File Transport Protocol) is a widely used protocol for file exchange on the network. Due to the requirements of data transmission reliability, FTP is a TCP/IP-based transmission protocol. In an FTP session, there is a server side and a client. The client actively connects to the server and sends file transfer requests to the server. The server waits for the client's access and processes the client's file transfer requests.

PE FTP Explorer is a very popular FTP client software based on Windows CE, and is also a fully functional file browser. Similar to FTP clients such as Cute FTP and WS FTP, which are commonly used on PCs, users can use the mouse (pointer) to zoom the directory tree on the local and server side, upload or download files and directories, or rename and delete files or directories. This software is available from the CE Archive website (/). Readers on this website can also find another popular FTP client vxFTP.

Although the functions of the FTP client software are already very complete and simple to operate, it is still inevitable to receive the limitation of a narrow display of a portable device. If an FTP server can be established on a portable device, the file transfer operation can be performed on a Linux host using commonly used FTP clients.

It is such an FTP server software based on Windows CE. This applet with only 28.5 KB can handle most common FTP requests, except that it does not provide identity authentication and Passive transmission mode. Use the Windows CE service software provided by Microsoft to upload it to any directory of the portable device. After starting the program, a small icon similar to a computer connecting two portable devices will appear on the task bar. After clicking the icon with the pointer, a small control window will appear. Here we can change the port number of the FTP server or terminate the program.

Can/Or/get. Readers can also find more useful applets on these two websites.

other

If a reader is using a Windows 9x/2000/NT host, you can also use the linear cable connection function provided by Windows to establish a PPP connection with Windows CE devices.

For example: On a Windows 2000 host, select Settings -> Network and Dial-up Connections -> New Connection from the Start menu. In the Network Connection Wizard that appears, select Connect directly to another computer and configure the machine as a host. After selecting the appropriate communication port and configuring the communication rate, the host acts as a PPP server for the client to access. Similarly, after creating a new connection on a Windows CE device, specifying the appropriate communication port and configuring communication parameters, you can establish a starting point-to-point connection with the Windows host. Since the Windows host is already equipped with a Dynamic Network Address Allocation (DHCP) server, Windows CE devices can use both the static IP address specified by the implementation, as well as the dynamic IP address assigned by the server in real time. However, since the maximum transfer rate allowed for linear cable connections is 19,200 bps, using Windows 9x/2000/NT host as a PPP server does not seem to be as practical as Linux hosts.

If the PPP server is set as a gateway, all machines in the LAN can access Windows CE devices that are already connected to the network through the gateway. On a Linux host, the host can be set as a transparent gateway through ipchains; on a Windows 9x/2000/NT host, it can be set as a transparent gateway through proxy server software such as Win Proxy. If any readers need to learn more about how to set Linux or Windows hosts as transparent gateways, please read other reference materials yourself.

Article entry: csh     Editor in charge: csh