Developer Toolbox and gmemusage

IRIX and IRIX software discussion including open source and commerical offerings.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
cris_adder
Posts: 174
Joined: Wed Jan 13, 2010 12:10 am
Location: Australia

Developer Toolbox and gmemusage

Unread postby cris_adder » Fri May 11, 2012 3:33 am

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: Select all

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.
gmemusage.c.txt
(21 KiB) Downloaded 17 times

gmemusage-0.2.tar.gz
(16.65 KiB) Downloaded 34 times


Thanks...

User avatar
cris_adder
Posts: 174
Joined: Wed Jan 13, 2010 12:10 am
Location: Australia

Re: Developer Toolbox and gmemusage

Unread postby cris_adder » Sat May 12, 2012 6:08 am

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: Select all

/*
 * 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 ;
}

User avatar
jan-jaap
Posts: 4081
Joined: Thu Jun 17, 2004 11:35 am
Location: Wijchen, The Netherlands

Re: Developer Toolbox and gmemusage

Unread postby jan-jaap » Sat May 12, 2012 2:13 pm

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 35 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)


Return to “IRIX and Software”

Who is online

Users browsing this forum: No registered users and 1 guest