Programming Super-VGA Graphics Devices Introduction to VESA graphics modes and to organization of the linear frame-buffer memory.

Slides:



Advertisements
Similar presentations
Programmable Interval Timer
Advertisements

VGA Text Mode An introduction to font selection and to reprogramming of the Character Generator ram.
Basic Computer Hardware and Software.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
CS-334: Computer Architecture
Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati. PCI Devices NIC Cards NIC card architecture Access to NIC register – PCI access.
CS 686: Programming SuperVGA Graphics Devices Introduction: An exercise in working with graphics file formats.
An introduction to the PCI configuration space registers
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
A look at memory issues Data-transfers must occur between system memory and the network interface controller.
The CRT Controller How to modify CRTC registers to achieve a non-standard horizontal and vertical screen resolution.
Accessing network hardware The Network Interface Controllers are part of a larger scheme used in modern PCs for device control.
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: internal fault (e.g.. divide by.
Wire-frame Modeling An application of Bresenham’s line-drawing algorithm.
Detecting PCI devices On identifying the peripheral equipment installed in our PC.
CS 686: Programming SuperVGA Graphics Devices Introduction: An exercise in working with graphics file formats.
The IDE/ATA Interface How can our mini-Operating System, executing in protected mode, access the hard disk?
A device-driver for Video Memory Introduction to basic principles of the PC’s graphics display.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Input-Output Problems L1 Prof. Sin-Min Lee Department of Mathematics and Computer Science.
Accessing the NIC A look at the mechanisms that software can use to interact with our 82573L network interface.
6. The CPU and Memory Chapt. 7.
Hardware and Software Basics. Computer Hardware  Central Processing Unit - also called “The Chip”, a CPU, a processor, or a microprocessor  Memory (RAM)
V Material obtained from summer workshop in Guildford County.
Video Monitor Uses raster scanning to display images
Chapter 2 How Computers Work.
C.S. Choy95 COMPUTER ORGANIZATION Logic Design Skill to design digital components JAVA Language Skill to program a computer Computer Organization Skill.
Chapter 5 Basic Input/Output System (BIOS)
Memory Main memory consists of a number of storage locations, each of which is identified by a unique address The ability of the CPU to identify each location.
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS) Excerpted from 1 Copyright © Texas Education Agency, All.
Basics of a Computer Graphics System Introduction to Computer Graphics CSE 470/598 Arizona State University Dianne Hansford.
Ch Review1 Review Chapter Microcomputer Systems Hardware, Software, and the Operating System.
Random access memory.
ORG ; FOUR INT 21H and INT 10H Programming and Macros Dec Hex Bin
8088 I/F with basic IO, RAM and 8255
Organization of a computer: The motherboard and its components.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
Raster-scan system In addition to the central processing unit a special purpose processor called the video controller or display controller is used to.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
Video Monitor Uses raster scanning to display images –Beam of electrons illuminates phosphorus dots on the screen called pixels. Starting at the top of.
1. Introduction 2. Methods for I/O Operations 3. Buses 4. Liquid Crystal Displays 5. Other Types of Displays 6. Graphics Adapters 7. Optical Discs 10/01/20151Input/Output.
Laface Operating System Design Booting a PC to run a kernel from Low memory VGA display.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
Memory  Main memory consists of a number of storage locations, each of which is identified by a unique address  The ability of the CPU to identify each.
Output Devices. Printers Factors affecting choice Volume of output High volume require fast, heavy-duty printer Quality of print required Location of.
1 Hardware and Software b Hardware the physical, tangible parts of a computerthe physical, tangible parts of a computer keyboard, monitor, wires, chips,
Computers Are Your Future Chapter 1 Slide 1 Introduction to the Computers & Internet Chapter 1 Concepts of Information Technology IT.
1 Homework Reading –PAL pp , Continue mp1 –Questions? Continue lab sessions with your section.
Computer Organization & Assembly Language © by DR. M. Amer.
1.  RAM is our working memory storage. All the data, which the PC uses and works with during operation, are stored here.  Data are stored on drives,
Digression on r/w ‘/proc’ files An application of kernel module programming to Super VGA graphics device control.
Motherboard A motherboard allows all the parts of your computer to receive power and communicate with one another.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
Computer Maintenance I
Basic Computer Hardware and Software. Guilford County SciVis V
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Memory Hierarchy (I). 2 Outline Random-Access Memory (RAM) Nonvolatile Memory Disk Storage Suggested Reading: 6.1.
Technology Vocabulary Matthew L. Morris. A-D Application- A program or group of programs designed for end users. Data- Distinct pieces of information.
Basic Computer Hardware and Software.
CS 1410 Intro to Computer Tecnology Computer Hardware1.
Computer Accessories (Component of A Computer) Motherboard Processor RAM HDD Power Unit/Cashing Monitor CD/DVD Keyboard Mouse.
THE COMPUTER MOTHERBOARD AND ITS COMPONENTS Compiled By: Jishnu Pradeep.
Flowchart of basic interrupt mechanism
Computer systems is a 10-credit unit
Introduction of microprocessor
CS703 - Advanced Operating Systems
Microprocessor & Assembly Language
Presentation transcript:

Programming Super-VGA Graphics Devices Introduction to VESA graphics modes and to organization of the linear frame-buffer memory

