Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Advanced Configuration and Power Interface (ACPI, Advanced Configuration and Power Interface) is the novel power supply management regulation that proposed by Intel (INTEL), Microsoft (MICROSOFT), Toshiba (TOSHIBA) in 1997, be intended that and allow operating system rather than BIOS control power management comprehensively, make operating system power saving more.Its characteristics mainly contain: power up function at once is provided, promptly can returns to the state when shutting down last time after the start immediately, CD-ROM drive, floppy drive and hard disk can not turned off power supply automatically when using, open during use again; Support equipment both inserting under "on" position promptly pulled out, and changes function at any time.
ACPI has six kinds of states, be respectively that S0 is to S5, wherein, the S3 state is for suspending to internal memory (STR, Suspend to RAM), operating system is stored in current operation system information in the internal memory, has only several critical component energisings such as internal memory, guaranteeing that data do not lose, and other equipment all are in closed condition.This computer-chronograph is in the height electricity-saving state, press any key after, operating system is waken up, computing machine is the read operation system information from internal memory, and returns to STR state before.
Embodiment one, describe in detail referring to Fig. 1, Fig. 1 is the method flow synoptic diagram of present embodiment.
Step 101: when operating system was made mistakes, the operating system error message that geocoding is exceeded Basic Input or Output System (BIOS) reference address scope was saved in the storage unit, and described storage unit is preserved operation system information.
Storage unit can be an internal memory, but or the storage organization of other storage operating system error messages, do not influence the realization of the embodiment of the invention.
When the operating system error message refers to that operating system is made mistakes, the error message that each program of the operating system of moving produces and interruption application (the CPU IRQ of central processing unit, Central Processing Unitinterrupt requests) and the address information at current stack (STACK) place, these information all need to preserve, use during for the follow-up debugging operations of operating system debug module system, when operating system can draw operating system and makes mistakes by CPU IRQ and STACK information, having which module to move, is that mistake has taken place which function of which thread.And operation system information refers to the required relevant information of the normal operation of system.
It for address bus 32 microcomputer, address space range can reach 2 23 powers, be 4GB, that is to say, the BIOS access address realm is generally 4GB, and when calculator memory exceeded 4GB, the operating system error message of preservation just might exceed 4GB, promptly exceed the BIOS access address realm, then exceeding part can not preserve in NVRAM.
The storage speed of internal memory is fast, storage space is big, therefore, after the operating system error message geocoding of judging the need preservation exceeded Basic Input or Output System (BIOS) reference address scope, the operating system error message that will exceed Basic Input or Output System (BIOS) reference address scope was saved in the internal memory.
After the described operating system error message that exceeds Basic Input or Output System (BIOS) reference address scope can being provided with zone bit, be saved in the storage unit.
Step 102: indication operating system starts according to the operation system information of preserving in the storage unit.
Starting according to the operation system information of preserving in the storage unit, can be to start with the S3 pattern among the ACPI.
Operating system is after makeing mistakes, (SMI interrupts to trigger the self-defining operation system management interrupt, SystemManagement Interrupt), this Interrupt Process function copies current operation system mistake relevant information among the NVRAM to, and trigger the South Bridge chip group and send the S3 mode instruction that enters ACPI, operating system then enters the S3 pattern.The S3 pattern is a kind of low energy consumption state, and operating system is only to critical piece power supply, but such as main memory and wake operation system equipment, and the operating system normal state information is kept in the internal memory, the state before being used for from the S3 recovering state to dormancy.
Step 103: revise the Basic Input or Output System (BIOS) source code, in the process of starting the operating system, skip detection to the described storage unit of preserving the operating system error message.
S3 pattern start-up course needs reading of data from internal memory, and the embodiment of the invention is then utilized these characteristics, the operating system error message of reading and saving from internal memory.
The S3 pattern is kept at the operating system normal state information in the internal memory, can carry out internal memory in start-up course detects, therefore, need to revise the Basic Input or Output System (BIOS) source code, make in the process that the S3 pattern starts, skip internal memory detection, to guarantee that the data of preserving can be by later use to the described region of memory of preserving the operating system error message.
Step 104: behind the os starting, copy the described operating system error message that is kept in the described storage unit to nonvolatile memory.
After copying nonvolatile memory to, then addressable this operating system error message of BIOS, operating system is called the debug module and is used this operating system error message to debug processing afterwards.When this operating system error message is provided with zone bit, then read this operating system error message according to zone bit.
Correctness for the operating system error message that guarantees to preserve in the internal memory, can reset test code to the described region of memory of preserving the operating system error message, and judge in internal memory self check process whether this test code is identical with the test code that is provided with before, if it is identical, showing that then this region of memory is not changed, is effective information.Test code can be for interrupting the default value that 19 functions are filled in, or the numerical value that is provided with of other modes, do not influence realization of the present invention.
The embodiment of the invention is saved in the storage unit by the operating system error message that geocoding is exceeded Basic Input or Output System (BIOS) reference address scope, and the operation system information of preserving in according to storage unit starts the operating system and skips detection to this storage unit in the process, behind the os starting, copy the described operating system error message that is kept in the storage unit to nonvolatile memory again, make that wrong relevant key message can be by complete documentation, then the operating system debugging can normally be carried out.
Following examples two are embodiment one described method processing procedure in actual applications, can be referring to Fig. 2, and Fig. 2 is the method flow synoptic diagram of the embodiment of the invention two.
Embodiment two,
Step 201: mistake appears in the operating system process, and CPU notice BIOS enters the S3 pattern.
When mistake appears in operating system, operating system stops programmable logic device (PLD) (CPLD, complexprogrammable logic device) house dog of simulation feeds dog in, CPLD will be defeated by the South Bridge chip group by a GPIO (General Purpose Input/Output) signal, and notice BIOS is about to enter the S3 pattern.
Step 202:CPU judges whether the operating system error message geocoding that needs to preserve exceeds 4GB, and exceeding changes step 204, and not exceeding then changes step 203.
When the operating system error message refers to that operating system is made mistakes, the error message that each program of the operating system of moving produces and the address information at CPU IRQ and current STACK place.This operation system information might exceed 4GB when calculator memory exceeds 4GB.
Step 203: the described operating system error message that will not exceed 4GB is saved among the NVRAM, changes step 206.
Step 204: the described operating system error message that will exceed 4GB is provided with zone bit, and is saved in the internal memory.
By reading of zone bit, system can load a self-defining module, and the operating system error message that exceeds the 4GB address space is copied.
Step 205: indication operating system starts from the S3 pattern.
Operating system triggers self-defined SMI and interrupts after makeing mistakes, and current operation system mistake relevant information is copied among the NVRAM, and trigger the South Bridge chip group and send the S3 mode instruction that enters ACPI, and operating system then enters the S3 pattern.
Step 206: revise the BIOS source code, in S3 pattern start-up course, skip internal memory detection to the region of memory of preserving the operating system error message.
Step 207: os starting, whether decision operation system error message geocoding exceeds 4GB, and exceeding changes step 208, otherwise changes step 209.
Step 208: the operating system error message that will be kept in the internal memory copies NVRAM to.
Step 209: read the operating system error message among the NVRAM, call the debug module and carry out the operating system debugging, the debug module is handled the operating system error message that copies from internal memory according to zone bit.
After copying nonvolatile memory to, then addressable this operating system error message of BIOS, operating system is called the debug module and is started correlation module according to zone bit afterwards, uses this operating system error message to debug processing.
The embodiment of the invention is saved in the internal memory by the operating system error message that geocoding is exceeded 4GB, and in S3 pattern start-up course, skip detection to this region of memory, after the normal startup of operating system, copy the described operating system error message that is kept in the internal memory to nonvolatile memory again, make that all and wrong relevant key message can be by complete documentations, then the operating system debugging can normally be carried out.
In the practical application, can test code be set, in the os starting process, have or not and be changed to test this region of memory to the region of memory of preserving the operating system error message.Three of following examples describe this treatment scheme in detail in conjunction with Fig. 3, and Fig. 3 is the method flow synoptic diagram of the embodiment of the invention three.
Embodiment three,
Step 301: mistake appears in the operating system process, and CPU notice BIOS enters the S3 pattern.
Step 302:CPU judges whether the operating system error message geocoding that needs to preserve exceeds 4GB, and exceeding changes step 304, and not exceeding then changes step 303.
Step 303: the described operating system error message that will not exceed 4GB is saved among the NVRAM, changes step 308.
Step 304: the described operating system error message that will exceed 4GB is provided with zone bit, and is saved in the internal memory.
Step 305: the region of memory of preserving the operating system error message is provided with test code.
Test code can be to interrupt the default value that 19 functions are filled in, as 5A5A, or the numerical value that is provided with of other modes, do not influence realization of the present invention.
Step 306: indication operating system starts from the S3 pattern.
Step 307: revise the BIOS source code, in S3 pattern start-up course, skip internal memory detection to the region of memory of preserving the operating system error message.
Step 308: during os starting, whether the test code that detects the region of memory of skipping is identical with the test code that is provided with.
Identical then explanation, the operating system error message that this region of memory is preserved does not change, or active data, can be in follow-up use.
Step 305 can repeat to 308, and whether the test code that detects the region of memory of skipping repeatedly is identical with the test code that is provided with, and different test codes can be set when detecting each time, do not influence realization of the present invention.
Step 309: whether decision operation system error message geocoding exceeds 4GB, and exceeding changes step 310, otherwise changes step 311.
Step 310: the operating system error message that will be kept in the internal memory copies NVRAM to.
Step 311: read the operating system error message among the NVRAM, call the debug module and carry out the operating system debugging, the debug module is handled the operating system error message that copies from internal memory according to zone bit.
The embodiment of the invention is saved in the internal memory by the operating system error message that geocoding is exceeded 4GB, and in S3 pattern start-up course, skip detection to this region of memory, after the normal startup of operating system, copy the described operating system error message that is kept in the internal memory to nonvolatile memory again, make that all and wrong relevant key message can be by complete documentations, then the operating system debugging can normally be carried out.
And, when operating system restarts, the region of memory of preserving the operating system error message is provided with test code, guarantee the correctness and the integrality of the data that internal memory is preserved.
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
A kind of method of preserving operation system information more than is provided, and the embodiment of the invention also provides a kind of device of operation system information and a kind of operational system of operating system of preserving.
A kind of device 40 of preserving operation system information, referring to Fig. 4, Fig. 4 is the structural representation of embodiment of the invention device, comprising:
Judging unit 41 is used for when operating system is made mistakes, and judges the operating system error message geocoding that needs to preserve and exceeds Basic Input or Output System (BIOS) reference address scope; When the operating system error message refers to that operating system is made mistakes, the error message that each program of the operating system of moving produces and the address information at CPU IRQ and current STACK place; In 32 machines, Basic Input or Output System (BIOS) reference address scope is 4GB; And operation system information might exceed 4GB when calculator memory exceeds 4GB.
Preserve unit 42, be used for the described operating system error message that exceeds Basic Input or Output System (BIOS) reference address scope that described judging unit 41 is judged is saved in storage unit, described storage unit is preserved operation system information; After also the described operating system error message that described judging unit 41 can be judged is provided with zone bit, be saved in the storage unit.Operation system information refers to the described relevant information of the normal operation of system.
Revise unit 43, be used to revise the Basic Input or Output System (BIOS) source code, in the start-up course of the operation system information that operating system is preserved in according to storage unit, skip detection described storage unit;
Copy cell 44 is used for behind os starting, and the operating system error message that described preservation unit 42 is preserved copies nonvolatile memory to.
The device 40 of described preservation operation system information also comprises zone bit unit 45 and debugging unit 46 is set:
Zone bit unit 45 is set, after being used for the described operating system error message that exceeds Basic Input or Output System (BIOS) reference address scope that described judging unit 41 is judged is provided with zone bit, is saved in the storage unit;
Debugging unit 46 is used for calling the operating system error message of debug module reading non-volatile storage, perhaps according to after the described operating system error message in the zone bit reading non-volatile storage, operating system is debugged.
The device 40 of described preservation operation system information also comprises:
Test code unit 47, be used for the described storage unit that the operating system error message is preserved in described preservation unit 42 is provided with test code, and when operating system restarts, judge in storage unit self check process whether this test code is identical with the test code that is provided with, confirm that the operating system error message of preserving in this storage unit is not changed, guarantee the correctness and the integrality of data.
A kind of operational system 50 of operating system, referring to Fig. 5, Fig. 5 is the structural representation of embodiment of the invention system, comprising:
Preserve the device 40 of operation system information, be used for when operating system 51 is made mistakes, after judging the operating system error message geocoding of need preserving and exceeding Basic Input or Output System (BIOS) reference address scope, the described operating system error message that exceeds Basic Input or Output System (BIOS) reference address scope is saved in the storage unit, described storage unit is preserved operation system information, and modification Basic Input or Output System (BIOS) source code, in the process that the operation system information that operating system 51 is preserved in according to described storage unit starts, skip detection to described storage unit, after operating system 51 started, the operating system error message that described preservation unit is preserved copied nonvolatile memory to;
Operating system 51 is used for after makeing mistakes, and the operation system information of preserving according to the device 40 of described preservation operation system information starts.
The device 40 of described preservation operation system information calls the debug module according to the operating system error message in the nonvolatile memory after also being used in operating system 51 startups, and operating system is debugged.
The embodiment of the invention is saved in the storage unit by the operating system error message that geocoding is exceeded Basic Input or Output System (BIOS) reference address scope, and the operation system information of preserving in according to storage unit starts the operating system and skips detection to this storage unit in the process, behind the os starting, copy the described operating system error message that is kept in the storage unit to nonvolatile memory again, make that wrong relevant key message can be by complete documentation, then the operating system debugging can normally be carried out.
And, when operating system restarts, the storage unit of preserving the operating system error message is provided with test code, guarantee the correctness and the integrality of the data that storage unit is preserved.
One of ordinary skill in the art will appreciate that, realize all or part of flow process in the foregoing description method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-OnlyMemory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
More than a kind of method and device of preserving operation system information that the embodiment of the invention provided is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.