1. Technical Field
The present disclosure relates to electronic devices, particularly, to diagnosing a bad sector of a memory of an electronic device and a method thereof.
2. Description of Related Art
Usually, a memory of a device such as a computer is diagnosed by a program executed in a user mode to find a bad sector of the memory. The program executed in the user mode is forbidden from accessing the physical address of the bad sector of the memory, thus only the virtual address can be obtained, while the physical address of the areas cannot be obtained.
Therefore, there is room for improvement in the art.
Many aspects of the embodiments can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the diagnosing system and method thereof. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
In general, the word “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, for example, Java, C, or Assembly. One or more software instructions in the modules may be embedded in firmware, such as an EPROM. It will be appreciated that modules may comprised connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage system. Embodiments of the present disclosure will now be described in detail with reference to the drawings.
Referring to
The processor 300 executes one or more computerized codes of the device 1 and other applications, to provide the functions of the electronic device 1.
The storage system 500 may be a read only memory (ROM), or be an external storage.
The determining module 10 determines whether there is a bad sector in the memory 700. If there is a bad sector in the memory 700, the determining module 10 generates an obtaining signal. If there is no bad sector in memory 700, the determining module 10 generates qualified information.
The display module 60 displays the qualified information on the screen of the device 1.
The obtaining module 20 obtains the virtual address of the bad sector responding to the obtaining signal.
The communication module 40 transmits the virtual address to the processing module 50. In the embodiment, the communication module 40 transmits the virtual address as an input/output (I/O) request package (IPR) to the processing module 50.
The processing module 50 converts the received virtual address into the corresponding physical address and transmits the physical address to the communication module 40.
The communication module 40 also transmits the received physical address to the display module 60.
The display module 60 also displays the physical address on a screen of the device 1.
Referring to
In step S201, in user mode the determining module 10 determines whether there is a bad sector in the memory 700. If there is no bad sector in the memory 700, the step S202 is implemented. If there is a bad sector in the memory 700, the determining module 10 generates an obtaining signal, the step S203 is implemented.
In step S202, in user mode the determining module 10 generates qualified information and the step S207 is implemented.
In step S203, in user mode the obtaining module 20 obtains the virtual address according to the obtaining signal and transmits the virtual address.
In step S204, the communication module 40 transmits the received virtual address to the processing module 50. In the embodiment, the communication module 40 transmits the virtual as an input/output (I/O) request package (IPR) to the processing module 50.
In step S205, in kernel mode the processing module 50 coverts the received virtual address into the corresponding physical address and transmits the corresponding physical address to the communication module 40.
In step S206, in user mode the communication module 40 transmits the received physical address to the display module 60.
In step S207, in user mode the display module 60 displays the received information in the screen of the device.
As described, when there is a bad sector in the memory, the diagnosing system can indicate the exact position of the memory by a physical address; people can easily analyze the reason for the bad sector in memory.
While various exemplary and preferred embodiments have been described, it is to be understood that the disclosure is not limited thereto. To the contrary, various modifications and similar arrangements (as would be apparent to those skilled in the art) are intended to also be covered. Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.
Number | Date | Country | Kind |
---|---|---|---|
201010285085.4 | Sep 2010 | CN | national |