DOC PREVIEW
USF CS 635 - Lecture Notes

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

RTL-8139 experimentationOperating the NICKernel memory-bufferAvoid using interruptsOverview of our setupThe ‘transmit’ stepsDid it work?Multiple packetsIn-class exercise #1In-class exercise #2RTL-8139 experimentationSetting up an environment for studying the Network ControllerOperating 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 interruptsKernel 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 memoryAvoid 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 efficiencyOverview of our setup‘nicstudy’application‘user8139.ko’ device-driverstandard runtime librariesLinux Kernelmemory buffermmap llseek write readuser- spacekernel-space8139 registersThe ‘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 concludedDid 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 itMultiple packets•To send another packet, we need to use the next ‘transmit descriptor’ among four that the network controller supports: –Descriptor 0: <TxStatus0, TxBuffer0>–Descriptor 1: <TxStatus0, TxBuffer1>–Descriptor 2: <TxStatus0, TxBuffer2>–Descriptor 3: <TxStatus0, TxBuffer3>•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


View Full Document

USF CS 635 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?