Nekochan Net

Official Chat Channel: #nekochan // irc.nekochan.net
It is currently Wed Oct 22, 2014 10:09 pm

All times are UTC - 8 hours [ DST ]


Forum rules


Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
Unread postPosted: Fri May 11, 2012 3:33 am 
Offline
User avatar

Joined: Wed Jan 13, 2010 1:10 am
Posts: 172
Location: Australia
Just trying to track down the source code for gmemusage to compile on Irix 5.3. The link below suggests the following:

http://www.auscert.org.au/render.html?it=183

Code:
Developer Toolbox versions 6.0 (based on IRIX 5.3) and 6.1 (based on
IRIX 6.2) contain the gmemusage program and source code.  With the
Developer Toolbox, the gmemusage program can be installed wherever
desired and on any IRIX version 5.x through 6.4.


I have found the source at a few places, but it seems to be a modified version for Linux... so just wanted to ask if someone could check if the source on Developer Toolbox V6.0 is the same as the Linux modified version below.
Attachment:
gmemusage.c.txt [21 KiB]
Downloaded 15 times

Attachment:
gmemusage-0.2.tar.gz [16.65 KiB]
Downloaded 24 times


Thanks...


Top
 Profile  
 
Unread postPosted: Sat May 12, 2012 6:08 am 
Offline
User avatar

Joined: Wed Jan 13, 2010 1:10 am
Posts: 172
Location: Australia
The above source files are definitely Linux, was able to compile the code, but when it runs it tries to make some Linux specific calls like reading the file "/proc/kcore", but of course exists as it does not exist in Irix 5.3.

So was hoping that someone might be able to help with the source code for gmemusage from one of those Developer Tooklkit CDs and let me know the changes to be made...

Thanks...

Code:
/*
 * Cheap way to get amount of installed mem in the computer -- get size of
 * /proc/kcore.
 */
   if ( stat ( "/proc/kcore" , &s ) < 0 )
   {
      fprintf ( stderr , "%s: cannot stat /proc/kcore" , progname ) ;
      perror ( "" ) ;
      exit ( 1 ) ;
   }
   sysmem = s . st_size ; /* in Kilobytes */
/*
 * Read /proc/meminfo to get usable memory and buffers. Presumably buffers
 * should be considered a part of the kernel memory.
 */
   if ( ( meminfo = fopen ( "/proc/meminfo" , "r" ) ) == NULL )
   {
      fprintf ( stderr , "%s: cannot open /proc/meminfo" , progname ) ;
      perror ( "" ) ;
      exit ( 1 ) ;
   }
   while ( fgets ( buf , sizeof ( buf ) , meminfo ) )
   {
      if ( !strncmp ( buf , MemLine , MemLineLen ) )
      {
    /* Mem: total used free shared buffers cached */
    sscanf ( buf , "%*s %d %*d %d %*d %d" , &totalmem , &freemem ,
        &buffermem ) ;
    break ;
      }
   }
   sysmem /= 1024 ;
   totalmem /= 1024 ;
   freemem /= 1024 ;
   buffermem /= 1024 ;
   kernelmem = sysmem - totalmem ;
   fclose ( meminfo ) ;
   return ;
}


Top
 Profile  
 
Unread postPosted: Sat May 12, 2012 2:13 pm 
Offline
User avatar

Joined: Thu Jun 17, 2004 11:35 am
Posts: 3921
Location: Wijchen, The Netherlands
There. Hope it doesn't violate forum rules -- then again, until a couple of years it was freely downloadable from sgi.com ...

This is from DT 6.1, disc 3/3


Attachments:
gmemusage.tar.gz [68.47 KiB]
Downloaded 27 times

_________________
Now this is a deep dark secret, so everybody keep it quiet :)
It turns out that when reset, the WD33C93 defaults to a SCSI ID of 0, and it was simpler to leave it that way... -- Dave Olson, in comp.sys.sgi

Currently in commercial service: Image :Onyx2:(2x) :O3x02L:
In the museum: almost every MIPS/IRIX system.
Wanted: GM1 board for Professional Series GT graphics (030-0076-003, 030-0076-004)
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group