* how to get at SRM flash ROM?
@ 1999-04-28 17:59 Jack Wathey
1999-04-28 21:43 ` Nikita Schmidt
0 siblings, 1 reply; 4+ messages in thread
From: Jack Wathey @ 1999-04-28 17:59 UTC (permalink / raw)
To: axp-list
Here's an esoteric question for the SRM gurus in the audience.
As you know, the SRM has some handy environment variables that
live in the flash ROM. These store default strings for the
boot device, kernel arguments, etc.
My question: Is there any way to read and write the values in
these SRM environment variables from a C program running under
Linux (i.e., after the kernel has booted and the system is up
and running)? If so, how?
The reason I ask is that I have a 16-node cluster of LX machines,
all but one of which is headless, and there are occasions when
it would make life a lot simpler if I could change the SRM
environment variables from a C program under Linux, rather than
manually at the SRM prompt.
TIA,
Jack
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to get at SRM flash ROM?
1999-04-28 17:59 how to get at SRM flash ROM? Jack Wathey
@ 1999-04-28 21:43 ` Nikita Schmidt
1999-04-29 8:08 ` Quant-X Alpha Linux Support
1999-05-02 20:10 ` Richard Henderson
0 siblings, 2 replies; 4+ messages in thread
From: Nikita Schmidt @ 1999-04-28 21:43 UTC (permalink / raw)
To: axp-list
On Wednesday, 28 Apr, Jack Wathey wrote:
>
> My question: Is there any way to read and write the values in
> these SRM environment variables from a C program running under
> Linux (i.e., after the kernel has booted and the system is up
> and running)? If so, how?
>
If you boot straight from SRM (not via MILO), the answer seems to be
yes, although the procedure is not very simple. You need to write a
kernel module that would call srm_dispatch(CCB_..._ENV, ...) for you.
See <asm/console.h> for details and arch/alpha/boot/main.c for examples.
I don't know if srm_fixup is needed or not; hopefully not.
Nikita
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to get at SRM flash ROM?
1999-04-28 21:43 ` Nikita Schmidt
@ 1999-04-29 8:08 ` Quant-X Alpha Linux Support
1999-05-02 20:10 ` Richard Henderson
1 sibling, 0 replies; 4+ messages in thread
From: Quant-X Alpha Linux Support @ 1999-04-29 8:08 UTC (permalink / raw)
To: axp-list
Hi Nikita, Jack !
On Wed, Apr 28, 1999 at 10:43:16PM +0100, Nikita Schmidt wrote:
> On Wednesday, 28 Apr, Jack Wathey wrote:
> >
> > My question: Is there any way to read and write the values in
> > these SRM environment variables from a C program running under
> > Linux (i.e., after the kernel has booted and the system is up
> > and running)? If so, how?
> >
>
> If you boot straight from SRM (not via MILO), the answer seems to be
> yes, although the procedure is not very simple. You need to write a
> kernel module that would call srm_dispatch(CCB_..._ENV, ...) for you.
> See <asm/console.h> for details and arch/alpha/boot/main.c for examples.
> I don't know if srm_fixup is needed or not; hopefully not.
A complete different idea ...
... even if it doesn't solve exactly Jack's problem.
Write an expect-like script and do the settings on serial console.
Here an (bad ?) example:
It set's up SRM for diskless/headless booting and also grabs the MAC address
(needed for bootptab on the server).
I normally start the script this way.
./DislessCFG < /dev/ttyS0 > /dev/ttyS0 2>>mac.out
----------------------------------------
#!/usr/bin/expectk -f
proc sput { str } {
.l configure -text "$str"
exp_send "$str\r"
expect ">>>"
}
proc GetMAC { } {
exp_send "sh dev ewa0\r"
# catching command echo
expect "\r"
# catching MAC
expect -re ".* .* (.*)\r"
.l configure -text "$expect_out(1,string)"
puts stderr "$expect_out(1,string)"
expect ">>>"
}
proc ConfigureSystem { } {
set timeout -1
.l configure -text "*** dedecting machine ***"
sput ""
sput ""
.l configure -text "*** starting configuration process ***"
sput "set oem_string \"Another Quant-X Beowulf Cluster\""
sput "set console serial"
sput "set ewa0_protocols bootp"
sput "set ewa0_mode FastFD"
sput "set ewa0_bootp_tries 9999"
sput "set ewa0_tftp_tries 9999"
sput "set bootdef_dev ewa0"
sput "set boot_osflags \"root=/dev/nfs console=ttyS0\""
sput "set auto_action RESTART"
GetMAC
.l configure -text "*** Done ***"
}
proc main {} {
button .r -text "Configure" -command ConfigureSystem
button .b -text "... goto hell" -command exit
label .l -text "--- uninitialized ---" -width 80
pack .r .b .l
}
main
----------------------------------------
Unlike older kernels, nfsroot now mounts r/o by default
so you need to change the script a bit (or hack the kernel).
For shure, this is not a good solution if you have already
a running system, because you must interrupt SRM while auto-booting
(by sending Ctrl-C).
--
ciao -
Stefan Traby
Quant-X Alpha Linux Support
Quant-X Service & Ph: (+43) 4212 90555-0
Consulting Ges.m.b.H. Fax: (+43) 4212 90555-555
http://www.quant-x.com Email: support@quant-x.com
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: how to get at SRM flash ROM?
1999-04-28 21:43 ` Nikita Schmidt
1999-04-29 8:08 ` Quant-X Alpha Linux Support
@ 1999-05-02 20:10 ` Richard Henderson
1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 1999-05-02 20:10 UTC (permalink / raw)
To: axp-list
On Wed, Apr 28, 1999 at 10:43:16PM +0100, Nikita Schmidt wrote:
> If you boot straight from SRM (not via MILO), the answer seems to be
> yes, although the procedure is not very simple. You need to write a
> kernel module that would call srm_dispatch(CCB_..._ENV, ...) for you.
> See <asm/console.h> for details and arch/alpha/boot/main.c for examples.
This won't work after booting...
> I don't know if srm_fixup is needed or not; hopefully not.
... because this _is_ needed, and I never got it to work.
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1999-05-02 20:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-04-28 17:59 how to get at SRM flash ROM? Jack Wathey
1999-04-28 21:43 ` Nikita Schmidt
1999-04-29 8:08 ` Quant-X Alpha Linux Support
1999-05-02 20:10 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox