⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chmem.1

📁 操作系统设计与实现源码
💻 1
字号:
%!PS-Adobe-1.0%%Creator: devps (Pipeline Associates, Inc.)%%CreationDate: Fri Sep 13 13:03:26 1996%%Pages: (atend)%%DocumentFonts: (atend)/devps 180 dict def devps begin/res 10.000000 def/y_offset 843 def/X{exch}bind def/mm {transform round X round X itransform} bind def/r{rmoveto}bind def/m{moveto}bind def/l{lineto}bind def/rl{rlineto}bind def/st{stroke}bind def/gs{gsave}bind def/gr{grestore}bind def/cp{currentpoint}bind def/np{newpath}bind def/ct{curveto}bind defsystemdict /setpacking known { /savepacking currentpacking def true setpacking } if/m0{0 0 moveto}bind def/xc{//res div}bind def/yc{//res neg div //y_offset add}bind def/lc{yc X xc X l st}bind def/mc{yc X xc X m}bind def/el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def/ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def/sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def/V{//res neg div //y_offset addcurrentpoint pop Xm}bind def/H{//res div0 transform X round X itransform popcurrentpoint X popmoveto}bind def/h{//res div 0 r}bind def/v{//res neg div 0 X r}bind def/S{X H show}bind def/A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def/psize 10 def/height 0 def/cheight { height 0 ne { height } { psize } ifelse } bind def/slant 0 def/FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def    [psize 0 cheight slant sin slant cos div mul cheight 0 0]    makefont setfont}bind def/shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fillgr}bind def1 setlinecap/resolution res 72 mul def/startFig {	/SavedState save def	userdict maxlength dict begin	currentpoint transform	DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap		setlinewidth setmatrix	itransform moveto	/ury exch def	/urx exch def	/lly exch def	/llx exch def	/y exch 72 mul resolution div def	/x exch 72 mul resolution div def		currentpoint /cy exch def /cx exch def	/sx x urx llx sub div def	/sy y ury lly sub div def	sx sy scale	cx sx div llx sub	cy sy div ury sub translate		/DefFigCTM matrix currentmatrix def	/initmatrix {		DefFigCTM setmatrix	} def	/defaultmatrix {		DefFigCTM exch copy	} def	/initgraphics {		DocumentInitState setmiterlimit setgray setdash 			setlinejoin setlinecap setlinewidth setmatrix		DefFigCTM setmatrix	} def	/showpage {		initgraphics	} def}bind  def/clipFig {	currentpoint 6 2 roll	newpath 4 copy	4 2 roll moveto	6 -1 roll exch lineto	exch lineto	exch lineto	closepath clip	newpath	moveto}bind  def/doclip { llx lly urx ury clipFig } def/endFig {	end SavedState restore}bind  def/globalstart {	fontnum psize slant height resolution currentpoint 	pagesave restore gsave }bind  def/globalend {	grestore moveto	/resolution exch def /height exch def	/slant exch def /psize exch def /fontnum exch def	F	/pagesave save def}bind  def/fontnum 1 def systemdict /setpacking known { savepacking setpacking} ifend/BP{save mark devps begin m0/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecapcurrentlinejoin currentdash currentgray currentmiterlimit ] cvx def}bind def/EP{end cleartomark restore showpage}def/Encoding-1 256 array def0 1 255 {Encoding-1 exch /.notdef put} forEncoding-1 8#301 StandardEncoding 8#101 26 getinterval putinterval %A-BEncoding-1 8#341 StandardEncoding 8#141 26 getinterval putinterval %a-bEncoding-1 8#241 StandardEncoding 8#301 16 getinterval putinterval %accentsEncoding-1 8#373 StandardEncoding 8#365 1 getinterval putinterval %dotlessiEncoding-1dup 8#41 /copyright putdup 8#42 /registered putdup 8#43 /trademark putdup 8#44 /logicalnot putdup 8#45 /Eth putdup 8#46 /eth putdup 8#47 /Thorn putdup 8#50 /thorn putdup 8#51 /brokenbar putdup 8#52 /degree putdup 8#53 /divide putdup 8#54 /multiply putdup 8#55 /minus putdup 8#56 /onehalf putdup 8#57 /onequarter putdup 8#60 /threequarters putdup 8#101 /Aacute putdup 8#102 /Acircumflex putdup 8#103 /Adieresis putdup 8#104 /Agrave putdup 8#105 /Aring putdup 8#106 /Atilde putdup 8#107 /Ccedilla putdup 8#110 /Eacute putdup 8#111 /Ecircumflex putdup 8#112 /Edieresis putdup 8#113 /Egrave putdup 8#114 /Iacute putdup 8#115 /Icircumflex putdup 8#116 /Idieresis putdup 8#117 /Igrave putdup 8#120 /Ntilde putdup 8#121 /Oacute putdup 8#122 /Ocircumflex putdup 8#123 /Odieresis putdup 8#124 /Ograve putdup 8#125 /Otilde putdup 8#126 /Scaron putdup 8#127 /Uacute putdup 8#130 /Ucircumflex putdup 8#131 /Udieresis putdup 8#132 /Ugrave putdup 8#133 /Ydieresis putdup 8#134 /Zcaron putdup 8#135 /aacute putdup 8#136 /acircumflex putdup 8#137 /adieresis putdup 8#140 /agrave putdup 8#141 /aring putdup 8#142 /atilde putdup 8#143 /ccedilla putdup 8#144 /eacute putdup 8#145 /ecircumflex putdup 8#146 /edieresis putdup 8#147 /egrave putdup 8#150 /iacute putdup 8#151 /icircumflex putdup 8#152 /idieresis putdup 8#153 /igrave putdup 8#154 /ntilde putdup 8#155 /oacute putdup 8#156 /ocircumflex putdup 8#157 /odieresis putdup 8#160 /ograve putdup 8#161 /otilde putdup 8#162 /scaron putdup 8#163 /uacute putdup 8#164 /ucircumflex putdup 8#165 /udieresis putdup 8#166 /ugrave putdup 8#167 /ydieresis putdup 8#170 /zcaron putpop/Enc-dict 30 dict defEnc-dict /tmpstr1 50 string putEnc-dict /tmpstr2 50 string putEnc-dict /tmpstr3 50 string dup (Encoding-) exch cvs pop put/AEnc-def { % arguments: the original font's name, encoding nrEnc-dict begintmpstr2 cvs /Enc-no exch def % Remember the number in a stringdup /OrigName exch def % remember the namefindfont dup maxlength dict /newdict exch def % get dictionary for new font{ exch dup /FID ne   { exch newdict 3 1 roll put }   { pop pop } % Ignore FID   ifelse} forallnewdict begin/Encoding  tmpstr3 9 Enc-no putinterval tmpstr3 0 9 Enc-no length add getinterval  cvn load  def % Replace encodingcurrentdict /UniqueID known{ /UniqueID UniqueID Enc-no cvi 49999 mul add def } if % Derive New UniqueIDend % newdict/FNlength OrigName tmpstr1 cvs length def % convert name, remember lengthFNlength 1 add Enc-no length add stringdup 0 OrigName tmpstr1 cvs putintervaldup FNlength (-) putintervaldup FNlength 1 add Enc-no putintervaldup 0 tmpstr1 0 FNlength getinterval putinterval % Add old namecvn dup newdict /FontName 3 2 roll put newdict definefontend % Enc-dict} def/Times-Roman 1 AEnc-def pop/R-1{/Times-Roman-1 FF}def/Times-Bold 1 AEnc-def pop/B-1{/Times-Bold-1 FF}def/R{/Times-Roman FF}def/B{/Times-Bold FF}def/I{/Times-Italic FF}def%%EndProlog%%Page: 1 1BP/slant 0 def/height 0 def480 V10 R720(CHMEM)S1108(\()S1150(1)S1208(\))S2696(Eighth)S(Edition)296 2989 A4739(CHMEM)S5127(\()S5169(1)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(chmem)S10 R-11401(-)S10 R1483(change)S1793(memory)S2153(allocation)S1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 B1080(chmem)S10 R1432([)S10 B1466(+)S10 R1523(])S1595([)S10 B-11629(-)S10 R1686(])S1758([)S10 B1792(=)S10 R1849(])S10 I(amount)301 1921 A2260(\256le)S1536 V9 R720(E)S722(EX)S780(XA)S848(AM)S916(MP)S998(PL)S1050(LE)S1108(ES)S1166(S)S1656 V10 B1080(chmem)S(=50000)307 1419 A1751(a.out)S10 R2080(#)S2155(Give)S10 I2376(a.out)S10 R2604(50K)S2802(of)S2911(stack)S(space)224 3143 A1824 V10 B1080(chmem)S10 B-11419(-)S10 B(4000)200 1476 A1701(a.out)S10 R2080(#)S2155(Reduce)S2482(the)S2630(stack)S(space)224 2862 A3111(by)S(4000)200 3236 A3461(bytes)S1992 V10 B1080(chmem)S(+1000)257 1419 A1701(file1)S10 R2080(#)S2155(Increase)S(each)185 2517 A2727(stack)S2959(by)S(1000)200 3084 A3309(bytes)S2160 V9 R720(D)S722(DE)S790(ES)S848(SC)S900(CR)S962(RI)S1024(IP)S1057(PT)S1109(TI)S1167(IO)S1200(ON)S1268(N)S2280 V10 R1080(When)S1351(a)S1427(program)S1799(is)S1897(loaded)S2196(into)S2383(memory,)S2774(it)S2861(is)S2959(allocated)S(enough)295 3354 A3680(memory)S4046(for)S4195(the)S4349(text)S4531(and)S4708(data+bss)S5093(seg-)S2400 V1080(ments,)S1373(plus)S1568(an)S1691(area)S1888(for)S2034(the)S2185(stack.)S2470(Data)S2689(segment)S3052(growth)S3365(using)S10 I3610(malloc)S3912(,)S3965(brk)S4127(,)S10 R4180(or)S10 I4292(sbrk)S10 R4492(eats)S4676(up)S4803(stack)S(space)224 5037 A2520 V1080(from)S1316(the)S1479(low)S1670(end.)S1905(The)S(amount)301 2102 A2443(of)S2567(stack)S(space)224 2814 A3079(to)S3198(allocate)S3553(is)S3661(derived)S4004(from)S4241(a)S4327(\256eld)S4547(in)S4666(the)S4830(executable)S2640 V1080(program's)S1530(\256le)S1695(header.)S2050(If)S2154(the)S2313(combined)S2745(stack)S2988(and)S3169(data)S3373(segment)S3743(growth)S(exceeds)319 4063 A4417(the)S4575(stack)S(space)224 4817 A5076(allo-)S2760 V1080(cated,)S1343(the)S1491(program)S(will)157 1857 A2039(be)S2159(terminated.)S2928 V1080(It)S1167(is)S1259(therefore)S1649(important)S2065(to)S2169(set)S2307(the)S(amount)301 2456 A2783(of)S2893(stack)S(space)224 3126 A3376(carefully.)S3811(If)S3905(too)S(little)185 4059 A4270(is)S4363(provided,)S4771(the)S4920(program)S3048 V1080(may)S1283(crash.)S1576(If)S1674(too)S1832(much)S2085(is)S2182(provided,)S2594(memory)S(will)157 2959 A3146(be)S3271(wasted,)S3606(and)S3781(fewer)S4042(programs)S(will)157 4452 A4639(be)S4764(able)S4962(to)S5070(\256t)S5183(in)S3168 V1080(memory)S1462(and)S1654(run)S1835(simultaneously.)S8 R2530(MINIX)S10 R2818(does)S3049(not)S3224(swap,)S3503(so)S3639(that)S3838(when)S4104(memory)S4487(is)S4602(full,)S4815(subsequent)S3288 V1080(attempts)S1452(to)S1561(fork)S(will)157 1760 A1948(fail.)S2164(The)S2352(compiler)S2741(sets)S2923(the)S3077(stack)S(space)224 3315 A3570(to)S3679(the)S3833(largest)S4133(possible)S4493(value)S4741(\(for)S4923(the)S5076(Intel)S3408 V1080(CPUs,)S1367(64K)S10 R-11567(-)S10 R1651(text)S10 R-11829(-)S10 R1913(data\).)S2192(For)S2359(many)S2609(programs,)S3041(this)S3213(value)S3459(is)S3554(far)S3695(too)S3851(large.)S4131(Nonrecursive)S4702(programs)S5110(that)S3528 V1080(do)S1206(not)S1360(call)S10 I1532(brk)S1692(,)S1743(sbrk)S1942(,)S10 R1993(or)S10 I2103(malloc)S2403(,)S10 R2454(and)S2625(do)S2751(not)S2905(have)S3121(any)S3292(local)S3514(arrays)S3787(usually)S4103(do)S4229(not)S4383(need)S4599(more)S4831(than)S5029(8K)S5177(of)S3648 V1080(stack)S(space.)249 1312 A3816 V1080(The)S10 I1272(chmem)S10 R1593(command)S2024(changes)S2383(the)S2541(value)S2794(of)S2913(the)S3071(header)S3376(\256eld)S3591(that)S3778(determines)S4256(the)S4415(stack)S4658(allocation,)S5116(and)S3936 V1080(thus)S1286(indirectly)S1711(the)S1873(total)S2091(memory)S2465(required)S2840(to)S2957(run)S3130(the)S3292(program.)S3722(The)S3918(=)S4014(option)S4309(sets)S4499(the)S4660(stack)S4905(size)S5100(to)S5216(a)S4056 V1080(speci\256c)S1415(value;)S1688(the)S1838(+)S1922(and)S10 R-12094(-)S10 R2178(options)S2500(increment)S2930(and)S3102(decrement)S3549(the)S3699(current)S4013(value)S4259(by)S4387(the)S4538(indicated)S(amount.)326 4935 A4176 V1080(The)S1262(old)S1415(and)S1585(new)S1778(stack)S2010(sizes)S2231(are)S2380(printed.)S4344 V9 R720(S)S722(SE)S774(EE)S832(E)S913(A)S915(AL)S983(LS)S1041(SO)S1093(O)S4464 V10 B1080(install)S10 R1343(\(1\),)S10 B1511(brk)S10 R1668(\(2\).)S7903 V720(Page)S941(1)S4455(September)S4911(13,)S(1996)200 5061 A8143 VEP%%Trailer%%DocumentFonts: Times-Roman Times-Bold Times-Italic%%Pages: 1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -