CN101872335B - CPU console redirecting method and system and CPUs - Google Patents

CPU console redirecting method and system and CPUs Download PDF

Info

Publication number
CN101872335B
CN101872335B CN2010101272344A CN201010127234A CN101872335B CN 101872335 B CN101872335 B CN 101872335B CN 2010101272344 A CN2010101272344 A CN 2010101272344A CN 201010127234 A CN201010127234 A CN 201010127234A CN 101872335 B CN101872335 B CN 101872335B
Authority
CN
China
Prior art keywords
cpu
bus
data
read
write
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2010101272344A
Other languages
Chinese (zh)
Other versions
CN101872335A (en
Inventor
黄毅
赵先林
胡扬忠
邬伟琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN2010101272344A priority Critical patent/CN101872335B/en
Publication of CN101872335A publication Critical patent/CN101872335A/en
Application granted granted Critical
Publication of CN101872335B publication Critical patent/CN101872335B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses CPU console redirecting method and system and CPUs. The system comprises a plurality of CPUs connected through buses, and the plurality of CPUs include at least one first CPU and at least one second CPU. The method comprises the following steps of: distributing buffer areas to the second CPUs on the internal memories of the first CPUs; constructing virtual bus equipment respectively on the first CPUs and the second CPUs and associating the first CPUs and the second CPUs through the virtual bus equipment; and carrying out reading and writing operations on CPU information through the buffer areas by the first CPUs and the second CPUs. In the embodiment of the invention, the information of the second CPUs is read and written on the first CPUs, and the reading and writing operations are carried out without a serial port; and moreover, in the redirecting process of a CPU console, a network is not depended, and the first CPUs can view all run progresses of the second CPUs and the print information of a kernel, thereby the convenience and the flexibility for reading the CPU information are enhanced.

Description

CPU control desk reorientation method, system and CPU
Technical field
The application relates to field of computer technology, relates in particular to CPU (Central Processing Unit, central processing unit) control desk reorientation method, system and CPU.
Background technology
The various systems that increase income that derive by Unix, like Linux, Solaris; FreeBSD etc.; Be operating system at present most active and competitive power, wherein Linux is widely used in every field with the pattern of its open source code and the characteristics of security reliably and stability.Based on comprising hundreds and thousands of CPU in the large computer system of linux system usually; These CPU are through PCI (Peripheral ComponentInterconnect; External unit is interconnected) or PCIe (Peripheral Component Interconnectexpress, the high speed external unit is interconnected) carry out interconnected.
In the prior art, the information that operates on the CPU is carried out read-write operation and checked that these information comprise the type information and the application information of operating system through the CPU serial ports that picks out; But; Though serial ports is commonly used and reliable, the CPU in system more just need pick out a large amount of Serial Port Lines for different CPU; Perhaps pick out a spot of Serial Port Line and between different CPU, switch, so operating process is more loaded down with trivial details; In addition; Also can operate CPU information, but, need behind system initialization, could use because this mode depends on network through network tool; Therefore the real time print information that can't check running process causes reading whole CPU information.
Summary of the invention
The purpose of the application embodiment provides CPU control desk reorientation method, system and CPU, when solving in the prior art in reading system CPU information operating process loaded down with trivial details, and be difficult to read the problem of whole CPU information.
For solving the problems of the technologies described above, the application embodiment provides following technical scheme:
A kind of CPU control desk reorientation method is applied to comprise in the computer system of some CPU, links to each other through bus between said some CPU, comprises at least one CPU and at least one the 2nd CPU among said some CPU, comprising:
It on the internal memory of a said CPU said the 2nd CPU allocation buffer;
On a said CPU and the 2nd CPU, make up virtual bus equipment respectively, through said CPU of said virtual bus device association and the 2nd CPU;
A said CPU and the 2nd CPU carry out the read-write operation of CPU information through said buffer zone.
Said bus is specially the PCIe bus, and said is that the 2nd CPU allocation buffer comprises on the internal memory of a CPU:
On the internal memory of a said CPU, be respectively each the 2nd CPU and distribute input block and output buffer, each said buffer zone comprises read pointer, write pointer and data field;
A said CPU and the 2nd CPU are mapped to the pci bus space respectively.
The said virtual bus equipment that on a CPU, makes up comprises:
A said CPU makes up character device and drives and corresponding application program, corresponding one the 2nd CPU of each character device;
With the virtual bus facility registration is said character device, and said application program is through driving the read-write operation of realizing said character device.
The said virtual bus equipment that on the 2nd CPU, makes up comprises:
It is virtual bus equipment that said the 2nd CPU in the end specifies console device in control desk command line parameter;
Is console device according to said command line parameter with said virtual bus facility registration, and is virtual terminal equipment with said virtual bus facility registration.
A said CPU and the 2nd CPU comprise through the read-write operation that said buffer zone carries out CPU information:
The write pointer of the one CPU operation input block writes the data field of said input block with the data of the said CPU of input, and the read pointer of said the 2nd CPU operation input block reads the data in the data field, said input block;
The write pointer of the 2nd CPU operation output buffer writes the data field of said output buffer with the control desk data of said the 2nd CPU, and the read pointer of said CPU operation output buffer reads the data in the said output buffer data field.
A kind of CPU control desk Redirectional system comprises some CPU that link to each other through bus, comprises at least one CPU and at least one the 2nd CPU among said some CPU, wherein,
A said CPU is used to make up virtual bus equipment, and deposits within it and be said the 2nd CPU allocation buffer;
Said the 2nd CPU is used to make up virtual bus equipment;
A said CPU and said the 2nd CPU virtual bus equipment through said structure carries out related, and carries out the read-write operation of CPU information through said buffer zone.
Said bus is specially the PCIe bus; A said CPU; Specifically be used for depositing within it and be respectively each the 2nd CPU and distribute input block and output buffer; Each said buffer zone comprises read pointer, write pointer and data field, and a said CPU and the 2nd CPU are mapped to the pci bus space respectively.A kind of CPU; Be applied to comprise in the computer system of some CPU, link to each other through bus between said some CPU, comprise at least one CPU and at least one the 2nd CPU among said some CPU; Said a kind of CPU is the CPU in the said computer system, comprising:
Allocation units are used on the internal memory of said CPU, being said the 2nd CPU allocation buffer;
Associative cell is used on said CPU, making up virtual bus equipment, and related with the 2nd CPU that has made up virtual bus equipment equally through said virtual bus equipment;
Operating unit is used for through said buffer zone the CPU information of said the 2nd CPU being carried out read-write operation.
Said bus is specially the PCIe bus, and said allocation units comprise:
Buffer zone distributes subelement, is used on the internal memory of said CPU, being respectively each the 2nd CPU and distributes input block and output buffer, and each said buffer zone comprises read pointer, write pointer and data field;
The spatial mappings subelement is used for said CPU and the 2nd CPU are mapped to the pci bus space respectively.
Said associative cell comprises:
The structure construction subelement is used to make up character device and drives and corresponding application program, corresponding one the 2nd CPU of each character device;
The facility registration subelement, being used for the virtual bus facility registration is said character device, said application program is through driving the read-write operation of realizing character device.
Said operating unit comprises:
Operator unit, input block is used to operate the write pointer of input block, the data of the said CPU of input is write the data field of said input block;
Output buffer operator unit is used to operate the read pointer of output buffer, reads the control desk data that write by said the 2nd CPU in the said output buffer data field.
A kind of CPU; Be applied to comprise in the computer system of some CPU, link to each other through bus between said some CPU, comprise at least one CPU and at least one the 2nd CPU among said some CPU; Said a kind of CPU is the 2nd CPU in the said computer system, comprising:
Associative cell is used on said CPU, making up virtual bus equipment, and related with a CPU who has made up virtual bus equipment equally through said virtual bus equipment, has distributed buffer zone for said the 2nd CPU on the internal memory on the said CPU;
Operating unit is used for through said buffer zone the CPU information of a said CPU being carried out read-write operation.
Said bus is specially the PCIe bus, and has distributed input block and output buffer for said CPU on the internal memory of a said CPU, and said each buffer zone comprises read pointer, write pointer and data field, and said associative cell comprises:
Console device is specified subelement, and being used in the end, a control desk command line parameter appointment console device is a virtual bus equipment;
Virtual bus facility registration subelement, being used for according to said command line parameter is console device with said virtual bus facility registration, and is virtual terminal equipment with said virtual bus facility registration.
Said operating unit comprises:
Operator unit, input block is used to operate the read pointer of input block, reads the input data that write by a CPU in the data field, said input block;
Output buffer operator unit is used to operate the output buffer write pointer, the control desk data of said CPU is write the data field of said output buffer.
It is thus clear that; The application embodiment is applied in and comprises in some computer systems through the continuous CPU of bus; Comprising at least one CPU and at least one the 2nd CPU among some CPU, is said the 2nd CPU allocation buffer on the internal memory of a CPU, and on a CPU and the 2nd CPU, makes up virtual bus equipment respectively; The one CPU and the 2nd CPU pass through the virtual bus device association, and carry out the read-write operation of CPU information through buffer zone.Thereby among the application embodiment through being that the 2nd CPU allocation buffer is redirected to the 2nd CPU control desk on the one CPU on the CPU; Be implemented in a CPU thus and upward the information of the 2nd CPU carried out read-write operation; CPU quantity more for a long time in system; Needn't carry out read-write operation through serial ports, and because the application embodiment in carrying out CPU control desk redirection process, does not rely on network; Therefore the CPU type information that can check the 2nd all running processes of CPU has strengthened the convenience and the dirigibility that CPU information is read of system thus.
Description of drawings
In order to be illustrated more clearly in the application embodiment or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously, the accompanying drawing in describing below only is some embodiment that put down in writing among the application, for those of ordinary skills; Under the prerequisite of not paying creative work property, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the first embodiment process flow diagram of the application CPU control desk reorientation method;
Fig. 2 is the first embodiment process flow diagram of the application CPU control desk reorientation method;
Fig. 3 is based on many CPU interconnect architecture synoptic diagram of PCIe among the application embodiment;
Fig. 4 is the distribution structure synoptic diagram in PCI space among the application embodiment;
Fig. 5 A carries out the synoptic diagram of read-write operation to buffer zone for master-slave cpu among the application embodiment;
Fig. 5 B is for carrying out the application flow synoptic diagram of read-write operation among the application embodiment to buffer zone;
Fig. 6 is the embodiment block diagram of the application CPU control desk Redirectional system;
Fig. 7 A is the embodiment block diagram of a kind of CPU of the application;
Fig. 7 B is the embodiment block diagram of allocation units among the CPU shown in the application Fig. 7 A;
Fig. 7 C is the embodiment block diagram of associative cell among the CPU shown in the application Fig. 7 A;
Fig. 7 D is the embodiment block diagram of operating unit among the CPU shown in the application Fig. 7 A;
Fig. 8 A is the embodiment block diagram of the another kind of CPU of the application;
Fig. 8 B is the embodiment block diagram of associative cell among the CPU shown in the application Fig. 8 A;
Fig. 8 C is the embodiment block diagram of operating unit among the CPU shown in the application Fig. 8 A.
Embodiment
The application embodiment provides a kind of CPU control desk reorientation method, system and CPU.
In order to make those skilled in the art person understand the technical scheme among the application embodiment better; And make the above-mentioned purpose of the application embodiment, feature and advantage can be more obviously understandable, below in conjunction with accompanying drawing technical scheme among the application embodiment done further detailed explanation.
The application embodiment is applied to comprise in the computer system of some CPU, links to each other through bus between some CPU, and this bus is generally PCI or PCIe; In some CPU, comprise at least one CPU and at least one the 2nd CPU; In realizing the process that the CPU control desk is redirected, specify one the one CPU in the system usually, a CPU is called host CPU; With remaining CPU as the 2nd CPU; These the 2nd CPU are called from CPU, will be redirected on the host CPU from the CPU control desk after so that on host CPU, realize to read-write operation from CPU information.
Referring to Fig. 1, be the first embodiment process flow diagram of the application CPU control desk reorientation method;
Step 101: be the 2nd CPU allocation buffer on the internal memory of a CPU.
Step 102: on a CPU and the 2nd CPU, make up virtual bus equipment respectively, through virtual bus device association the one CPU and the 2nd CPU.
Step 103: a CPU and the 2nd CPU carry out the read-write operation of CPU information through buffer zone, finish current flow process.
Referring to Fig. 2, be the second embodiment process flow diagram of the application CPU control desk reorientation method, this embodiment shows redirected detailed process, and wherein bus is the PCIe bus:
Step 201: on the internal memory of a CPU, be respectively each the 2nd CPU and distribute input block and output buffer, each buffer zone comprises read pointer, write pointer and data field.
Step 202 a: CPU and the 2nd CPU are mapped to the pci bus space respectively.
Step 203: a CPU makes up character device and drives and corresponding application program, corresponding one the 2nd CPU of each character device.
Step 204: with the virtual bus facility registration is character device, and application program is through driving the read-write operation of realizing character device.
Step 205: it is virtual bus equipment that the 2nd CPU in the end specifies console device in control desk command line parameter.
Step 206: is console device according to command line parameter with the virtual bus facility registration, and is virtual terminal equipment with the virtual bus facility registration.
Step 207: judge that which buffer zone need carry out data read-write operation, if the input block, then execution in step 208; If output buffer, then execution in step 210.
Step 208: a CPU operates the write pointer of input block, the data of input the one CPU is write the data field of input block.
Step 209: the read pointer of the 2nd CPU operation input block, read the data in the data field, input block, finish current flow process.
Step 210: the 2nd CPU operates the write pointer of output buffer, the control desk data of the 2nd CPU is write the data field of output buffer.
Step 211: the read pointer of CPU operation output buffer, read the data in the output buffer data field, finish current flow process.
The core of the application embodiment is to have realized that with virtual tty device model the control desk between many CPU is redirected; Key point is the virtual tty device model that how between the CPU that the redirected relation of control desk takes place, to make up and to realize playing function served as bridge; Emphasis is how to realize that on different CPU buffer zone is shared and how shared buffer is carried out synchronous read-write operation, how virtual virtual tty equipment, console device and the character device of turning to of this device model.
Referring to Fig. 3, among the application embodiment based on many CPU interconnect architecture synoptic diagram of PCIe.
N CPU has been shown among Fig. 3; Wherein CPU 0 is a host CPU; CPU 1 to CPU N is from CPU, and these are connected on the PCIe Switch (interchanger) as PCIe equipment from CPU, and PCIe Switch (interchanger) links to each other with the Root complex (root complex) of host CPU; PCIe Switch can be one-level or multilevel hierarchy, all can move linux system on each CPU.
Referring to Fig. 4, be the distribution structure synoptic diagram in PCI space among the application embodiment.
Wherein, host CPU 0 distributes read-write buffer zone, tty_buf_in as shown in Figure 2 and tty_buf_out for each CPU; Wherein tty_buf_in is the input block; Tty_buf_out is an output buffer, and these two buffer zones all are mapped to the PCI space, and each is respectively read pointer and write pointer from r and the w in the CPU buffer zone; Buf is the data field, and BUF_SIZE is the size of data field; Host CPU 0 is the buffer zone that extremely distributes from CPU N from CPU1, and extremely all is mapped to the PCI space from CPU N from CPU1, realizes that thus 0 pair of host CPU passes through operation buffer tty_buf_in and tty_buf_out realizes the read-write operation from CPU.
Referring to Fig. 5 A, buffer zone is carried out the synoptic diagram of read-write operation for master-slave cpu among the application embodiment.
Wherein, supposing that host CPU is CPU0, is CPUn from CPU.On the one hand; Can on the terminal at host CPU 0 place, run application, this application program is carried out the kernel that will pass to CPU0 from the data that the standard input is read, the write pointer w of the kernel operations tty_buf_in of CPU0; Write data the data field of input block tty_buf_in; When in the data field of tty_buf_in data being arranged, will operate the read pointer r of tty_buf_in from the kernel of CPUn, read the data in the tty_buf_in data field; On the other hand; Kernel operations write pointer w from CPUn; Send to this to all from data field that the data of the control desk of CPUn and console device are write output buffer tty_buf_out; When there were data the data field of tty_buf_out, the kernel operations read pointer r of host CPU 0 read the data in the tty_buf_out data field application program of operation on the host CPU 0; This application program shows the data that receive in standard output, realize thus exporting at the terminal at host CPU 0 place from the CPU information of CPUn.Hence one can see that, just is equivalent to be redirected on the host CPU 0 from the control desk (console) of CPUn; In addition,, also availablely write full mode of just stopping, this application embodiment is not limited the mode that the write operation of buffer zone both can adopt circulation to cover.
Below in conjunction with Fig. 3 to Fig. 5 A, the redirection process of the application embodiment is described through concrete application.
In the application process that is described below, virtual bus equipment representes with pcitty, from CPU one side; Pcitty is expressed as console device and virtual tty equipment; In host CPU one side, pcitty is expressed as character device and corresponding application program thereof, and redirection process comprises:
One, being redirected from the CPU control desk
In linux system; The type information of CPU core (printk) can output on the specified all devices of command line parameter console usually; But last equipment of parameter c onsole appointment just can become console device (/dev/console); The standard input of application program, output all can be directed on the console device when initialization, and all inputs, output all are that console device is operated.
At first; Be appointed as last console command line parameter to virtual bus equipment pcitty, for example, console=pcitty0; Wherein pcitty0 representes first pcitty equipment; And the console command line parameter of appointment passed to the kernel from CPU, when the kernel of CPU is resolved this console command line parameter, last parameter p citty0 is initialized as console device;
Secondly, in the pcitty driver module, make up the console structure, register pcitty as console device, realize setup (foundation), device (driving), the write methods such as (writing) of console device thus.Wherein, the setup method is used for the buffer zone tty_buf_in of pcitty and tty_buf_out by the PCI spatial mappings driving after the mapping and just can visiting this two buffer zones to kernel spacing; The device method is used for that control desk is driven the tty that is appointed as pcitty and drives (next section that is structured in that tty drives is described); When opening console device; Tty drives through calling the device method, drives the tty of console device and pcitty and binds, and that is to say; All all can be converted into tty and drive the read-write operation to buffer zone tty_buf_in and tty_buf_out the read-write operation of console device; The write method is used for type information is outputed to current control desk, promptly writes the tty_buf_out buffer zone;
At last, in the pcitty driver module, be initialized as a virtual tty equipment to pcitty, promptly register tty and drive and tty equipment, realize open (opening), close (closing), the write methods such as (writing) of virtual tty device drives thus.Wherein, The open method is used to open virtual tty equipment; This method can be added up the number of times of open through increasing progressively a reference counter, for the first time can timer of initialization during open, be used for regularly reading the data of tty_buf_in; When opening console device, kernel tty core can drive this method of readjustment through the tty that has bound after calling the device method of console device; The close method is corresponding with the open method, and the reference counter that is used to successively decrease when counter is 0, is destroyed this timer, and when closing control platform equipment, the tty core drives this method of readjustment through tty; The write method is used for writing corresponding buffer region to the received data of tty core through driving; When to the console device write data; The tty core drives this method of readjustment through tty, writes the tty_buf_out buffer zone to data, upgrades write pointer simultaneously; In case tty_buf_out has data in the data field, host CPU will read these data and output to standard output; Because the tty device drives is not read method; Therefore the application embodiment can regularly inquire about the tty_buf_in buffer zone through timer; In case host CPU is to this buffer zone write data, then timer will sense data, upgrades read pointer; And give the tty core data push, the tty core is handled data accordingly.
Two, create driving and application program on the host CPU
At first, on host CPU, bufcreate, comprise tty_buf_in and tty_buf_out,, be mapped to the PCI space to buffer zone, can find buffer location separately thereby make from CPU if there be N then need distribute N pcitty buffer zone from CPU;
Secondly, make up the file operation structure of character device pcitty, realize open (opening), close (closing), read (reading), write (writing), poll methods of operating such as (calling).Wherein, the open method is used to open character device pcitty, and safeguards a reference counter; Make character device pcitty be opened at the most once simultaneously; This method also can timer of initialization, is used for periodic monitor tty_buf_in and tty_buf_out, if the tty_buf_in buffer zone less than or tty_buf_out buffer zone non-NULL; Then the timer function can wake the process that is blocked on the select function up, makes this process can write the tty_buf_in buffer zone or reads the tty_buf_out buffer zone; The close method is corresponding with the open method, is used to the reference counter that successively decreases, and destroys timer; The read method is used for the data of tty_buf_out are read buffer zone, and upgrades read pointer; The write method is used for writing tty_buf_in to the data of buffer zone, upgrades write pointer; The poll method is used to call the select function, thereby application program pcitty is blocked, and after application program is waken up by timer, then can carry out read-write operation;
At last; Registration character device pcitty; The operation that reads and writes data of character device pcitty realizes through the method in the readjustment aforementioned document operating structure; Each is from all corresponding character device pcitty n (n is 1 to N integer) of CPU, and each control desk from CPU can both be redirected on the host CPU like this.
Three, host CPU and between the CPU to the read-write operation of buffer zone
At first, open character device pcitty n, pcitty n is n, and the device descriptor behind this character device of successfully opening is called fdn from CPU corresponding characters equipment, and standard input descriptor table is shown 0, and standard output descriptor table is shown 1;
Secondly; When carrying out write operation, 0 be blocked in the select function the descriptor set of reading close, if on 0 to data inputs should be arranged; The descriptor set of writing that is blocked in the select function to fdn again closes; If fdn can write, then, promptly write the tty_buf_in buffer zone writing on the fdn from 0 data read; When carrying out read operation, the descriptor set of reading that is blocked in fdn the select function closes, if having data readable on the fdn, then reads data on 1, promptly reads standard output to the data among the tty_buf_out;
At last, aforementioned read-write operation is carried out in circulation, will be converted into the read-write operation from CPU at the read-write operation that host CPU belongs on the terminal.
Referring to Fig. 5 B, for buffer zone being carried out the application flow synoptic diagram of read-write operation:
Step 501: open character device fdn=/dev/pcitty n.
Step 502: judge the read operation of select 0 and character device fdn, if having data readable on select 0 or the fdn, then execution in step 503; If select makes mistakes, then return step 502.
Step 503: judge that whether data are arranged on 0 is readable, if having, then execution in step 504; Otherwise, execution in step 506.
Step 504: judge the write operation of select fdn, but if the fdn write data, then execution in step 505; If fdn can not write data, then execution in step 506.
Step 505: read 0 data and the data of reading are write fdn.
Step 506: judge whether fdn has data readable, if having, then execution in step 507; If there are not data readable, then return step 502.
Step 507: the data that read fdn are returned step 501 to outputing to 1.
In addition, need to prove that set forth the application embodiment with the redirected instance of the many-one of master-slave cpu pattern above, still, the embodiment of the invention can realize being redirected between any two CPU; And; Though the interconnect architecture that the present invention has been basic description between the CPU with linux system and PCI/PCIe,, no matter adopt any bus interconnected between the CPU; As long as buffer zone can be realized sharing; And no matter CPU goes up what operating system of operation, as long as this operating system system supports the virtual of tty equipment and console device, just can realize the redirected of control desk between any CPU according to the application embodiment.
Corresponding with the embodiment of the application CPU control desk reorientation method, the application also provides the embodiment of CPU control desk Redirectional system and CPU.
Referring to Fig. 6, be the embodiment block diagram of the application CPU control desk Redirectional system.
The application CPU control desk Redirectional system is the computer system that comprises some CPU; Link to each other through bus between some CPU; Comprise at least one CPU610 and at least one the 2nd CPU620 in this system; Convenient for example, only show one the one CPU610 and one the 2nd CPU620 among Fig. 6.
Wherein, a CPU610 is used to make up virtual bus equipment, and to deposit within it be the 2nd CPU620 allocation buffer;
The 2nd CPU620 is used to make up virtual bus equipment;
The one CPU610 and the 2nd CPU620 carry out related through the virtual bus equipment that makes up, and carry out the read-write operation of CPU information through buffer zone.
Concrete; Bus in the system is the PCIe bus; The one CPU610 specifically is used for; Deposit within it and be respectively each the 2nd CPU distribution input block and output buffer, each buffer zone comprises read pointer, write pointer and data field, and a CPU and the 2nd CPU are mapped to the pci bus space respectively.
Referring to Fig. 7 A, be the embodiment block diagram of a kind of CPU of the application.
This CPU is applied to comprise in the computer system of some CPU, links to each other through bus between some CPU, comprises at least one CPU and at least one the 2nd CPU among some CPU, and the CPU shown in the present embodiment is the CPU in this computer system.
This CPU comprises: allocation units 710, associative cell 720 and operating unit 730.
Wherein, allocation units 710, being used on the internal memory of CPU is the 2nd CPU allocation buffer;
Associative cell 720 is used on CPU, making up virtual bus equipment, and related with the 2nd CPU that has made up virtual bus equipment equally through virtual bus equipment;
Operating unit 730 is used for through buffer zone the CPU information of the 2nd CPU being carried out read-write operation.
Referring to Fig. 7 B, be the embodiment block diagram of allocation units among the CPU shown in the application Fig. 7 A.
These allocation units comprise: buffer zone distributes subelement 711 and spatial mappings subelement 712.
Wherein, buffer zone distributes subelement 711, is used on the internal memory of CPU, being respectively each the 2nd CPU and distributes input block and output buffer, and each buffer zone comprises read pointer, write pointer and data field;
Spatial mappings subelement 712 is used for CPU and the 2nd CPU are mapped to bus space respectively, and this bus space is specially the pci bus space.
Referring to Fig. 7 C, be the embodiment block diagram of associative cell among the CPU shown in the application Fig. 7 A.
This associative cell comprises: structure construction subelement 721 and facility registration subelement 722.
Wherein, structure construction subelement 721 is used to make up the data manipulation structure of character device, corresponding one the 2nd CPU of each character device;
Facility registration subelement 722 is used for registering character device as virtual bus equipment, and this character device is realized the data write operation through the callback data operating structure.
Referring to Fig. 7 D, be the embodiment block diagram of operating unit among the CPU shown in the application Fig. 7 A.
This operating unit comprises: operator unit, input block 731 and output buffer operator unit 732.
Wherein, operator unit, input block 731 is used to operate the write pointer of input block, the data of input the one CPU is write the data field of input block;
Output buffer operator unit 732 is used to operate the read pointer of output buffer, reads the control desk data that write by the 2nd CPU in the output buffer data field.
Referring to Fig. 8 A, be the embodiment block diagram of the another kind of CPU of the application.
This CPU is applied to comprise in the computer system of some CPU, links to each other through bus between some CPU, comprises at least one CPU and at least one the 2nd CPU among some CPU, and the CPU shown in the present embodiment is the 2nd CPU in this computer system.
This CPU comprises: associative cell 810 and operating unit 820.
Wherein, associative cell 810 is used on CPU, making up virtual bus equipment, and related with a CPU who has made up virtual bus equipment equally through virtual bus equipment, has distributed buffer zone for this CPU on the internal memory of a CPU;
Operating unit 820 is used for through buffer zone the CPU information of the one CPU being carried out read-write operation.
Participate in Fig. 8 B, be the embodiment block diagram of associative cell among the CPU shown in the application Fig. 8 A.Among this embodiment, bus is specially the PCIe bus, and on the internal memory of a CPU for this CPU has distributed input block and output buffer, each buffer zone comprises read pointer, write pointer and data field.
This associative cell comprises: console device is specified subelement 811 and virtual bus facility registration subelement 812.
Wherein, console device is specified subelement 811, and being used in the end, a control desk command line parameter appointment console device is a virtual bus equipment;
Virtual bus facility registration subelement 812, being used for according to command line parameter is console device with the virtual bus facility registration, and is virtual terminal equipment with the virtual bus facility registration.
Referring to Fig. 8 C, be the embodiment block diagram of operating unit among the CPU shown in the application Fig. 8 A.
This operating unit comprises: operator unit, input block 821 and output buffer operator unit 822.
Wherein, input block operating unit 821 is used to operate the read pointer of input block, reads the input data that write by a CPU in the data field, said input block;
Output buffer operating unit 822 is used to operate the output buffer write pointer, the control desk data of CPU is write the data field of output buffer.
Description through above embodiment can be known; The application embodiment is applied in and comprises in some computer systems through the continuous CPU of bus; Comprising at least one CPU and at least one the 2nd CPU among some CPU, is said the 2nd CPU allocation buffer on the internal memory of a CPU, and on a CPU and the 2nd CPU, makes up virtual bus equipment respectively; The one CPU and the 2nd CPU pass through the virtual bus device association, and carry out the read-write operation of CPU information through buffer zone.Thereby among the application embodiment through being that the 2nd CPU allocation buffer is redirected to the 2nd CPU control desk on the one CPU on the CPU; Be implemented in a CPU thus and upward the information of the 2nd CPU carried out read-write operation; CPU quantity more for a long time in system; Needn't carry out read-write operation through serial ports, and because the application embodiment in carrying out CPU control desk redirection process, does not rely on network; Therefore the CPU type information that can check the 2nd all running processes of CPU has strengthened the convenience and the dirigibility that CPU information is read of system thus.
Description through above embodiment can know, those skilled in the art can be well understood to the application and can realize by the mode that software adds essential general hardware platform.Based on such understanding; The part that the application's technical scheme contributes to prior art in essence in other words can be come out with the embodied of software product; This computer software product can be stored in the storage medium, like ROM/RAM, magnetic disc, CD etc., comprises that some instructions are with so that a computer equipment (can be a personal computer; Server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the application or embodiment.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and identical similar part is mutually referring to getting final product between each embodiment, and each embodiment stresses all is the difference with other embodiment.Especially, for system embodiment, because it is basically similar in appearance to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
The application can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in DCE, put into practice the application, in these DCEs, by through communication network connected teleprocessing equipment execute the task.In DCE, program module can be arranged in this locality and the remote computer storage medium that comprises memory device.
Though described the application through embodiment, those of ordinary skills know, the application has many distortion and variation and the spirit that do not break away from the application, hope that appended claim comprises these distortion and variation and the spirit that do not break away from the application.

Claims (8)

1. CPU control desk reorientation method; It is characterized in that, be applied to comprise in the computer system of some CPU, link to each other through bus between said some CPU; Comprise at least one CPU and at least one the 2nd CPU among said some CPU, said method comprises:
It on the internal memory of a said CPU said the 2nd CPU allocation buffer;
On a said CPU and the 2nd CPU, make up virtual bus equipment respectively, through said CPU of said virtual bus device association and the 2nd CPU;
A said CPU and the 2nd CPU carry out the read-write operation of CPU information through said buffer zone;
Said bus is specially the PCIe bus, and said is that the 2nd CPU allocation buffer comprises on the internal memory of a CPU:
On the internal memory of a said CPU, be respectively each the 2nd CPU and distribute input block and output buffer, each said buffer zone comprises read pointer, write pointer and data field;
A said CPU and the 2nd CPU are mapped to the pci bus space respectively;
A said CPU and the 2nd CPU comprise through the read-write operation that said buffer zone carries out CPU information:
The write pointer of the one CPU operation input block writes the data field of said input block with the data of the said CPU of input, and the read pointer of said the 2nd CPU operation input block reads the data in the data field, said input block;
The write pointer of the 2nd CPU operation output buffer writes the data field of said output buffer with the control desk data of said the 2nd CPU, and the read pointer of said CPU operation output buffer reads the data in the said output buffer data field.
2. method according to claim 1 is characterized in that, the said virtual bus equipment that on a CPU, makes up comprises:
A said CPU makes up character device and drives and corresponding application program, corresponding one the 2nd CPU of each character device;
With said virtual bus facility registration is said character device, and said application program is through driving the read-write operation of realizing said character device.
3. method according to claim 1 is characterized in that, the said virtual bus equipment that on the 2nd CPU, makes up comprises:
It is virtual bus equipment that said the 2nd CPU in the end specifies console device in control desk command line parameter;
Is console device according to said command line parameter with said virtual bus facility registration, and is virtual terminal equipment with said virtual bus facility registration.
4. a CPU control desk Redirectional system is characterized in that, comprises some CPU that link to each other through bus, comprises at least one CPU and at least one the 2nd CPU among said some CPU, wherein,
A said CPU is used to make up virtual bus equipment, and deposits within it and be said the 2nd CPU allocation buffer;
Said the 2nd CPU is used to make up virtual bus equipment;
A said CPU and said the 2nd CPU virtual bus equipment through said structure carries out related, and carries out the read-write operation of CPU information through said buffer zone;
Said bus is specially the PCIe bus; A said CPU; Specifically be used for depositing within it and be respectively each the 2nd CPU and distribute input block and output buffer; Each said buffer zone comprises read pointer, write pointer and data field, and a said CPU and the 2nd CPU are mapped to the pci bus space respectively;
A said CPU and the 2nd CPU are used for realizing the said read-write operation that carries out CPU information through said buffer zone through following method:
The write pointer of the one CPU operation input block writes the data field of said input block with the data of the said CPU of input, and the read pointer of said the 2nd CPU operation input block reads the data in the data field, said input block;
The write pointer of the 2nd CPU operation output buffer writes the data field of said output buffer with the control desk data of said the 2nd CPU, and the read pointer of said CPU operation output buffer reads the data in the said output buffer data field.
5. CPU; It is characterized in that; Be applied to comprise in the computer system of some CPU, link to each other through bus between said some CPU, comprise at least one CPU and at least one the 2nd CPU among said some CPU; Said a kind of CPU is the CPU in the said computer system, and a said CPU comprises:
Allocation units are used on the internal memory of a said CPU, being said the 2nd CPU allocation buffer;
Associative cell is used on a said CPU, making up virtual bus equipment, and related with the 2nd CPU that has made up virtual bus equipment equally through said virtual bus equipment;
Operating unit is used for through said buffer zone the CPU information of said the 2nd CPU being carried out read-write operation;
Said bus is specially the PCIe bus, and said allocation units comprise:
Buffer zone distributes subelement, is used on the internal memory of a said CPU, being respectively each the 2nd CPU and distributes input block and output buffer, and each said buffer zone comprises read pointer, write pointer and data field;
The spatial mappings subelement is used for a said CPU and the 2nd CPU are mapped to the pci bus space respectively;
Said operating unit comprises:
Operator unit, input block is used to operate the write pointer of input block, the data of the said CPU of input is write the data field of said input block;
Output buffer operator unit is used to operate the read pointer of output buffer, reads the control desk data that write by said the 2nd CPU in the said output buffer data field.
6. CPU according to claim 5 is characterized in that, said associative cell comprises:
The structure construction subelement is used to make up character device and drives and corresponding application program, corresponding one the 2nd CPU of each character device;
The facility registration subelement, being used for the virtual bus facility registration is said character device, said application program is through driving the read-write operation of realizing said character device.
7. CPU; It is characterized in that; Be applied to comprise in the computer system of some CPU, link to each other through bus between said some CPU, comprise at least one CPU and at least one the 2nd CPU among said some CPU; Said a kind of CPU is the 2nd CPU in the said computer system, and said the 2nd CPU comprises:
Associative cell is used on said the 2nd CPU, making up virtual bus equipment, and related with a CPU who has made up virtual bus equipment equally through said virtual bus equipment, has distributed buffer zone for said the 2nd CPU on the internal memory on the said CPU;
Said bus is specially the PCIe bus, and has distributed input block and output buffer for said CPU on the internal memory of a said CPU, and each said buffer zone comprises read pointer, write pointer and data field;
Operating unit is used for through said buffer zone the CPU information of a said CPU being carried out read-write operation;
Said operating unit comprises:
Operator unit, input block is used to operate the read pointer of input block, reads the input data that write by a CPU in the data field, said input block;
Output buffer operator unit is used to operate the output buffer write pointer, the control desk data of said the 2nd CPU is write the data field of said output buffer.
8. CPU according to claim 7 is characterized in that, said associative cell comprises:
Console device is specified subelement, and being used in the end, a control desk command line parameter appointment console device is a virtual bus equipment;
Virtual bus facility registration subelement, being used for according to said command line parameter is console device with said virtual bus facility registration, and is virtual terminal equipment with said virtual bus facility registration.
CN2010101272344A 2010-03-05 2010-03-05 CPU console redirecting method and system and CPUs Active CN101872335B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101272344A CN101872335B (en) 2010-03-05 2010-03-05 CPU console redirecting method and system and CPUs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101272344A CN101872335B (en) 2010-03-05 2010-03-05 CPU console redirecting method and system and CPUs

Publications (2)

Publication Number Publication Date
CN101872335A CN101872335A (en) 2010-10-27
CN101872335B true CN101872335B (en) 2012-11-21

Family

ID=42997201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101272344A Active CN101872335B (en) 2010-03-05 2010-03-05 CPU console redirecting method and system and CPUs

Country Status (1)

Country Link
CN (1) CN101872335B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289368B (en) * 2011-06-17 2017-09-05 中兴通讯股份有限公司 A kind of method and system for obtaining serial printing information
CN103514131A (en) * 2012-06-29 2014-01-15 联想(北京)有限公司 System information output method and electronic equipment
CN102752223B (en) * 2012-07-26 2014-11-05 杭州海康威视数字技术股份有限公司 Method for transmitting data among parallel systems and system of method
CN103036817A (en) * 2012-12-14 2013-04-10 华为技术有限公司 Server single-board, server single-board realization method and host processor
CN103605628A (en) * 2013-11-29 2014-02-26 迈普通信技术股份有限公司 PCI-E-based method and device for achieving command interaction between master equipment and slave equipment
CN109739799A (en) * 2018-12-29 2019-05-10 深圳市优必选科技有限公司 Data interactive method, heterogeneous multi-nucleus processor and the terminal of heterogeneous multi-nucleus processor
CN109696878B (en) * 2019-01-03 2020-10-02 中电智能科技有限公司 Controller based on multiple buffer zones
CN111177043B (en) * 2019-12-26 2021-07-06 苏州浪潮智能科技有限公司 Method, system, device and medium for accelerating reading of field replaceable unit information
CN111338998B (en) * 2020-02-20 2021-07-02 深圳震有科技股份有限公司 FLASH access processing method and device based on AMP system
CN111339000B (en) * 2020-02-24 2021-07-06 深圳震有科技股份有限公司 AMP system memory file transmission method and device
CN111427817B (en) * 2020-03-23 2021-09-24 深圳震有科技股份有限公司 Method for sharing I2C interface by dual cores of AMP system, storage medium and intelligent terminal

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101093450A (en) * 2006-06-19 2007-12-26 迈普(四川)通信技术有限公司 Mutual exclusion method for multiple CPUs

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101093450A (en) * 2006-06-19 2007-12-26 迈普(四川)通信技术有限公司 Mutual exclusion method for multiple CPUs

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
祝良荣.linux下tty终端设备的工作机制的分析及应用.《现代电子技术》.2006,(第13期),第112-114页. *

Also Published As

Publication number Publication date
CN101872335A (en) 2010-10-27

Similar Documents

Publication Publication Date Title
CN101872335B (en) CPU console redirecting method and system and CPUs
US6078338A (en) Accelerated graphics port programmable memory access arbiter
US7784060B2 (en) Efficient virtual machine communication via virtual machine queues
US7409478B2 (en) Peripheral hardware devices providing multiple interfaces and related systems and methods
CN101158935B (en) South bridge system and method
EP2856313B1 (en) Dynamically erectable computer system
CN101243396B (en) Method and apparatus for supporting universal serial bus devices in a virtualized environment
CN103873489A (en) Device sharing system with PCIe interface and device sharing method with PCIe interface
US8990451B2 (en) Controller for direct access to a memory for the direct transfer of data between memories of several peripheral devices, method and computer program enabling the implementation of such a controller
CN102388357B (en) Method and system for accessing memory device
CN102736972A (en) Processing method of test case of application to be tested and system
CN103092810A (en) Processor with programmable virtual ports
CN105786589A (en) Cloud rendering system, server and method
US20150205530A1 (en) Autonomous memory subsystem architecture
CN101876954B (en) Virtual machine control system and working method thereof
CN110333946A (en) One kind being based on artificial intelligence cpu data processing system and method
CN103856547A (en) Mapping method and system of virtual machines and client side devices
CN104636186A (en) Virtual machine memory management method, physical host, PCIE equipment, configuration method thereof and migration management equipment
CN103559087A (en) Interrupt realization method between virtual processors, relevant device and system
CN107967225A (en) Data transmission method, device, computer-readable recording medium and terminal device
CN103649923A (en) NUMA system memory mirror impage configuration method, removing method, system and major node
CN106462522A (en) An input/output virtualization (IVO) host controller (HC) (IOV-HC) of a flash-memory-based storage device
CN1325511A (en) Processing arrangements
CN105260332A (en) Method and system for orderly storing CPLD data packets
CN100447731C (en) Redundant storage virtualization computer system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant