1. Technical Field
The invention relates to personal computer systems. More particularly, the invention relates to a cache boot mechanism.
2. Description of the Prior Art
Many personal computer systems require more than 60 seconds to boot. This boot time is unacceptable for instant-on solutions. Among the various factors that affect boot time is the disk I/O waiting time during system boot. Accordingly, it would be desirable to provide a mechanism that reduces disk/IO waiting time during system boot.
One embodiment of the invention provides a block device driver to accomplish system boot using cache data. This mechanism improves computer boot time by reducing disk I/O (Input/Output) waiting time during system boot. This embodiment also can replace the traditional loop block device driver, can co-exist with the loop block device driver, and can perform a standard block device driver role.
One embodiment of the invention provides a sector based caching system that improves system and application launch time. It utilizes a block device driver to accomplish system boot using cached data. This mechanism improves computer boot time by reducing disk I/O (Input/Output) waiting time and hard drive/flash initialization time during system boot. This embodiment of the block device driver also can replace the traditional loop block device driver, can co-exist with the loop block device driver, and can perform a standard block device driver role.
An embodiment of the invention provides a mechanism that effects a boot environment for a computer operating system, such as the Linux operating system (OS). One aspect of the invention makes system boot and application launch faster. According to the inventor's investigations, the Linux OS does not need to access all data in the hard drive during boot time. All required data or the sectors where the necessary data is stored can be found during the boot time procedure. One aspect of the invention takes advantage of this procedure to prepare cached data for the next boot. In addition, the Linux OS generally has a First Time Wizard procedure that runs when the system is booted for the first time which can be used to prepare the cached data as well. Based on this approach, we have invented a new block device driver to accomplish system boot using cached data. This mechanism for system booting is referred to herein as “Cache Boot.”
The cache boot mechanism can only add a cache data function that is beyond the normal boot. The following discussion describes the mechanism in greater detail.
If cache data is not found, the system initializes the hard disk and reads the real data from hard disk to the logical block device interface (330) and kernel thread processing continues (350).
The cache boot driver can seek data after cache data is found. If the requested cache data is found, the sector request is returned to the upper block layer with the cache data (380) and processing continues (390).
If data is not found (350) and the block device data is not set (360), the cache boot driver generates a sector fault, which is similar to a page fault for a virtual memory mechanism, and then it joins an exception handling procedure as follows:
In general, the cache data is now complete, except that the system has been updated. Thus, the system initializes that hard disk after the desktop is ready.
An embodiment of the invention uses a thread pool to process all block devices, instead of creating a thread for each block device. Thus, one thread can serve more than one block device. This approach optimizes the thread model, compared with the loop device driver, and thus saves system resources.
In this embodiment, a boot driver module 17 is provided in the block device driver layer, i.e. at the same system level as the loop block device driver 16 or other block device drivers 18. An embodiment of the invention provides a boot environment without the need for hard disk access during the OS boot. Thus, the system does not need to load the driver of the hard disk during boot time. Instead, the system uses cache data to boot. In a real world application of the invention, if the system has been changed, such as the result of adding an upgrade or new packages, then cache missing can occur in certain cases while using such cache data. In this situation, the system loads the hard disk driver to read real data from the hard disk. This mechanism can be thought of as a backup or failover feature of the invention.
A generic block layer provides common APIs for processing the block sector I/O request in Linux OS. An embodiment of the invention also provides a normal block device driver, and thus must follow the APIs to implement a call back routine for the Linux OS.
The computer system 1600 includes a processor 1602, a main memory 1604 and a static memory 1606, which communicate with each other via a bus 1608. The computer system 1600 may further include a display unit 1610, for example, a liquid crystal display (LCD) or a cathode ray tube (CRT). The computer system 1600 also includes an alphanumeric input device 1612, for example, a keyboard; a cursor control device 1614, for example, a mouse; a disk drive unit 1616, a signal generation device 1618, for example, a speaker, and a network interface device 1628.
The disk drive unit 1616 includes a machine-readable medium 1624 on which is stored a set of executable instructions, i.e. software, 1626 embodying any one, or all, of the methodologies described herein below. The software 1626 is also shown to reside, completely or at least partially, within the main memory 1604 and/or within the processor 1602. The software 1626 may further be transmitted or received over a network 1630 by means of a network interface device 1628.
In contrast to the system 1600 discussed above, a different embodiment uses logic circuitry instead of computer-executed instructions to implement processing entities. Depending upon the particular requirements of the application in the areas of speed, expense, tooling. costs, and the like, this logic may be implemented by constructing an application-specific integrated circuit (ASIC) having thousands of tiny integrated transistors. Such an ASIC may be implemented with complementary metal oxide semiconductor (CMOS), transistor-transistor logic (TTL), very large systems integration (VLSI), or another suitable construction. Other alternatives include a digital signal processing chip
(DSP), discrete circuitry (such as resistors, capacitors, diodes, inductors, and transistors), field programmable gate array (FPGA), programmable logic array (PLA), programmable logic device (PLD), and the like.
It is to be understood that embodiments may be used as or to support software programs or software modules executed upon some form of processing core (such as the CPU of a computer) or otherwise implemented or realized upon or within a machine or computer readable medium. A machine-readable medium includes any mechanism for storing or transmitting information in a form readable by a machine, e.g., a computer. For example, a machine readable medium includes read-only memory (ROM); random access memory (RAM); magnetic disk storage media; optical storage media; flash memory devices;
electrical, optical, acoustical or other form of propagated signals, for example, carrier waves, infrared signals, digital signals, etc.; or any other type of media suitable for storing or transmitting information.
Although the invention is described herein with reference to the preferred embodiment, one skilled in the art will readily appreciate that other applications may be substituted for those set forth herein without departing from the spirit and scope of the present invention. Accordingly, the invention should only be limited by the Claims included below.