1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode...

41
1 PC Peripherals PC Peripherals for Technicians for Technicians Chapter 3.3 - Video Chapter 3.3 - Video Graphics Mode Graphics Mode Operation Operation Systems Manufacturing Systems Manufacturing Training and Employee Training and Employee Development Development Copyright © 1998 Intel Copyright © 1998 Intel Corp. Corp.

Transcript of 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode...

Page 1: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

1

PC PeripheralsPC Peripherals for for TechniciansTechnicians

Chapter 3.3 - Video Chapter 3.3 - Video Graphics Mode OperationGraphics Mode Operation

Systems Manufacturing Training Systems Manufacturing Training and Employee Developmentand Employee Development

Copyright © 1998 Intel Corp.Copyright © 1998 Intel Corp.

Page 2: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

2

Graphics Mode Graphics Mode Operation OverviewOperation Overview

OBJECTIVES: At the end of this section, the student will be able to do the following:

Discuss Graphics Modes & Video Buffer data format. List the characteristics of VGA Mode 12 hex. Discuss Graphics Mode memory organization,

Graphics Mode color generation, & character fonts. Discuss 256 Color Graphics Mode 13 hex. Describe Super VGA, VESA, & display memory pages. Discuss the initialization of the Video Subsystem. Discuss video troubleshooting techniques.

Page 3: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

3

Video Display Modes This chapter is an OVERVIEW on the operation of

a Video Controller in GRAPHICS MODES. Video subsystems operate in multiple display modes.

Each display mode controls certain aspects of the video subsystem operation:

» Graphics or Text: > Graphics modes are bit-mapped (All Points Addressable) > Text modes display alphanumeric characters only.

» Screen Resolution: # of pixels vertically & horizontally.> Often stated with a third number which refers to the color

depth. (e.g. 800x600x256 where 256 implies 256 colors)

» Number of colors available: Typically 16 to 256.> 16 million colors available for some Super VGA modes.

Page 4: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

4

Video Display Modes Graphics modes are used to display special symbols

or images that are not part of the predefined character sets in Text mode.Mathematical symbols, special characters, images, filling

areas of screen with colors, etc.

Modes 12h and 13h will be examined in this discussion of graphics modes.Mode 12 hex is a 640 x 480 16 color modeMode 13 hex is a 320 x 200 256 color modeNote: Many other graphics modes are available and

discussion of the various memory mapping schemes, register use, and programming techniques is beyond the scope of this course.

Page 5: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

5

Modes supported BIOS (Partial list)

CGAEGAVGACGAEGAVGACGACGAMDAVGAEGAEGAEGAEGAVGAVGAVGA

TextGraphicsGraphicsTextTextGraphicsGraphicsGraphicsGraphicsGraphicsGraphicsGraphics

Mode Emul. Res. TypeMaxColors Scheme

Char.Box

Max.Pages

Buff.Start

0,10,10,12,32,32,3!4,5677!DEF10111213

320x200320x350360x400640x200640x350720x400320x200640x200720x350720x400320x200640x200640x350640x350640x480640x480320x200

TextTextTextTextText

88888811888422111

16/256k16/256k16/256k16/256k16/256k16/256k4/256k2/256kMDA MonoVGA Mono16/256k16/256kMono16/356k2/256k16/256k256/256k

40x2540x2540x2580x2580x2580x2540x2580x2580x2580x2540x2580x2580x2580x2580x3080x3040x25

8x88x149x168x88x149x168x88x89x149x168x88x88x148x148x168x168x8

B8000hB8000hB8000hB8000hB8000hB8000hB8000hB8000hB0000hB0000hA0000hA0000hA0000hA0000hA0000hA0000hA0000h

! - Indicates power-on default mode 3! - Color monitor is attached 7! - Monochrome monitor is attached

Page 6: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

6

Video Data Format - Graphics Mode In Graphics mode the data stored in video RAM is

NOT interpreted as a character code & attribute, but instead directly determines pixel intensity & color.In Graphics mode the microprocessor addresses the

display buffer as a series of bits and writes the individual color value of each pixel to be painted on the screen.

» Programmers build screens by describing each dot individually - All Points Addressable (APA).

