CN102662714B - A kind of (SuSE) Linux OS and starting method thereof - Google Patents
A kind of (SuSE) Linux OS and starting method thereof Download PDFInfo
- Publication number
- CN102662714B CN102662714B CN201210113827.4A CN201210113827A CN102662714B CN 102662714 B CN102662714 B CN 102662714B CN 201210113827 A CN201210113827 A CN 201210113827A CN 102662714 B CN102662714 B CN 102662714B
- Authority
- CN
- China
- Prior art keywords
- file
- startup
- disk
- needed
- operating system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The invention discloses a kind of starting method of (SuSE) Linux OS, it is characterized in that, comprising: start the operating system; Judge whether to there is specified file, if judged result is no, then perform following steps: by read from disk this start needed for each startup file to start the operating system; Follow the tracks of to obtain log-on message to the start-up course of this operating system; Based on log-on message, each startup file needed for this startup is sorted; The filename of each startup file needed for being started by this after sequence and the physical address on disk thereof are stored in file, using this file as specified file, log-on message comprise this start needed for the filename of each startup file and the physical address on disk.The present invention uses disk read ahead technique, and the file in logic needed for the startup of order reading system, decreases the disk address-time that random file reading brings, thus reduces the time that in start-up course, operating system is waited for.
Description
Technical field
The present invention relates to field of computer technology, be specifically related to a kind of (SuSE) Linux OS and starting method thereof.
Background technology
There is due to linux system the advantages such as the low and application and development aboundresources of characteristic, the soft ware authorization expense of increasing income, be widely used, and in civilian and office and development field, there is increasing user.
Linux system has safe and reliable, these advantages such as kernel is customizable, open source, but the problem such as linux system also has weak point, and such as real-time is bad, and start-up time is long.
For linux system long problem start-up time, because linux system applied environment is complicated, the service application that the linux system of each version is installed is mostly not identical, therefore, how more effectively optimize linux system toggle speed, become an important research topic.
The user of desktop system is to accelerate the speed of start, so usual that first to solve operating system Holding Problem in start process.Current, be loaded into by the instrument relied on as readahead the file wanting to read in advance, to improve the speed of system loading.
When the instrument utilizing readahead such, need to realize the file that may use in start process to be loaded in memory body to accelerate the startup to operating system.Although current method accelerates startup to a certain extent, carry out disk physical addressing according to the file that will start and also can cause a large amount of stand-by period.For the deficiencies in the prior art, therefore need a kind of (SuSE) Linux OS starting method badly to accelerate the toggle speed of operating system, the time spent during minimizing os starting.
Summary of the invention
One of technical matters to be solved by this invention needs to provide a kind of method can accelerating (SuSE) Linux OS toggle speed.
In order to solve the problems of the technologies described above, the invention provides a kind of starting method of (SuSE) Linux OS, comprising: setting up procedure, start described operating system; Determining step, judges whether to there is specified file, if judged result is no, then performs following steps:
By read from disk this start needed for each startup file to start described operating system;
Follow the tracks of to obtain log-on message to the start-up course of operating system described in this;
Based on described log-on message, each startup file needed for this startup described is sorted;
The filename of each startup file needed for being started by this after sequence and the physical address on disk thereof are stored in file, using this file as described specified file,
Wherein, described log-on message comprise this start needed for the filename of each startup file and the physical address on disk.
According to the starting method of the (SuSE) Linux OS of another aspect of the invention, if the determination result is YES, then perform following steps: the content pre-reading described specified file, each startup file needed for starting based on this reading in advance and the physical address on disk thereof start described operating system to load each startup file described.
According to the starting method of the (SuSE) Linux OS of another aspect of the invention, if make a mistake when loading each startup file described and starting described operating system, then perform following steps: by read from disk this start needed for each startup file to start described operating system; Follow the tracks of to obtain log-on message to the start-up course of operating system described in this; Based on described log-on message, each startup file needed for this startup described is sorted; The filename of each startup file needed for being started by this after sequence and the physical address on disk thereof upgrade the content of described specified file, wherein, described log-on message comprise this start needed for the filename of each startup file and the physical address on disk.
According to the starting method of the (SuSE) Linux OS of another aspect of the invention, if the determination result is YES, then carry out following steps: judge in described specified file, whether to comprise the filename that this starts required file, if described specified file comprises the filename that this starts required file, then pre-read the content of described specified file, each startup file needed for starting based on this reading in advance and the physical address on disk thereof start described operating system to load each startup file described.
According to the starting method of the (SuSE) Linux OS of another aspect of the invention, the filename that this starts required file if do not comprise in described specified file, then perform following steps: by read from disk this start needed for each startup file to start described operating system; Follow the tracks of to obtain log-on message to the start-up course of operating system described in this; Based on described log-on message, each startup file needed for this startup described is sorted; The filename of each startup file needed for being started by this after sequence and the physical address on disk thereof upgrade the content of described specified file, wherein, described log-on message comprise this start needed for the filename of each startup file and the physical address on disk.
According to the starting method of the (SuSE) Linux OS of another aspect of the invention, readahead software is utilized to start to the content pre-reading described specified file described operating system.
According to the starting method of the (SuSE) Linux OS of another aspect of the invention, described log-on message also comprise this start needed for each startup file time of consuming when starting.
According to the starting method of the (SuSE) Linux OS of another aspect of the invention, based on described log-on message to described this start needed for the process of sorting of each startup file in, sort based on the startup file needed for starting this about the corresponding physical address on disk of each startup file in described log-on message.
According to the starting method of the (SuSE) Linux OS of another aspect of the invention, following the tracks of to obtain in the process of log-on message to the start-up course of this operating system, by carrying out following the tracks of to obtain log-on message for the system call of reading file, written document and getting file status information.
According to a further aspect in the invention, additionally provide a kind of (SuSE) Linux OS, described operating system adopts above-described method to start.
Compared with prior art, one or more embodiment of the present invention can have the following advantages by tool:
The present invention uses disk read ahead technique, file in logic needed for the startup of order reading system, decrease the disk address-time that random file reading brings, thus reduce the time that in start-up course, operating system is waited for, serve the effect accelerating os starting.
Other features and advantages of the present invention will be set forth in the following description, and, partly become apparent from instructions, or understand by implementing the present invention.Object of the present invention and other advantages realize by structure specifically noted in instructions, claims and accompanying drawing and obtain.
Accompanying drawing explanation
Accompanying drawing is used to provide a further understanding of the present invention, and forms a part for instructions, with embodiments of the invention jointly for explaining the present invention, is not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the schematic flow sheet of the starting method of (SuSE) Linux OS according to a first embodiment of the present invention;
Fig. 2 is the schematic flow sheet of the starting method of (SuSE) Linux OS according to a second embodiment of the present invention.
Embodiment
Describe embodiments of the present invention in detail below with reference to drawings and Examples, to the present invention, how application technology means solve technical matters whereby, and the implementation procedure reaching technique effect can fully understand and implement according to this.It should be noted that, only otherwise form conflict, each embodiment in the present invention and each feature in each embodiment can be combined with each other, and the technical scheme formed is all within protection scope of the present invention.
In addition, can perform in the computer system of such as one group of computer executable instructions in the step shown in the process flow diagram of accompanying drawing, and, although show logical order in flow charts, but in some cases, can be different from the step shown or described by order execution herein.
first embodiment
The speed that example of the present invention starts mainly through the Optimum Operation system that sorts to required file when starting, Fig. 1 is the schematic flow sheet of the starting method of (SuSE) Linux OS according to a first embodiment of the present invention, is below with reference to the accompanying drawings described in detail to each step of the present embodiment.
Step S110, starts (SuSE) Linux OS.
Step S120, judges whether to there is specified file.
Particularly, judging whether to there is specified file, if judged result is not for exist, enter step S130, if judged result is for existing, then entering step S170.
It should be noted that, specified file can be a database file, the filename of file required when storing os starting in this specified file and the physical address corresponding on disk of file, and the filename stored sorts according to the physical address of file on disk.The filename of file stores with the form of listed files, pre-reads when pre-reading later to facilitate according to sequencing.
Step S130, by read from disk this start needed for each startup file to start the operating system.
Step S140, follows the tracks of to obtain log-on message to the start-up course of this operating system.
Particularly, trace analysis is carried out to the start-up course in linux system, obtains log-on message, also can be described as Linux and start detailed report.
More specifically, by following the tracks of to obtain log-on message to the system call of reading file (be called for short read), written document (being called for short write) and getting file status information (being called for short stat) in kernel.By following the tracks of the log-on message obtained, being exported by debug fs order, obtaining all startup files required in system starting process and actual physical address corresponding on disk thereof.According to the listed files exported about startup file name, analyzed and be saved in database file, in database file, recorded the actual physical address information of each startup file at disk simultaneously.
In addition, also comprise in log-on message this start needed for the size of each startup file disk shared by time of consuming and each startup file when starting.
Step S150, sorts based on each startup file needed for starting this in log-on message.
Particularly, the startup file needed for this startup is sorted about the corresponding physical address on disk of each startup file based in log-on message.
More specifically, ordered arrangement can be carried out according to disk sector growing direction to each startup file.Circular disk sector is smallest addressable unit, file may take the sector of multiple dispersion simultaneously, such file reading can relate to discontinuous sector operation, the result sorted according to disk sector growing direction is that file is deposited continuously, and the physical address (sector) of each file is also continuous arrangement.
It should be noted that, the random file reading spended time of traditional magnetic disk is greater than according to disk physical location order file reading, because the time of disk addressing is longer, in order to better improve the speed that file reads, All Files being carried out sequence according to disk actual physical location and can save the file reading time.
In the present embodiment, by being not only the address-time shortening once certain startup file of request startup separately by the ordered arrangement that puts in order of sector on disk to each startup file, priorly to be, by keeping magnetic disk head to move with rectilinear direction, shorten the time of all startup files disk addressing in os starting process.
Step S160, the filename of each startup file needed for being started by this after sequence and the physical address on disk thereof are stored in file, using this file as specified file.
It should be noted that, by the filename of each startup file needed for this startup after sequence and the physical address on disk thereof are stored in file, this file is stored in disk as specified file to facilitate when starting next time, not needing the mode read by disk to start the operating system, starting (SuSE) Linux OS by pre-reading the content of specified file.Decrease the time that disk addressing is waited for, accelerate the speed of os starting.
Step S170, pre-reads the content of specified file, and each startup file needed for starting based on this reading in advance and the physical address on disk thereof start operating system to load each startup file.
Particularly, what can utilize (SuSE) Linux OS inside pre-reads machine-processed readahead to pre-read sorted file in specified file, after running through in advance, in the process pre-read, the data of associated documents leave in internal memory, then to associated documents carry out operation can not produce real disk read-write.
More specifically, the content of specified file is pre-read in units of file, according to the filename read and file, this startup file reads in internal memory from disk by the physical address on disk, because the startup file name in specified file carries out sorting according to the actual physical address at disk, therefore magnetic disk head moves with rectilinear direction and reads startup file.Until after the content of specified file is all pre-read, according to all startup files stored in internal memory to complete the startup to operating system.
For example, if the boot sequence of startup file during os starting reads A → B → C → D, B → C → D → A according to the sequence of Disk Locality after sequence, when next operation system starts, readahead pre-reads mechanism and first can pre-read these files by the order that the B → C sorted with Disk Locality → D → A is such, os starting still reads according to the order that A → B → C → D is such, but A, B, C, D file is now all inside buffer memory, do not have I/O operation.
It should be noted that, readahead mechanism is loaded in memory body by the file that may use in starting up's process in advance, and wherein memory body is generally a page cache memory (pagecache).When Linux reading and writing of files, page cache memory is used for the logic content of cache file, thus accelerates the access to reflection and data on disk, therefore when os starting formula performs, just can save the time of reading in file, and then accelerate starting up speed.
In order to make that readahead mechanism can be correct system is started time required startup file read, must be pre-loaded and arrange having at present how many file needs, the filename of the startup file arranged in the specified file obtained as above-mentioned.
It should be noted that, pre-read and effectively can reduce the addressing number of times of disk and the I/O stand-by period of application program, order read-write is good at by disk, is bad at random I/O, I/O and postpones very large.
In addition, if make a mistake when loading each startup file and starting operating system, then perform step S130, step S140 and step S150, the filename of each startup file needed for being started by this after sequence after performing S150 and the physical address on disk thereof upgrade the content of specified file.
Due to when loading each startup file, may make a mistake by the corresponding physical address of startup file needed for this starts, causing loading this startup file.Therefore the mode by again reading according to disk starts the operating system and upgrades the content of specified file, makes, when utilizing the mode pre-reading specified file to start the operating system next time, can carry out smoothly and start quickly speed.
The embodiment of the present invention, starting the operating system according to the mode of the startup file name of disk sector sequence by pre-reading to be stored in specified file, decreasing the stand-by period of disk addressing, accelerating the speed of os starting.
second embodiment
Fig. 2 is the schematic flow sheet of operating system restorative procedure according to a second embodiment of the present invention, is described this embodiment referring to Fig. 2.
For convenience of explanation, no longer the step identical with previous embodiment is launched in detail, and only stress the difference with previous embodiment.In fig. 1 and 2, to step same or analogous with previous embodiment, have employed identical Reference numeral.
Step S110, starts (SuSE) Linux OS.
Step S120, judges whether to there is specified file.
Particularly, judging whether to there is specified file, if judged result is not for exist, enter step S130, if judged result is for existing, then entering step S210.
Step S130, by read from disk this start needed for each startup file to start the operating system.
Step S140, follows the tracks of to obtain log-on message to the start-up course of this operating system.
Step S150, sorts based on each startup file needed for starting this in log-on message.
Step S160, the filename of each startup file needed for being started by this after sequence and the physical address on disk thereof are stored in file, using this file as specified file.
Step S210, judges whether comprise the filename that this starts required file in described specified file.
If specified file comprises the filename that this starts required file, then enter step S170, if judged result is do not comprise the filename that this starts required file in specified file, then performs step S130, step S140 and step S150, then enter step S180.
Step S180, the filename of each startup file needed for being started by this after sequence and the physical address on disk thereof upgrade the content of specified file.
It should be noted that, because (SuSE) Linux OS can carry out the issue of redaction in not setting-up time section for the various leaks of system, the file of the system after therefore upgrading, some file during the os starting particularly increased, do not exist in specified file before, need when os starting to read these files increased from disk, therefore the stand-by period of the file being read increase by disk can be produced, compared with the mode started the operating system with the content by pre-reading specified file, the time spent by Starting mode of being read the file of increase by disk is longer.
Therefore by again obtaining startup file needed for this os starting to upgrade the content of specified file, can ensure that required startup file correctly can be loaded into and complete the startup of this operating system when next operation system starts by the specified file after pre-reading renewal, and operating system after starting is the operating system of latest edition, does not need to upgrade again.
Step S170, pre-reads the content of specified file, and each startup file needed for starting based on this reading in advance and the physical address on disk thereof start operating system to load each startup file.
In addition, the invention still further relates to a kind of (SuSE) Linux OS, this operating system realizes the startup of (SuSE) Linux OS by implementing the first embodiment and the second embodiment.
In embodiments of the present invention, by judging whether the file content of specified file comprises the startup file needed for this startup, the version that can make the operating system after starting is up-to-date.By pre-reading the content of specified file, can speeding up operation system start time.
Experimental result:
According to not adopting readahead method, adopt the method (SuSE) Linux OS that beta version is Ubuntu on X86 machine of readahead method and the second embodiment start spent by time, data start-up time of these three kinds of methods are as follows:
Ubuntu does not adopt readahead to start required time: 40S on X86 machine
Ubuntu have employed readahead and starts required time: 30S on X86 machine
After Ubuntu optimizes on X86 machine, readahead starts required time: 20S
Can be obtained by above data, utilize the embodiment of the present invention to start (SuSE) Linux OS, can start quickly speed significantly, save stand-by period during startup.
Those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
Although the embodiment disclosed by the present invention is as above, the embodiment that described content just adopts for the ease of understanding the present invention, and be not used to limit the present invention.Technician in any the technical field of the invention; under the prerequisite not departing from the spirit and scope disclosed by the present invention; any amendment and change can be done what implement in form and in details; but scope of patent protection of the present invention, the scope that still must define with appending claims is as the criterion.
Claims (6)
1. a starting method for (SuSE) Linux OS, is characterized in that, comprising:
Setting up procedure, starts described operating system;
Determining step, judges whether to there is specified file,
If judged result is no, then perform following steps:
By read from disk this start needed for each startup file to start described operating system;
Follow the tracks of to obtain log-on message to the start-up course of operating system described in this;
Based on described log-on message, according to disk sector growing direction, each startup file needed for this startup described is sorted;
The filename of each startup file needed for being started by this after sequence and the physical address on disk thereof are stored in file, using this file as described specified file,
Wherein, described log-on message comprise this start needed for the filename of each startup file and the physical address on disk,
If the determination result is YES, then following steps are performed:
Pre-read the content of described specified file, each startup file needed for starting based on this reading in advance and the physical address on disk thereof start described operating system to load each startup file described, if make a mistake when loading each startup file described and starting described operating system, then perform following steps:
By read from disk this start needed for each startup file to start described operating system;
Follow the tracks of to obtain log-on message to the start-up course of operating system described in this;
Based on described log-on message, according to disk sector growing direction, each startup file needed for this startup described is sorted;
The filename of each startup file needed for being started by this after sequence and the physical address on disk thereof upgrade the content of described specified file.
2. method according to claim 1, is characterized in that,
The machine-processed readahead that pre-reads of (SuSE) Linux OS inside is utilized to start to the content pre-reading described specified file described operating system.
3. method according to claim 1, is characterized in that,
Described log-on message also comprise this start needed for each startup file time of consuming when starting.
4. method according to claim 1, is characterized in that, based on described log-on message to described this start needed for the process of sorting of each startup file in,
Startup file needed for this startup is sorted about the corresponding physical address on disk of each startup file based in described log-on message.
5. method according to claim 1, is characterized in that, is following the tracks of to obtain in the process of log-on message to the start-up course of this operating system,
By carrying out following the tracks of to obtain log-on message for the system call of reading file, written document and getting file status information.
6. a (SuSE) Linux OS, is characterized in that, described operating system adopts the method according to any one of claim 1 to 5 to start.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210113827.4A CN102662714B (en) | 2012-04-17 | 2012-04-17 | A kind of (SuSE) Linux OS and starting method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210113827.4A CN102662714B (en) | 2012-04-17 | 2012-04-17 | A kind of (SuSE) Linux OS and starting method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102662714A CN102662714A (en) | 2012-09-12 |
CN102662714B true CN102662714B (en) | 2015-10-07 |
Family
ID=46772215
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210113827.4A Active CN102662714B (en) | 2012-04-17 | 2012-04-17 | A kind of (SuSE) Linux OS and starting method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102662714B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102968324B (en) * | 2012-11-30 | 2015-11-25 | 北京奇虎科技有限公司 | The method for sorting of computer system power-on file and device |
CN102968323B (en) * | 2012-11-30 | 2016-05-25 | 北京奇虎科技有限公司 | Terminal and the method that realizes computer system power-on acceleration |
CN103677900B (en) * | 2013-11-15 | 2017-05-31 | 北京奇虎科技有限公司 | A kind of method and apparatus of computer equipment system Acceleration of starting |
CN107247640B (en) * | 2017-05-22 | 2020-07-14 | 深圳市科力锐科技有限公司 | Rapid restoration method and device for operating system |
CN109508535B (en) * | 2018-10-30 | 2021-07-13 | 百富计算机技术(深圳)有限公司 | Firmware security authentication method and device and payment terminal |
CN114625433A (en) * | 2020-11-27 | 2022-06-14 | 北京字跳网络技术有限公司 | Application program starting method and system |
CN112559060A (en) * | 2020-12-09 | 2021-03-26 | 珠海全志科技股份有限公司 | Method and device for accelerating startup based on file pagecache pre-reading |
CN112654075A (en) * | 2020-12-22 | 2021-04-13 | 广州芯之联科技有限公司 | Method and system for rapidly connecting AP (access point) by WLAN (wireless local area network) cold start |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7669044B2 (en) * | 2006-09-29 | 2010-02-23 | Microsoft Corporation | Accelerated system boot |
US20080191014A1 (en) * | 2007-02-08 | 2008-08-14 | Heisei Electronics Co., Ltd. | Multifunctional card reader |
US8230208B2 (en) * | 2009-04-20 | 2012-07-24 | Intel Corporation | Booting an operating system of a system using a read ahead technique |
-
2012
- 2012-04-17 CN CN201210113827.4A patent/CN102662714B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN102662714A (en) | 2012-09-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102662714B (en) | A kind of (SuSE) Linux OS and starting method thereof | |
JP6221086B2 (en) | System operating system boot, prefetch controller, storage device, method, program, and computer-readable recording medium performed using prefetch technology | |
Hahn et al. | Improving file system performance of mobile storage systems using a decoupled defragmenter | |
US8561194B2 (en) | Memory storage device and memory controller and virus scanning method thereof | |
US8347029B2 (en) | Systems and methods for fast state modification of at least a portion of non-volatile memory | |
CN108132890B (en) | Garbage recycling method, device and equipment for memory chip and storage medium | |
US9223553B2 (en) | Methods and apparatus to validate translated guest code in a dynamic binary translator | |
KR101555210B1 (en) | Apparatus and method for downloadin contents using movinand in portable terminal | |
CN110718264A (en) | Method and device for testing information of solid state disk, computer equipment and storage medium | |
CN113272903B (en) | Handling operation conflicts in non-volatile memory | |
US20110265072A1 (en) | Dynamic Installation of Files for Running Programs | |
CN112860325B (en) | Automatic and rapid hardware drive preassembling method and system in diskless environment | |
US10402101B2 (en) | System and method for using persistent memory to accelerate write performance | |
US20040225874A1 (en) | Method for reduced BIOS boot time | |
CN111176566B (en) | eMMC read-write control method supporting queue command and storage medium | |
US7886205B2 (en) | Verification of a data processing system using overlapping address ranges | |
CN111338562A (en) | Data storage device and data processing method | |
US7975303B1 (en) | Efficient file scanning using input-output hints | |
US11494113B2 (en) | Computer program product and method and apparatus for scheduling execution of host commands | |
US20180341723A1 (en) | Triggering untriggered assertions in design verification | |
US9495278B2 (en) | Dynamic discovery of data segments within instrumented code | |
CN111694727A (en) | Network card firmware upgrading and downgrading test method, system, terminal and storage medium | |
CN111400342A (en) | Database updating method, device, equipment and storage medium | |
Jun et al. | We Ain't Afraid of No File Fragmentation: Causes and Prevention of Its Performance Impact on Modern Flash {SSDs} | |
CN116126239B (en) | Method for improving NOR FLASH write-in performance of ZNS solid state disk |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |