From: Quant-X Alpha Linux Support <stefan@sime.com>
To: axp-list@redhat.com
Subject: Re: how to get at SRM flash ROM?
Date: Thu, 29 Apr 1999 10:08:32 +0200 [thread overview]
Message-ID: <19990429100832.A1538@stefan.sime.com> (raw)
In-Reply-To: <19990428224316.A5738@snowball.ucd.ie>; from Nikita Schmidt on Wed, Apr 28, 1999 at 10:43:16PM +0100
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
next prev parent reply other threads:[~1999-04-29 9:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
1999-05-02 20:10 ` Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox