01. bios introduction

14
1 A.學習目標 (BIOS Introduction) a.瞭解 BIOS PC 中扮演的角色及相關的解釋名詞。 b.瞭解基本的 System Memory Mapc.關於 BIOS Training Course 接下來課程的基本介紹。 B.大綱 1. BIOS Brief Introduction 1.1. What is BIOS? 1.2. BIOS Definition 1.3 System Memory Map 1.4 BIOS Category 1.5 BIOS Vendor 1.6 Vendors of Flash ROM 1.7 First Instruction Executed 2. BIOS Develop and Debug Tools: ADU& RW 3. What is SF100? C. BIOS Introduction 1. BIOS Brief Introduction 1.1. What is BIOS? Acronym: Basic Input Output System Function: Perform all necessary functions Properly initialize the system's hardware (POST-Power on Self Test) Keyboard, video display, communications ports, and disk drives Store medium: Flash ROM (Read Only Memory) Interface: Between OS/AP and H/W (Firmware 韌體) Language: Assembler or C (EFI BIOS) 1.2. BIOS Definition BIOS -- Basic Input and Output System, is used for initializing, testing and putting the PC into the ready state so that an OS may be started. Part of the BIOS remains in the system main memory after POST (Power on Self Test). BIOS provides a consistent software interface to varying types of the hardware devices. It also provides the basic system level services to OS. The BIOS is also used for helping IHV to fix their hardware design bugs by using the SMM mode of the IA architecture. BIOS,基本輸入輸出系統(Basic InputOutput System),其內容儲存在主機板上的一個 ROM 內,主要儲存著有關系統最重要的基本輸入輸出程式,系統訊息設置、Post 程式和 Boot to OS 程式等。 所有會在 BIOS 之前發生的操作就只有 Power On,也就是按下電腦上電源開關的那 一瞬間。在 Power On 階段一開始,會進入 BIOS 的啟動流程,當使用者按下電源開 關,CPU 會先被啟動去尋找 BIOS 中的第一道指令,接著 BIOS 會在 Flash Memory 中執行,配合著 CMOS 中使用者所喜好的設置,然後 BIOS 會將自己解壓縮到電腦 的主記憶體中繼續執行。 BIOS 的基本功能:

Upload: certain310

Post on 21-Jun-2015

2.268 views

Category:

Documents


5 download

TRANSCRIPT

  • 1. A. (BIOS Introduction)a. BIOS PC b. System Memory Mapc. BIOS Training Course B. 1. BIOS Brief Introduction1.1. What is BIOS?1.2. BIOS Definition1.3 System Memory Map1.4 BIOS Category1.5 BIOS Vendor1.6 Vendors of Flash ROM1.7 First Instruction Executed 2. BIOS Develop and Debug Tools: ADU& RW 3. What is SF100?C. BIOS Introduction 1. BIOS Brief Introduction 1.1. What is BIOS? Acronym: Basic Input Output System Function: Perform all necessary functionsProperly initialize the system's hardware (POST-Power on Self Test)Keyboard, video display, communications ports, and disk drives Store medium: Flash ROM (Read Only Memory) Interface: Between OS/AP and H/W (Firmware ) Language: Assembler or C (EFI BIOS)1.2. BIOS Definition BIOS -- Basic Input and Output System, is used for initializing, testing and putting the PC into the ready state so that an OS may be started. Part of the BIOS remains in the system main memory after POST (Power on Self Test). BIOS provides a consistent software interface to varying types of the hardware devices. It also provides the basic system level services to OS. The BIOS is also used for helping IHV to fix their hardware design bugs by using the SMM mode of the IA architecture.BIOSBasic InputOutput System ROM Post Boot to OS BIOS Power On Power On BIOS CPU BIOS BIOS Flash Memory CMOS BIOS BIOS 1

