A kind of method of Godson mainboard hard disk handover management
Technical field
The present invention relates to mainboard BIOS, specifically, relate to the hardware platform based on Godson loongson3A CPU and AMD RS780E combination, realize the method that SATA and the work of IDE hard disk are switched.
Background technology
Godson (English: Loongson) is universal cpu, adopts lean instruction set, is similar to MIPS instruction set; The Basic Input or Output System (BIOS) that it adopts is the software of a kind of PMON by name.PMON is an Open Source Code Software that has BIOS and boot loader partial function concurrently, is mainly used in the platforms such as MIPS, ARM, PowerPC, is different from the BIOS of X86-based.
Godson product in the market used the hard disk of two types, and the one, the IDE hard disk that south bridge IDE controller is direct-connected, the 2nd, turn by IDE the hard disk that SATA interface connector connects.And the situation that uses south bridge IDE controller and SATA controller to be connected separately hard disk on a Godson mainboard did not occur simultaneously; In the time that south bridge IDE controller and SATA controller can be worked simultaneously, work how to consult two kinds of hard disks has just become problem.
Summary of the invention
In order to address the above problem, the present invention proposes the method for the work of a kind of SATA of negotiation controller and IDE controller.
A kind of method of Godson mainboard hard disk handover management, BIOS scans and initialization hard disk controller in the time starting, hard disk controller scanning hard disc apparatus, and read the hard disk configuration information of hard disk handover module, configuration information is fed back to BIOS, BIOS according to feedback information from hard disk startup operating system.
Preferably, described BIOS adopts PMON program.
Preferably, described hard disk controller comprises IDE controller and SATA controller.
Preferably, described handover module is SMBUS controller.
More preferably, described SMBUS controller is by 0xAD register control hard disk startup order.
More preferably, whether set carrys out setting harddisk boot sequence by the 4th for described 0xAD register.
More preferably, when the 4th position of described 0xAD register is empty, SATA hard disk is main equipment; When the 4th position, position of described 0xAD register, IDE hard disk position main equipment.
Preferably, in the configuration file of described BIOS and device file, added SET_SATA option.
More preferably, when described SET_SATA option is selected, from SATA hard disk startup; When described SET_SATA option is not selected, from IDE hard disk startup.
The present invention, by checking, can be good at controlling the job order of SATA and IDE, has guaranteed the stable operation of Godson CPU+AMD RS780E mainboard.
Embodiment
This example based on hardware platform be Godson blade server.The major part of Godson blade is Godson 3A chip and AMD 780E+SB700 chipset.The Main Function of PMON program is the initialization realizing each functions of the equipments on Godson blade, and assurance Godson blade is normally worked, and guides operating system smoothly.
PMON can be divided into three steps substantially to the work of south bridge hard disk controller: one, enabling of hard disk controller; Two, the scanning of hard disk controller and configuration; Three, the initialization of hard disk controller.Therefore, in PMON, no matter be to SATA controller or IDE controller, their initial method is all the same, that is to say that PMON can be both equality for the treatment of.
The present invention solves IDE device start or the problem from SATA device start by the 0xAD register of controlling SMBUS controller in the south bridge device initialize part of PMON: in the time putting the 4th of empty this register, it is main equipment that Godson mainboard will arrange SATA hard disk, and from SATA hard disk startup; In the time of the 4th, this register of set, it is main equipment that Godson mainboard will arrange IDE hard disk, and starts from IDE.In addition, in order better to control this register in program, the present invention adds SET_SATA option in the configuration file of PMON and device file, in the time selecting this option, the default value that keeps the 4th, the 0xAD register of SMBUS, it is main equipment that SATA hard disk is set; In the time not selecting this, the 4th of the 0xAD of SMBUS is set, making IDE hard disk is main equipment.