27.10.2014 Views

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

Cracking the Coding Interview, 4 Edition - 150 Programming Interview Questions and Solutions

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.

<strong>Solutions</strong> 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 />

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 <strong>and</strong> grants access by asserting<br />

DMA acknowledgement signal. Once it gets <strong>the</strong> access, it reads/writes <strong>the</strong> data <strong>and</strong><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.<br />

2 3 9<br />

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

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

Saved successfully!

Ooh no, something went wrong!