看板 Grad-ProbAsk 關於我們 聯絡資訊
[100交大計組] 11(b) Before DMA transfer. DMA controller must notify processor by supplying identity of the device,operation, memory addrss, number of bytes to transfer,etc. 我知道DMA在傳data之前要先去跟CPU問說可不可以傳,我想問這題錯在DMA是都不會去提供這些資訊嗎還是? [100交大OS] 05. Consider a tiny paging system has 16KB physical memory, and the frame size is 1KB. Let the logical address have 16 bits. The page table uses single-level direct index. Which one of the following is not correct? (c)There are 16 entries in the page table (e)The page table requires 320 bits , including the vaild-invaild bits. 竟然卡住了,這題應該假設page size=frame size去算(吧),所以page offset=10,page index+tag=16-10=6 frame number=4 bits(因為有16個frame),想問(c)和(e)是? 謝大家 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.25.105 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1484405114.A.6F7.html
yupog2003: OS(5),page index有6個bits,所以page table有2^6=64 01/14 22:54
yupog2003: 個entry 01/14 22:54
yupog2003: physical memory內有16KB/1KB=16個frame,所以PPN需要 01/14 22:55
yupog2003: 4個bits,加上valid-invalid bit,一個entry需5個bits 01/14 22:56
yupog2003: page table就需要64*5=320bits 01/14 22:56
yupog2003: 100-11(b)應該是processor去notify DMA controller? 01/14 22:59
kyuudonut: 龍書是寫CPU設定device controller, 後者在設定DMA 01/14 23:04
kyuudonut: 我覺得有點奇怪就是 01/14 23:04
Transfat: 阿我想起來了,這些東西是CPU去設定device controller, 01/14 23:06
Transfat: Device controller再下command給DMA 01/14 23:07
yupog2003: 我看到龍書的一段話: 01/14 23:13
yupog2003: To initiate a DMA transfer, the host writes a DMA 01/14 23:14
yupog2003: command block into memory.This block contains... 01/14 23:14
yupog2003: (就是那些東西).The CPU writes the address of this 01/14 23:15
yupog2003: command block to the DMA controller,then goes on 01/14 23:15
yupog2003: with other work. 01/14 23:15
yupog2003: 這邊的host應該就是device controller的意思? 01/14 23:17
yupog2003: 不過直接看龍書給的圖的確是T大和k大那樣說的沒錯 01/14 23:18
yupog2003: 不過這裡又寫CPU writes the address of this command 01/14 23:18
yupog2003: block to DMA controller,感覺又有點像CPU在做的 01/14 23:19
yupog2003: 張凡的書是直接寫:處理器對DMAC進行設定,包括提供... 01/14 23:19
yupog2003: (就是那些東西),這樣感覺有點差異,不過都不會是DMA去 01/14 23:21
yupog2003: notify CPU就是了 01/14 23:21
kyuudonut: 對阿 我覺得超怪的 龍書有兩種寫法 但應該還是要看 01/14 23:21
kyuudonut: 實作啦 @@ 01/14 23:21
yupog2003: 也許那段話是包含在圖的第三個步驟也說不定XD 01/14 23:30
yupog2003: 感覺我好鑽牛角尖... 01/14 23:30