Graphics modes require more memory than text modes because each pixel can be described by one or more bits depending on the video mode.Text modes consume less memory, but you can only

manipulate characters.

Page 7: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

7

Video Data Format - Graphics Mode In 640 x 350, 16 color graphics mode 10h with 4 bits

per pixel, you need 896,000 bits (640 x 350 x 4) or 112K bytes to represent one screen of information (80 x 25 display using an 8 x 14 character box)In Text Mode 03h with the same 80 x 25 character

resolution, you need only 4K bytes (80 x 25 x 2)» 2 bytes per character (Character Code & Attribute)

Note that there is a performance penalty for using graphics modes because of the larger number of bytes that must be manipulated.A program that manipulates 112K bytes in Graphics

Mode is much more complex than a program that manipulates 4000 bytes in Text Mode.

Page 8: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

8

Characteristics of VGA Mode 12hVideo Buffer @ A0000Resolution = 640 pixels x 480 lines displayedCharacter size = 8 pixels x 16 pixels (Default VGA font)80 Characters/line; 30 lines frame (screen)

> 80 char/line -> (640 pixels/line) / (8 pixels/char)> 30 char/frame -> (480 lines/frame) / (16 lines/char)

38.4K bytes/page of Memory used (4 pages total)

» 38.4K bytes/page = (640 x 480 pixels/page) / (8 pixels/byte)Horizontal Freq. = 31.5 KHz (lines per second)Vertical Freq = 60 Hz (frames per second)Dot Clock = 25.175 MHz (25,175,000 dots per second)

» 25.175 MHz / 31.5 KHz = 800 dots/lineNumber of colors = 16 (Pixels stored in 4 color planes)

Page 9: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

9

Characteristics of VGA Mode 12h

Note: The timing values stored in registers are measured in “Character Clocks”! 1 Character Clock corresponds to 8 pixels in Mode 12

Displayed Video Buffer area

Line 0

Line 480

Overscan

841 80

96 100

4 characterOverscan

Horiz. Sync pulse@ clk 84 lasts for 12 Char. clocks 8 x (80 col) = 640

Vert. Sync pulse@ Line 503 lasts for 2 Scan Lines

Character Matrix is 8x16 in Mode 12H

8 x (80 chars) = 64016 x (30 rows) = 480

Line 524

Line 503

640

480

Page 10: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

10

Mode 12h Memory Organization In Graphics Mode 12h, the video buffer is a set of four

parallel bit planes (one for each color), each of which shares the same addresses starting at A000:0000.Only 1 map in Display Memory can be accessed at a

time by the CPU since they all share the same address.» Video Controller registers must be modified by the

programmer before accessing an individual bit plane.

You need 38,400 bytes/page in Graphics Mode 12h (640 x 480, 16 color) with 1 bit per pixel,[(640 x 480 pixels) / 8 pixels/byte] = 38,400 bytes/page

4 pages are needed to generate 16 colors (24=16)38,400 bytes/page x 4 pages = 153.6 KB

Page 11: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

11

Mode 12h Memory Organization

640 x 480 = 307,200 pixels38, 400 bytes = (307,200 pixels) / (8 pixels/byte)

Co

lor

bit

0

Co

lor

bit

1

Co

lor

bit

2

Co

lor

bit

3

A0000

A95FF A9600

AFFFF

DisplayData

Unused

38,400Bytes

Map 0Map 1

Map 2Map 3

Bit address

27,135 Bytes

Co

lor

bit

2

Co

lor

bit

1

Co

lor

bit

0

Page 12: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

12

Graphics Mode Color Generation

Pixels are represented by the set of corresponding bits at the same address in each of the bit planes.

VGA Video RAM

Each pixel is one color or

another, there is no foreground or background

color.

Bit address

Co

lor

bit

0

Co

lor

bit

1

Co

lor

bit

2

Co

lor

bit

338,400

Bytes

Map 0 - BlueMap 1 - Green

Map 2 - RedMap 3- Intensity

27,135 Bytes

Co

lor

bit

2

Co

lor

bit

1

Co

lor

bit

0

Screen

Page 13: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

13

