| Author |
Message |
R Boyd *nix forums beginner
Joined: 14 Sep 2005
Posts: 36
|
Posted: Thu Jul 20, 2006 4:25 pm Post subject:
Re: C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
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
|
Posted: Thu Jul 20, 2006 1:36 am Post subject:
Re: C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
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
|
Posted: Wed Jul 19, 2006 9:38 pm Post subject:
Re: C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
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
|
Posted: Wed Jul 19, 2006 8:55 pm Post subject:
Re: C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
"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
|
Posted: Wed Jul 19, 2006 8:54 pm Post subject:
Re: C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
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
|
Posted: Wed Jul 19, 2006 8:46 pm Post subject:
Re: C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
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
|
Posted: Wed Jul 19, 2006 8:19 pm Post subject:
Re: C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
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
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
|
Posted: Wed Jul 19, 2006 7:59 pm Post subject:
Re: C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
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
|
Posted: Wed Jul 19, 2006 7:45 pm Post subject:
C or DCL routine to examine EXE$GQ_CPUTYPE
|
|
|
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 |
|
 |
|