RTL-8139 experimentation Setting up an environment for studying the Network Controller.

Slides:



Advertisements
Similar presentations
Device Virtualization Architecture
Advertisements

Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
Memory.
Memory Management Unit
Part IV: Memory Management
Another device-driver? Getting ready to program the network interface.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Receiver ‘packet-splitting’
IA32 Paging Scheme Introduction to the Pentium’s support for “virtual” memory.
The RealTek interface Introduction to the RTL-8139 network controller registers.
Chapter 8.3: Memory Management
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
Examining network packets Information about the RTL8139 needed for understanding our ‘watch235.c’ pseudo driver.
IXP2400 Protocol Offloading Yan Luo Chris Baron
CE6105 Linux 作業系統 Linux Operating System 許 富 皓. Chapter 2 Memory Addressing.
The hardware ringbuffer Understanding the RTL-8139 mechanism for packet reception.
Our ‘nic.c’ module We create a ‘character-mode’ device-driver for the 82573L NIC to use in futrure experiments.
Memory Management Chapter 5.
Adjusting out device-driver Here we complete the job of modifying our ‘nicf.c’ Linux driver to support ‘raw’ packet-transfers.
MEMORY MANAGEMENT By KUNAL KADAKIA RISHIT SHAH. Memory Memory is a large array of words or bytes, each with its own address. It is a repository of quickly.
Memory Management Five Requirements for Memory Management to satisfy: –Relocation Users generally don’t know where they will be placed in main memory May.
What’s needed to transmit? A look at the minimum steps required for programming our anchor nic’s to send packets.
Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only.
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
FreeBSD Network Stack Performance Srinivas Krishnan University of North Carolina at Chapel Hill.
Chapter 9 Managing a Cisco Internetwork Cisco Router Components Bootstrap - Brings up the router during initialization POST - Checks basic functionality;
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
An Introduction to Device Drivers Sarah Diesburg COP 5641 / CIS 4930.
Memory Management in Windows and Linux &. Windows Memory Management Virtual memory manager (VMM) –Executive component responsible for managing memory.
© Wiley Inc All Rights Reserved. CCNA: Cisco Certified Network Associate Study Guide CHAPTER 9: Managing a Cisco Internetwork.
Cosc 4740 Chapter 7 Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Input queue –
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
A Comparative Study of the Linux and Windows Device Driver Architectures with a focus on IEEE1394 (high speed serial bus) drivers Melekam Tsegaye
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Ethernet Driver Changes for NET+OS V5.1. Design Changes Resides in bsp\devices\ethernet directory. Source code broken into more C files. Native driver.
1 Linux Operating System 許 富 皓. 2 Memory Addressing.
KeyStone Training Multicore Navigator: Packet DMA (PKTDMA)
NS Training Hardware.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 3 v3.0 Module 4 Switching Concepts.
Operating Systems CMPSC 473 Virtual Memory Management (4) November – Lecture 22 Instructor: Bhuvan Urgaonkar.
Virtual Machine Queue Driver Development Sambhrama Mundkur Sr. Software Design Engineer Core Networking
Intel Research & Development ETA: Experience with an IA processor as a Packet Processing Engine HP Labs Computer Systems Colloquium August 2003 Greg Regnier.
An Introduction to Device Drivers Ted Baker  Andy Wang COP 5641 / CIS 4930.
Processes and Virtual Memory
Memory Management CS Spring Overview Partitioning, Segmentation, and Paging External versus Internal Fragmentation Logical to Physical Address.
Kernel Modules – Introduction CSC/ECE 573, Sections 001 Fall, 2012.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Chapter 7: Main Memory CS 170, Fall Program Execution & Memory Management Program execution Swapping Contiguous Memory Allocation Paging Structure.
Chapter 8: Memory Management
Background Information Text Chapter 8
Final Review CS144 Review Session 9 June 4, 2008 Derrick Isaacson
Introduction to the Kernel and Device Drivers
An Introduction to Device Drivers
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Xen Network I/O Performance Analysis and Opportunities for Improvement
So far… Text RO …. printf() RW link printf Linking, loading
Memory Management-I 1.
Main Memory Background Swapping Contiguous Allocation Paging
Introduction to the Intel x86’s support for “virtual” memory
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Lecture 3: Main Memory.
Chapter 8: Memory Management strategies
2P13 Week 7.
Fixes and Enhancements
Who’s listening? Some experiments with an ‘echo’ service on our anchor-cluster’s local network of 82573L nic’s.
CSE 542: Operating Systems
Presentation transcript:

RTL-8139 experimentation Setting up an environment for studying the Network Controller

Operating the NIC We saw that, with a suitable device-driver, we could memory-map the NIC’s registers into an application’s virtual address space (our ‘mmap8139.c’ module did that for us) But operating the NIC requires two further ‘resources’ that are not directly accessible from user-space: memory and interrupts

Kernel memory-buffer We can enhance of our device-driver so it provides access to a region of physically contiguous processor memory, by using ‘kmalloc()’ during module-initialization to reserve a big enough buffer (80-KB), and by equipping our driver with functions that perform ‘read()’, ‘write()’, and ‘lseek()’ on the allocated region of kernel memory

Avoid using interrupts We can temporarily avoid using interrupts by performing ‘polling’ operations during our initial exploratory work with the NIC Interrupts are disabled by doing a ‘reset’ Later, after we have developed our basic understanding of the NIC’s operations, we can turn to the issue of how interrupts may be employed for improved efficiency

Overview of our setup ‘nicstudy’ application ‘user8139.ko’ device-driver standard runtime libraries Linux Kernel memory buffer mmapllseekwriteread user-space kernel-space 8139 registers

The ‘transmit’ steps To transmit our first network packet, we ‘write’ it into our kernel buffer (at offset 0) We ‘enable’ transmission (bit #2 of CR) We ‘configure’ transmission, or use default To ‘initiate’ packet-transmission, we write the packet’s length to ‘TxStatus0’ register The NIC sets bit 13 of TxStatus when the transmission has been concluded

Did it work? Our ‘nicstudy.cpp’ application performs a packet-transmission (using ‘user8139.c’) To verify that our packet was indeed sent over the Local Area Network, we need to setup another workstation that receives it (and displays the transmitted information) Our ‘rxtester.cpp’ program can do this – but it requires a ‘privileged’ user to run it

Multiple packets To send another packet, we need to use the next ‘transmit descriptor’ among four that the network controller supports: –Descriptor 0: –Descriptor 1: –Descriptor 2: –Descriptor 3: These descriptors must be used in ‘round robin’ fashion (i.e., as a ‘circular queue’)

In-class exercise #1 Modify the ‘nicstudy.cpp’ application so it transmits fifteen packets in succession You can use your ‘rxtester’ workstation’s MAC address in the destination-field for your packet (first six bytes), to avoid your 15 packets being received by everyone’s test-station (that would be very confusing)!

In-class exercise #2 Find out the lengths for the smallest and the largest packets you can successfully transmit and receive Find out the maximum number of 80-byte packets that you can successfully transmit and receive during a one-second interval