Graphics Mode Color Generation Pixels are represented by the set of corresponding bits

at the same address in each of the bit planes.The data in the bit planes is sent to the Attribute

controller and generates colors in the same fashion as in text mode.

Text and graphics modes use the same colors and intensity options.

In Mode 12h with 4 bits/pixel, the four planes are combined to produce a color for an individual pixel.With four bit planes, a pixel can have any of 16 (24)

different values (16 different colors at the same time).A color is produced by a combination of 3 color

components (RGB) plus an intensity component.

Page 14: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

14

Graphics Mode Color Generation Pixel attributes are not always 4 bits in size, but can

range from 1 to 8 bits depending on the video mode. Mode 12h bit fields are 4 bits wide.

» e.g. - Mode 12: 640 x 480, 16 color mode (24 =16)

The smallest bit fields are only 1 bit wide.» e.g. - Mode 6: 640 x200, 2 color mode (21 = 2)

The largest bit fields are 8 bits wide.» e.g. - Mode 13: 320 x 200, 256 color mode (28 = 256)

Note: The Palette Registers and the DAC are loaded by the BIOS during POST with default values for the 16 color modes.

Page 15: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

15

Graphics Mode Color GenerationThe following table shows the relationship between the Attribute nibble value, the Palette Register value, and the color displayed.

Attribute Nibble

8

9

A

B

C

D

E

F

Palette Value

38

39

3A

3B

3C

3D

3E

3F

Default Color

Dark Gray/Dim White (r+g+b)

Light Blue (r+g+b+B)

Light Green (r+g+b+G)

Light Cyan (r+g+b+G+B)

Light Red (r+g+b+R)

Light Magenta (r+g+b+R+B)

Yellow (r+g+b+R+G)

Intensified White (r+g+b +R+G+B)

Attribute Nibble

0

1

2

3

4

5

6

7

Palette Value

00

01

02

03

04

05

14

07

Default Color

Black

Blue (B)

Green (G)

Cyan (G+B)

Red (R)

Magenta (R+B)

Brown (g+R)

White (R+G+B)

This chart is same as the Text Mode charts in previous chapter.

Page 16: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

16

Graphics Mode Color GenerationVGA uses analog signal levels to drive the monitor, and the 6

bits in the Palette Registers are inputs to the Video DAC.The 6-bit Palette Register output combined with 2 bits from a

Color Select register to form an 8-bit value passed to the DAC.

4-bitAttribute

(1 of 16 Registers)

6-bits(bits 0-5)

r,g,b,R,G,B(1 of 64

Registers)

8-bits(1 of 256

Registers)[4 banks of 64 colors]

bits 6 & 7Attr CtlrPalette

Registers3C0, 3C1Offsets00-0Fh

Attribute ControllerColor Select Register

Ports 3C0, 3C1Offset 14 - Bits 3 & 2

(1 of 4 banks)

VIDEO DAC3C7, 3C8, 3C9

Offsets00-FFh

[Note: 00-3Fhw/ 6 bits]

R

G

B

To MonitorAnalogOutput0 - 0.7 V

Attribute Mode Control Reg Ports 3C0, 3C1

Offset 10 - Bits 7 = 0(Palette Size Select - 16 color

4 banks of 64 entries)

Page 17: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

17

Fonts in Graphics Modes In Graphics modes, the character set is NOT loaded

into the VGA display memory, but resides in host memory space (either the BIOS ROM or in RAM).Graphics modes cannot load the character sets into

VGA memory bit plane 2 (as is done in text modes), because bit planes 0-3 store the graphics information

» Note: In Text mode Bit plane 0 stored the characters, Bit plane 1 the attributes, and Bit plane 2 the character fonts.

The BIOS provides service through INT 10 and uses the address of a ROM-based character pattern.You can also place a custom bit pattern table in RAM

and instruct the BIOS to use it to display your own (downloadable) character set.

Page 18: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

18

Character Box - Pixel pattern for “a”8 X 16 VGA graphics-mode character box

(VGA Graphics Video Mode 12h)

(480 lines/screen) / (16 lines/char) = 30 char lines /screen (640 pixels / line) / (8 pixels/char) = 80 char/line

