From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 25453 invoked from network); 29 Apr 1999 09:44:43 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 29 Apr 1999 09:44:43 -0000 Received: from arctica.sime.com (root@arctica.sime.com [193.228.80.12]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id FAA02660 for ; Thu, 29 Apr 1999 05:15:02 -0400 Received: from sime.com (stefan.sime.com [194.112.213.115]) by arctica.sime.com (8.9.1/8.9.1) with ESMTP id LAA11830; Thu, 29 Apr 1999 11:14:55 +0200 Received: (from stefan@localhost) by sime.com (8.8.7/8.8.7) id KAA01625; Thu, 29 Apr 1999 10:08:32 +0200 Date: Thu, 29 Apr 1999 10:08:32 +0200 From: Quant-X Alpha Linux Support To: axp-list@redhat.com Subject: Re: how to get at SRM flash ROM? Message-ID: <19990429100832.A1538@stefan.sime.com> Reply-To: Quant-X Alpha Linux Support References: <199904281759.KAA20767@helmholtz.salk.edu> <19990428224316.A5738@snowball.ucd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: <19990428224316.A5738@snowball.ucd.ie>; from Nikita Schmidt on Wed, Apr 28, 1999 at 10:43:16PM +0100 Organization: Quant-X Service & Consulting Ges.m.b.H. X-Operating-System: Linux 2.2.6 (i686) 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 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