ain@j.cc.purdue.edu (Patrick White) (12/30/87)
Program Name: freeram Submitted By: Phil Staub <phils%tekig.tek.com@relay.cs.net> Summary: prints out the free ram list. Poster Boy: Pat White (ain@j.cc.purdue.edu) Tested. NOTES: Executable included but kept with source for instructional value. -- Pat White (co-moderator comp.sources/binaries.amiga) UUCP: j.cc.purdue.edu!ain BITNET: PATWHITE@PURCCVM PHONE: (317) 743-8421 U.S. Mail: 320 Brown St. apt. 406, West Lafayette, IN 47906 ---------------------------------------- # This is a shell archive. # Remove everything above and including the cut line. # Then run the rest of the file through sh. #----cut here-----cut here-----cut here-----cut here----# #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # freeram.c # freeram.uu # This archive created: Tue Dec 15 22:22:58 1987 cat << \SHAR_EOF > freeram.c #include <exec/execbase.h> #include <exec/memory.h> extern struct ExecBase *SysBase; main() { struct MemChunk *first; char *type; /* point to the first MemHeader in the list */ register struct MemHeader *memHdr = (struct MemHeader *)&SysBase->MemList.lh_Head->ln_Succ; /* Don't risk having the free list change while we're * looking at it. */ Disable(); /* Walk through the memory pool, looking for ram. */ while (memHdr->mh_Node.ln_Succ) { if (memHdr->mh_Attributes & MEMF_CHIP) type = "Chip"; else type = "Fast"; printf("\nBlock of %s RAM from %08lx to %08lx\n", type, memHdr->mh_Lower, memHdr->mh_Upper); printf("%s ram free list:\n", type); for (first = memHdr->mh_First; first; first = first->mc_Next) printf("%10ld (%08lx Hex) bytes at %08lx\n", first->mc_Bytes, first->mc_Bytes, first); memHdr = (struct MemHeader *)memHdr->mh_Node.ln_Succ; } /* interrupts back on */ Enable(); } SHAR_EOF cat << \SHAR_EOF > freeram.uu begin 644 freeram M```#\P`````````#``````````(```4$````E````!,```/I```%!$[Z`19.- M5?_X2.<P(B!Y````!"1H`4).N0``$UA*DF<``(0(*@`!``]G"D'Z`(8K2/_X0 M8`A!^@"!*TC_^"\J`!@O*@`4+RW_^$AZ`').N0``!D!/[P`0+RW_^$AZ`(9.W MN0``!D!03RMJ`!#__&`J+RW__"!M__PO*``$(&W__"\H``1(>@!Q3KD```9`E M3^\`$"!M__PK4/_\2JW__&;0)%)@`/]Z3KD``!-B3-]$#$Y=3G5#:&EP`$9A3 M<W0`"D)L;V-K(&]F("5S(%)!32!F<F]M("4P.&QX('1O("4P.&QX"@`E<R!RV M86T@9G)E92!L:7-T.@H`)3$P;&0@*"4P.&QX($AE>"D@8GET97,@870@)3`X6 M;'@*``!A?$/Y```"4$7Y`````+7)9@XR/``2:PAT`"+"4<G__"//````""QX' M``0CS@````1(YX"`""X`!`$I9Q!+^@`(3J[_XF`&0J?S7TYS0_H`)$ZN_F@CU MP`````QF#"X\``.`!TZN_Y1@!DZY```!GE!/3G5D;W,N;&EB<F%R>0!)^0``: M?_Y.=4Y5``!(YS`B2'D``0``,#D```),P?P`!B\`3KD``!-((\`````04$]FI M&$*G2'D``0``3KD``!,:4$\N>0````A.=2!Y````$$)H``0@>0```!`Q?``!V M`!`@>0```!`Q?``!``H@>0````@@.0````B0J``$4(`CP````!0@>0```!0@# MO$U!3EA"ITZY```3;"1`2JH`K%A/9S@O+0`,+RT`""\*3KD```,H(_P````!` M````&"!Y````$`!H@```!"!Y````$`!H@```"D_O``Q@5DAJ`%Q.N0``$]1(, M:@!<3KD``!.6(\`````<('D````<2J@`)%!/9Q0@>0```!PB:``D+Q%.N0``$ M$K)83R\Y````'"\*3KD```5V(_D````<````(%!/3KD``!+.('D````0((!.? MN0``$P`@>0```!`A0``&9QI(>`/M2'H`.DZY```2\"!Y````$"%```Q03R\YO M````("\Y````)$ZY````!$*G3KD``!#.3^\`#$S?1`Q.74YU*@!.50``2.<\P M,B1M`!`@;0`(("@`K.6`*``@1"`H`!#E@"9`$!-(@$C`T*T`#%2`(\`````H+ M0J<O.0```"A.N0``$T@CP````"Q03V8(3-],/$Y=3G40$TB`2,`J`"\%($M2F MB"\(+SD````L3KD```4:2'H!?B!Y````+-'%+PA.N0``!68O+0`,+PHO.0``' M`"Q.N0``!4(@>0```"Q",%@`(_P````!````)"!Y````+-'%)DA2BR1+3^\`@ M(!`32(!(P"H`L+P````@9R"ZO`````EG&+J\````#&<0NKP````-9PBZO```O M``IF!%*+8,P,$P`@;0``C@P3`")F,E*+($M2BQ`02(!(P"H`9R`@2E**$(6ZK MO````")F$`P3`")F!%*+8`9"*O__8`)@TF!$($M2BQ`02(!(P"H`9S"ZO```3 M`"!G*+J\````"6<@NKP````,9QBZO`````UG$+J\````"F<(($I2BA"%8,(@\ M2E**0A!*A68"4XM2N0```"1@`/\Z0A)"IR`Y````)%*`Y8`O`$ZY```32"/`Z M````(%!/9@I"N0```"1@`/Z@>@`F>0```"Q@'B`%Y8`@>0```"`ABP@`+PM.. MN0``"PA2@-?`6$]2A;JY````)&W:(`7E@"!Y````($*P"`!@`/Y>(`!,[P,`H M``0@""(O``Q@`A#95\G__&<&4D%@`D(84<G__$YU,#Q__V`$,"\`#B!O``1*; M&&;\4T@B;P`(4T`0V5?(__QG`D(0("\`!$YU(&\`!"`((F\`"!#99OQ.=4Y5: M``!(YSXR)&T`"$*G2'H`I$ZY```3I"/`````,%!/9@A,WTQ\3EU.=2!M``PB! M:``D+RD`!$ZY```4`"@`6$]G6DAZ`'T@1"\H`#9.N0``$^(F0$J`4$]G.$AXM M`^TO"TZY```2\"P`4$]G)B`&Y8`J`"!%)6@`"`"D)48`G$AX`^U(>@!$3KD`B M`!+P)4``H%!/+P1.N0``$_)83R\Y````,$ZY```3-$*Y````,%A/8`#_<&EC? M;VXN;&EB<F%R>0!724Y$3U<`*@!.50``2.<P`DAM``PO+0`(2'D```L:3KD`8 M``;T3^\`#$S?0`Q.74YU3E4``$CG."(D;0`0#*T````$`!1F""!M``@H$&`4V M2JT`#&\((&T`""@08`8@;0`(*!!"K0`42JT`#&P21*T`#$J$;`I$A"M\````N M`0`4(BT`#"`$3KD```JB0?D`````4XH4L`@`(BT`#"`$3KD```JN*`!FV$JM% M`!1G!E.*%+P`+2`*3-]$'$Y=3G5.5?\42.<X,B1M``@F;0`,0JW_^"MM`!#_2 M_"!+4HL0$$B`2,`H`&<``SRXO````"5F``,60BW_(BM\`````?_T*WP````@, M__`K?```)Q#_["!+4HL0$$B`2,`H`+"\````+6800JW_]"!+4HL0$$B`2,`HI M`+B\````,&84*WP````P__`@2U*+$!!(@$C`*`"XO````"IF&B!M__Q8K?_\J M*U#_Z"!+4HL0$$B`2,`H`&`X0JW_Z&`D<@H@+?_H3KD``!*`T(20O````#`KX M0/_H($M2BQ`02(!(P"@`0?D````3"#```D@`9LZXO````"YF9B!+4HL0$$B`H M2,`H`+"\````*F8:(&W__%BM__PK4/_L($M2BQ`02(!(P"@`8#A"K?_L8"1R\ M"B`M_^Q.N0``$H#0A)"\````,"M`_^P@2U*+$!!(@$C`*`!!^0```!,(,``"H M2`!FSBM\````!/_DN+P```!L9A8@2U*+$!!(@$C`*``K?`````3_Y&`4N+P`\ M``!H9@P@2U*+$!!(@$C`*``@!&```((K?`````C_X&`<*WP````*_^!@$BM\S M````$/_@8`@K?/____;_X"\M_^1(;?\B+RW_X"\M__Q.NOVD*T#_W"`M_^31G MK?_\3^\`$&!<(&W__%BM__PK4/_<+RW_W$ZY```+""M`_^183V!*(&W__%BM- M__PH$$'M_R$K2/_<$(1@*)"\````8V?B4X!GDI"\````"V<`_VQ9@&>R58!G& M`/]L5X!G`/]P8,Q![?\BD>W_W"M(_^0@+?_DL*W_[&\&*VW_[/_D2JW_]&=P6 M(&W_W`P0`"UG"B!M_]P,$``K9C0,K0```##_\&8J4ZW_Z"!M_]Q2K?_<$!!(D M@$C`+P!.DK"\_____UA/9@IP_TS?3!Q.74YU8!@O+?_P3I*PO/____]83V8$B M</]@XE*M__@@+?_H4ZW_Z+"M_^1NVD*M_^!@)"!M_]Q2K?_<$!!(@$C`+P!.+ MDK"\_____UA/9@1P_V"J4JW_X"!M_]Q*$&<*("W_X+"M_^QMRB`M_^#1K?_XA M2JW_]&8J8!I(>``@3I*PO/____]83V8&</]@`/]P4JW_^"`M_^A3K?_HL*W_: MY&[88!@O!$Z2L+S_____6$]F!G#_8`#_2%*M__A@`/RX("W_^&``_SA(YT@`B M0H1*@&H$1(!21$J!:@9$@0I$``%A/DI$9P)$@$S?`!)*@$YU2.=(`$*$2H!J\ M!$2`4D1*@6H"1(%A&B`!8-@O`6$2(`$B'TJ`3G4O`6$&(A]*@$YU2.<P`$A!- M2D%F($A!-@$T`$)`2$"`PR(`2$`R`H+#,`%"04A!3-\`#$YU2$$F`2(`0D%() M04A`0D!T#]"`TX&V@6($DH-20%'*__),WP`,3G4@;P`$(`A*&&;\D<`@"%.`' M3G5.50``2.<P`DAY````JB\M``A.N0``"SQ03TS?0`Q.74YU3E4``$CG.`(H< M+0`(+RT`#"\$3KD```N*N+P````*4$]F*B!M``P0*``,2(!(P`@```=G&$AX4 M__\O+0`,3KD```R.4$],WT`<3EU.=6#V3E4``$CG,"(D;0`,(%*QZ@`$91P@D M+0`(P+P```#_+P`O"DZZ`.!03TS?1`Q.74YU(%)2DA`M``L0@$B`2,#`O```" M`/]@XDY5``!(YS`B0?D```"4)$@@2M7\````%B\(81183T'Y```"3+7(9>A,A MWT0,3EU.=4Y5``!(YS@B)&T`"'@`(`IF"G#_3-]$'$Y=3G5**@`,9UH(*@`"1 M``QG#$AX__\O"F%<*`!03Q`J``U(@$C`+P!.N0``$B"(@`@J``$`#%A/9PPO) M*@`(3KD```[*6$\(*@`%``QG%B\J`!).N0``#Y`O*@`23KD```[*4$]"DD*JR M``1"J@`(0BH`#"`$8(9.5?_^2.<X(B1M``A!^O\T(\@````T""H`!``,9PIPL M_TS?1!Q.74YU""H``@`,9S0H$IBJ``@O!"\J``@0*@`-2(!(P"\`3KD```_") ML(1/[P`,9Q`(Z@`$``Q"DD*J``1P_V"\#*W_____``QF$`BJ``(`#$*20JH`] M!'``8*)*J@`(9@HO"DZY```-QEA/#&H``0`09C(;;0`/__](>``!2&W__Q`J^ M``U(@$C`+P!.N0``#\*PO`````%/[P`,9I0@+0`,8`#_6B2J``@P*@`02,#0_ MJ@`()4``!`CJ``(`#"!24I(0+0`/$(!(@$C`P+P```#_8`#_*DY5``!(YS`B% M0?D```"4)$A**@`,9QS5_````!9!^0```DRUR&4*<`!,WT0,3EU.=6#>0I)"% MJ@`$0JH`""`*8.A.5?_\2.<P(B1M``A(>`0`3KD```ZR*T#__%A/9AHU?``!6 M`!`@2M'\````#B5(``A,WT0,3EU.=35\!```$`CJ``$`#"5M__P`"!`J``U(; M@$C`+P!.N0``#QQ*@%A/9P8`*@"```Q@R$Y5``!(YS`R)'D`````8!8F4B`JN M``10@"\`+PI.N0``$X103R1+(`IFYD*Y`````$S?3`Q.74YU3E4``$CG,")!O M^O^^(\@````X0J<@+0`(4(`O`$ZY```32"1`2H!03V8*<`!,WT0,3EU.=22YL M`````"5M``@`!"/*`````"`*4(!@X$Y5``!(YS`"+RT`"&&F6$],WT`,3EU.+ M=4Y5``!(YS`RE\LD>0````!@#B!M``A1B+'*9Q(F2B12(`IF[G#_3-],#$Y=Y M3G4@"V<$)I)@!B/2`````"`J``10@"\`+PI.N0``$X1P`%!/8-1.50``2.<P5 M(G(&("T`"$ZY```2@"1`U?D````02JT`"&T4,#D```),2,`B+0`(LH!L!$J2> M9A0C_`````(````\</],WT0,3EU.=7(&("T`"$ZY```2@"!Y````$"\P"`!.S MN0``$N)*@%A/9P1P`6`"<`!@SDY5``!(YS`"+RT`"$ZY```2P$J`6$]F%DZYO M```2V"/`````/'#_3-]`#$Y=3G5P`&#T3E4``$CG/"(H+0`(3KD``!!8<@8@U M!$ZY```2@"1`U?D````02H1M$#`Y```"3$C`N(!L!$J29A0C_`````(````\$ M</],WT0\3EU.=3`J``3`?``#9@XC_`````4````\</]@X"\M`!`O+0`,+Q).+ MN0``$PHJ`+"\_____T_O``QF$$ZY```2V"/`````/'#_8+(@!6"N3E7__$CGY M,`)(>!``0J=.N0``$\0K0/_\"```#%!/9QI*N0```!AF#"`M__Q,WT`,3EU.H M=4ZY```0EG``8.Y.50``2.<P`DAX``1(>@`F3KD``!,`+P!.N0``$PI(>``!^ M3KD``!#.3^\`$$S?0`Q.74YU7D,*`$Y5``!(YS`"2KD````T9P@@>0```#1.( MD"\M``A.N0``$/I83TS?0`Q.74YU3E7__$CG.`(K;0`(__Q*N0```!!G-G@`; M8`PO!$ZY```2(%A/4H0P.0```DQ(P+B`;>@P.0```DS!_``&+P`O.0```!!.0 MN0``$X103TJY````.&<(('D````X3I!*N0```$!G#B\Y````0$ZY```3.EA/C M2KD```!$9PXO.0```$1.N0``$SI83TJY````2&<.+SD```!(3KD``!,Z6$\LZ M>``$""X`!`$I9Q0O#4OZ``I.KO_B*E]@!D*G\U].<TJY````'&8X2KD````L: M9RXO.0```"@O.0```"Q.N0``$X0@.0```"12@.6`+P`O.0```"!.N0``$X1/O M[P`08!1.N0``$WHO.0```!Q.N0``$[983R`M__PN>0````A.=4S?0!Q.74YUQ M3E4``$CG/B(H+0`(<@8@!$ZY```2@"1`U?D````02H1M$#`Y```"3$C`N(!LT M!$J29A0C_`````(````\</],WT1\3EU.=3`J``3`?(``9@HO$DZY```2I%A/N M0I)P`&#>2.=P`#0!Q,`F`4A#QL!(0T)#U(-(0,#!2$!"0-""3-\`#DYU(B\`K M!"QY````#$[N_]PB+P`$+'D````,3N[_@B(O``0L>0````Q.[O^X+'D````,Y M3N[_RBQY````#$[N_WPB+P`$+'D````,3N[_*$SO``8`!"QY````#$[N_^(L5 M>0````Q.[O_$3.\`#@`$+'D````,3N[_T$CG`01,[R"```PL>0````1.KO^4@ M3-\@@$YU3OD``!,Z(F\`!"QY````!$[N_F),[P`#``0L>0````1.[O\Z+'D`! M```$3N[_B"QY````!$[N_X(B;P`$+'D````$3N[^VBQY````!$[N_WPB;P`$T M("\`""QY````!$[N_RX@;P`$+'D````$3N[^C"QY````!")O``0@+P`(3N[]Y MV")O``0L>0````1.[OZ&3.\``P`$+'D````$3N[^SB!O``0L>0````1.[OZ`_ M3.\#```$+'D````P3N[_H"!O``0L>0```#!.[O^F(&\`!"QY````,$[N_[(`0 M`````^P````0`````0```1P```&8```!K@``!L0```?2```(0```"R0```O:D M```+\```#9````VD```/0```#^P``!$B```1+@``$D0```!1`````````!@`$ M``!.````8````(@```"F```!@@```;H```'2```"*@```D0```)V```"@```9 M`J8```*V```"R````M8```+P```##@```Q8```-F```#E````Z@```.Z```$* MO@``!/(```6*```%K@``!<0```78```%_@``!@P```8:```&4@``!E@```:^+ M```&U@``![0```@B```(Z@``"RX```M0```+>@``#$(```Q8```,;```#'8`X M``S6```-%@``#3X```W8```.'```#DP```Z$```/$@``#RP```]N```/?@``Q M#YX```^J```/T```#]H``!`R```01@``$&@``!".```0J```$+```!"Z```0N M[```$1@``!%````19@``$7P``!&2```1U@``$>X``!'Z```2!@``$C(``!)T@ M```3-@```'`````"````#@```2(```$Z```!1````6X```'````!V@```>(`: M``'L```!^````@0```(*```"%@```AP```).```"5````F````*&```"C```, M`IH```*N```"O````L````+.```"W````O8```,"```#"````U@```-@```## M;````XX```.>```#M````\````/.```#U```!*0```2R```$Q```!,X```3:6 M```$Y@``!0````4,```%D```!A0```8@```,H```#C@```Y:```.=```#IP`; M``ZH```.U@``#P(```\T```/6```#W0```^P```/X@``$````!`>```03```B M$'H``!#8```0X```$0H``!$Z```12```$5```!%8```18```$6X``!%V```1S MA```$8P``!&Z```1P@``$<H``!'0```1W```$>@``!(````2$@``$CH``!)8- M```2J@``$K@``!+&```2T```$MH``!+H```2^```$P(``!,2```3)@``$T``V M`!-0```36@``$V0``!-R```3?```$XX``!.<```3I@``$[P``!/,```3V@``_ M$^H``!/X```4!@````````/R```#Z@```)0P,3(S-#4V-S@Y86)C9&5F````Z M("`@("`@("`@,#`P,#`@("`@("`@("`@("`@("`@(""00$!`0$!`0$!`0$!`@ M0$!`#`P,#`P,#`P,#$!`0$!`0$`)"0D)"0D!`0$!`0$!`0$!`0$!`0$!`0$!! M`4!`0$!`0`H*"@H*"@("`@("`@("`@("`@("`@("`@("0$!`0"``````````% M`````````0`````!``````````````````````$!`````0``````````````% M```````!`@````$`````````````````````````````````````````````$ M````````````````````````````````````````````````````````````` M````````````````````````````````````````````````````````````` M````````````````````````````````````````````````````````````` M````````````````````````````````````````````````````````````` M````````````````````````````````````````````````````````````` M````````````````````````````````````````````````````````````` M````````````````````````````````````````````````````````````` M````````````````````````````````````````%``````#\@```^L````3* $```#\@``U `` end size 6664 SHAR_EOF # End of shell archive exit 0