Network Adapter Driver NCTU High Speed Network Lab.

Slides:



Advertisements
Similar presentations
Device Layer and Device Drivers
Advertisements

1 Homework Reading –Intel 8254 Programmable Interval Timer (PIT) Data Sheet Machine Projects –Continue on MP3 Labs –Continue in labs with your assigned.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
1 Homework Reading (linked from my web page) –S and S Extracts –National Semiconductor UART Data Sheet Machine Projects –mp2 due at start of class 12 Labs.
DMA Controller (8237 Programming Examples)
Interrupt Controller Introduction to 8259.
1 SpaceWire Update NASA GSFC November 25, GSFC SpaceWire Status New Link core with split clock domains complete (Much faster) New Router core.
I/O Unit.
Serial I/O - Programmable Communication Interface
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 6 INPUT/OUTPUT PROGRAMMING.
1 Homework Reading –Review previous material on “interrupts” Machine Projects –MP4 Due today –Starting on MP5 (Due at start of Class 28) Labs –Continue.
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.
The RealTek interface Introduction to the RTL-8139 network controller registers.
PC To GT Program Load Shachar Rosenberg Alex Normatov Technion - Digital Lab.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
t Popularity of the Internet t Provides universal interconnection between individual groups that use different hardware suited for their needs t Based.
Chapter 7 Interupts DMA Channels Context Switching.
Hardware Support for Operating Systems Sunny Gleason Vivek Uppal COM S 414
1 COMP541 Interrupts, DMA, Serial I/O Montek Singh April 24, 2007.
LDD Final Project Background report
The University of New Hampshire InterOperability Laboratory Serial ATA (SATA) Protocol Chapter 10 – Transport Layer.
ECE/CS-352: Embedded Microcontroller Systems Embedded Microcontroller Systems.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Introduction to Embedded Systems Buffering and DMA (Direct Memory Access) Lecture 11.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
© 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.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
1 Microprocessor-based Systems Course 8 Design of input/output interfaces.
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. Registers Used in Timer/Counter  TH0, TL0, TH1, TL1  TMOD (Timer mode register)  TCON (Timer control register) 2.
More on UART Interrupts; System Calls Reference on Interrupt Identification Register(IIR) slide 17 of
NS Training Hardware.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
Virtual Machine Queue Driver Development Sambhrama Mundkur Sr. Software Design Engineer Core Networking
Fall 2000M.B. Ibáñez Lecture 25 I/O Systems. Fall 2000M.B. Ibáñez Categories of I/O Devices Human readable –used to communicate with the user –video display.
Embedded Network Interface (ENI). What is ENI? Embedded Network Interface Originally called DPO (Digital Product Option) card Printer without network.
7.2 Peripheral Supplementary 2 DMA. Reference Siberschatz, “Operating System Concepts Sixth Edition”, John Wiley and Sons, Inc.
6-1 Infineon 167 Interrupts The C167CS provides 56 separate interrupt sources that may be assigned to 16 priority levels. The C167CS uses a vectored interrupt.
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
GROS ( G ROS ( G ROS IS IS A R OUTING R OUTING O PERATING O PERATING S YSTEM ) Batch : 6 Guide :Sabitha. S Hemant Pillai Dean John Abraham Krishnakumar.R.
Introduction of Direct Memory Access (DMA). Why is DMA? It is wasteful to feed data into a controller register 1 bytes at a time. (PIO) The DMA unit is.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 I/O through system calls Protection.
1 COMP541 Interrupts, DMA, Serial I/O Montek Singh April 13, 2010.
DMA Driver APIs DMA State Diagram Loading Driver and Opening Channel DMA Channel Attributes Loading Data to a Channel Unloading Data from a Channel.
CHAPTER 7 CONCURRENT SOFTWARE Copyright © 2000, Daniel W. Lewis. All Rights Reserved.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Computer Networks & Digital Lab project. In cooperation with Mellanox Technologies Ltd. Guided by: Crupnicoff Diego & Gurewitz Omer. Students: Cohen Erez,
Intel 8259A PIC EEE 365 [FALL 2014] LECTURE 21 ATANU K SAHA BRAC UNIVERSITY.
Transmitter Interrupts Review of Receiver Interrupts How to Handle Transmitter Interrupts? Critical Regions Text: Tanenbaum
DEI ARINC 429 TRANSCEIVER SEPT ARINC Transceiver Categories Industry Standard (5V) –DEI1016 family –Wafer ID: 1016 Second Generation (3.3V to 5V)
Homework Reading Machine Projects
Embedded Microcontroller Systems
Homework Reading Machine Projects Labs
Embedded Microcontroller Systems
After Mcasp_open completed
Reference Router on NetFPGA 1G
CS 286 Computer Organization and Architecture
Homework Reading Machine Projects Labs
Transmitter Interrupts
CHAPTER 6 INPUT/OUTPUT PROGRAMMING
Reference Router on NetFPGA 1G
Lecture 12 Input/Output (programmer view)
Presentation transcript:

Network Adapter Driver NCTU High Speed Network Lab.

NCTU High Speed Network Lab2 System Architecture

NCTU High Speed Network Lab3 Adapter Rx Process 16 byte FIFO CRCAddr. Filter DMA If my addr Rx Buffer Ring BUS Coax cable

NCTU High Speed Network Lab4 NIC Rx Procedure HOST CPU NIC FIFO Romote start address(308,309) Romote byte count (30a,30b) Romote DMA write (300) Data port (310) Data port NIC memory Host Memory Local DMA Media (3) (5) (4) (2) (1) Interrupt cup (307) Current page register(page1:307)

NCTU High Speed Network Lab5 NIC Tx Procedure HOST CPU NIC FIFO Romote start address(308,309) Romote byte count (30a,30b) Romote DMA write (300) Data port (310) Remote DMA complete(307) Romote start address(308,309) Data port NIC memory Host Memory Local DMA Media (1) (2) (3) (4) (5) (6)

NCTU High Speed Network Lab6 Buffer Ring Control Points Set one times when initial:  Page Start Point (PSTART) : Set when Initial  Page Stop Point (PSTOP) : Set when Initial Update when received packet:  Current Page Point (CURR) : NIC auto update  Boundary Page Point (BNDRY) : manual update  Next Packet Page (next_pkt) : memory variable

NCTU High Speed Network Lab7 Receive Buffer Ring 256 bytes n Buffer #1 Buffer #2 Buffer #n Page start address

NCTU High Speed Network Lab8 Rx Buffer Ring Maintain When initializing the NIC set : BNDRY = PSTART CURR = PSTART + 1 next_pkt = PSTART + 1 After a packet is DMAed from Rx Buffer Ring next_pkt = Next Page Pointer BNDRY = Next Page Pointer if BNDRY < PSTART then BNDRY = PSTOP - 1

NCTU High Speed Network Lab9 Receive Buffer Ring n1 2 4 Status next page Length(L) Length(H) Packet status Current Page Register Current Page Register Packet Ends 3

NCTU High Speed Network Lab10 Driver ISR Disable interrupt Save PC Registers Read Interrupt Status Register Packet Reception? Packet Transmission? YES Reset PTX bit in Interrupt Status Register Reset PRX bit in Interrupt Status Register YES NO

NCTU High Speed Network Lab11 Read Transmit Status Register Inform High Level Software Empty Transmission Queue? Transmit Next Packet in Queue Update Queue Pointers Send “EOI” to 8259 Enable Interrupt Restore PC Registers IRET DMA Packet from Local memory to PC Inform High Level Software Receive Buffer Ring Empty? NO YES

NCTU High Speed Network Lab12 Driver Send NIC Ready to Transmit? DMA Packet from PC to Local Memory Program NIC to Transmit Packet (Command Reg = 26h) RETURN Queue Packet in PC Memory NO YES

NCTU High Speed Network Lab13 Note: Enter ISR Disable PC Interrupt Save PC Registers Disable Adapter Interrupt Send EOI to 8259 Enable PC Interrupt CLI PUSHA MOV AL,00H WR_NE INTERRUPTMASK MOV DX,20h MOVAL,63h OUTDX,AL STI

NCTU High Speed Network Lab14 Note: Leave ISR Disable PC Interrupt Enable Adapter Interrupt Restore PC Registers Enable PC Interrupt CLI MOV AL,0FFH WR_NE INTERRUPTMASK POPA STI Return to Original ProcessIRET