A method for restoring system configuration information of a network attached storage includes the steps of: setting system configuration information of an network attached storage as a backup file; registering an interrupt handler; pressing down an input key (16) to turn off a power switch (K1) and generate an interrupt signal; invoking the interrupt handler to process the interrupt signal and returning interrupt GPIO information; determining whether an operating system receives the interrupt GPIO information from the interrupt handler; sending a periodical voltage to a second pin (P2) for blinking a LED (L1) if the operating system receives the interrupt GPIO information from the interrupt handler; invoking the backup file to restore the system configuration information of the network attached storage; and sending a high voltage command to the second pin for powering off the LED, which indicates that the system configuration information has been restored.
|
1. A method for restoring system configuration information of a network attached storage, the network attached storage comprises a general purpose input/output (GPIO) device, the GPIO device comprises a first pin, a power switch connected to the first pin, a light emitting diode (LED) connected to the power switch, and a second pin connected to the LED, the method comprising the steps of:
setting system configuration information of the network attached storage as a backup file;
registering an interrupt handler;
pressing down an input key connected to the power switch to turn off the power switch and generate an interrupt signal in the first pin;
invoking the interrupt handler to process the interrupt signal and returning interrupt GPIO information;
determining whether an operating system of the network attached storage receives the interrupt GPIO information from the interrupt handler;
sending a periodical voltage to the second pin for blinking the LED if the operating system receives the interrupt GPIO information from the interrupt handler;
invoking the backup file to restore the system configuration information of the network attached storage; and
sending a high voltage command to the second pin for powering off the LED, which indicates that the system configuration information has been restored.
2. The method according to
processing the interrupt signal by executing a top half stack of the interrupt handler; and
processing the interrupt signal by executing a bottom half stack of the interrupt handler.
3. The method according to
receiving the interrupt signal;
determining whether the interrupt signal is a GPIO interrupt signal; and
configuring an interrupt symbol of the interrupt signal if the interrupt signal is a GPIO interrupt signal.
4. The method according to
resetting the interrupt symbol as zero; and
returning the interrupt GPIO information.
|
1. Field of the Invention
The present invention generally related to methods for restoring system configuration information of a network attached storage.
2. Description of Related Art
Most network attached storage (NAS) devices are embedded systems. NAS generally refers to a data storage element or device that is connected to a network allowing access to computers on the network, thus providing more storage space for users.
The NAS often resides in a machine that is expected to run continuously for years without errors. Therefore software for NAS is usually tested more thoroughly than general purpose operating systems or applications software. When systems errors or other critical errors occur in the NAS, system configuration information of the NAS may be destroyed or altered. The current method for restoring the NAS is to reload new system configuration information on a Flash ROM of the NAS. However, the current method for restoring the NAS has disadvantages, such as some data of the original system configuration information are lost because the new system configuration information is not the same as the original system configuration information.
What is needed is a method for restoring a network attached storage, which can restore system configuration information of the NAS.
One preferred embodiment provides a method for restoring a network attached storage. The network attached storage includes a general purpose input/output (GPIO) device, the GPIO device comprises a first pin, a power switch, a light emitting diode (LED) and a second pin connected in turn. The method includes the steps of: setting system configuration information of the network attached storage as a backup file; registering an interrupt handler; pressing down an input key connected to the power switch to turn off the power switch and generate an interrupt signal in the first pin; invoking the interrupt handler to process the interrupt signal and returning interrupt GPIO information; determining whether an operating system of the network attached storage receives the interrupt GPIO information from the interrupt handler; sending a periodical voltage to the second pin for blinking the LED if the operating system receives the interrupt GPIO information from the interrupt handler; invoking the backup file to restore the system configuration information of the network attached storage; and sending a high voltage command to the second pin for powering off the LED, which indicates that the system configuration information has been restored.
Other systems, methods, features, and advantages will be or become apparent to one skilled in the art upon examination of the following drawings and detailed description.
In step S11, system configuration information of the NAS is set as a backup file in the Flash-ROM 14. The system configuration information includes startup information, user information, and start services of restoring the NAS.
In step S12, GPIO system setting is initialized. The details of initializing GPIO system setting are described in
In step S13, when the system configuration of the NAS is destroyed, the input key 16 is pressed down to turn off the power switch K1 and generate a hardware interrupt and an interrupt signal.
In step S14, the interrupt handler is invoked to process the interrupt signal. The details of processing the interrupt signal by the interrupt handler are described in
In step S15, it is to determine whether the operating system receives interrupt GPIO information sent from the interrupt handler.
In step S16, if the operating system receives the interrupt GPIO information from the interrupt handler, a periodical voltage is sent to the second pin P2 of the GPIO device 12 for blinking the LED, which indicates that the system configuration information is in a restoring state.
In step S17, the backup file is invoked to restore the system configuration information of the NAS.
In step S18, a high voltage is sent to the second pin P2 for powering off the LED L1, which indicates that the system configuration information has been restored.
In the step S15, if the operating system hasn't received the interrupt GPIO information from the interrupt handler, repeat step S15 to determining whether the operating system receives interrupt GPIO information sent from the interrupt handler.
In step S161, the high voltage signal from the first pin P1 is read, and the interrupt signal is received.
In step S162, it is to determine whether the interrupt signal is GPIO interrupt signal. If the interrupt number of the interrupt signal is between 32 and 64, the interrupt signal is GPIO interrupt signal; otherwise, if the interrupt number of the interrupt signal is not between 32 and 64, the interrupt signal is not GPIO interrupt signal.
In step S163, an interrupt symbol of the interrupt signal is configured with a global variable N if the interrupt signal is GPIO interrupt signal. The initial value of the global variable N is zero.
In step S164, the bottom half stack of the interrupt handler is dispatched to process the interrupt signal.
If the interrupt signal is GPIO interrupt signal in step S162, the procedure ends.
In step S165, the interrupt symbol N is reset as zero.
In step S166, interrupt GPIO information is returned to the application layer of the NAS, and then the procedure returns to step S15 to process the interrupt GPIO information.
It should be emphasized that the above-described embodiments of the preferred embodiments, particularly, any “preferred” embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the invention. Many variations and modifications may be made to the above-described preferred embodiment(s) without departing substantially from the spirit and principles of the invention. All such modifications and variations are intended to be included herein within the scope of this disclosure and the above-described preferred embodiment(s) and protected by the following claims.
Patent | Priority | Assignee | Title |
Patent | Priority | Assignee | Title |
6438684, | Nov 03 1997 | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | Push button shutdown and reset of embedded systems |
6496858, | Jul 14 1997 | Tut Systems, Inc. | Remote reconfiguration of a secure network interface |
6751681, | Jun 18 2001 | Sony Corporation; Sony Electronics Inc. | System and method for providing automatic firmware updates and diagnostics for network attached storage devices |
7310704, | Nov 02 2004 | Veritas Technologies LLC | System and method for performing online backup and restore of volume configuration information |
20030037120, | |||
20030140132, | |||
20050034122, | |||
20070260717, | |||
20080117920, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Nov 14 2007 | TONG, MO-YING | HONG FU JIN PRECISION INDUSTRY SHENZHEN CO , LTD | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 020147 | /0889 | |
Nov 14 2007 | TONG, MO-YING | HON HAI PRECISION INDUSTRY CO , LTD | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 020147 | /0889 | |
Nov 22 2007 | Hong Fu Jin Precision Industry (ShenZhen) Co., Ltd. | (assignment on the face of the patent) | / | |||
Nov 22 2007 | Hon Hai Precision Industry Co., Ltd. | (assignment on the face of the patent) | / | |||
Dec 27 2012 | HON HAI PRECISION INDUSTRY CO , LTD | Gold Charm Limited | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 029701 | /0374 | |
Dec 27 2012 | HONG FU JIN PRECISION INDUSTRY SHENZHEN CO , LTD | Gold Charm Limited | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 029701 | /0374 |
Date | Maintenance Fee Events |
Oct 24 2013 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Dec 18 2017 | REM: Maintenance Fee Reminder Mailed. |
Jun 04 2018 | EXP: Patent Expired for Failure to Pay Maintenance Fees. |
Date | Maintenance Schedule |
May 04 2013 | 4 years fee payment window open |
Nov 04 2013 | 6 months grace period start (w surcharge) |
May 04 2014 | patent expiry (for year 4) |
May 04 2016 | 2 years to revive unintentionally abandoned end. (for year 4) |
May 04 2017 | 8 years fee payment window open |
Nov 04 2017 | 6 months grace period start (w surcharge) |
May 04 2018 | patent expiry (for year 8) |
May 04 2020 | 2 years to revive unintentionally abandoned end. (for year 8) |
May 04 2021 | 12 years fee payment window open |
Nov 04 2021 | 6 months grace period start (w surcharge) |
May 04 2022 | patent expiry (for year 12) |
May 04 2024 | 2 years to revive unintentionally abandoned end. (for year 12) |