niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Not Unix » VMS
C or DCL routine to examine EXE
Post new topic   Reply to topic Page 1 of 1 [9 Posts] View previous topic :: View next topic
Author Message
R Boyd
*nix forums beginner


Joined: 14 Sep 2005
Posts: 36

PostPosted: Thu Jul 20, 2006 4:25 pm    Post subject: Re: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

Thanks for that link Hoff!
That routine is perfect. I'll see what I can do to adapt it to the
config scripts.

Hoff Hoffman wrote:
Quote:
R Boyd wrote:
The gnu config.sub and related routines have various strategies for
determining what model of cpu they are running on. I'm trying to fix
one for the GMP kit so that it can distinguish which variant of Alpha
it's running on. As of now the routine blows up when it fails the
attempt to compile the assembler routine that works for Tru64 and/or
Linux on Alpha.

The C code available via the following URL works on OpenVMS, and is
known to be portable to at least Tru64 UNIX:

http://h71000.www7.hp.com/wizard/swdev/implver.html
Back to top
Hoff Hoffman
*nix forums Guru


Joined: 22 Jul 2005
Posts: 572

PostPosted: Thu Jul 20, 2006 1:36 am    Post subject: Re: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

R Boyd wrote:
Quote:
The gnu config.sub and related routines have various strategies for
determining what model of cpu they are running on. I'm trying to fix
one for the GMP kit so that it can distinguish which variant of Alpha
it's running on. As of now the routine blows up when it fails the
attempt to compile the assembler routine that works for Tru64 and/or
Linux on Alpha.

The C code available via the following URL works on OpenVMS, and is
known to be portable to at least Tru64 UNIX:

http://h71000.www7.hp.com/wizard/swdev/implver.html
Back to top
R Boyd
*nix forums beginner


Joined: 14 Sep 2005
Posts: 36

PostPosted: Wed Jul 19, 2006 9:38 pm    Post subject: Re: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

Here's a bit of perl code that does pretty much what is called for. If
someone has a prettier bit of code to offer, I'll be happy to look at
it.


my $cpu_word = qr/[a-zA-Z0-9]+/ ;
my $number = qr/[0-9]+/ ;
my @cpu_types = () ;
#
# Find the appropriate records in the include file
#
foreach (`library/text
SYS\$SHARE:SYS\$LIB_C.TLB/extract=HWRPBDEF/output=sys\$output`)
{
# print ;
if ( m/HWRPB_CPU_TYPE\$K_($cpu_word)\s*($number)\s*/ ) {
@cpu_types[$2] = $1 ;
# print $2,"=",$1,"\n"
}
}
#
# find out the cpu type from GETSYI
#
my $cpu_type = `write sys\$output f\$getsyi("cputype")` ;
#print "Cpu type $cpu_type = @cpu_types[$cpu_type]" ;
print "@cpu_types[$cpu_type]";
Back to top
Rob Brooks
*nix forums Guru Wannabe


Joined: 28 Feb 2005
Posts: 106

PostPosted: Wed Jul 19, 2006 8:55 pm    Post subject: Re: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

"R Boyd" <bob@hax.com> writes:

Quote:
The gnu config.sub and related routines have various strategies for
determining what model of cpu they are running on. I'm trying to fix
one for the GMP kit so that it can distinguish which variant of Alpha
it's running on. As of now the routine blows up when it fails the
attempt to compile the assembler routine that works for Tru64 and/or
Linux on Alpha.

I'd like to find a bit of code that would do the same using either DECC
or DCL on VMS. There's an assembler routine that is part of the GMP

$ write sys$output f$getsyi( "cputype" )
8

--

Rob Brooks VMS Engineering -- Exec Group brooks!cuebid.zko.hp.com
Back to top
sol gongola
*nix forums addict


Joined: 16 Mar 2005
Posts: 72

PostPosted: Wed Jul 19, 2006 8:54 pm    Post subject: Re: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

R Boyd wrote:
Quote:
Perhaps I should have been more explicit.

What I need is the EV level of the cpu, not the "hardware name". Take
a look at the output of ANALYZE/SYSTEM
CLUE CONFIG

and look at the CPU TYPE field(s)

I have looked at all of the F$GETSYI bits and there may be something in
the SYSTEM ID, or ARCHFLAG but I am not sure how do decode the
necessary subfield(s).

sol gongola wrote:

write sys$output f$getsyi("hw_name")

The following refers to a C program call whatami.c

It help you get what you are looking for.