ROM contains a default table of

character pattern bits (typically in the 8x6 to 9x16 range).

Bit Patternof font asstored inmemory

= Foreground color

= Background color

Data = 78h01111000b

15

7 6 5 4 3 2 1 0

2

4

5

9

01

3

6

7

8

10

1112

13

14

0000

00

00

00780C7CCCCCCC

7600

000000

16 (10h) bytes are reserved for each of the characters.

Page 19: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

19

Fonts in Graphics Modes When you set a graphics modes with INT 10 function

0, the Video BIOS loads a pointer to the appropriate character set into interrupt vector 43h (0000:010C).The location of a character in host memory is determined

by locating the starting address of the character set (using the IVT 43h entry) & adding the offset [“a” = 61h].

» Char Addr = Char Set Pointer + Offset to Character

» C000:72E0h = C000:6CD0h + (10h * 61h)

In graphics mode, characters are drawn pixel by pixel using software (e.g. BIOS INT 10h) instead of by the hardware character generator used in text modes.Graphics mode fonts are copied from ROM or RAM

(pointed to by IVT 43h) to the video buffer (e.g. A000:0)

Page 20: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

20

256 Color Graphics Mode 13h Mode 13h has 256 colors with a resolution of 320x200.

Every pixel is represented by 8 bits of data and a screen line consists of 320 contiguous bytes in video RAM.

» This byte represents the color as a value from 0 to 255.

» This byte acts as a direct index to the DAC color table, from which the actual color representing the pixel on the screen is taken.

The DAC is equipped with 256 color registers (8 address bits are required to use all 256 colors).

» Each DAC color register is composed of Red, Green, & Blue components each 6 bits wide (00-3fh) - 18 bits total.

> 18 bits provide up to 256K (218=262,144) possible colors.> Only 256 colors are available at any one time.

Page 21: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

21

256 Color Graphics Mode 13hVideo Buffer @ A0000Resolution = 320 pixels x 200 lines displayedCharacter size = 8 pixels x 8 pixels40 Characters/line; 25 lines frame (screen)

> 40 char/line -> (320 pixels/line) / (8 pixels/char)> 25 char/frame -> (200 lines/frame) / (8 lines/char)

64,000 bytes of Memory used

» 64K bytes = (320 x 200 x 8 pixels) / (8 pixels/byte)Horizontal Freq. = 31.5 KHz (lines per second)Vertical Freq = 70 Hz (frames per second)Dot Clock = 12.5 MHz (12,500,000 dots per second)

» 12.5 MHz / 31.5 KHz = 400 dots/lineNumber of colors = 256 (Pixels stored in 8 color planes)

Page 22: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

22

256 Color Graphics Mode 13h

DisplayData

Unused

A0000

AF9FFAFA00AFFFF

64,000Bytes

1535 Bytes

320 x 200 = 64,000 pixels64,000 bytes = (64,000 pixels) *(1 byte/pixel)

VGA 256 Color Graphics ModeEvery pixel in Mode 13h is represented by 8 bits of data.This byte represents the color as a value from 0 to 255.

Note: VGA Mode 03h; 720 x 400; 4K of Memory used

Page 23: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

23

256 Color Graphics Mode 13hPalette Register Addressing in 256 color mode

The 8 bits in display memory are split into two 4-bit fields.Bits (0-3) address the Palette Registers; Bits(4-7) address the DAC.

The Palette Regs provide a one-to-one transfer of data.The 8-bits in Video Memory effectively directly control the DAC.

VideoMemory

PaletteRegs

256DACColorRegs

Addr 0-3

Addr 4-7

Simplified drawing of 256 Color Generation

Page 24: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

24

In Mode 13h, the Palette Register is loaded with the following default values:

The 8 bits in Video RAM are split into two 4-bit fields.The low-order bits (0-3) address the Palette Registers.

» The Palette Registers are restricted to providing a one-to-one transfer of address to data.

> This effectively bypasses the Palette Registers and sends the color value of the lower 4 bits directly to the DAC.

The high-order bits (4-7) address the DAC Color Regs.

256 Color Graphics Mode 13h

REG 0 1 2 3 4 5 6 7 8 9 A B C D E FVAL 0 1 2 3 4 5 6 7 8 9 A B C D E F

Page 25: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

25

Initialization of DAC 256 Color RegsF8-FFh Preload with 0, for black.20-F7h 24 color groups, 9 shades of color.10-20h 16 evenly spaced shades of gray.00-0Fh Identical to 16 EGA colors loaded into Palette Regs.

F8-FFh

<- F7H

B0H->

<- AFH

68H->

<- 67H

20 ->

10-1Fh

00-0Fh

Black

RGB-Low Int.

RGB-Low Int.

RGB-Low Int.

RGB-Med Int.

RGB-Med Int.

RGB-Med Int.

RGB-High Int.

RGB-High Int.

RGB-High Int.

Gray Scales

EGA Color

24-High Sat.

24-Mid Sat.

24-Low Sat.

24-High Sat.

24-Mid Sat.

24-Low Sat.

24-High Sat.

24-Mid Sat.

24-Low Sat.

8 Black

16 Gray

16 Colors

Page 26: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

26

Super VGA, VESA & Beyond Current video controllers exceed the 1987 VGA standard.

» Super VGA (SVGA), Extended VGA, and Advanced VGA are informal terms for anything better than VGA.

With no “super” standards to go by designers have developed their own specific implementations.

» Most programs treat SVGA just like VGA because no standards have been developed to test for SVGA.

» Most hardware remains compatible with the VGA register interface and video memory addressing.

Standard VGA Super VGA

640 X 480 1024X 768

256 K Memory 4M bytes Memory

6-bit color DAC 8,16,24-bit color DAC

8-bit ISA bus 16-bit ISA, VL, & PCI

Page 27: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

27

Super VGA, VESA & Beyond The Video Electronics Standards Association, a

consortium of 140+ graphics card and video monitor manufactures, made an after-the-fact attempt (1989) to create a set of standards.VESA introduced a standard for an extension to the

original IBM VGA BIOS that supports SVGA hardware called the VESA BIOS Extensions (VBE) using INT 10 function 4Fh (i.e.-Use INT 10 with AH set for 4F.)

» VESA BIOS Extensions (VBE) provide a standard method for accessing additional SVGA functionality

Unlike the standard video BIOS routines which use an 8-bit mode #, the VESA routines use a 16-bit mode #.

» Numbers begin at 100h--e.g., Mode 107h (1280x1024x256)

Page 28: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

28

5E5F586A5C5D606C6D55-----------------------------------

Graphics GraphicsGraphicsGraphics

TEXTGraphicsGraphicsGraphicsGraphicsGraphicsGraphicsGraphics

VESAMode Mode Res. Type

MaxColors

Char. xRow

Char.Box

10010110210210310410510610710910F110112113 115116 11B

640x400640x480800X600800X600 800X600

1024X7681024X7681280x10241280x10241056x350320x200 640x480640x480800X600 800X600

1024X768 1280x1024

GraphicsGraphicsGraphicsGraphicsGraphics

256/256k 256/256k 16/256k

256/256k 256/256k 16/256k

256/256k 16/256k

256/256k16/256k 16.8 M

32k16.8 M

32k16.8 M

32k16.8 M

80x2580x30100x37100x37100x37128x48128x48160x64160x64132x25---------------------------------------------------------------

8x16 8x168x16 8x16 8x168x168x16 8x168x168x14----------------------------

Super VGA, VESA & Beyond

In addition to the “standard” modes, a number of higher-resolution video modes available on SVGA hardware has been standardized by VESA.

SVGA Modes (Partial list)

Page 29: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

29

Super VGA, VESA & Beyond Graphics accelerators

A special type of video adapter that contains its own specialized coprocessor which is capable of specific graphics operation to boost performance levels.

» Some accelerator cards include functions for 3D graphics rendering and/or on-the-fly magnification of video clips.

» Accelerators require drivers to interpret video commands.

Accelerated Graphics Port (AGP)A new interface specification based on PCI, but designed

especially for the throughput demands of 3-D graphics. » AGP shares the main PC memory to hold 3D images which

