Updates and Common Questions Asked by Simulation Developers Peter Shier Architect Windows Devices and Storage Technologies

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

CT213 – Computing system Organization
Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Primary Author: Girish Verma Secondary Author(s): Navya Prabhakar Presenter: Navya Prabhakar Company/Organization: CircuitSutra USB Modeling Quick Start.
Lectures on File Management
Computer System Overview
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
EEE 435 Principles of Operating Systems Principles and Structure of I/O Software (Modern Operating Systems 5.2 & 5.3) 5/22/20151Dr Alain Beaulieu.
Yevgeny Petrilin Shay Dan Shadi Ibrahim. GUI : Graphical User Interface DAQ :Data Acquisition Data Acquisition device  a self-powered system that communicated.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
Chapter 1 and 2 Computer System and Operating System Overview
Chapter 11 Operating Systems
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Operating Systems.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
2. Methods for I/O Operations
May 8, The EASY Way to Create I/O Devices John Hyde Intel Corporation intel.com.
October 11, Firmware for USB 2.0 Ryan Augustin Netchip Technology, Inc
XenDesktop Design and Architecture
Windows audio architecture Win MM Application DirectSound Application SysAudio.SYS Kmixer.SYS WinMM.DLLDSound.DLL Device Drive Container USB Device Driver.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Introduction to USB © 2010 Renesas Electronics America Inc. All rights reserved.
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
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.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Overview of Hardware.
2007 Oct 18SYSC2001* - Dept. Systems and Computer Engineering, Carleton University Fall SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 1 Computer System Overview.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
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.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
Storage Device Design Pattern JEFF MEISSNER; KEN HARDY Windows Program Management.
Operating System 1 COMPUTER SYSTEM OVERVIEW Achmad Arwan, S.Kom.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
Intel Open Source Technology Center Lu Baolu 2015/09
Processes and Virtual Memory
4P13 Week 12 Talking Points Device Drivers 1.Auto-configuration and initialization routines 2.Routines for servicing I/O requests (the top half)
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.
What is a Process ? A program in execution.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
LonWorks Introduction Hwayoung Chae.
CHAPTER 3 Router CLI Command Line Interface. Router User Interface User and privileged modes User mode --Typical tasks include those that check the router.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
CSCE451/851 Introduction to Operating Systems
Introduction to Operating Systems Concepts
Resource Management IB Computer Science.
Computer Architecture
Operating Systems: A Modern Perspective, Chapter 6
NS Training Hardware.
DUCKS – Distributed User-mode Chirp-Knowledgeable Server
GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES
Computer System Overview
Lecture Topics: 11/1 General Operating System Concepts Processes
Operating Systems Lecture 3.
Implementing Processes, Threads, and Resources
Chapter 13: I/O Systems.
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:

Updates and Common Questions Asked by Simulation Developers Peter Shier Architect Windows Devices and Storage Technologies

Agenda Interface association descriptors Choosing polled or event-driven data transfer Implementing event sinks for multiple endpoints Implementing mass storage simulation Testing selective suspend Using endpoint diagnostics Using managed code with simulations

Interface Association Descriptors DSF enables specifying an IAD Create a SAFEARRAY of VT_UI1 and fill it with the binary content of your IAD Call ISoftUSBConfiguration::put_DeviceSpecificDescriptor to add it to your descriptor set. See for more info and code samplehttp://msdn.microsoft.com/en-us/library/bb aspx

Choosing Polled or Event-Driven Data Transfer Control (device requests): event driven typically easiest unless data volume and frequency are high Bulk: use event-driven if volume and frequency allow Interrupt: event driven is best Isochronous: must use polled

Implementing Event Sinks for Multiple Endpoints Define an event sink class that implements ISoftUSBEndpointEvents Add a public Init function that takes a pointer to your main simulator class and the ISoftUSBEndpoint interface Add public functions to your simulator class for each event you need to handle. Parameters should be same as event plus the ISoftUSBEndpoint interface pointer (or anything you want to identify the source endpoint) Event handlers just call into the simulator class to report the event. Add a Terminate function to the event sink class so that it can remove its event sink on the endpoint and release its back pointer to the simulator class.

Implementing Mass Storage Simulation This is not trivial but it has been done and works well. The USB portions are not too hard but the bus-independent storage portion can be a large body of code depending on how much you need to implement. Overview: Implement as an in-proc COM object Use event-driven transfers on bulk endpoints if possible. If not then use dedicated thread to keep data moving. Use a worker thread to execute storage commands Communicate with worker thread from endpoint data handling threadevents that will occur in arbitrary thread If using a file as backing store then use overlapped I/O with FILE_FLAG_NO_BUFFERING Use a sparse array for simulating large volumes. We have some design details available. Send to if you’d like a

Testing Selective Suspend DSF implements selective suspend on root hub and external hub ports. If the driver implements selective suspend then DSF will respond to it. SoftUSBDevice.State changes to SoftUSBDeviceStateSuspended when device is suspended. There is no event for this. To test whether your device suspends: Stop submitting I/O to device Poll SoftUSBDevice.State at some reasonable frequency (e.g. 200ms) for a period that matches the driver’s idle detection to check that the device suspends in a timely manner. For a device-initiated resume call SoftUSBDevice.Resume

Using Endpoint Diagnostics Connect test machine to kernel debugger Alternatively use a Virtual PC for your test machine In Vista, at the debugger command line enter: ed nt!kd_default_mask 8 In your test app (C++) call: ISoftUSBEndpoint::QueryInterface(__uuidof(IDSFDebug), …) IDSFDebug::SetObjectFlags(SOFTUSBENDPOINT_OBJECTFLAGS, ) In your test app (script) call: SoftUSBEndpoint.SetObjectFlags 100, Trace flags available: SOFTUSBENDPOINT_TRACETRANSFERINPUT SOFTUSBENDPOINT_TRACETRANSFEROUPUT SOFTUSBENDPOINT_TRACETRANSFERINPUTANDOUPUT SOFTUSBENDPOINT_TRACEOUTLISTOVERFLOW More info at

Using Managed Code with Simulators Simulators should be written in C++ Simulators can expose interfaces that are usable from managed code Write test apps in managed code

Resources DSF on MSDN: Under Win32 and COM Development/Windows Driver Kit/Other Tools. Currently at Tech support questions: