Summary of the invention
Fundamental purpose of the present invention is at the deficiencies in the prior art, provides a kind of and can detect fdisk automatically simultaneously from portable hard drive startup (SuSE) Linux OS, and the method for automatic carry fdisk.
The present invention is achieved by the following technical solutions:
A kind of method that on portable hard drive, realizes starting (SuSE) Linux OS:
Step 1: in portable hard drive, set up (SuSE) Linux OS;
Step 1: enter the BIOS of PC, PC is set to USB-HDD or the USB-ZIP mode starts;
Step 2: the start-up system boot, the user selects the version of Linux, and system bootstrap routine is loaded into linux kernel and Initrd the internal memory of PC from portable hard drive
Step 3: start linux kernel, initialization system and loading tasks
Step 4: enter the file system of Initrd, switch to the root file system on the portable hard drive
Step 5: detection hardware equipment and install driver automatically automatically, and dispose automatically
Step 6: start desktop system, after the user imports username and password, detect fdisk automatically, and automatic carry fdisk.
The present invention further realizes by following technology solution:
The aforesaid method that on portable hard drive, realizes starting (SuSE) Linux OS, wherein the described step of setting up (SuSE) Linux OS in portable hard drive of step 1 is:
Step 100: compile source code and configuration file generate linux kernel;
Step 101: create linux system catalogue and configuration script, generate Initrd
Step 102: compile source code and configuration file generate root file system
Step 103: in portable hard drive, set up boot partition, with root file system, linux kernel, Initrd etc. copy in the boot partition.
Step 104: utilize tool software that this boot partition is made hard disk mirror-image
Step 105: utilize working software that hard disk mirror-image is copied in the portable hard drive
The present invention has realized that linux system from the method that portable hard drive starts, expanded the function of portable hard drive, makes portable hard drive become efficient, safe, intelligent mobile office application platform.The personal desktop's system environments that has solved during portable hard drive uses can not be moved, the threat of computer virus infection, and problems such as the potential safety hazard of data leak are for portable hard drive has embedded a (SuSE) Linux OS.And the solution of the present invention is to be based upon on the basis of (SuSE) Linux OS of open source code, increases under few condition at the cost of portable hard drive, the desktop environment and the application program that portable hard drive have been had be similar to Window operating system.
Purpose of the present invention, advantage and characteristics will illustrate and explain that these embodiment only provide as an example by the unrestricted explanation of following preferential embodiment.
Embodiment
The present invention has adopted the USB start-up technique based on the linux system of open source code, the hardware Automatic Measurement Technique, and the automatic carry technology of hard disk is provided at the method that starts (SuSE) Linux OS on the portable hard drive.
As shown in Figure 1, the step of setting up (SuSE) Linux OS in portable hard drive is:
Step 100: compile source code and configuration file generate linux kernel;
Step 101: create linux system catalogue and configuration script, generate Initrd
Step 102: compile source code and configuration file generate root file system
Step 103: in portable hard drive, set up boot partition, with root file system, linux kernel, Initrd etc. copy in the boot partition.
Step 104: utilize tool software that this boot partition is made hard disk mirror-image
Step 105: utilize working software that hard disk mirror-image is copied in the portable hard drive
See also shown in Figure 2ly, the step of method that starts (SuSE) Linux OS on portable hard drive is as follows:
Step 2: enter the BIOS of PC, PC is set to USB-HDD or the USB-ZIP mode starts; Its concrete steps are:
Step 200: open the PC power supply
Step 201: the BIOS that enters PC
Step 202: with PC step 1: the BIOS that enters PC, PC is set to USB-HDD or the USB-ZIP mode starts (if the BIOS of PC does not support USB-HDD and USB-ZIP mode to start, the method that then starts (SuSE) Linux OS on portable hard drive can not be used)
Step 203: preserve setting, and restart PC;
Step 3: the start-up system boot, the user selects the version of Linux, and system bootstrap routine is loaded into linux kernel and Initrd the internal memory of PC from portable hard drive, and its concrete steps are:
After step 301:PC machine restarts, executive system boot at first
Step 302: system bootstrap routine carries out initialization, loads the USB driver, supports USB 1.1 and USB 2.0 host-host protocols
Step 303: on the screen of PC, point out the user to select the (SuSE) Linux OS version that starts
Step 304: behind the (SuSE) Linux OS version that the user selects to start, perhaps select default configuration after, start boot linux kernel and Initrd called in the internal memory of PC system from the USB portable hard drive respectively.
Step 4: start linux kernel, initialization system and loading tasks, its concrete steps are:
Step 401: start linux kernel, analyze the parameter of importing into from system bootstrap routine
Step 402: the various data structures of the hardware of initialization system and linux kernel oneself
Step 403: loading system task
Step 5: enter the file system of Initrd, switch to the root file system on the portable hard drive, its concrete steps are:
Step 501: enter the Initrd file system
Step 502:mount root file system also switches to root file system on the portable hard drive
Step 503: carry out in the root directory/start service script among the etc/rc2.d
Step 6: detection hardware equipment and install driver automatically automatically, and dispose automatically, the hardware device of described automatic detection comprises: video card, sound card, network interface card, keyboard (usb, ps2), mouse (usb, equipment such as ps2). described automatic configuration comprises: revise the configuration of video card piece in the configuration file of Xfree86 automatically, plugging IP address and domain name service (DNS hereinafter the abbreviates DNS as) server that disposes network interface card under the situation of network interface card automatically, its concrete steps are:
Step 601: obtain hardware device ID number;
Step 602: find the corresponding hardware driver according to ID number of equipment, and load;
Step 603: for video card, obtain the title of corresponding X11 configuration file video card, and change the title of X11 configuration file video card by script according to ID number of equipment; If do not obtain the title of corresponding X11 configuration file video card according to ID number of equipment, then use the default configuration title;
Step 604: detect whether PC connects netting twine,, then obtain IP address and dns server automatically if PC connects netting twine, if PC does not connect netting twine, the step below then carrying out;
Step 7: start desktop system, after the user imports username and password, detect fdisk automatically, and automatic carry fdisk.Described desktop system comprises: GNOME desktop management instrument, openoffice word processing instrument, gaim instant message gFtp, the mozilla browser, mozilla Email, GGV PostScript reader, the Gthumb image viewer, XPDF browser, BEEP media player, the CD player, the Totem movie player, sound-track engraving apparatus etc., described automatic detection fdisk comprises: the fdisk on the PC, subregion on the USB portable hard drive, its concrete steps are:
Step 701: start desktop system, the prompting user imports username and password, after the user imports username and password, and according to user profile information, the initialization desktop system;
Step 702: kernel detects the hardware change, produces corresponding message;
Step 703 linux-hotplug user attitude finger daemon is collected these information, and notice Hald program;
Step 704:hald is according to these information, and the corresponding strategy of user's setting, the carry relevant device.
In addition to the implementation, the present invention can also have other embodiments.All employings are equal to the technical scheme of replacement or equivalent transformation formation, all drop in the protection domain of requirement of the present invention.