1. Field of the Invention
The invention relates to booting methods, and in particular, to a method for executing an encrypted boot loader.
2. Description of the Related Art
Conventionally, an embedded system such as a programmable device is controlled by firmware, and the firmware may also be referred to as an operation system (OS) designated to provide various functionalities on the programmable device. The firmware is generally stored in a Read Only Memory (ROM) within the programmable device. To protect the programmable device from eavesdropping, the operation system in the ROM is in an encrypted form. To initialize the operation system, a boot loader is provided as an executable code stream comprising essential parameters required by system hardware. The boot loader may be first loaded upon system start up (initialization), and a core then executes the boot loader instructions to initialize system hardware, thereby initializing the operation system.
The operation system may be protected by encryption, however, the boot loader must be in a plaintext form because the core can not interpret and execute an encrypted code. Thus, the boot loader is vulnerable from eavesdropping, and essential information to decipher the operation system may still be compromised. It is therefore desirable to provide an enhanced structure for securing the firmware.
A detailed description is given in the following embodiments with reference to the accompanying drawings.
An exemplary embodiment of a programmable device is provided, comprising a memory for storage of an encrypted boot loader, and a processing unit coupled to the ROM. In the processing unit, a boot straper decrypts the encrypted boot loader into a plurality of boot loader instructions when the programmable device is initialized. A core executes boot loader instructions to accordingly load and execute an operation system.
Another embodiment provides a booting method implemented on the programmable device. First, the encrypted boot loader is decrypted into boot loader instructions when the programmable device is initialized. Thereafter, the boot loader instructions are executed to accordingly load and execute an operation system.
The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
a, 2b and 2c are flowcharts of the booting method according to the invention; and
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
The encrypted boot loader 212 is transmitted to the boot straper 230 as a plurality of encrypted codes #E. The boot straper 230 sequentially decrypts the encrypted codes #E to acquire a plurality of boot loader instructions #D executable by the core 222. In an embodiment, the encrypted boot loader 212 comprises customized parameters for executing the operation system 214, such as privilege information, file system information, partition and root directory configuration, and device driver tuning parameters. Furthermore, the operation system 214 may be stored in the memory 210 or other external memories, and the encrypted boot loader 212 must include an entry point indicating where to load the operation system 214. In the embodiment, the encrypted boot loader 212 is encrypted, thus the information contained in the encrypted boot loader 212 can be protected from eavesdropping. As described, the operation system 214 is usually in an encrypted form, thus, an algorithm or a key can be defined in the encrypted boot loader 212 or embedded inside the chip for decrypting the operation system 214 into an executable form.
As shown in
The internal memory 224 may be used as a buffer for storing the encrypted codes #E before the decryptor 234 performs the decryption, and a buffer for storing the boot loader instructions #D before they are executed by the core 222. When the programmable device 200 is initialized or powered up, the controller 232 asserts a hold signal #hold to prevent the core 222 from fetching and executing instructions. As an alternative approach, the hold signal #hold may modify a program counter of the core 222 to cause the core 222 halted. Decryption of the encrypted boot loader 212 is performed during the suspension of the core 222. The controller 232 first consequently fetches the encrypted codes #E from the memory 210 to buffer in the internal memory 224, and the decryptor 234 then reads the internal memory 224 to decrypt the encrypted codes #E into the boot loader instructions #D.
When the boot loader instructions #D are generated by the decryptor 234, the boot loader instructions #D are buffered in the internal memory 224, available for the core 222 to execute. At this instance, the controller 232 de-asserts the hold signal #hold, such that the core 222 is enabled to fetch and execute the boot loader instructions #D from the internal memory 224.
In an alternative embodiment, the decryptor 234 may directly output the boot loader instructions #D to the core 222 instead of buffering in the internal memory 224. In this case, when the decryptor 234 decrypts the boot loader instructions #D, the controller 232 de-asserts the hold signal #hold, such that the core 222 directly fetches the decrypted boot loader instructions #D from the decryptor 234 to execute.
In an alternative embodiment, the controller 232 does not buffer the encrypted codes #E read from the memory 210 into the internal memory 224 after the core 222 is halted. To the contrary, the controller 232 directly passes the encrypted codes #E from the memory 210 to the decryptor 234 (doted line #E), and the decryptor 234 simultaneously decrypts the encrypted codes #E into the boot loader instructions #D. As described, the output of decryptor 234 has two alternative data paths. The boot loader instructions #D may be buffered in the internal memory 224, or directly sent to the core 222 (doted line #D). If the controller 232, decryptor 234 and core 222 simultaneously function as a pipeline to directly provide the boot loader instructions #D to the core 222 (dotted line data paths #E and #D), it would not be necessary to hold the core 222, and the hold signal #hold may not be necessary in this case.
The embodiment of programmable device 200 is particularly adaptable for a compact disc (CD) ROM device, a digital versatile device (DVD) ROM or a Blu-ray device. However, any firmware based devices may also be applicable.
a, 2b and 2c are flowcharts of the booting method according to embodiments of the invention. In
b is a flowchart of a decryption process employing the internal memory 224. In step 311, the decryption process is initialized after the core 222 is halted. In step 313, the encrypted codes #E are buffered to the internal memory 224. In step 315, the decryptor 234 reads the internal memory 224 in the internal memory 224 to decrypt the encrypted codes #E. In step 317, the decryptor 234 stores the boot loader instructions #D decrypted from the encrypted codes #E in the internal memory 224.
c is a flowchart of execution of the boot loader instructions #D. In step 321, the core 222 is un-halt when the decryption is complete. In step 323, the core 222 fetches boot loader instructions #D from the internal memory 224. In step 325, the boot loader instructions #D are executed, and consequently, the operation system 214 can be securely initialized and loaded.
While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.