Notes for Lab 10 On implementing ‘show’ and ‘hide’ for the SiS 315 hardware cursor.

Slides:



Advertisements
Similar presentations
Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Advertisements

Sogang University Advanced Operating Systems (Linux Device Drivers) Advanced Operating Systems (Linux Device Drivers) Sang Gue Oh, Ph.D.
Computer System Laboratory
Using our device-drivers How can an application display the data in a device special file?
USERSPACE I/O Reporter: R 張凱富.
Using VMX within Linux We explore the feasibility of executing ROM-BIOS code within the Linux x86_64 kernel.
Linux ‘Demand-Paging’
CS 686: Programming SuperVGA Graphics Devices Introduction: An exercise in working with graphics file formats.
Creating a device-file node An introduction to some privileged Linux system-calls (needed for an upcoming programming exercise)
I/o multiplexing On adding a ‘poll()’ method to our character-mode device-driver for an 82573L network controller.
The Linux PCI Interface An introduction to the PCI configuration space registers.
IA32 Paging Scheme Introduction to the Pentium’s support for “virtual” memory.
Hardware-address filtering How can we send packets to just one node on our ‘anchor’ cluster?
The RealTek interface Introduction to the RTL-8139 network controller registers.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
A look at memory issues Data-transfers must occur between system memory and the network interface controller.
Timeout for some demos An instructive look at how the Linux Operating System sets up system data-structures.
SiS 315 Graphics Engine Introduction to some capabilities of graphics accelerator hardware.
Standard C Libraries Application Programmming Interface to System-Calls.
Exploring a modern NIC An introduction to programming the Intel 82573L gigabit ethernet network interface controller.
Using VM controls Examples of ‘event-injection’ by our ‘host’ VMM into its ‘guest’ VM.
RTL-8139 experimentation Setting up an environment for studying the Network Controller.
“Virtual” Memory How does the OS kernel provide “private” and “shared” memory areas to multiple concurrent processes?
Examining network packets Information about the RTL8139 needed for understanding our ‘watch235.c’ pseudo driver.
The ‘ioctl’ driver-function On implementing ‘show’ and ‘hide’ for the SiS 315 hardware cursor.
Access to video memory We create a Linux device-driver that gives applications access to our graphics frame-buffer.
Graphics acceleration An example of line-drawing by the ATI Radeon’s 2D graphics engine.
Direct I/O Programming An introduction to the Pentium’s mechanism for programming peripheral hardware components.
Linux Memory Issues Introduction. Some Architecture History 8080 (late-1970s) 16-bit address (64-KB) 8086 (early-1980s) 20-bit address (1-MB) (mid-’80s)
Scientific Visualization Using imagery to aid humans in understanding a complicated phenomenon.
Managing physical memory
Rapid prototyping of LKMs Configuring our Linux systems for the quick creation and use of loadable kernel modules.
Detecting PCI devices On identifying the peripheral equipment installed in our PC.
How to do ‘page-flipping’ The steps needed when revising our ‘wfmodel1.cpp’ prototype to achieve ‘smooth’ animation.
The ‘ioctl’ driver-function On implementing a way to query and modify our UART’s baudrate via the ‘device-file’ abstraction.
Adjusting out device-driver Here we complete the job of modifying our ‘nicf.c’ Linux driver to support ‘raw’ packet-transfers.
CS 686: Programming SuperVGA Graphics Devices Introduction: An exercise in working with graphics file formats.
A device-driver for Video Memory Introduction to basic principles of the PC’s graphics display.
The ‘mmap()’ method Adding the ‘mmap()’ capability to our ‘vram.c’ device-driver.
CENG334 Introduction to Operating Systems Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
Introduction to the Intel x86’s support for “virtual” memory
SiS 315 An introductory exploration of features of the SVGA graphics processor used in our classroom’s workstations.
What’s needed to transmit? A look at the minimum steps required for programming our anchor nic’s to send packets.
Introduction to Computer Engineering by Richard E. Haskell 8086 Memory Module M14.1 Sections 9.3.
Hardware-address filtering How can we send packets to just one node on our ‘anchor’ cluster?
Accessing the NIC A look at the mechanisms that software can use to interact with our 82573L network interface.
HW API internal meeting 2/10/2001 Eric CANO, CERN/EP-CMD1 What’s proposed? l Integration with Christoph’s generic hardware access library for user-friendly.
Final presentation- Part A Avi Urman, Kobi Maltinsky Supervisor: Inna Rivkin Linux on SOPC – Embedded System Implementation.
UART and UART Driver B. Ramamurthy.
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
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.
I/O management is a major component of operating system design and operation Important aspect of computer operation I/O devices vary greatly Various methods.
Linux Kernel Management. Module 9 – Kernel Administration ♦ Overview The innermost layer of Linux operating system is the kernel, which is a thin layer.
Digression on r/w ‘/proc’ files An application of kernel module programming to Super VGA graphics device control.
CSC414 “Introduction to UNIX/ Linux” Lecture 2. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Lab 12 Department of Computer Science and Information Engineering National Taiwan University Lab12 – Driver 2014/12/16 1 /21.
CS-321 Dr. Mark L. Hornick 1 Graphics Displays Video graphics adapter Monitor.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
Lecture 11 Text mode video
 Backlight 에서 나온 백색광이 액정 셀을 통과하면 서 투과율이 조절되고 red, green, blue 의 color filter 를 투과해 나오는 빛의 혼합을 통해 색이 구 성됨  Color filter 는 셀사이의 빛을 차단하는 black matrix,