in effect gives AGP an unlimited amount of video memory.

» AGP adds a dedicated high-speed bus directly between the chipset and the graphics controller.

Page 30: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

30

Accessing Display Memory PagesA PC reserves only 64KB of address space for the video

buffer (Graphics Mode: A000:0 -> A000:FFFF)Many of the high resolution Graphics Modes require

more than 64-KB of memory.» For VESA mode 101h (640 x 480 x 256) 307,200 bytes of

memory are required (64 KB * 4 = 262,144 bytes)

» Can address this memory by selecting which portion to map into the 64-KB CPU address range of A000:0->A000:FFFF.

> Can be thought of as a hardware window into the video buffer.

The following is an example of accessing more than 64 KB of the video buffer in Mode 101h using the ITP to set the Video Mode and write to the Video Buffer.

» A proc like “setvidpg” uses VESA BIOS INT 10h, Function 4F, Sub-function 05 to select a display memory page.

Page 31: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

31

Accessing > 64 KB of the video buffer1) Set Video Mode to 101 hex [e.g. vesamode (101)]2) Fill 64 KB of memory with some pattern:

» e.g. byte 0a0000p length 0ffff = 01> Fills Page Zero with BLUE > Top ~ 1/5th of screen is BLUE (1st 64K of 307,200 bytes)

3) Select another Video Memory Window» Select page 1 [e.g. ITP proc “setvidpg (1)”]

4) Fill the next 64 KB of memory with some other pattern:» e.g. byte 0a0000p length 0ffff = 02 (Fill page 1 with GREEN)

5) Continue until last 5th of screen is filled (Page 4)» e.g Select page 4 [e.g. ITP proc “setvidpg (4)”]

» e.g. byte 0a0000p length 0ffff = 04 > Fills page 4 with RED (Bottom ~ 1/5th of screen is RED)

Page 32: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

32

Initializing the Video SubsystemUpon power up or reset, access to internal registers and

memory is not allowed until the Video Subsystem has been enabled.

» Usually accomplished by the BIOS during POST, but can use ITP commands (Required if POST didn’t initialize)

The following registers enable the Video Subsystem depending on configuration (ISA, PCI, MCA, etc.).

» Port CF8 Offset 4 - PCI Configuration

» Port 3C3 - Video Subsystem Enable (on system board)

» Port 102 - Card Enable (PC/AT adapter based cards)

» Port 46E8 - Setup / Adapter Enable (PC/AT adapter)

» Once enabled, a write to the Misc. Output Register at port 3C2 enables access to Video Controller I/O & memory .

Page 33: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

33

Initializing the Video Subsystem This is a typical initialization sequence for PCI video.

