Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings。Although accompanying drawing showing the exemplary embodiment of the disclosure, it being understood, however, that may be realized in various forms the disclosure and should do not limited by embodiments set forth here。On the contrary, it is provided that these embodiments are able to be best understood from the disclosure, and complete for the scope of the present disclosure can be conveyed to those skilled in the art。
Fig. 1 illustrates the flow chart of the method 100 showing information according to an embodiment of the invention in system boot process。In system boot process, main program module runs system bootstrap routine, and driver runs module and runs driver。In the embodiment of the present invention, system boot process refers to the character pattern stage of System guides, and the program run in this process is system bootstrap routine。Native program is exactly a kind of system bootstrap routine, and the embodiment of the present invention illustrates for Native program, but is not limited only to this。
The embodiment of the present invention is in the process that system is reset, and by Compare System file, and after downloading correct file from server, can reboot into the Native stage。Run preset Native program, by this program download correct file replace in system existing incorrect, damage file。The Naitve program phase now is exactly the textual interface described in the embodiment of the present invention。Specifically, the starting method of Naitve program is: run system in, the Native program copy that will run to windows system32;To registration table HKEY_LOCAL_MACHINE SYSTEM CurrentControlSet Control SessionManager the name of the Native program that write to run in BootExecute;Restart computer;Windows finds the Native program that there is a need to run in BootExecute in start-up course, and screen automatically switches to character pattern, and runs Native program, and this running is to start complete at system kernel, before display login interface。
As it is shown in figure 1, method 100 starts from step S101, the wherein information according to required display, make bitmap file, this bitmap file is the picture file comprising explanation information corresponding to information。In view of the information that existing Native program is shown on a user interface is English, in order to be able to the concrete meaning allowing the user being ignorant of English understand this information, first the information of these English of required display is translated as the explanation information of Chinese, then explanation information is made as bitmap file, pre-saves with the form of picture file。Alternatively, explanation information is possible not only to include Chinese explanation information, it is also possible to include other additional product introduction information and picture, such as name of product, product identification picture etc.。
Subsequently, method 100 enters step S102, wherein creates driver, and specifies the different drawing interface called in driver for different operating system。In different operating system, drawing interface is different, therefore can specify different drawing interfaces for different operating system in driver。Such as, for Win2000 or WinXP system, it is intended that use the bootvid VidBitBlt drawing function driven as drawing interface;For Vista or Win7 system, it is intended that use the ntoskrnl InbvIsBootDriverInstalled drawing function derived and InbvSolidColorFill drawing function as drawing interface。The present invention is by have invoked the drawing interface of Windows kernel, it is ensured that compatible and stability。
Subsequently, method 100 enters step S103, and wherein when Native program display information, main program module runs module to driver and sends control information。In Native program operation process, it is necessary to during display reminding information, the main program module running Native program runs module transmission control information to driver, and this control information makes driver run module control driver and performs corresponding operation。
Subsequently, method 100 enters step S104, and wherein driver runs module according to the information of control, calls, by running driver, the drawing interface display bitmap file on a user interface specified。Driver runs module by calling the above-mentioned drawing interface specified, display bitmap file on a user interface, namely shows explanation information on a user interface。
All can not call for Win32API all of in prior art, displaying interface is restricted, graphical interfaces can not be used and the problem of only textual interface, according to the method that the present embodiment provides, when Native program display information, control driver and call the drawing interface drafting bitmap file specified, this bitmap file comprises the picture file of explanation information corresponding to information, by showing these explanation information, give user to point out fully, it is to avoid operating system that user misoperation causes is damaged or the serious problems such as loss of data。
Fig. 2 illustrates the flow chart of the method 200 showing information in accordance with another embodiment of the present invention in system boot process。As in figure 2 it is shown, method 200 starts from step S201, the wherein information according to required display, make bitmap file, this bitmap file is the picture file comprising explanation information corresponding to information。In view of the information that existing Native program is shown on a user interface is English, in order to be able to the concrete meaning allowing the user being ignorant of English understand this information, first the information of these English of required display is translated as the explanation information of Chinese, then explanation information is made as bitmap file, pre-saves with the form of picture file。Alternatively, explanation information is possible not only to include Chinese explanation information, it is also possible to include other additional product introduction information and picture, such as name of product, product identification picture etc.。
Due to NT(NewTechnoly, new technique) operating system of kernel to shown information be limited to 16 colors within, so this method Bitmap file is also the picture within 16 colors。In the size of WinXP and Win7 system Bitmap file less than 640*55。
Subsequently, method 200 enters step S202, wherein creates driver, specifies the different drawing interface called in driver for different operating system。Specifically, the driver that the present invention creates is based on WDM(WindowsDriverModel, Windows driver module) Windows device driver, this driver is a PE(PreInstallationEnvironment, WindowsPE) file, need to derive a DriverEntry function, after such system finds the log-on message of this driver in registration table, will load driver file, and call this DriverEntry function driver initialized。In the present embodiment, create driver and need following work:
1, create device object, generate an object instance of this driver in systems;
2, registration drives designation, and so common application program just can use driving designation link lookup to open this equipment;
3, driving routine callback list is filled: the meaning of this driving routine callback list is, driver is to system registry thing of interest, by the process function registration of corresponding event to system。When there is event in system, operating system can be called the corresponding function that processes and notify driver。Such as, the driver in this method have registered the event handling function of this classification of IRP_MJ_DEVICE_CONTROL, when mastery routine to driver send IOcontrolcode time, system will call driver IOcontrolcode process function。Process in function at IOcontrolcode, system can pass over enough information, including IO control code, inputoutput data buffer pointer and buffer length etc., driver in the present embodiment can identify the IO control code pre-defined, concrete meaning according to IO control code, the drawing interface of calling system, specifies position graphing in user interface。
4, in driver, specify, for different operating system, the different drawing interface called: in different operating system, drawing interface is different, therefore can specify different drawing interfaces for different operating system in driver。Such as, for Win2000 or WinXP system, it is intended that use the bootvid VidBitBlt drawing function driven as drawing interface;For Vista or Win7 system, it is intended that use the ntoskrnl InbvIsBootDriverInstalled drawing function derived and InbvSolidColorFill drawing function as drawing interface。The present invention is by have invoked the drawing interface of Windows kernel, it is ensured that compatible and stability。
In this method, the execution sequence of step S201 and step S202 is not limit, it is possible to first carry out step S202, performs step S201 afterwards again。
After step S201 and step S202, method 200 enters step S203, is wherein embedded in driver by bitmap file。In the present invention, bitmap file is embedded in driver and can have two kinds of optional embodiments。One of which embodiment is: first bitmap file is converted to array data, then array data is embedded in driver。Specifically, utilize file crossover tool that bitmap file is converted to the c language array data that can be embedded into source code, such as bitmap file can be carried out binary conversion treatment, obtain the binaryzation data of bitmap file, the binaryzation data of bitmap file are embedded in driver。Another embodiment is: be directly embedded in driver with the form (resource form) of windows resource file by bitmap file。Specifically, bitmap file is transferred to the file of resource form, is embedded in driver。
After driver has created, also including the process installing driver, specifically, Windows driver can adopt following two installation method:
(1) using inf file to install, this method needs to write by the inf file of Microsoft's specified format and grammer, and calls SetupAPI and carry out installing or manual in explorer install, for instance on inf file, right button is clicked, and selects to install。This method is cumbersome comparatively speaking。
(2) WindowsSCM(ServiceControlManager is utilized, Service Control Manager) carry out the method installed, specifically comprise the following steps that
(2.1) opening SCM:OpenSCManager (NULL, NULL, SC_MANAGER_ALL_ACCESS), this calls the handle that can return SCM;
(2.2) use the SCM handle obtained that driver is installed: calling CreateService and install driving, detail parameters MSDN has a detailed description;
(2.3) closing SCM handle, drive installation completes。
Subsequently, method 200 enters step S204, wherein in the Native program initialization stage, obtains the handle of driver。The embodiment of the present invention, in the Native program initialization stage, opens driver by obtaining the handle of driver。Specifically, in the Native program initialization stage, main program module is transferred opendevicehandle function and is obtained the handle of driver, thus opening driver。
Subsequently, method 200 enters step S205, wherein when Native program display information, the main program module handle according to driver, runs module to driver and sends IOcontrolcode。Specifically, in Native program operation process, it is necessary to during display reminding information, main program module runs module to driver and sends IOcontrolcode。Known according to being described above, driver in this method have registered the event handling function of this classification of IRP_MJ_DEVICE_CONTROL, when main program module to driver run module send IOcontrolcode time, system will call driver IOcontrolcode process function。
Subsequently, method 200 enters step S206, and wherein driver runs module according to IOcontrolcode, calls, by running driver, the drawing interface display bitmap file on a user interface specified。If what embed in driver is array data, so driver runs module by calling the above-mentioned drawing interface specified, carry out mapping operation according to the array data that driver is internally embedded, thus display bitmap file on a user interface, namely show explanation information on a user interface。If what embed in driver is the file of resource form, so driver is to access the way access bitmap file of resource, bitmap file is converted to array data, then call the drawing interface specified and access array data, display bitmap file on a user interface, namely shows explanation information on a user interface。
Fig. 3 illustrates the schematic diagram of one application example of method showing information according to an embodiment of the invention in system boot process。As shown in Figure 3, said method is applied in 360 system refitting great master's softwares, perform to replace at this software and update the system file stage, user interface shows information " 360SysResetisupdatingsystemfiles ... Pleasedon ' tshutdownorrebootyourcomputer.48%completed.3000itemsproc essed. ", meanwhile, user interface also showing, product marking picture, name of product " 360 system refitting great master " and Chinese explanation information " are updating system file: please do not shut down or restart!", make the clear and definite 360 system refitting great masters of user just properly functioning, it is to avoid user misoperation。
All can not call for Win32API all of in prior art, displaying interface is restricted, graphical interfaces can not be used and the problem of only textual interface, according to the method that above-described embodiment provides, when Native program display information, control driver and call the drawing interface drafting bitmap file specified, this bitmap file comprises the picture file of explanation information corresponding to information, by showing these explanation information, give user to point out fully, it is to avoid operating system that user misoperation causes is damaged or the serious problems such as loss of data。
Fig. 4 illustrates the structured flowchart of the system showing information according to an embodiment of the invention in system boot process。As shown in Figure 4, this system includes: plot module 410, creation module 420, main program module 430 and driver run module 440;Alternatively, system may also include embedding module 450。
Wherein, plot module 410 is suitable to the information according to required display, makes bitmap file, and this bitmap file is the picture file comprising explanation information corresponding to information。In view of the information that existing system bootstrap routine is shown on a user interface is English, in order to be able to the concrete meaning allowing the user being ignorant of English understand this information, the information of these English of required display is translated as the explanation information of Chinese, explanation information is made as bitmap file by plot module 410, pre-saves with the form of picture file。Alternatively, explanation information is possible not only to include Chinese explanation information, it is also possible to include other additional product introduction information and picture, such as name of product, product identification picture etc.。Due to NT kernel operating system to shown information be limited to 16 colors within, so native system Bitmap file is also the picture within 16 colors。In the size of WinXP and Win7 system Bitmap file less than 640*55。
Creation module 420 is suitable to create driver, and specifies the different drawing interface called in driver for different operating system。Specifically, the driver that creation module 420 creates is based on the Windows device driver of WDM, this driver is a PE file, need to derive a DriverEntry function, after such system finds the log-on message of this driver in registration table, will load driver file, and call this DriverEntry function driver initialized。In the present embodiment, creation module 420 has needed following work:
1, create device object, generate an object instance of this driver in systems;
2, registration drives designation, and so common application program just can use driving designation link lookup to open this equipment;
3, driving routine callback list is filled: the meaning of this driving routine callback list is, driver is to system registry thing of interest, by the process function registration of corresponding event to system。When there is event in system, operating system can be called the corresponding function that processes and notify driver。Such as, driver in native system have registered the event handling function of this classification of IRP_MJ_DEVICE_CONTROL, when main program module to driver run module send IOcontrolcode time, system will call driver IOcontrolcode process function。Process in function at IOcontrolcode, system can pass over enough information, including IO control code, inputoutput data buffer pointer and buffer length etc., driver in the present embodiment can identify the IO control code pre-defined, concrete meaning according to IO control code, the drawing interface of calling system, specifies position graphing in user interface。
4, in driver, specify, for different operating system, the different drawing interface called: in different operating system, drawing interface is different, therefore can specify different drawing interfaces for different operating system in driver。Creation module 420 is further adapted for: for Win2000 or WinXP system, it is intended that use the bootvid VidBitBlt drawing function driven as drawing interface;For Vista or Win7 system, it is intended that use the ntoskrnl InbvIsBootDriverInstalled drawing function derived and InbvSolidColorFill drawing function as drawing interface。The present invention is by have invoked the drawing interface of Windows kernel, it is ensured that compatible and stability。
Embed module 450 to be suitable to be embedded in driver bitmap file。In the present invention, embed module and can have two kinds of optional working methods。One of which working method is: embeds module 450 and can include converting unit 451 and embedded unit 452。Converting unit 451 is suitable to bitmap file is converted to array data;Embedded unit 452 is suitable to be embedded in driver array data。Specifically, converting unit 451 utilizes file crossover tool that bitmap file is converted to the c language array data that can be embedded into source code, such as bitmap file can be carried out binary conversion treatment, obtaining the binaryzation data of bitmap file, the binaryzation data of bitmap file are embedded in driver by embedded unit 452。Another kind of working method is: embeds module and is directly embedded in driver with the form (resource form) of windows resource file by bitmap file。Specifically, bitmap file is transferred to the file of resource form, is embedded in driver。
The present embodiment may also include the module for installing driver, and this module can adopt following two installation method to install Windows driver:
(1) using inf file to install, this method needs to write by the inf file of Microsoft's specified format and grammer, and calls SetupAPI and carry out installing or manual in explorer install, for instance on inf file, right button is clicked, and selects to install。This method is cumbersome comparatively speaking。
(2) utilize WindowsSCM to carry out the method installed, specifically comprise the following steps that
(2.1) opening SCM:OpenSCManager (NULL, NULL, SC_MANAGER_ALL_ACCESS), this calls the handle that can return SCM;
(2.2) use the SCM handle obtained that driver is installed: calling CreateService and install driving, detail parameters MSDN has a detailed description;
(2.3) closing SCM handle, drive installation completes。
Main program module 430 is suitable at system bootstrap routine initial phase, obtains the handle of driver;And, when system bootstrap routine display reminding information, the handle according to driver, send control information to driver。Main program module 430 is the module running system bootstrap routine。Main program module 430 has at system bootstrap routine initial phase, opens the function of driver by obtaining the handle of driver。Specifically, at system bootstrap routine initial phase, main program module 430 is transferred opendevicehandle function and is obtained the handle of driver, thus opening driver。Main program module 430 also has the transmission IOcontrolcode function when display reminding information。In system bootstrap routine running, it is necessary to during display reminding information, main program module 430 runs module 440 to driver and sends IOcontrolcode。
Driver runs module 440 and is suitable to, according to control information, call the drawing interface specified and show on a user interface and bitmap file。If what embed in driver is array data, so driver runs module 440 by calling the above-mentioned drawing interface specified, carry out mapping operation according to the array data that driver is internally embedded, thus display bitmap file on a user interface, namely show explanation information on a user interface。If what embed in driver is the file of resource form, so driver runs module 440 to access the way access bitmap file of resource, bitmap file is converted to array data, then call the drawing interface specified and access array data, display bitmap file on a user interface, namely shows explanation information on a user interface。
All can not call for Win32API all of in prior art, displaying interface is restricted, graphical interfaces can not be used and the problem of only textual interface, according to the system that above-described embodiment provides, when system bootstrap routine display reminding information, control driver and call the drawing interface drafting bitmap file specified, this bitmap file comprises the picture file of explanation information corresponding to information, by showing these explanation information, give user to point out fully, it is to avoid operating system that user misoperation causes is damaged or the serious problems such as loss of data。
In the embodiment of the present invention, described embedding module includes:
Converting unit, is suitable to institute's bitmap file is converted to array data;
Embedded unit, is suitable to be embedded in described driver described array data。
Described embedding module is particularly adapted to be embedded in described driver institute's bitmap file with the form of windows resource file;
Described driver runs module and is particularly adapted to, according to described control information, by running described driver to access the way access bitmap file of resource, bitmap file is converted to array data;Then call the drawing interface specified and access described array data, show institute's bitmap file on a user interface。
Institute's bitmap file is the picture within 16 colors。
Described creation module is further adapted for:
For Win2000 or WinXP system, it is intended that using the bootvid VidBitBlt drawing function driven is drawing interface;
Or, for Vista or Win7 system, it is intended that using the ntoskrnl InbvIsBootDriverInstalled drawing function derived and InbvSolidColorFill drawing function is drawing interface。
Not intrinsic to any certain computer, virtual system or miscellaneous equipment relevant in algorithm and the display of this offer。Various general-purpose systems can also with use based on together with this teaching。As described above, the structure constructed required by this kind of system is apparent from。Additionally, the present invention is also not for any certain programmed language。It is understood that, it is possible to utilize various programming language to realize the content of invention described herein, and the description above language-specific done is the preferred forms in order to disclose the present invention。
In description mentioned herein, describe a large amount of detail。It is to be appreciated, however, that embodiments of the invention can be put into practice when not having these details。In some instances, known method, structure and technology it are not shown specifically, in order to do not obscure the understanding of this description。
Similarly, it is to be understood that, one or more in order to what simplify that the disclosure helping understands in each inventive aspect, herein above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or descriptions thereof sometimes。But, the method for the disclosure should be construed to and reflect an intention that namely the present invention for required protection requires feature more more than the feature being expressly recited in each claim。More precisely, as the following claims reflect, inventive aspect is in that all features less than single embodiment disclosed above。Therefore, it then follows claims of detailed description of the invention are thus expressly incorporated in this detailed description of the invention, wherein each claim itself as the independent embodiment of the present invention。
Those skilled in the art are appreciated that, it is possible to carry out the module in the equipment in embodiment adaptively changing and they being arranged in one or more equipment different from this embodiment。Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition。Except at least some in such feature and/or process or unit excludes each other, it is possible to adopt any combination that all processes or the unit of all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment are combined。Unless expressly stated otherwise, each feature disclosed in this specification (including adjoint claim, summary and accompanying drawing) can be replaced by the alternative features providing purpose identical, equivalent or similar。
In addition, those skilled in the art it will be appreciated that, although embodiments more described herein include some feature included in other embodiments rather than further feature, but the combination of the feature of different embodiment means to be within the scope of the present invention and form different embodiments。Such as, in the following claims, the one of any of embodiment required for protection can mode use in any combination。
The all parts embodiment of the present invention can realize with hardware, or realizes with the software module run on one or more processor, or realizes with their combination。It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize the some or all parts in the system showing information in system boot process according to embodiments of the present invention。The present invention is also implemented as part or all the equipment for performing method as described herein or device program (such as, computer program and computer program)。The program of such present invention of realization can store on a computer-readable medium, or can have the form of one or more signal。Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form。
The present invention will be described rather than limits the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment without departing from the scope of the appended claims。In the claims, any reference marks that should not will be located between bracket is configured to limitations on claims。Word " comprises " and does not exclude the presence of the element or step not arranged in the claims。Word "a" or "an" before being positioned at element does not exclude the presence of multiple such element。The present invention by means of including the hardware of some different elements and can realize by means of properly programmed computer。In the unit claim listing some devices, several in these devices can be through same hardware branch and specifically embody。Word first, second and third use do not indicate that any order。Can be title by these word explanations。