[理工] OS交大100 第三大題 題組E.

看板Grad-ProbAsk作者 (Eric)時間13年前 (2012/12/13 12:12), 編輯推噓0(0010)
留言10則, 3人參與, 最新討論串1/1
題目如下: Continue the previous questions. To reduce the memory space needed, UNIX (Linux) uses permission bit to control users' access to files. The permission bits 0755 with three classes of users are demonstrated as follows: RWX a) owner access 7 => 111 b) group access 5 => 101 c) others access 5 => 101 Consider a system with ten domains and one hundred objects. How many bits in total are needed for UNIX to maintain the permission bits for all files? If the number of bits is P. P = P4 * 5^4 + P3 * 5^3 + P2 * 5^2 + P1 * 5^1 + P0 (0≦P0,P1,P2,P3,P4<5). Please choose the correct values of P4, P3, P2, and P1 in the following. 37. P4=? (a)4, (b)3, (c)2, (d)1, (e)0 38. P3=? (a)4, (b)3, (c)2, (d)1, (e)0 39. P2=? (a)4, (b)3, (c)2, (d)1, (e)0 40 P1=? (a)4, (b)3, (c)2, (d)1, (e)0 交大公布正解為 37:D 38:C 39:D 40:E 因為補習時老師也沒有講過關於這類題目的計算, 所以看完題目完全沒有頭緒, 不知道如何計算, 不知道有沒有人會?感謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.240.89.47

12/13 14:03, , 1F
那提組D有人會嗎 我D小提就不會了QAQ
12/13 14:03, 1F

12/13 14:30, , 2F
如果按照題目給的0755共12bit存就算錯了QQ
12/13 14:30, 2F

12/13 14:32, , 3F
但用9bit存,100objects需900bits,而答案就對了QQ
12/13 14:32, 3F

12/13 14:34, , 4F
900的5進位表示是12100..配選項DCDEE..QQ
12/13 14:34, 4F

12/13 14:40, , 5F
回答yywamg的問題:其實我也不太確定D小題怎麼做的,但是
12/13 14:40, 5F

12/13 14:41, , 6F
用以下的寫法答案會是對的,如下:因為有10 domain 以及
12/13 14:41, 6F

12/13 14:42, , 7F
100個objects, 將他寫成矩陣,當中會有1000個entries,
12/13 14:42, 7F

12/13 14:43, , 8F
每格有r,w,x三種權限可以設定,所以3*1000=3000,想辦
12/13 14:43, 8F

12/13 14:44, , 9F
法寫成題目要的形式,答案就會是a,a,e,e
12/13 14:44, 9F

12/13 17:45, , 10F
囧..0755的0表示0755是八進位...
12/13 17:45, 10F
文章代碼(AID): #1GoLMm36 (Grad-ProbAsk)