Skip to contentSkip to conversation

Generic access to firmware environment variables

RFC Jan-Benedict Glaw 2 participants 2 messages Apr 10, 2002

lore
Share & tools
lore
#0 lore raw

Hi!

I've developed a driver to access environment variables on Alpha computers from userspace through procfs some time ago. These days, I updated the driver. While doing this, I also looked at other architectures; some of them also do have some kind of environment variables in firmware:

	Alphas			-	SRM firmware
	SGI Workstations	-	ARCS firmware
	MIPS/ITE-Boards		-	PMON
	m68k/MAC		-	?? (info is placed into a
					"bootinfo" struct)
	IA64			-	(_seems_ to know about
					environment...)

They all access environment variables either by name, or by an internally handles number. For Alpha, I've (now) implemented both, access by name (if variable name is known/described) and access by generic number.

I think it would be useful to have something like this for other architectures as well. So I'm currently thinking about implementing a base driver (like parport does) and additional modules to implement machine/architecture specific access methode (like parport_pc).

It's easy to code, so what do you think of this?

MfG, JBG

Signature · 3 lines
Jan-Benedict Glaw   .   [email protected]   .   +49-172-7608481
	 -- New APT-Proxy written in shell script --
	   http://lug-owl.de/~jbglaw/software/ap2/
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jan-Benedict Glaw

Jan-Benedict> Hi! I've developed a driver to access environment Jan-Benedict> variables on Alpha computers from userspace through Jan-Benedict> procfs some time ago. These days, I updated the Jan-Benedict> driver. While doing this, I also looked at other Jan-Benedict> architectures; some of them also do have some kind of Jan-Benedict> environment variables in firmware:

Jan-Benedict> Alphas - SRM firmware SGI Workstations - ARCS
Jan-Benedict> firmware MIPS/ITE-Boards - PMON m68k/MAC - ?? (info is Jan-Benedict> placed into a "bootinfo" struct) IA64 - (_seems_ to Jan-Benedict> know about environment...)

Jan-Benedict> They all access environment variables either by name, Jan-Benedict> or by an internally handles number. For Alpha, I've Jan-Benedict> (now) implemented both, access by name (if variable Jan-Benedict> name is known/described) and access by generic number.

Jan-Benedict> I think it would be useful to have something like this Jan-Benedict> for other architectures as well. So I'm currently Jan-Benedict> thinking about implementing a base driver (like Jan-Benedict> parport does) and additional modules to implement Jan-Benedict> machine/architecture specific access methode (like Jan-Benedict> parport_pc).

Jan-Benedict> It's easy to code, so what do you think of this?

On EFI platforms, there is /proc/efi/vars. The module was written by Matt Domsch <[email protected]>. EFI is used on ia64 and x86 servers. Note that EFI variables can contain arbitrary binary data, not just text strings.

	--david