25.03.2013 Views

Cracking the Coding Interview - Fooo

Cracking the Coding Interview - Fooo

Cracking the Coding Interview - Fooo

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Solutions to Chapter 16 | Low Level<br />

16 3 Describe direct memory access (DMA) Can a user level buffer / pointer be used by<br />

kernel or drivers?<br />

SOLUTION<br />

2 3 9<br />

<strong>Cracking</strong> <strong>the</strong> <strong>Coding</strong> <strong>Interview</strong> | Knowledge Based<br />

pg 82<br />

Direct Memory is a feature which provides direct access (read/write) to system memory without<br />

interaction from <strong>the</strong> CPU The “DMA Controller” manages this by requesting <strong>the</strong> System<br />

bus access (DMA request) from CPU CPU completes its current task and grants access by asserting<br />

DMA acknowledgement signal Once it gets <strong>the</strong> access, it reads/writes <strong>the</strong> data and<br />

returns back <strong>the</strong> system bus to <strong>the</strong> CPU by asserting <strong>the</strong> bus release signal This transfer is<br />

faster than <strong>the</strong> usual transfer by CPU Between this time CPU is involved with processing task<br />

which doesn’t require memory access<br />

By using DMA, drivers can access <strong>the</strong> memory allocated to <strong>the</strong> user level buffer / pointer

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!