A kind of method of self-defining sector
The present invention is a kind of method of self-defining sector, and particularly a kind of the use hidden the method for sector as the parameter access.
Fierce day by day along with global computer supply the market competition, factor such as meet customer need, shorten the supply time to greatest extent, reduce cost, becoming influence manufacturer's living or death and the important key that develops.And the rise of selling directly to households gives bigger facility in guest room and elasticity, gives the demand that manufacturer proposes constantly to improve production model simultaneously.In recent years production model produce after from optimization selling mode (ODM) to order (Build To Order, BTO) arrive again custom-made production (Config To Order, CTO), just in order to comply with this development trend.
Because client's order has different demands to pre-installed software, so need to keep these parameters in the whole erection process, comprises type code (Model Number), software code (SKUNumber) etc.With regard to whole custom-made production run, the various codes that obtain by scanning order or keyboard input will use as the important parameter in the installation process.Usually preserving parameter is the data archival that data is write user-defined format, and the later operating system of Windows3.1 can also write data in the registry.But when scanning obtained data, hard disk just through the processing of low-level formatting, did not have operating system, even does not have archives economy.
So in this case, the method that traditional approach adopted as shown in Figure 1, at first will install installation (after step 10) finishes, see through the input of scanning order or keyboard and obtain software installation parameter (step 20), and the software installation parameter write (step 30) in the floppy disk, then connect servomechanism and download driver (step 40), finish software at last and install and test (step 50) according to the software installation parameter in the floppy disk.
But data are write data archival on the floppy disk, utilize this floppy disk to provide the processing mode of parameter not only inefficent in process of production again, more may import wrong or incomplete parameter into because of the wrong or damage of floppy disk, therefore the reliability to system is a very big secret worry.
Traditional program is installed and the problem of test in order to solve, method proposed by the invention is to preserve data with hard disk, owing in follow-up installation process, the mode of sector (sector tosector) is downloaded driver with the sector, so the present invention proposes to look for a suitable position on hard disk, can guarantee that data are uncovered, and not influence the normal use of various softwares again.And the concrete method that solves is as described below:
After at first device being installed, see through the input of scanning order or keyboard and obtain the software installation parameter, and the software installation parameter write in the hard disk, then connect servomechanism and download driver according to the software installation parameter in the hard disk, finish at last that software is installed and test.The present invention is according to the data capacity of design, choose a sector from the hiding sector between 0 magnetic surface, 0 magnetic post, 2 sector to 0 magnetic surfaces, 1 magnetic post, 1 sector, zone as the access correlation parameter is defined as data sector, comes access software installation parameter by the data sector of definition hard disk.This method not only can elevator system reliability, the development trend that also can cater to custom-made production (CTO).
Relevant detailed content of the present invention and technology, existing accompanying drawings is as follows:
Fig. 1 for prior art from customer order to finishing the process flow diagram that software is installed;
Fig. 2 for according to method that the present invention carried from customer order to the process flow diagram of finishing the software installation;
Fig. 3 is the hard disc data structural representation of DOS;
Fig. 4 is to finish the process flow diagram that software is installed according to data sector used herein;
Fig. 5 is for writing data according to the present invention the detail flowchart of data sector; And
The detail flowchart of Fig. 6 for data being read from data sector according to the present invention.
Symbol description
Step 10 ... device is installed
Step 20 ... scanning order or keyboard input obtain the software installation parameter
Step 30 ... the software installation parameter is write in the floppy disk
Step 40 ... connect servomechanism and download driver according to the software installation parameter in the floppy disk
Step 50 ... finishing software installs and tests
Step 60 ... device is installed
Step 70 ... scanning order or keyboard input obtain the software installation parameter
Step 80 ... the software installation parameter is write in the hard disk
Step 90 ... connect servomechanism and download driver according to the software installation parameter in the hard disk
Step 100 ... finishing software installs and tests
101 ... system region
102 ... DOS partition
103 ... the DOS system region
104 ... with the data field
105 ... the logical drive district
106 ... the Main Boot Record district (Main Boot Record, MBR)
107 ... to data pilot recording areas (DBR)
108 ... data sector
Step 110 ... scanning order or keyboard input obtain the software installation parameter
Step 120 ... utilization writes the sector instrument installation parameter is write data sector
Step 130 ... utilization is read the sector instrument installation parameter is read from data sector
Step 140 ... carrying out software driver installs
Step 150 ... utilization writes the sector instrument installation parameter is removed from data sector
Step 160 ... prepare an impact damper
Step 170 ... with the data storing of data sector to impact damper
Step 180 ... get 8 bit data that offset=0 begins
Step 190 ... judge whether this 8 bit data is INFOSECT
Step 200 ... whether the judgment data sector has data
Step 210 ... whether write by force
Step 220 ... mistake is returned and is finished
Step 230 ... whether data sector is removed is zero
Step 240 ... the data of input are inserted in the corresponding structure and are stored in the impact damper
Step 250 ... content of buffer is made as zero
Step 260 ... data in the impact damper are write data sector
Step 270 ... whether write operation is correct
Step 280 ... remove impact damper
Step 290 ... remove impact damper
Step 300 ... correctly return and finish
Step 310 ... prepare an impact damper
Step 320 ... with the data storing of data sector to impact damper
Step 330 ... whether read operation is correct
Step 340 ... remove impact damper
Step 350 ... mistake is returned and is finished
Step 360 ... get 8 bit data that offset=0 begins
Step 370 ... judge whether this 8 bit data is INFOSECT
Step 380 ... video data does not have data in the sector
Step 390 ... organization definition according to data sector obtains the data on the relevant position in the impact damper
Step 400 ... remove impact damper
Step 410 ... correctly return and finish
Fig. 2 for according to method proposed by the invention from customer order to finishing the process flow diagram that software is installed.To install at first equally after installation (step 60) finishes, see through the input of scanning order or keyboard and obtain software installation parameter (step 70), and the software installation parameter write (step 80) in the hard disk, then connect servomechanism and download driver (step 90), finish software at last and install and test (step 100) according to the software installation parameter in the hard disk.
The method of utilizing the present invention to carry, existing data structure with regard to hard disk further specifies as follows:
Generally speaking, be divided into plurality of magnetic post (Cylinder) and sector (sector) through formative hard disk, wherein each concentric circles is called a magnetic post, is divided into several sectors again in each magnetic post.The sector is an addressable storage area unit minimum on the disk, and the size of sector is generally 512 bytes (bit group) on the disk, and the sector is divided into physical sector number and two kinds of numberings of logical sector number usually.
Physical sector is called absolute sector or BIOS sector again, represent a zone on the disk with magnetic surface (Surface), magnetic post (Cylinder) and sector (sector), the physical sector number of a sector on the disk is 0 magnetic surface, 0 magnetic post, 1 sector, and for example this kind numbering scheme is adopted in ROME BIOS addressing.
Logic sector is called relative sector or DOS sector again, and DOS does not directly use the physical sector addressing, and numeral of its usefulness is represented the sector, and the represented sector number of this numeral is called relative sector number or DOS sector number.In the DOS of PC system, physics first sector of hard disk, promptly 0 magnetic surface, 0 magnetic post, 1 sector is used to store partition table and leader record (Boot Record), and this is a special zone, and DOS can not access to this sector.Therefore, for the physics 0 magnetic surface 0 magnetic post of hard disk, DOS sector number system is not considered fully.
Fig. 3 is the hard disc data structural representation of DOS, the wherein whole system region 101 and DOS partition 102 2 big classes that produces by FDISK that divide for, and the DOS system region 103 that is produced by FORMAT in fact constitutes a logical drive district 105 with data field 104, and a plurality of logical drive district 105 forms a DOS partition 102.
The Main Boot Record district (Main Boot Record, MBR) 106 to the sector between the data pilot recording areas (DBR) 107, and promptly 0 magnetic surface, 0 magnetic post, 1 sector to 0 magnetic surface, 1 magnetic post, 1 sector can not be the access of DOS institute, so for hiding the sector, also be system region 101.In theory, hiding sector is the zone of operating system and general not access of application program, sector except that Main Boot Record district (MBR) 106 meets our request for utilization, utilize the disk edit instrument that the sector of finding between 0 magnetic surface, 0 magnetic post, 2 sector to 0 magnetic surfaces, 1 magnetic post, 1 sector is observed by different types of machines, system, that is 0 magnetic surface, 0 other sectors of magnetic post do not have valid data really.
Therefore the present invention chooses a sector according to the data capacity of design from the hiding sector between 0 magnetic surface, 0 magnetic post, 2 sector to 0 magnetic surfaces, 1 magnetic post, 1 sector, as the zone of access correlation parameter, is defined as data sector 108.
Following table is the organization definition table 1 of institute definition of data sector 108:
Offset address | Byte | The implication definition |
OH | ?8 | The section position of data sector (INFOSECT) |
9H | ?10 | 10 bit manipulation system codes |
14H | ?12 | 12 computer model code |
36H | ?458 | Demand application code (12) set |
Fig. 4 is to finish the process flow diagram that software is installed according to data sector used herein, at first same foundation scanning order or keyboard input obtain software installation parameter (step 110), as for then deciding on product attribute according to scanning order or keyboard Input Software installation parameter, utilization writes the sector instrument installation parameter is write data sector (step 120) again, then utilization is read the sector instrument installation parameter is read (step 130) from data sector, to carry out software driver (step 140) is installed, utilization at last writes the sector instrument installation parameter is removed (step 150) from data sector, reach mode, finish software and install by the self-defining data sector.
Because in the whole erection process, special one what carry is to have only for hiding sector use to interrupt (INT 13H) and just can carry out read-write operation, Figure 5 shows that data are write the detail flowchart of data sector, cooperate the organization definition table 1 of institute of the present invention definition of data sector to further specify as follows according to the present invention:
At first prepare an impact damper (step 160), this impact damper is the size of one 512 bytes; Data storing (step 170) to impact damper with data sector; Get 8 bit data (step 180) that offset=0 begins, for example 000000F0,000001B0 or the like; Judge whether this 8 bit data is INFOSECT (step 190); If this 8 bit data is not data segments (INFOSECT), then then whether the judgment data sector has data (step 200); If data are arranged in the data sector, and do not have to carry out the instruction write (step 210) by force, then representative writes data and produces mistake and return and finish (step 220).
If do not have data in the data sector or carry out the instruction write by force in step 210, carrying out then whether the judgment data sector remove is zero (step 230); If do not remove not is zero, then inserts the data of input in the corresponding structure and is stored to (step 240) in the impact damper; If remove is zero, then content of buffer is made as zero (step 250); At this moment, the data in the impact damper are write data sector (step 260); Judge write operation whether correctly (step 270) at last; If incorrect, then remove impact damper (step 280), and get back to step 220; Otherwise remove impact damper (step 290), correctly return and finish (step 300), finish the action that data is write data sector.
According to the above-mentioned explanation that data is write data sector, the present invention provides the method that data are read from data sector equally, the detail flowchart of Fig. 6 for according to the present invention data being read from data sector cooperates the organization definition table 1 of institute of the present invention definition of data sector to further specify as follows equally:
At first prepare an impact damper (step 310), with the data storing (step 320) to impact damper of data sector; Judge read operation whether correctly (step 330); If incorrect, then remove impact damper (step 340), mistake is returned and is finished (step 350); If read operation is correct, then get 8 bit data (step 360) that offset=0 begins; Judge then whether this 8 bit data is INFOSECT (step 370); If this 8 bit data is not data segments (INFOSECT), then there are not data (step 380) in the video data sector; And execution in step 350; If this 8 bit data is data segments (INFOSECT), then the organization definition according to data sector obtains the data (step 390) on the relevant position in the impact damper, remove impact damper (step 400) at last, correctly return and finish (step 410), finish the action that data are read from data sector.
Though the present invention discloses as above with aforementioned preferred embodiment; but it is not in order to limit the present invention; any those skilled in the art; without departing from the spirit and scope of the invention; when can doing a little change and retouching, so protection scope of the present invention is as the criterion when looking accompanying Claim book institute confining spectrum.