📄 allman4.ps
字号:
3938(\256les)S4137(one)S4313(has)S(access)258 4478 A4767(to)S4876(the)S5030(disks,)S1488 V1080(terminals)S1487(and)S1664(other)S1903(parts)S2131(of)S2247(the)S2402(machine.)S2825(Single)S3114(bytes)S3358(or)S3474(disk)S3673(blocks)S3966(may)S4170(be)S4296(transferred)S4765(to)S4874(or)S4989(from)S5216(a)S1608 V1080(device)S1377(with)S1590(ordinary)S10 B1965(read)S10 R2161(\(2\))S2313(or)S10 B2431(write)S10 R2656(\(2\))S2808(calls,)S3052(byte)S(positions)362 3259 A3656(set)S3803(with)S10 B4017(lseek)S10 R4230(\(2\),)S4408(or)S4527(more)S4769(complicated)S1728 V1080(control)S1390(functions)S1789(performed)S2234(with)S10 B2438(ioctl\(2\).)S1896 V10 R1080(Device)S1391(\256les)S1584(as)S(found)234 1693 A1952(in)S10 B2056(/dev)S10 R2261(have)S2477(several)S2789(attributes)S3190(that)S3367(must)S3588(be)S3709(considered.)S4221(Here)S4444(are)S4594(two)S4771(examples)S5177(as)S2016 V10 B1080(ls)S10 B-11172(-)S10 B1229(l)S10 R1282(shows)S1558(them:)S2184 V10 C(brw-rw-rw-)610 1440 A2172(1)S(root)244 2294 A(operator)488 2843 A3514(2,)S3819(1)S(Jun)183 3941 A4185(10)S(1995)244 4429 A(fd1)183 4734 A2304 V(crw--w----)610 1440 A2172(1)S(kjb)183 2294 A(tty)183 2843 A3514(4,)S3819(0)S(May)183 3941 A4185(11)S(09:41)305 4368 A(console)427 4734 A2472 V10 R1080(Most)S1323(attributes)S1735(are)S1896(the)S2056(same)S2300(as)S2421(for)S2576(a)S2658(regular)S2981(\256le)S3147(and)S3329(have)S3556(the)S3716(same)S3960(function.)S4382(The)S4577(\256le)S4744(type)S4955(and)S5138(the)S2592 V1080(major)S1340(and)S1510(minor)S1775(device)S2063(numbers)S2434(are)S2583(special)S2888(to)S2991(devices.)S2760 V1080(Character)S1501(devices)S1831(are)S1983(marked)S2313(with)S2520(a)S10 B2593(c)S10 R2666(as)S2778(a)S2851(\256le)S3008(type)S3209(letter.)S3495(Any)S3696(I/O)S3859(on)S3987(a)S4060(character)S4459(device)S4751(is)S4847(sent)S5038(down)S2880 V1080(to)S1186(the)S1337(device)S1628(driver)S(without)307 1897 A2232(any)S2405(interpretation.)S3026(This)S3233(means)S3518(that)S3697(a)S3770(process)S4099(doing)S4354(the)S4504(I/O)S4666(must)S(know)223 4888 A5138(the)S3000 V1080(characteristics)S1683(of)S1792(the)S1940(device)S2228(and)S2398(deal)S2591(with)S2795(them)S3021(appropriately.)S3168 V1080(Block)S1357(devices)S(provoke)329 1696 A2062(the)S2222(\256le)S2388(system)S2704(server)S2988(into)S3181(buffering)S3593(the)S3753(data)S3958(on)S4096(those)S4346(devices.)S4736(Data)S4965(read)S5177(or)S3288 V(written)286 1080 A1393(by)S1520(processes)S1933(is)S2027(passed)S(through)312 2322 A2661(the)S2811(\256le)S2967(system)S3273(block)S(cache.)255 3523 A3830(Unaligned)S4276(bytes)S4515(read)S4715(or)S(written)286 4825 A5137(are)S3408 V1080(extracted)S1494(or)S1622(reassembled)S2164(by)S2308(the)S2475(\256le)S2648(server)S2939(from)S3179(or)S3307(to)S3429(whole)S3719(blocks)S4025(in)S4147(the)S(cache.)255 4314 A4638(The)S4840(\256le)S5014(server)S3528 V1080(transfers)S1455(data)S1650(to)S1755(or)S1866(from)S2089(the)S2238(device)S2527(driver)S2794(as)S2904(blocks)S3192(to)S(positions)362 3296 A3684(at)S3783(block)S4032(size)S(boundaries.)466 4215 A4732(These)S4999(blocks)S3648 V1080(are)S1236(Minix)S1513(blocks)S1807(of)S(1024)200 1923 A2155(bytes,)S2425(disk)S2625(devices)S2960(usually)S3283(have)S3506(a)S(512)150 3584 A3767(byte)S3973(block)S4229(size.)S4469(Only)S4703(block)S4959(devices)S3768 V1080(can)S1245(be)S(mounted)351 1365 A1741(as)S1850(part)S2032(of)S2141(the)S2289(\256le)S2443(system)S2747(tree)S2924(if)S3011(they)S3209(contain)S3530(a)S3600(Minix)S3870(\256le)S4024(system.)S3936 V1080(The)S1271(major)S1540(device)S1837(number)S2178(\(2)S2296(for)S10 B2448(fd1)S10 R2622(and)S2801(4)S2885(for)S10 B3037(console)S10 R3350(\))S3418(are)S3576(used)S3794(by)S3928(FS)S4074(to)S4187(\256nd)S4378(the)S4536(device)S4834(driver)S5110(that)S4056 V1080(manages)S1467(a)S1546(device.)S1893(The)S2084(minor)S2358(device)S2655(number)S2996(\(1)S3114(for)S10 B3266(fd1)S10 R3440(and)S3619(0)S3703(for)S10 B3855(console)S10 R4168(\))S4236(is)S4337(passed)S4639(to)S4751(the)S4908(driver)S5183(to)S4176 V1080(select)S1348(a)S1431(device)S(among)273 1732 A2043(a)S2126(number)S2471(of)S2593(related)S2907(devices)S3248(that)S3438(are)S3601(all)S3741(managed)S4143(by)S4282(that)S4472(driver.)S4802(The)S4998(device)S4296 V1080(drivers)S1402(are)S1568(usually)S1900(kernel)S2194(tasks)S(under)229 2437 A2708(Minix,)S3020(small)S3280(processes)S3708(that)S3900(are)S4065(contained)S4497(within)S4795(the)S4959(address)S4416 V(space)224 1080 A1329(of)S1438(the)S1586(kernel.)S1913(The)S2095(following)S2511(tasks)S2737(and)S2907(associated)S3346(devices)S3673(exist:)S4584 V870(M)S872(Me)S963(em)S1010(mo)S1090(or)S1142(ry)S1178(y)S1255(\()S1257(\(m)S1293(ma)S1373(aj)S1420(jo)S1450(or)S1502(r)S1563(1)S1565(1\))S1617(\))S4704 V1080(The)S10 B1263(ram)S10 R1442(,)S10 B1493(mem)S10 R1706(,)S10 B1757(kmem)S10 R2026(,)S2077(and)S10 B2249(null)S10 R2444(devices)S2773(are)S2924(managed)S3314(by)S3441(the)S3591(memory)S3953(task.)S4192(The)S10 B4376(ram)S10 R4582(device)S4872(is)S4966(a)S5038(block)S4824 V1080(device)S1372(for)S1519(a)S(chunk)245 1593 A1867(of)S1980(memory)S2344(that)S2524(is)S2620(the)S2772(RAM)S3030(disk.)S3276(Any)S3478(byte)S3680(read)S3883(from)S4108(or)S(written)286 4220 A4534(to)S4640(the)S10 B4791(ram)S10 R4998(device)S4944 V1080(is)S1177(copied)S1475(from)S1701(or)S1816(to)S1925(that)S2107(memory)S(chunk.)270 2473 A2799(The)S10 B2987(mem)S10 R3231(device)S3525(is)S3623(a)S3699(character)S4101(device)S4395(for)S4544(the)S4698(entire)S4959(address)S5064 V(space)224 1080 A1336(of)S1452(the)S1607(system,)S1943(but)S10 B2103(kmem)S10 R2404(only)S2614(for)S2764(the)S2919(kernel)S3203(data)S3403(area.)S3654(These)S3927(two)S4110(devices)S4444(allow)S4699(programs)S5110(like)S5184 V10 B1080(ps)S10 R1175(\(1\))S1322(to)S(hunt)178 1430 A(around)279 1638 A1947(the)S2100(system)S(looking)306 2409 A2745(for)S2893(interesting)S3348(bits.)S3573(The)S10 B3760(null)S10 R3958(device)S4251(is)S4348(a)S4423(data)S4621(sink.)S4868(It)S4960(happily)S5304 V1080(swallows)S1480(any)S1650(bytes)S(written)286 1887 A2198(to)S2301(it,)S2407(and)S2577(returns)S2882(nothing)S3213(on)S3338(a)S3408(read.)S5472 V870(F)S872(Fl)S930(lo)S960(op)S1012(pp)S1064(py)S1116(y)S1193(d)S1195(di)S1247(is)S1277(sk)S1318(k)S1395(\()S1397(\(m)S1433(ma)S1513(aj)S1560(jo)S1590(or)S1642(r)S1703(2)S1705(2\))S1757(\))S5592 V1080(The)S10 B1267(fd0)S10 R1407(,)S10 B1462(fd0a)S10 R1652(,)S10 B1707(fd0b)S10 R1903(,)S10 B1958(fd0c)S10 R2143(,)S2198(and)S10 B2374(fd0d)S10 R2601(block)S2855(devices)S3188(are)S3343(the)S3497(\256rst)S(\257oppy)256 3685 A3972(disk)S4170(and)S4346(the)S4500(four)S(partitions)380 4699 A5110(that)S5712 V1080(may)S1279(exist)S1495(on)S1621(a)S1692(that)S(\257oppy)256 1869 A2151(disk.)S2394(Likewise)S2790(are)S10 B2940(fd1)S10 R3106(and)S10 B3277(fd1[a)S10 B-13501(-)S10 B3558(d])S10 R3674(the)S3823(device)S4112(and)S(partitions)380 4283 A4689(for)S4833(the)S(second)279 4982 A5832 V(\257oppy)256 1080 A1386(disk.)S1653(The)S(\257oppy)256 1860 A2166(disk)S2384(devices)S2737(are)S2912(described)S3349(in)S3478(detail)S3753(in)S10 B3882(fd)S10 R3972(\(4\).)S(Partitioning)475 4191 A4717(in)S4846(general)S5194(is)S5952 V1080(explained)S1496(in)S10 B1599(hd)S10 R1711(\(4\).)S6120 V870(H)S872(Ha)S947(ar)S994(rd)S1030(d)S1107(d)S1109(di)S1161(is)S1191(sk)S1232(k)S1309(\()S1311(\(m)S1347(ma)S1427(aj)S1474(jo)S1504(or)S1556(r)S1617(3)S1619(3\))S1671(\))S6240 V1080(The)S1272(\256rst)S1464(hard)S1678(disk)S1880(can)S2056(be)S(accessed)353 2187 A2576(by)S2712(block)S2971(device)S10 B3270(hd0)S10 R3432(.)S3518(This)S3733(device)S4032(addresses)S4454(the)S4613(entire)S4879(hard)S5094(disk)S6360 V1080(from)S1312(the)S1471(\256rst)S1664(to)S1778(the)S1937(last)S2113(sector.)S2440(A)S2549(hard)S2764(disk)S2967(is)S3069(normally)S(partitioned)436 3467 A3938(in)S4051(up)S4186(to)S4299(four)S4502(primary)S(partitions,)405 4856 A6480 V10 B1080(hd1)S10 R1242(,)S10 B1302(hd2)S10 R1464(,)S10 B1524(hd3)S10 R1686(,)S1746(and)S10 B1926(hd4)S10 R2088(.)S2173(Each)S2410(of)S2529(these)S2771(devices)S(accesses)342 3108 A3485(a)S3565(range)S3824(of)S3943(sectors)S4258(on)S4393(the)S10 B4551(hd0)S10 R4748(device.)S5096(It)S5194(is)S6600 V1080(customary)S1527(to)S1633(give)S(each)185 1834 A2047(operating)S2455(system)S2762(on)S2890(a)S2962(disk)S3156(a)S3228(primary)S(partition.)366 3574 A3992(So)S4125(the)S4275(MS-DOS)S4683(C:)S4805("drive")S5121(can)S6720 V1080(be)S1202(on)S10 B1329(hd1)S10 R1491(,)S1543(and)S1715(Minix)S1987(can)S2154(be)S2276(on)S10 B2403(hd2)S10 R2565(.)S2642(Minix)S2914(wants)S3176(to)S3281(have)S3498(several)S(partitions)380 3811 A4218(on)S4345(its)S4467(own,)S4692(so)S10 B4808(hd2)S10 R4998(can)S5166(be)S6840 V1080(further)S(subdivided)440 1390 A1865(into)S2056(the)S(subpartitions)519 2214 A10 B2768(hd2a)S10 R2980(,)S10 B3040(hd2b)S10 R3258(,)S10 B3318(hd2c)S10 R3525(,)S3585(and)S10 B3765(hd2d)S10 R3983(.)S10 B4068(/dev)S10 R4281(contains)S4650(devices)S4986(for)S5138(the)S6960 V1080(\256rst)S1283(and)S(second)279 1474 A1799(hard)S2024(disk)S2238(\()S10 B2272(hd0)S10 R2481(and)S10 B2673(hd5)S10 R2835(\))S2916(their)S3148(primary)S(partitions)380 3514 A3941(\()S10 B3975(hd[1)S10 B-14171(-)S10 B4228(46)S10 B-14328(-)S10 B4385(9])S10 R4469(\))S4550(and)S(subpartitions)519 4742 A7080 V1080(thereof)S1391(\()S10 B1425(hd[1)S10 B-11621(-)S10 B1678(46)S10 B-11778(-)S10 B1835(9][a)S10 B-12003(-)S10 B2060(d])S10 R2150(\).)S2259(More)S2502(detail)S2751(can)S2916(be)S(found)234 3036 A3295(in)S10 B3398(hd)S10 R3510(\(4\).)S7248 V870(T)S872(Te)S936(er)S983(rm)S1019(mi)S1099(in)S1129(na)S1181(al)S1228(ls)S1258(s)S1324(\()S1326(\(m)S1362(mi)S1442(in)S1472(no)S1524(or)S1576(r)S1637(4)S1639(4\))S1691(\))S7368 V1080(The)S1271(TTY)S1502(driver)S1777(manages)S2163(the)S2320(system)S2633(console)S2974(device,)S3296(aptly)S3531(named)S10 B3833(console)S10 R4146(,)S4205(the)S4362(serial)S4615(lines,)S10 B(tty00)218 4864 A10 R5116(and)S7488 V10 B(tty01)218 1080 A10 R1298(,)S1350(and)S1522(the)S(pseudo)284 1672 A1983(ttys.)S(Through)346 2205 A2578(the)S2728(console)S3062(device)S3352(one)S3524(can)S3691(display)S4008(characters)S4444(on)S4570(a)S4641(screen)S4925(attached)S7903 V720(Page)S941(1)S4455(September)S4911(17,)S(1996)200 5061 A8143 VEP%%Page: 2 5BP/slant 0 def/height 0 def480 V10 R720(DEV)S936(\()S978(4)S1036(\))S2696(Eighth)S(Edition)296 2989 A4911(DEV)S5127(\()S5169(4)S5227(\))S960 V1080(to)S1194(a)S(monochrome,)555 1275 A1866(Hercules,)S2286(color,)S2554(or)S(VGA)219 2674 A2929(adapter.)S3313(The)S10 B3507(ttyc1)S10 R3720(,)S10 B3782(ttyc2)S10 R3995(,)S4057(etc.)S4237(devices)S4576(are)S4737(the)S4897(so-called)S1080 V1080("virtual)S1410(consoles")S1823(that)S2000(share)S2239(the)S2388(one)S2559(console)S2892(display.)S3258(One)S3452(can)S3618(select)S3874(which)S4146(virtual)S4435(console)S4767(is)S4859(to)S4962(be)S5082(visi-)S1200 V1080(ble)S1241(on)S1379(the)S1540(screen)S1836(and)S2019(take)S(input)206 2225 A2469(from)S2703(the)S(keyboard.)399 2864 A3326(To)S3476(allow)S3738(remote)S4056(login)S4300(the)S4462(devices)S4803(with)S5021(minor)S1320 V1080(numbers)S1458(of)S(128)150 1574 A1756(or)S1872(higher)S2160(offer)S2388(virtual)S2682(terminals.)S3138(These)S(pseudo)284 3410 A3725(ttys)S3901(come)S4150(in)S4259(tty,)S4421(pty)S4580(pairs)S4807(that)S4989(form)S5216(a)S
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -