UDI Tutorial & Driver Walk-Through Part 1 Kurt Gollhardt SCO Core OS Architect

Slides:



Advertisements
Similar presentations
A C++ Crash Course Part II UW Association for Computing Machinery Questions & Feedback.
Advertisements

Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
CS 450 MPX P ROJECT Introduction to MPX. I NTRODUCTION TO MPX The MPX module is divided into six modules Module R1: User Interface Module R2: Process.
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
UDI, a Uniform Driver Interface By Project UDI Kevin Quick, Interphase, Chairman Mark Evenson, HP, Vice-Chairman Kurt Gollhardt, SCO, Editor.
04/14/2008CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying the textbook.
File System Implementation
PC To GT Program Load Shachar Rosenberg Alex Normatov Technion - Digital Lab.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Processes and Resources
1 I/O Management in Representative Operating Systems.
CSI 400/500 Operating Systems Spring 2009 Lecture #2 – Functional Parts of an Operating System Monday January 23, 2009.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
October 11, Firmware for USB 2.0 Ryan Augustin Netchip Technology, Inc
UDI, a Uniform Driver Interface Architecture Overview Kurt Gollhardt (Chair, Project UDI) November 2010.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
UDI Tutorial & Driver Walk-Through Part 2 Kurt Gollhardt SCO Core OS Architect
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
MD – Object Model Domain eSales Checker Presentation Régis Elling 26 th October 2005.
2003 Dominic Swayne1 Microsoft Disk Operating System and PC DOS CS-550-1: Operating Systems Fall 2003 Dominic Swayne.
Processes Introduction to Operating Systems: Module 3.
OS2014 PROJECT 2 Supplemental Information. Outline Sequence Diagram of Project 2 Kernel Modules Kernel Sockets Work Queues Synchronization.
CPSC 252 The Big Three Page 1 The “Big Three” Every class that has data members pointing to dynamically allocated memory must implement these three methods:
CE Operating Systems Lecture 17 File systems – interface and implementation.
12/8/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
CS-1030 Dr. Mark L. Hornick 1 Basic C++ State the difference between a function/class declaration and a function/class definition. Explain the purpose.
UDI Advanced Topics DMA and Interrupts Robert Lipe UDI Development Team Lead
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Migration to PPC at JLab Richard Dickson. VME data interface differences: CPU VMEchip2 VME mvme177 System Local Bus PPC 750 CPU Raven VME mvme2700.
ICOM Noack Linux I/O structure Device special files Device switch tables and fops How the kernel finds a device Parts of a device driver or module.
Chapter 10: Classes and Data Abstraction. Classes Object-oriented design (OOD): a problem solving methodology Objects: components of a solution Class:
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
UDI Technology Benefits Slide 1 Uniform Driver Interface UDI Technology Benefits.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the Project Generator function.
UDI Network Drivers Network Interface Metalanguage Barry Feild SCO Server Products Group
Memory Management Chapter 5 Advanced Operating System.
UDI Architecture In-Depth Robert Lipe UDI Development Team Lead
Where Testing Fails …. Problem Areas Stack Overflow Race Conditions Deadlock Timing Reentrancy.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
1394 H/W and OHCI Gi-Hoon Jung. 2002/01/162 Agenda Overview of the VITANA board OHCILynx PCI-based Host Controller Overview of the OHCI Spec.
Introduction to Operating Systems Concepts
Input/Output (I/O) Important OS function – control I/O
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Processes and threads.
Operating Systems CMPSC 473
Software Development with uMPS
The PCI bus (Peripheral Component Interconnect ) is the most commonly used peripheral bus on desktops and bigger computers. higher-level bus architectures.
Review.
Chapter 11: File System Implementation
Operating System Concepts
CPSC 457 Operating Systems
Memory Allocation CS 217.
CS703 - Advanced Operating Systems
Lecture Topics: 11/1 General Operating System Concepts Processes
System Calls System calls are the user API to the OS
RUN-TIME STORAGE Chuen-Liang Chen Department of Computer Science
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

UDI Tutorial & Driver Walk-Through Part 1 Kurt Gollhardt SCO Core OS Architect

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 2 Overview Key Concepts Description of Sample Driver Walk-Through Additional Examples Hints & Tips

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 3 Key Concepts Static Driver Properties Initialization Instance Independence Regions, Channels & Control Blocks Channel Operations Programmed I/O

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 4 Driver Package Driver writer must supply: –Driver source code and/or binary –Exported header files (e.g. for custom ops) –Static driver properties file (udiprops.txt) »Attached to driver binary for binary distribution Make package with udimkpkg command

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 5 Static Driver Properties udiprops.txt Properties that are known and fixed in advance of compiling the driver Such as: –driver name –supplier name –identifying attributes of supported devices –message strings

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 6 Initialization udi_init_info Fixed properties of driver code Such as: –Entry-point function pointers –Data structure sizes »Region data, channel context, scratch space –Lists of channel operation & control block types

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 7 Instance Independence Each H/W device instance (“unit”) identified separately Driver maintains per-instance state –No writeable memory shared between instances Instances are dynamic (hot plug)

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 8 Regions One or more regions per driver instance –Driver’s udi_init_info determines # of regions –No writeable memory shared between regions All region data implicitly synchronized –Global and static data is read-only

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 9 Channels Channels connect regions Channel operations pass data over channels Not all types of objects are transferable between regions

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 10 Control Blocks Maintain per-request state Required for channel ops & asynchronous service calls Allocate with udi_cb_alloc Free with udi_cb_free

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 11 Channel Operations Function with control block & metalanguage-specific parameters Target end invoked asynchronously Target channel stored in control block –Initialized by udi_cb_alloc –Points to channel over which a channel op is received

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 12 Programmed I/O One or more register sets per device –Contiguous block of registers or memory –For PCI, register set = BAR All PIO addresses relative to register set Endianness conversion automatic –Driver simply indicates device endianness Both strong & weak ordering supported

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 13 Description of Sample Driver Simple driver for PC-AT CMOS RAM Source includes some interrupt handling code even though not used by device Driver is 95% complete –No constraints propagation –No abort handling –No tracing/logging

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 14 Walk-Through Listing Complete source code listing in handout –“UDI CMOS Sample Driver Listing” – developfast/F9/udi_cmos_sample.htmlhttp:// developfast/F9/udi_cmos_sample.html Selected excerpts in slides –Excerpts include line numbers Included in SCO UDI Development Kit –

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 15 Walk-Through udiprops.txt line 3 First declaration must be properties_version 3 properties_version 0x095 Comments begin with ‘#’ Line continuation with ‘\’

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 16 Walk-Through udiprops.txt lines 9-17 Identify driver and supplier 9 supplier 1 10 message 1 Project UDI 11 contact 2 12 message name 3 14 message 3 CMOS RAM Sample UDI Driver shortname udi_cmos 17 release 2 alpha1.0rc3

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 17 Walk-Through udiprops.txt lines Describe supported devices 28 device 10 2 bus_type string system 29 message 10 Motherboard CMOS RAM 30 config_choices 10 ioaddr1 ubit32 0x70 any \ iolen1 ubit32 2 only Describe driver modules and regions 37 module udi_cmos 38 region 0

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 18 Walk-Through udiprops.txt lines Interface dependencies 44 requires udi 0x requires udi_physio 0x requires udi_gio 0x requires udi_bridge 0x095 Metalanguage usage 53 meta 1 udi_gio # Generic I/O Metalanguage 54 meta 2 udi_bridge # Bus Bridge Metalanguage 56 child_bind_ops # GIO meta, region 0, ops_idx 1 57 parent_bind_ops # Bridge meta, region 0, ops_idx 2

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 19 Walk-Through udiprops.txt lines Build rules 63 compile_option -DCMOS_GIO_META=1 -DCMOS_BRIDGE_META=2 64 source_files udi_cmos.c

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 20 Walk-Through udi_cmos.c lines Versions and header files 16 #define UDI_VERSION 0x #define UDI_PHYSIO_VERSION 0x #include 20 #include

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 21 Walk-Through udi_cmos.c lines Region data structure 25 typedef struct { 26 /* init_context is filled in by the environment: */ 27 udi_init_context_t init_context; 28 udi_bus_bind_cb_t *bus_bind_cb; 29 /* PIO trans handles for reading and writing, respectively: */ 30 udi_pio_handle_t trans_read; 31 udi_pio_handle_t trans_write; 32 } cmos_region_data_t;

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 22 Walk-Through udi_cmos.c lines Scratch structures and offsets 37 typedef struct { 38 udi_ubit8_t addr; 39 udi_ubit8_t count; 40 } cmos_gio_xfer_scratch_t; 45 #define SCRATCH_ADDR \ offsetof(cmos_gio_xfer_scratch_t, addr) 46 #define SCRATCH_COUNT \ offsetof(cmos_gio_xfer_scratch_t, count) 64 #define GIO_XFER_SCRATCH \ sizeof(cmos_gio_xfer_scratch_t)

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 23 Walk-Through udi_cmos.c lines Control block indexes 51 #define GIO_BIND_CB_IDX 1 52 #define GIO_XFER_CB_IDX 2 53 #define GIO_EVENT_CB_IDX 3 54 #define BUS_BIND_CB_IDX 4 Channel ops indexes 75 #define GIO_OPS_IDX 1 76 #define BUS_DEVICE_OPS_IDX 2

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 24 Walk-Through udi_cmos.c lines Management metalanguage ops vector 87 static const udi_mgmt_ops_t cmos_mgmt_ops = { 88 udi_static_usage, 89 udi_enumerate_no_children, 90 cmos_devmgmt_req, 91 cmos_final_cleanup_req 92 }; Similarly for GIO & Bridge metas –Two bridge ops vectors if using interrupts

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 25 Walk-Through udi_cmos.c lines Defines for PIO 149 #define CMOS_REGSET 1 /* first (and only) register set */ 150 #define CMOS_BASE 0 /* base address within this regset */ 151 #define CMOS_LENGTH 2 /* two bytes worth of registers */ 152 #define CMOS_PACE 5 /* wait 5 microseconds btw accesses */ 161 #define CMOS_ADDR #define CMOS_DATA 1

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 26 Walk-Through udi_cmos.c lines Other defines for CMOS device 167 #define CMOS_DEVSIZE 0x40 /* # data bytes supported by device */ 168 #define CMOS_RDONLY_SZ 0x0E /* first 14 bytes are read-only */

F9: UDI Tutorial & Driver Walk-Through, Part 1 © 1999 SCO All Rights Reserved - Slide 27 Walk-Through udi_cmos.c lines PIO transaction lists 173 static const udi_pio_trans_t cmos_trans_read[] = { … 204 }; 205 static const udi_pio_trans_t cmos_trans_write[] = { … 236 }; Transaction list details covered later in Part 2

Presenter’s Notes Cover Page Go to “Notes Page View” to see this one Put this page at end of presentation so numbering of slides will remain accurate.