2. (1) POST (Power On Self Test) CPU MemoryROMMain boardCMOS videodisplaycommunications portsdisk drives Keyboard (2) Initialize Ready State PC BIOS IHV register enable (a) Build up Interrupt Vector Table ()(b) System Resources Allocation(c) Register(d) I/O Device Note:IVH (Independent Hardware Vendor) An organization that makes electronic equipment. Itimplies a company that specializes in a niche area, such as display adapters or diskcontrollers, rather than a computer systems manufacturer.(3) CMOS or FLASH Memory ESCD CPU BIOS ROM "" CMOS RAM CMOS " BIOS " CMOSRAM CMOS BIOS CMOS CMOS SMBIOS CMOS SMBIOS BIOS (4) Boot to OS OS Loader BIOS BIOS BIOS DOS Vista loader MBR BIOS MBR EFI EFI Boot From File MBR POST ROM BIOS CMOS CD-ROM 2 3. (Between OS/AP and H/W)(5) *() OS BIOS OS BIOS IO I/O Port PC BIOS (10H)(05H)(14H) BIOS CPU IRQ IRQ CPU IRQ EOI(end of interrupt) CPU(6) IA32e System Management ModeBIOS SMM BIOS Microcode CPU bug CPU Microcode update CPU CPU1.3 System Memory Map 3 4. DOS System Memory Map BIOS (1.) Interrupt Vector Table 4byte pointer interrupt code memory 0000:0000h~0000:0400h DOS 100 Interrupt (2.) BIOS Data Area PC information() (3.) System BIOSExtended BIOS runtime service (4.) C000:0000 VGA Note: RAM 5 .. (Conventional Memory):640k (Extended Memory):1M ( Expanded Memory):, 1MB ,, 640K~1MB , 64KB (Page Frame),(Mapping) UMB (Upper Memory Block):640K 1M UPPER MEMORY AREA (A0000H FFFFFH) ROM BIOS Upper Memory Block , UMB HMA (High Memory Area): cpu register 16bits 0000:0000 FFFF:FFFF, 20 1MEGA (wrapping) CPU 20 , A20 enable, wrapping , 1M (FFFF:0010 FFFF:FFFF) 64K HMA(High Memory Area) 1.4 BIOS Category (1.) System BIOS (2.) Video BIOS 4 5. (3) KBC BIOS (4) I/O BIOS - SCSI BIOS or BOOT ROM (PXE ROM)1.5 BIOS Vendor (1)Phoenix BIOS (Award BIOS ) (2)AMI BIOS (3)Insyde Software1.6 Vendors of Flash ROM (1) SST (2) Winbond (3) MXIC (4) Atmel1.7 First Instruction Executed The first instruction that is fetched and executed following a hardware reset is located at physical address FFFFFFF0H. This address is 16 bytes below the processor supper most physical address. The EPROM contains the software-initialization code must be located at this address. The address FFFFFFF0H is beyond the 1-M Byte addressable range of the processor while in real-address mode.hardware reset FFFFFFF0H 16 EPROM FFFFFFF0H FFFFFFF0H 1M The processor is initialized to this starting address as flows. The CS register has two parts: the visible segment selector part and the hidden base address part. In real-address mode, the base address is normally formed by shifting the 16-bit segment selector value 4 bits to the left to produce a 20-bit base address. However, during a hardware reset, the segment selector in the CS register is loaded with F000H and the base address is loaded with FFFF0000H. The starting address is thus formed by adding the base address to the value in the EIP register (that is, FFFF0000+FFF0H=FFFFFFF0H) CS register Real mode segment selector 4 20 base address(CS base address = CS segment selector*16) hardware reset CS register F000H base address FFFF0000H base address + EIP register FFFF0000 FFFF0HFFFFFFF0HThe first time the CS register is loaded with a new value after a hardware reset, the processor will follow the normal rule for address translation in real-address mode (that is ,[CS base address=CS segment selector*16]). To insure that the base address in the CS register remains unchanged until the EPROM based 5 6. software-initialization code is completed, the code must not contain a far jump or allow an interrupt to occur(which would cause the CS selector value to be changed). hardware reset CS register real address mode CS base address CS selector * 16 CS register base address EPROM far jump ( CS selector value )2. BIOS Develop and Debug Tools: ADU & RWADU Award Doctor UtilityADU is Award Doctor Utility Acronym. This utility access hardware including:PCI ITE(IO)Memory(Normal/Flat Mode)SMSC(IO)CMOS(IO)SPD(SMBus)ISA(IO) ClockGen(SMBus)IO Space(IO)Read Byte(SMBus)Winbond(IO) Read Block(SMBus)main function of ADU utility. PCI Get PCI register show device information. Ex. We show VIA IEEE1394 controller, and we can see INT IRQ line is 07h locate in 3Ch. 6 7. Memory Flat mode I set start address in 000FFFF0h(F000:FFF0). We can see EA5B. This is BIOS firstinstruction executed. Normal mode Flat mode and Normal mode is mean different memory address mode. CMOS Dump CMOS data, for RTCexample: RTC, record thesystem time/data. 7 8. RW Read & WriteThis utility access almost all the computer hardware, including: PCI (PCI Express) CPU MSR Registers PCI Index/DataATA/ATAPI Identify Data MemoryACPI Tables Dump (include AML decode) Memory Index/Data Embedded Controller I/O Space USB Information I/O Index/DataSMBIOS Structures Super I/O PCI Option ROMs Clock Generator MP Configuration Table DIMM SPDRemote Acce SMBus Device Now I explain the main function of RW utility.PCI (PCI Express)To dump PCI register (256Bytes). Select different PCI device To express the info which be selectedBinary to Text expressionPCI device summary 8 9. InfoWhen I select first two bytes that I can to know it is Vendor ID form info. 11hex >> 17decTextHex value mapping to ASCII code. Hex ASCII SummaryMapping register, show device summary follow PCI specification.Device summary 9 10. Memory Dump Dump all data of main memory. Dump memory, we must set astar address and will show a block value (FFh 256Byte).Set star address HexASCII Range search Search function Search function We can set a rangeand key-in a keyword tosearch in memory. Set rangeEx. We search signature RSDPTR (find ACPI table), setRang in E&F segments. AfterAnswersearch we can get a string (inFA8C0). 10 11. ACPI Show all about ACPI table.RSDP is ACPI table entry pointer, it record RSDT address.RSDP addressPoint to RSDT address RSDT is ACPI table root, record all ACPI table address.List of all ACPI table In top, we could select different ACPI table to watch eachRSDT address tables detail information.Point to all of ACPI table Ex. check DSDT table could get ASL code 11 12. USB Work mode (USB2.0)USB2.0 EHCIDevice NameUSB Device SMBIOSSMBIOS Entry SMBIOS structurepoint and lengthSystem informationDevice info 12 13. 3. What is SF100? SF100 is used to program the SPI flash memory soldered on application board. SF100 must be a coworker with Dediprog SF software. As below is the application window of Dediprog SF software. 2. How to use Dediprog SF software? Preprepareation Connect the SF100 to the PC through a USB cable. Insert the flash card (face in when inserting) into the flash card header on the programmer. The Toolbar Function Chip Icon: It is used to detect the type of flash memory. File Icon: It is used to select the file that user want to program. The file can not be larger than the memory. Blank Icon: Check the flash memory is blank or not. Erase Icon: Erase the full content in a memory. After Erase the application memory shall be blank. Prog Icon: Program the selected image into the memory Verify Icon: Verify the checksum value of the selected image and the programmed image View Icon: When click on View, the programmer will read both the content of13 14. the selected image and the content in the application memory. Batch Icon: The programmer will perform a pre-configured set of operations such as (reload file+blank check+erase+program+verify) all together in one click. The configuration can be done by clicking on the option on the top of the screen menu. The configuration will not be changed until it is reconfigured. 3. Flash Rom Operation Principle Program Flash programming always writes 0 into memory. Flash memory can not be programmed with 1. So we have to erase the flash memory before program it. Erase: The operation of erase is always writing 1 into flash memory. The basic unit erased is block. 14