Background technology
In embedded developping system, especially in the Linux embedded developping system, use two types machine, a kind of being used for compiles embedded software, because compilation process is often more consuming time, so PC (PC, Personal computer) machine or server are finished such work preferably generally to need performance.Another kind of then be used for embedded software is debugged, not high to the performance requirement of machine, the PC of poor-performing just can be competent at.
Present research and development system all adopts basically, and every developer all disposes a PC or a server that performance is higher, both has been used for compiling, also is used for debugging.
But in fact this is not necessary, and we can adopt a kind of by the shared high-performance server of many people, is used for compiling; Every developer PC of being equipped with a poor-performing more separately is used for debugging in addition, thereby can save the hardware cost of system development.Be competent at because the PC of low performance can be eliminated the machine that gets off with enterprise's office fully, and high performance server can be shared one by 10-20 people.
Yet this mode exists a problem to be: in embedded system development, it is quite convenient to debug by NFS (NFS, Network File System) mode, and debugging efficiency is very high, uses quite extensively.But NFS has a characteristic can't pass through gateway exactly, can only use in same subnet.Adopt a station server to add in the PC method of platform low performance, because some Target Boards adopt the virtual network port of USB, can only connect together with PC USB virtual network port and form an independently subnet, and server and PC also form an independently subnet, so can't use the NFS mode that the compiling result on the server directly is installed to local runtime on the debug target plate.
In this method, have to copy to the compiling result of server on the PC earlier, could behind the copy of installing on the debug target plate on the PC, debug then, have to increase once manual copy in this case, and recompility all will copy again each time, influences very much debugging efficiency.
Summary of the invention
The technical problem that the present invention solves is to provide a kind of system that is used to develop embedded software, add to use Single-Server that platform is cheap, the system of the PC of low performance, replace the system that uses many high-performance PC or server to carry out the embedded system development compiling, thereby reduce the cost of embedded system development, guarantee debugging efficiency efficiently simultaneously.
For solving the problems of the technologies described above, the invention provides a kind of system that is used to develop embedded software, a server that is used to compile embedded software, many the computers that are used for debugging embedded software, a plurality of debug target plates that are used to carry out embedded software, the quantity of Target Board is identical with the quantity of computer, native system comprises: server has a physics network interface, every computer has a physics network interface and a virtual network interface, each Target Board has a virtual network interface, server and many computers link to each other by physics network interface separately, form first subnet, corresponding with it the respectively Target Board of many computers links to each other by virtual network interface separately, form second subnet, every computer all is configured as ARP proxy, on the physics network interface of the computer that the IP address that disposes on the virtual network interface of each Target Board is corresponding with this Target Board and the virtual network interface respectively the IP address of configuration belong in the same subnet network segment, this subnet network segment is corresponding identical with one of them subnet network segment on the server physics network interface.
Dispose a plurality of IP address on the physics network interface of described server, its quantity is identical with the quantity of computer, and this a plurality of IP address belongs to the different subnet network segments, the corresponding computer of the subnet network segment.
Dispose an IP address on the physics network interface of described every computer and the virtual network interface, described two IP addresses belong to the same subnet network segment, and this subnet network segment is corresponding identical with one of them subnet network segment on the server physics network interface.
All dispose an IP address on the virtual network interface of described each Target Board, the IP address that disposes on the physics network interface of the computer that this IP address is corresponding with this Target Board and the virtual network interface belongs in the same subnet network segment.
Routing iinformation in the described server between configures physical network interface and the IP address.
Dispose the routing iinformation between physics network interface, virtual network interface and the IP address in described every computer.
Owing to adopted the system of the PC group of compiler server that the many people of separate unit share and Duo Tai low performance in the present invention, replace the embedded system development compiling system of traditional many high-performance PCs or server, reduced the cost of embedded system development effectively.Simultaneously owing to adopted ARP (address resolution protocol, Address Resolution protocol) agency two independently subnet combine and become a virtual subnet, overcome NFS effectively and can't pass through gateway, the deficiency that can only in same subnet, use, thereby can be on the debug target plate by NFS, directly debug after file system on the compiler server is installed, obtained the development efficiency of embedded system compiling efficiently.
Embodiment
Further set forth design of the present invention and the concrete method of operation of implementing below in conjunction with accompanying drawing.
Fig. 1 is according to the described system configuration schematic diagram that is used to develop embedded software of the embodiment of the invention.As shown in Figure 1, contain a station server and multiple pc machine, Target Board in the compiling development system of present embodiment, they connect in one network, but adhere to different subnets separately.Target Board links to each other with the PC virtual network port by the USB virtual network port; Server contains a network interface, PC contains a network interface and another one virtual network interface, adopt the most current present USB virtual network port to operate in the present embodiment, Target Board also contains a virtual network interface, has also adopted the USB virtual network port to operate in the present embodiment.For convenience of description, be example only among the embodiment with a station server 11, three PCs, three Target Boards, three PCs are respectively: first PC 21, second PC 22,23, three Target Boards of the 3rd PC are respectively: first Target Board 31, second Target Board 32, the 3rd Target Board 33.
For ease of describing, suppose: first PC 21 belongs to that 192.168.11.0-255 subnet, second PC 22 belong to the 192.168.12.0-255 subnet, the 3rd PC 23 belongs to the 192.168.13.0-255 subnet; And the address is: first PC 21 is 192.168.13.1mask:255.255.255.0 for 192.168.11.1mask (subnet mask): 255.255.255.0, the second PC 22:192.168.12.1mask:255.255.255.0, the 3rd PC 23.
Wherein dispose a plurality of IP address on the physics network interface of server 11, its quantity is identical with the quantity of PC, and this a plurality of IP address belongs to the different subnet network segments, the corresponding computer of the subnet network segment.Server 11 contains three IP addresses in an embodiment, corresponding with first PC 21, second PC 22, the 3rd PC 23, they also adhere to separately simultaneously: 192.168.11.0-255 subnet, 192.168.12.0-255 subnet, three different network segments of 192.168.13.0-255 subnet.Server 11 has also disposed the routing iinformation between physics network interface and the IP address.
Dispose an IP address on the physics network interface of every PC and the virtual network interface, two IP addresses belong to the same subnet network segment, and this subnet network segment is corresponding identical with one of them subnet network segment on the server physics network interface.For example respectively disposed an IP address on the physics network interface of first PC 21 and the virtual network interface, two IP addresses belong to the 192.168.11.0-255 subnet network segment, and this subnet network segment is corresponding identical with the 192.168.11.0-255 subnet network segment on the server 11 physics network interfaces.Dispose the routing iinformation between physics network interface, virtual network interface and the IP address in every computer.
All dispose an IP address on the virtual network interface of each Target Board, the IP address that disposes on the physics network interface of the computer that this IP address is corresponding with this Target Board and the virtual network interface belongs in the same subnet network segment.As IP address of configuration on the virtual network interface of first Target Board 31, the IP address that disposes on the physics network interface of first PC 21 that this IP address is corresponding with first Target Board 31 and the virtual network interface all belongs in the 192.168.11.0-255 subnet network segment.
Fig. 2 is the compile-debugging method implementing procedure schematic diagram according to the described embedded software of the embodiment of the invention.The concrete implementation step of this method is described with Fig. 2 below.
Step 201: server and many computers physics network interface by is separately linked to each other, form first subnet.
In the specific implementation, can at first dispose a plurality of IP address on the physics network interface of server, its quantity is identical with the quantity of computer, and this a plurality of IP address belongs to the different subnet network segments, the corresponding computer of the subnet network segment;
Secondly dispose an IP address on the physics network interface of every computer and virtual network interface, two IP addresses belong to the same subnet network segment, and this subnet network segment is corresponding identical with one of them subnet network segment on the server physics network interface.
Step 202: the Target Board that many computers are corresponding with it respectively links to each other by virtual network interface separately, forms second subnet.
Can all dispose an IP address on the virtual network interface of each Target Board, the IP address that disposes on the physics network interface of the computer that this IP address is corresponding with this Target Board and the virtual network interface belongs in the same subnet network segment.
Step 203: every computer is all disposed as ARP proxy, first subnet and second subnet are integrated into a virtual subnet.
During concrete enforcement, the routing iinformation between configures physical network interface and the IP address in server at first; The routing iinformation between configures physical network interface, virtual network interface and the IP address in every computer then; Enable (enable) every generation of computers reason ARP and route at last.
Step 204: by ARP proxy, on the debug target plate, directly the compiling result on the server is articulated to this locality, debugs.
The concrete implementation step that is used in below in the Linux embedded software developing is an example, in conjunction with Fig. 1 native system is described further.
Step 1: on server 11, add and debug the identical but IP address of different sub-network of PC number, dispose them respectively and be to network interface:
The first PC 21:192.168.11.1 mask:255.255.255.0
The second PC 22:192.168.12.1 mask:255.255.255.0
The 3rd PC 23:192.168.13.1 mask:255.255.255.0
And add corresponding routing iinformation:
#route?add-net?192.168.11.0netmask?255.255.255.0dev?eth0
#route?add-net?192.168.12.0netmask?255.255.255.0dev?eth0
#route?add-net?192.168.13.0netmask?255.255.255.0dev?eth0
Step 2: on the debugging PC, a certain IP address is with two IP addresses of the subnet network segment, as then disposing as follows to the IP address in first PC 21 on configuration and server on network interface and the virtual network port:
Network interface eth0:192.168.11.2mask 255.255.255.0
Virtual network port usb0:192.168.11.3mask 255.255.255.0
Step 3: the IP address of the PC same subnet network segment that configuration is attached thereto on Target Board, in first PC 21, the IP address configuration of the first debug target plate 31 that will link to each other with it is:
192.168.11.4mask?255.255.255.0
Step 4: debugging first PC 21 is example as ARP proxy, and the process that disposes at first PC 21 is:
At first add IP route table:
#ip?route?add?192.168.11.1?dev?eth0
#ip?route?add?192.168.11.0/24?dev?usb0?proto?kernel?src?192.168.11.2
Enable the proxy ARP and the route of (enable) first PC 21 then:
#?echo?1>/proc/sys/net/ipv4/conf/eth0/proxy_arp
#?echo?1>/proc/sys/net/ipv4/conf/usb0/proxy_arp
#?echo?1>/proc/sys/net/ipv4/ip_forward
From the foregoing description as can be seen, owing to the compiler server that has adopted the many people of separate unit to share in an embodiment and the PC group of Duo Tai low performance, replace the embedded system development pattern compiler of traditional many high-performance PCs or server, reduced the cost of embedded system development effectively.Simultaneously since adopted ARP proxy two independently subnet combine and become a virtual subnet, overcome NFS effectively and can't pass through gateway, the deficiency that can only in same subnet, use, thereby can with by NFS directly the file system on build-in services device on the debug target plate debug, obtained efficiently embedded system compiling development efficiency.