Write 8000xx04 to Port CF8 (xx depends on PCI Dev#)» Point to offset 4 in PCI Video device.

Write 3 to Port CFC to enable Mem & I/O accesses.» Example ITP commands for PCI Device # 8:

> “dport (cf8) = 80004004”> “dport (cfc) = 00000003”

» For PCI video on the System board, also write Port 3C3.> Example ITP command: “port (3c3) = 1”

Sets bits 0 & 1 in port 3C2:> Example ITP command: “port (3c2) = 3”

VGA Ctlr registers can now be programmed & tested.

Page 34: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

34

Troubleshooting Video problems POST completes and the system boots:

Use a diagnostic program such as Testview for a thorough test of the Video Sub-system.

» Testview is particularly useful for evaluating functionality in the high resolution video modes, and for testing ALL of the memory in a particular Video Subsystem.

» Testview tests are written for a specific Video Controller and perform more comprehensive tests than most ITP procs.

» With Testview, you can loop on a failing test to find intermittents and observe Video Controller signals with an O’scope.

» Testview has HELP files that describe the test algorithm and give you “debug hints” for the failing tests.

Page 35: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

35

Troubleshooting Video problems POST puts text on screen, but does not boot an

O/S (can’t run Testview):The Video Controller was programmed for Text Mode 3.

» At least part of the Video Buffer circuitry is functional.> Only the 32K B8000P video buffer is used in Text Mode 3.

Observe any display anomaly on the screen that could give clues about the failure mechanism:

» Sync problems (CRTC): Jitter or folded images

» Memory/Video Controller: Missing characters or pixels.

» DAC or connector: Incorrect or missing colors.

Use a debug tool such as the ITP to test functionality by reading and writing I/O registers and Video Memory with available ITP procs.

Page 36: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

36

Troubleshooting Video problems POST runs but does not display text on the screen

FIRST: Check voltages, clocks, bus functionality, etc.Check strapping/configuration options.

» Video controllers often “read” configuration information during reset (e.g.-pull-down resistors installed on MD lines).

Use a debug tool such as the ITP to initialize the Video controller and test functionality by reading and writing I/O registers and Video Memory.

» Use available ITP procs to program the VGA Controller for Text or Graphics modes to verify register accesses.

» Note: Host address/data bus problems could be indicated by failure to correctly read/write some or all of the registers.

Page 37: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

37

Troubleshooting Video problems POST does NOT display text on the screen (cont.)

If you could program the Video Controller registers, you should be able to read and write the Video Memory.

Use an ITP proc to program the VGA Controller and test the 128K (A000:0-B000:FFFF) range of the Video Buffer.

» Loop on a failing memory address to find a bad address line, data line, or memory chip.

Note: Isolating memory problems to either the Video controller or the Memory chip(s) can be challenging.

» Since access to the Video Buffer is THROUGH the Video Controller, you may have to analyze several of the memory control, address, and data signals to determine if the Video Controller is functioning correctly.

Page 38: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

38

REVIEW & SUMMARYWE HAVE DISCUSSED THE FOLLOWING:

Graphics Modes & Video Buffer data format. Graphics modes display special symbols/images that are

not part of the predefined character sets in Text mode.Graphics mode data stored in video RAM is NOT

interpreted as a character code & attribute, but instead directly determines pixel intensity & color.

Graphics modes require more memory than text modes because each pixel can be described by one or more bits

The characteristics of VGA Mode 12 hex.Video Buffer @ A0000; Resolution = 640 pixels x 480 lines80 Characters/line; 30 lines frame (screen)38.4K bytes/page of Memory used (4 pages total)

Page 39: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

39

REVIEW & SUMMARY Graphics Mode memory organization, Graphics Mode

color generation & character fonts.In Graphics Mode 12h, the video buffer is a set of four

parallel bit planes (one for each color), each of which shares the same addresses starting at A000:0000.

» A pixel can have any of 16 (24) different values.

Characters are drawn pixel by pixel using software instead of by the character generator used in text modes.

256 Color Graphics Mode 13 hex. Every pixel is represented by 8 bits of data and this byte

acts as a direct index to the DAC color table and represents the color as a value from 0 to 255.

Resolution 320x200; 320x200 = 64,000 bytes

Page 40: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

40

REVIEW & SUMMARY Super VGA, VESA, & display memory pages.

Super VGA (SVGA), Extended VGA, and Advanced VGA are informal terms for anything better than VGA.

VESA BIOS Extensions (VBE) provide a standard method for accessing additional SVGA functionality

Many Graphics Modes require more than 64-KB of memory which can be addressed by selecting which portion to map into the 64-KB range of A0000-AFFFFp.

The initialization of the Video Subsystem.Upon power up or reset, access to internal registers and

memory is not allowed until the Video Subsystem has been enabled (usually by the BIOS during POST).

» If Video Controller registers are NOT programmed, you cannot read and write the Video Memory.

Page 41: 1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter 3.3 - Video Graphics Mode Operation Chapter 3.3 - Video Graphics Mode Operation.

41

REVIEW & SUMMARY Techniques for troubleshooting video problems.

Use Testview for evaluating functionality in the high resolution modes and for testing ALL of the memory.

If POST puts text on screen, but does not boot an O/S, observe any display anomaly on the screen that could give clues about the failure mechanism.

If POST runs but does not display text on the screen:» Check voltages, clocks, bus functionality, strapping &

configuration options, etc.

» Use the ITP to initialize the controller and test functionality by reading and writing I/O registers and Video Memory.

» If you could program the Video Controller registers, you should be able to read & write the Video Memory.

End of Chapter 3-3