Serial graphical interface interaction method and device of firmware layer
Technical Field
The invention relates to the field of computer firmware, in particular to a serial port graphical interface interaction method and device of a firmware layer.
Background
Firmware is important basic software in a computer system, and is solidified and stored in a chip of hardware. The main board, the video card, the network card and the hard disk of the computer are all provided with firmware, and although the functions are different, the firmware is essentially enabling and driving hardware. The most important firmware in a computer is called BIOS (Basic Input/Output System), which is used to initialize hardware, manage hardware resources, shield platform characteristics, and boot an operating System, and is a bridge connecting Basic hardware and System software of the computer.
One of the important roles of firmware is to boot and boot the operating system in the native storage medium or in the network. However, in a specific use process, the firmware under different processor platforms may need to be configured by specific hardware (such as a keyboard, a mouse, a display and the like) before the operating system is started, so as to meet the needs of users or hardware.
Currently, most firmware products use a keyboard and a display as an input/output interface of the firmware configuration. However, when the firmware on the server and the embedded device is configured, it is difficult to provide corresponding graphical display, keyboard and mouse configurations, and therefore a real-time graphical human-computer interaction interface cannot be provided. At present, some proposals have appeared to implement control by receiving serial command symbols by writing an independently customized software interface on the local computer. However, such solutions still have some drawbacks, such as: 1) Software running on a configuration computer needs to be customized independently, and interface upgrading needs to be reinstalled; 2) The receiving effect is not real-time; 3) And after the serial port character protocol is updated, the configured computer and the configuration computer need to be upgraded again.
Disclosure of Invention
The invention aims to provide a serial port graphical interface interaction method and device of a firmware layer, which are suitable for being used in equipment without a display and a keyboard or for interaction when the display and the keyboard have problems. The interaction function is real-time, and can be realized by a serial port debugging assistant which is arranged in the system and supports a serial port protocol, and special configuration interface software does not need to be customized.
The implementation main body of the method is an input-output interaction module built in a firmware system, and a graphical man-machine interaction firmware configuration interface can be provided for an external computer through a serial port before an operating system of a local computer runs.
The method of the present application comprises the steps of:
adapting firmware on a configured device;
connecting the configured equipment and the configuration computer by using a serial communication interface;
outputting a firmware configuration interface of the configured computer to the configuration computer;
configuring the firmware of the configured equipment through the input equipment of the configuration computer and the graphical interface output by the configuration computer;
the configured device receives the firmware configuration parameters and validates them.
Further, the adapting firmware on the configured device includes recording basic parameters of the serial communication, the basic parameters including: baud rate, data bit length, whether parity check, stop bit, serial interrupt length.
Further, after connecting the configured device and the configuration computer with the serial communication interface, the method further includes: starting the configured equipment, installing serial communication serial console software in the configuration computer, and setting the serial communication mode of the serial console software according to the recorded basic parameters of serial communication.
Further, the setting of the serial communication mode of the serial console software according to the recorded serial recorded basic parameters of the serial communication further comprises judging whether the serial communication is normal, and if the serial communication is normal, outputting the serial communication to a configuration computer by a firmware configuration interface of the configuration computer; and if the serial port communication is abnormal, the parameter configuration is carried out again.
Furthermore, the firmware layer is divided into an application layer, a protocol layer and a hardware layer.
Further, the hardware layer comprises a hardware serial communication interface, and the serial communication interface is an RS232 serial interface, an RS485 serial interface or a ttl serial interface.
Further, the protocol layer is to:
the method comprises the following steps of realizing related protocols aiming at serial equipment in a firmware process, packaging an input/output software interface, and providing a corresponding input/output interface for an upper application layer;
and providing color and character output at the output interface, and providing key input at the input interface.
Further, the application layer is to:
receiving key input operation by calling a basic protocol of input and output to finish control;
realizing the graphic configuration of the whole firmware system;
the input and output interface provided by the protocol layer is called to complete the control and display change of the graphical interface and provide dynamic graphical configuration.
The application also provides a serial graphical interface interaction device, which is used for realizing the interaction of the serial graphical interface and comprises the following steps:
the serial port communication module is configured to connect the configured equipment and the configuration computer by a serial port;
the parameter configuration module is configured to set serial port communication parameters of the configured equipment and the configuration computer;
the interface display module is configured to output the configuration interface to a serial port console of the configuration computer and provide interface interaction;
and the firmware configuration module is used for configuring the firmware of the configured equipment in real time through the configuration computer.
Further, the interaction device of the present application further includes: the serial communication judging module is configured to judge whether serial communication is normal or not; and judging whether the serial communication is normal or not further comprises the step of reconfiguring the parameters by the parameter configuration module if the serial communication is abnormal.
Further, the interaction device of the present application further includes: the input module is configured to receive input performed through the input device of the configuration computer, and the firmware of the configured equipment is configured through the graphical interface output by the interface display module and the input device.
Drawings
Fig. 1 shows a flow chart of the interactive debugging of the serial port graphics of the present invention.
Fig. 2 shows a frame diagram of a serial interface debugging scheme of the present invention.
Fig. 3 is a block diagram of the serial interface interaction device of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise. The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Fig. 1 is a flowchart of interactive debugging of a serial port graph in a firmware layer according to the present invention. The execution steps of the whole method are as follows: adapting firmware on a configured device; connecting the configured equipment and the configuration computer by using a serial communication interface; outputting a firmware configuration interface of the configured computer to the configuration computer; configuring the firmware of the configured equipment through the input equipment of the configuration computer and the graphical interface output by the configuration computer; the configured device receives the firmware configuration parameters and validates them.
The adapting firmware on the configured device specifically includes: deploying a serial firmware image configuration module in the configured device, and adapting firmware on the existing serial communication configured device aiming at the hardware needing configuration, so as to upgrade firmware software to the device. The configured device may be a server, an embedded device, a computer, etc., and the configured device may or may not have a graphical display, when not, the graphical interactive interface provided by the configuration device. At the same time, the basic parameters necessary for serial communication are recorded: such as baud rate, data bit length, whether parity is present, stop bit, serial interrupt length, etc.
The step of connecting the configured device and the configuration computer by using the serial communication interface is to connect the pointed device and the configuration computer by using a signal wire through an RS232 serial interface, an RS485 serial interface or a ttl serial interface.
After the configured device is connected with the configuration computer by the serial port, before the firmware configuration interface of the configured device is output to the configuration computer, the method further comprises the following steps: configuring basic parameters for serial communication at a configuration computer: such as baud rate, data bit length, parity check, stop bit, serial interrupt length, etc. Starting the configured equipment, outputting a configuration interface to a serial port console of a configuration computer through a serial interface after the equipment is started, installing serial communication serial port console software (such as SecureCRT) in the configuration computer, and setting a serial communication mode of the serial port console software according to recorded basic parameters of serial communication, wherein if the serial communication mode of the software is set to be consistent with the recorded configuration parameters of the configured equipment.
Setting a serial communication mode of serial console software according to the recorded serial recorded basic parameters of serial communication, judging whether the serial communication is normal, and if the serial communication is normal, outputting the serial communication mode to a configuration computer by a firmware configuration interface of the configuration computer; if the serial port communication is abnormal, the parameter configuration is carried out again; and if the serial port communication is normal, outputting the firmware configuration interface of the configured computer to the configured computer.
The user can set the firmware of the configured device by configuring the input device such as the keyboard, the mouse, the touch screen and the like of the computer and combining with the graphic interface output by the serial port of the configuration computer, the configured computer receives the configuration parameters, and the configuration information is effective in the configured computer. Therefore, the process of debugging through serial port graphical interface interaction is completed, and a graphical man-machine interaction firmware configuration interface can be provided for external equipment through a serial port before a local computer operating system runs through an input-output interaction module arranged in a firmware system.
Further, the serial port graphical interface interaction of the firmware layer of the invention is divided into three layers, including: the overall framework diagram of the application layer, the protocol layer, the hardware layer and the serial interface debugging scheme is shown in fig. 2. The hardware layer mainly comprises a hardware serial communication interface. The communication interface may be served by an RS232 serial interface, an RS485 serial interface, or a ttl serial interface. And is connected with the serial port configuration equipment through a signal wire. And the configuration client corresponding to the serial port configuration equipment is connected with the host through a serial port. The protocol layer mainly comprises the following functions: a) In the firmware process, related protocols aiming at serial equipment need to be realized, an input/output software interface is packaged, and an input/output corresponding interface is provided for an upper application layer; b) The output interface provides color and character output, and the input interface provides key input. The application layer mainly comprises the following functions: a) Receiving basic key input operation by calling a basic protocol of input and output to finish control; b) Realizing a graphic configuration interface and graphic configuration of the whole firmware system; c) The input and output interface provided by the protocol layer is called to complete the control and display change of the graphical interface and provide dynamic graphical configuration.
The invention also provides a serial port graphical interface interaction device of the firmware layer, which mainly comprises: the serial port communication module is configured to connect the configured computer and the configuration computer by a serial port; the parameter configuration module is configured to set serial port communication parameters between the configured equipment and the configuration computer, such as baud rate, data bit length, whether parity check exists or not, stop bit, serial interrupt length and the like; the interface display module is configured to output an interface to a serial port console of the configuration computer and provide interface interaction; and the firmware configuration module is used for configuring the firmware of the configured computer in real time through the configuration computer.
The serial port graphical interface interaction device further comprises a serial port communication judgment module which judges whether the serial port communication is normal or not, if the serial port communication is abnormal, the parameter configuration module reconfigures parameters, so that serial port communication parameters of the configured equipment and the configured computer are consistent, and the configured equipment and the configured computer can be communicated.
Further, the serial port graphical interface interaction device further comprises a receiving module configured to receive an input performed by the input device of the configuration computer, such as an input of a keyboard, a mouse, and the like, and configure the firmware of the configured device through the graphical interface output by the interface display module and the input device.
The invention provides a graphical serial port communication configuration mode for firmware interaction, and is suitable for equipment without a display and a keyboard or interaction when the display and the keyboard have problems. Compared with the traditional configuration mode without graphic commands, the method has wide application range and convenient and fast use. Meanwhile, the invention has a real-time interaction function, and the function is used on a serial port debugging assistant which is arranged in the system and supports a serial port protocol, and special customized configuration interface software does not need to be developed like some schemes. Even if any upgrading change of the interface of the configurator does not affect the interface display of the configurator. As long as the configuration computer is provided with the universal serial port terminal software, the configuration of the interaction of the graphic configuration interface can be carried out on the firmware of the configured computer, and the real-time performance and the convenience of the firmware configuration are improved.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.