Interrupts and Interrupts Handling
Chapter 12: File System Implementation
Computer System Laboratory
Linux device driver development
FIGURE 12-1 Memory Hierarchy
CS 140 Lecture Notes: Virtual Machines
Virtual Memory CSCI 380: Operating Systems Lecture #7 -- Review and Lab Suggestions William Killian.
Implementation of Embedded OS
CSCI 380: Operating Systems William Killian
Computer System Laboratory
Presentation transcript:

Notes for Lab 10 On implementing ‘show’ and ‘hide’ for the SiS 315 hardware cursor

The GPU resources The SiS 315 graphics processing units in our workstations are each equipped with 32-megabytes of video display memory (designated as PCI resource 0) These graphics adapters also implement a set of memory-mapped registers known as the 2D graphics engine (and designated as PCI resource 1)

‘pci_resource_start()’ Device-drivers can use this Linux kernel function to discover the physical address where resource 0, or resource 1, resides struct pci_dev*devp = NULL: devp = pci_find_device( VEN, DEV, devp ); vram = pci_resource_start( devp, 0 ); mmio = pci_resource_start( devp, 1 );

SiS 315 information Programming manual for the SiS 315 GPU is not usually made available to the public But some information can be derived from reading Linux device-driver source-code Examples are: –The ‘/usr/src/linux/drivers/video/sis’ directory –Also download the ‘svgalib ’ package

Graphics Cursor cursor-image source-offset x8500 cursor visibility control bit: 0=hide, 1=show cursor-image horizontal coordinate 0x850C 0x8510 cursor starting command bit: 0=no, 1=yes cursor-image vertical coordinate

Algorithm to hide cursor Map physical page containing the registers to a virtual address (with ‘ioremap()’) Read current values of these registers Clear bit #30 (to make cursor invisible) Set bit #31 (to initiate a new command) Write these adjusted register values Undo the mapping (with ‘iounmap()’)

Algorithm to show cursor Map physical page containing the registers to a virtual address (with ‘ioremap()’) Read current values of these registers Set bit #30 (to make cursor visible) Set bit #31 (to initiate a new command) Write these adjusted register values Undo the mapping (with ‘iounmap()’)

The ‘ioctl.c’ module These techniques are demonstrated in this device-driver module’s ‘ioctl()’ function Two IOCTL commands are implemented –#define CURSOR_HIDE0 –#define CURSOR_SHOW1 Applications can open the device-file, then use an ioctl-command; for example: int fd = open( “/dev/vram”, O_RDWR ); ioctl( fd, CURSOR_HIDE);

In-class exercise: Try adding new IOCTL commands to the ‘ioctl.c’ driver which lets applications find or move the cursor’s screen-position; #define CURSOR_FIND2 #define CURSOR_MOVE3 struct { long x, y; } location; ioctl( fd, CURSOR_FIND, &location ); location.x += 40; location.y += 40; ioctl( fd, CURSOR_MOVE, &location );