http://h21007.www2.hp.com/dspp/files/unprotected/tru64/tips.pdf
Back to top
sol gongola
*nix forums addict


Joined: 16 Mar 2005
Posts: 72

PostPosted: Wed Jul 19, 2006 8:46 pm    Post subject: Re: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

R Boyd wrote:
Quote:
Perhaps I should have been more explicit.

What I need is the EV level of the cpu, not the "hardware name". Take
a look at the output of ANALYZE/SYSTEM
CLUE CONFIG

and look at the CPU TYPE field(s)

I have looked at all of the F$GETSYI bits and there may be something in
the SYSTEM ID, or ARCHFLAG but I am not sure how do decode the
necessary subfield(s).

sol gongola wrote:

write sys$output f$getsyi("hw_name")

The following refers to a C program call whatami.c

It may give you what you are looking for.
Back to top
R Boyd
*nix forums beginner


Joined: 14 Sep 2005
Posts: 36

PostPosted: Wed Jul 19, 2006 8:19 pm    Post subject: Re: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

Perhaps I should have been more explicit.

What I need is the EV level of the cpu, not the "hardware name". Take
a look at the output of ANALYZE/SYSTEM
Quote:
CLUE CONFIG

and look at the CPU TYPE field(s)

I have looked at all of the F$GETSYI bits and there may be something in
the SYSTEM ID, or ARCHFLAG but I am not sure how do decode the
necessary subfield(s).

sol gongola wrote:

> write sys$output f$getsyi("hw_name")
Back to top
sol gongola
*nix forums addict


Joined: 16 Mar 2005
Posts: 72

PostPosted: Wed Jul 19, 2006 7:59 pm    Post subject: Re: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

R Boyd wrote:
Quote:
The gnu config.sub and related routines have various strategies for
determining what model of cpu they are running on. I'm trying to fix
one for the GMP kit so that it can distinguish which variant of Alpha
it's running on. As of now the routine blows up when it fails the
attempt to compile the assembler routine that works for Tru64 and/or
Linux on Alpha.

I'd like to find a bit of code that would do the same using either DECC
or DCL on VMS. There's an assembler routine that is part of the GMP
conf routines that apparently does it, but the assembler is not
available on my system and I don't know if it would actually compile if
I had it. I do have a C compiler. Doing it from DCL would be even
slicker. I can get the information from ANALYZE/SYSTEM CLUE CONFIG --
I would like to think there might be a lighter weight path to getting
the information.

Anyone have something they've done like this?

Thanks!

Robert

write sys$output f$getsyi("hw_name")
Back to top
R Boyd
*nix forums beginner


Joined: 14 Sep 2005
Posts: 36

PostPosted: Wed Jul 19, 2006 7:45 pm    Post subject: C or DCL routine to examine EXE$GQ_CPUTYPE Reply with quote

The gnu config.sub and related routines have various strategies for
determining what model of cpu they are running on. I'm trying to fix
one for the GMP kit so that it can distinguish which variant of Alpha
it's running on. As of now the routine blows up when it fails the
attempt to compile the assembler routine that works for Tru64 and/or
Linux on Alpha.

I'd like to find a bit of code that would do the same using either DECC
or DCL on VMS. There's an assembler routine that is part of the GMP
conf routines that apparently does it, but the assembler is not
available on my system and I don't know if it would actually compile if
I had it. I do have a C compiler. Doing it from DCL would be even
slicker. I can get the information from ANALYZE/SYSTEM CLUE CONFIG --
I would like to think there might be a lighter weight path to getting
the information.

Anyone have something they've done like this?

Thanks!

Robert
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [9 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 8:35 pm | All times are GMT
navigation Forum index » Not Unix » VMS
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts SQL0440 - Routine XXXX in *N not found with specified par... Sanjay IBM DB2 1 Sat Jul 08, 2006 2:35 pm
No new posts Understanding socket_select routine mydejamail@yahoo.co.uk PHP 4 Tue Jun 06, 2006 11:23 am
No new posts the performance of delete with commitcount routine heming_g@hotmail.com IBM DB2 1 Thu May 25, 2006 2:21 am
No new posts Squid Doesn't Cache Some URLs, Does it Examine Content? Ralph Corderoy Squid 5 Sat May 20, 2006 11:15 am
No new posts Overloaded vendor library routine: is this C++? Or very c... Jack Daly C 12 Sun May 14, 2006 11:39 am

Internet Advertising | Free Advertising | Remortgages | Website Design | Adverse Credit Remortgage
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 1.9560s ][ Queries: 20 (0.3620s) ][ GZIP on - Debug on ]