Motivation The impetus for high-quality PC graphics was an early incentive for developing the 32-bit Intel x86 processor, since graphics images with realistic color and animation requires efficient access to a much larger memory-segment than can be addressed with the original 20-bit real-mode scheme

Raster Display Technology The graphics screen is a two-dimensional array of picture elements (‘pixels’) These pixels are redrawn sequentially, left-to-right, by rows from top to bottom

Special “dual-ported” memory VRAM RAM CPU CRT 128-MB of VRAM 4096-MB of RAM

Screen-resolution by-480 = pixels (i.e., picture-elements)

Early ‘planar’ memory Each cpu byte-address controlled 8 adjacent pixels in 4 parallel color-planes 640-by-480 times 4-planes, divided by 8 bits-per-byte = byte-addresses

Greater picture fidelity by-960 = pixels (i.e., picture-elements) times 4 bytes-per-pixel = bytes of vram

Typical Chipset Layout MCH Memory Controller Hub (Northbridge) ICH I/O Controller Hub (Southbridge) CPU Central Processing Unit DRAM Dynamic Random Access Memory NIC Network Interface Controller HDC Hard Disk Controller AC Audio Controller Graphics Controller TimerKeyboardMouseClock Multimedia Controller Firmware Hub

PCI Configuration Space PCI Configuration Space Body (48 doublewords – variable format) 64 doublewords PCI Configuration Space Header (16 doublewords – fixed format) A non-volatile parameter-storage area for each PCI device-function

PCI Configuration Header Status Register Command Register Device ID Vendor ID BIST Cache Line Size Class Code Class/SubClass/ProgIF Revision ID Base Address 0 Subsystem Device ID Subsystem Vendor ID CardBus CIS Pointer reserved capabilities pointer Expansion ROM Base Address Minimum Grant Interrupt Pin reserved Latency Timer Header Type Base Address 1 Base Address 2Base Address 3 Base Address 4Base Address 5 Interrupt Line Maximum Latency doublewords Dwords

reserved Interface to PCI Configuration Space CONFADD ( 0x0CF8) CONFDAT ( 0x0CFC) ENEN bus (8-bits) device (5-bits) doubleword (6-bits) function (3-bits) 00 PCI Configuration Space Address Port (32-bits) PCI Configuration Space Data Port (32-bits) 31 0 Enable Configuration Space Mapping (1=yes, 0=no)

Reading PCI Configuration Data Step one: Output the desired longword’s address (bus, device, function, and dword) with bit 31 set to 1 (to enable access) to the Configuration-Space Address-Port Step two: Read the designated data from the Configuration-Space Data-Port: # read the PCI Header-Type field (byte 2 of dword 3) for bus=0, device=0, function=0 movl$0x C, %eax# setup address in EAX movw$0x0CF8, %dx# setup port-number in DX outl%eax, %dx# output address to port mov$0x0CFC, %dx# setup port-number in DX inl%dx, %eax# input configuration longword shr$16, %eax# shift word 2 into AL register movb%al, header_type# store Header Type in variable

Graphics programs What a graphics program must do is put appropriate bit-patterns into the correct locations in the VRAM, so that the CRT will show an array of colored dots which in some way is meaningful to the human eye So the programmer must understand what the CRT will do with the contents of VRAM

How ‘truecolor’ works R B G alpharedgreenblue pixel longword The intensity of each color-component within a pixel is an 8-bit value

Intel uses “little-endian” order BGRBGRBGR VRAM Video Screen

Vendor incompatibilities Several competing vendors manufacture graphics controllers for the PC market They’re based in various parts of the world (e.g., United States, Canada, Taiwan, etc.) Their hardware designs are not identical The VESA (Video Electronics Standards Association) organization was created to create a standardized firmware interface

VBE 3.0 The VESA BIOS Extensions document is accessible on our CS 630 course website It implements services in a manner similar to the ROM-BIOS routines we’ve used in our previous boot-time applications (e.g., via software interrupt-0x10) We’ve created a demo-program (named ‘vesademo.s’) illustrating VESA’s use

Typical ‘program-structure’ Usual steps within a graphics application: – Initialize video system hardware – Display some graphical imagery – Wait for a termination condition – Restore original hardware state

Hardware Initialization The SVGA system has over 300 registers which must be individually reprogrammed It would take us many months to learn how they all work to support a graphics mode For now, we just ‘reuse’ vendor-supplied routines, built into the SVGA firmware They usually support quite a few different screen-resolutions and color-depths

Physical Memory Layout Graphics frame-buffer our code/data 0x Base-Address is dynamically assigned by firmware at power-on CPU address space (4GB)

VESA function 1 Obtains a block of parameter-values for the desired graphics display-mode: –Scanline-width (in bytes) –Horizontal resolution (in pixels) –Vertical resolution (in pixels) –Pixel-size (in bits-per-pixel) –Frame-buffer’s physical address

VESA function 2 Reprograms all the graphics controller’s internal device registers for the selected VESA-standard display-mode

In-class exercise #1 Can you reprogram the colors used in our ‘vesademo.s’ application to use another border-color and another annulus-color? ALPHAREDGREENBLUE 31…… ……16 15…..… ……… 0

In-class exercise #2 Can you modify our demo-program so as to use a standard VESA graphics mode that has a higher screen-resolution? –Mode 0x0115 was for 800-by-600, 32bpp –Mode 0x0118 is for 1024-by-768, 32bpp