Docsity

IOM and Frameworks Part 2-Network Programming-Lecture Slides, Slides of Network Programming

Partial preview of the text

Download IOM and Frameworks Part 2-Network Programming-Lecture Slides and more Slides Network Programming in PDF only on Docsity!

1. Static Configuration

(Registration)

name

fxns

devid

params

type

devp

/codec

_DSK5402_AD50_FXN

0x

0x

IOM_Fxns

0x

DEV Table

T^

TO

1. Static Configuration

(DIO)

T^

TO

1. Static Configuration

(TSK)

T^

TO

2. Building the App with the Mini-driver

Including the library

Including the necessary header files

T^

TO

3. Application Initialization

(main)

BIOS_init

main

main ^

other non driver init ^

return (to BIOS)

T^

TO

Task Create Phase

BIOS_init

main

tsk

1. Create Streams2. Allocate Buffers3. Prime Streams

tsk_function(…){

SIO_create()

C E D

SIO_create

  1. Create SIO Object2. Create IOP Packets3. Open Adapter

DIO_open

  1. Create DIO Object2. Create Queues3. Create MD Chan mdCreateChan 1. Create Queue2. Create Chan Object3. Enable Interrupts

T^

TO

Channel Object

typedef struct ChanObj {

Bool

inuse;

/* TRUE => channel is open */

Int

mode;

/* IOM_INPUT or IOM_OUTPUT only */

IOM_Packet

dataPacket; / active I/O packet */

QUE_Obj

pendList;

/* list of packets for I/O */

Uns

*bufptr;

/* pointer in current buffer */

Uns

bufcnt;

/* samples left to handle */

IOM_TiomCallback cbFxn;

/* to notify client */

Ptr

cbArg;

/* info for client */

} ChanObj, *ChanHandle; T^

TO

Task Create Phase

BIOS_init

main

tsk

1. Create Streams2. Allocate Buffers3. Prime Streams

MEM_alloc()MEM_alloc()

C E D

T^

TO

Task Execute Phase

BIOS_init

main

tsk

1. Allocate Buffers2. Create Streams3. Prime Streams1. Reclaim Full Buf2. Process3. Issue Empty Buf

SIO_reclaim

  1. Call adapter2. Deque IOP3. Extract buf info

from IOP & ret

DIO_reclaim

  1. Pend on SEM2. Return to SIO

isr

  1. Fill buf with data2. When buf is full,

call Callbackwith arg and IOP …

while(!terminate) {

SIO_reclaim();

C E D

Callback

  1. Queue IOP2. Post Sem

T^

TO

Task Execute Phase

BIOS_init

main

tsk

1. Allocate Buffers2. Create Streams3. Prime Streams1. Reclaim Full Buf2. Process3. Issue Empty Buf

while(!terminate) {

SIO_reclaim()DSP_stuff

C E D

T^

TO

Task Delete Phase

BIOS_init

main

tsk

1. Allocate Buffers2. Create Streams3. Prime Streams1. Reclaim Full Buf2. Process3. Issue Empty Buf 1. Delete

while(!terminate) {

SIO_reclaim()DSP_stuff()SIO_issue() } SIO_reclaim()SIO_reclaim()SIO_delete()MEM_free()... }

C E D

T^

TO

Outline

Intro. to Device Drivers

The Device Driver Developer’s Kit

An Example^ 

Code Flow

Buffer Flow

The Other Class Drivers

Layering Device Drivers

T^

TO

SIO

Buffer Flow

BIOS_init

main

tsk

1. Allocate Buffers2. Create Streams3. Prime Streams1. Reclaim Full Buf2. Process3. Issue Empty Buf

App

IOP

IOP

buf

buf

task_function(){

SIO_create()MEM_alloc()MEM_alloc()SIO_issue()SIO_issue()while(!terminate) {

SIO_reclaim()DSP_stuff()SIO_issue() } SIO_delete()MEM_free() } T^

TO

SIO

Buffer Flow

BIOS_init

main

tsk

1. Allocate Buffers2. Create Streams3. Prime Streams1. Reclaim Full Buf2. Process3. Issue Empty Buf

App DIO

IOP

buf

IOP

buf

task_function(){

SIO_create()MEM_alloc()MEM_alloc()SIO_issue()SIO_issue()while(!terminate) {

SIO_reclaim()DSP_stuff()SIO_issue() } SIO_delete()MEM_free() } T^

TO