Hey guys. My company has been looking at using LinuxBIOS for some of our products. Since a fair amount of our customers are using Solaris, we are interested in getting involved with that effort. I've seen a few references to porting the flashrom utility to Solaris, which would be a good priority for us. I poked around the LB source a bit, and it seems like it will be some work to get that running in Solaris. I wondered if you guys have researched this effort at all, and if so, what ideas you had for implementation.
Thanks,
Adam
I don't see a solaris port as a huge problem. flashrom just uses mmap and solaris has that.
If you want to try a make and see what happens, I'd like to hear how it goes.
ron
On Wed, Jan 31, 2007 at 02:44:05PM -0700, ron minnich wrote:
I don't see a solaris port as a huge problem. flashrom just uses mmap and solaris has that.
If you want to try a make and see what happens, I'd like to hear how it goes.
Just a short note: if you build flashrom without having the whole LinuxBIOS source tree around, you'll need to copy the file src/include/boot/linuxbios_tables.h into the flashrom source directory and apply the attached patch to make it use the file.
Btw, should we apply this in svn anyways? flashrom cannot be used indepently otherwise...
Uwe.
On Wed, Jan 31, 2007 at 11:42:43PM +0100, Stefan Reinauer wrote:
Uwe Hermann wrote:
On Wed, Jan 31, 2007 at 02:44:05PM -0700, ron minnich wrote:
I don't see a solaris port as a huge problem. flashrom just uses mmap and solaris has that.
If you want to try a make and see what happens, I'd like to hear how it goes.
Just a short note: if you build flashrom without having the whole LinuxBIOS source tree around, you'll need to copy the file src/include/boot/linuxbios_tables.h into the flashrom source directory and apply the attached patch to make it use the file.
Btw, should we apply this in svn anyways? flashrom cannot be used indepently otherwise...
Yes. Should we have a "make update_includes" target or something similar, or mention this in the README at least?
Hm, why not just put a copy of the file in util/flashrom? Will there be (backwards-)compatibility problems when the file changes in LinuxBIOS? I don't think so, but maybe I'm wrong.
Patch attached.
Uwe.
On Thu, Feb 01, 2007 at 02:26:45AM +0100, Uwe Hermann wrote:
Patch attached.
Forgot the sign-off. New patch.
Uwe.
* Uwe Hermann uwe@hermann-uwe.de [070201 02:33]:
On Thu, Feb 01, 2007 at 02:26:45AM +0100, Uwe Hermann wrote:
Patch attached.
Forgot the sign-off. New patch.
Acked-by: Stefan Reinauer stepan@coresystems.de
and applied.
Well, I had to do a bit of messing around, but I got both pciutils and flashrom to compile on my Solaris 10 box. My biggest concern was the /dev/mem wouldn't allow the same access we get on linux... here's what I get:
bash-3.00# ./flashrom Calibrating delay loop... ok Can not mmap /dev/mem at 00000000 errno(6):No such device or address
Ideas?
Thanks, -ak
-----Original Message----- From: ron minnich [mailto:rminnich@gmail.com] Sent: Wednesday, January 31, 2007 4:44 PM To: Kaufman, Adam Cc: linuxbios@linuxbios.org Subject: Re: [LinuxBIOS] LinuxBIOS Solaris Dev
I don't see a solaris port as a huge problem. flashrom just uses mmap and solaris has that.
If you want to try a make and see what happens, I'd like to hear how it goes.
ron
On Wed, Jan 31, 2007 at 07:16:32PM -0500, Kaufman, Adam wrote:
Well, I had to do a bit of messing around, but I got both pciutils and flashrom to compile on my Solaris 10 box. My biggest concern was the /dev/mem wouldn't allow the same access we get on linux... here's what I get:
bash-3.00# ./flashrom Calibrating delay loop... ok Can not mmap /dev/mem at 00000000 errno(6):No such device or address
Ideas?
Dunno about userspace IO in Solaris.
Here are some semi-useful links about device drivers at least:
Writing Device Drivers http://docs.sun.com/app/docs/doc/816-4854?q=816-4854 (Grab the PDF, I find docs.sun.com to be terribly slow.)
Writing 64-bit Clean Device Drivers for Solaris 10 for x64 Platforms: A 32-bit and 64-bit Compatible Guide http://partneradvantage.sun.com/protected/solaris10/adoptionkit/x86/Porting_...
//Peter
Kaufman, Adam wrote:
Well, I had to do a bit of messing around, but I got both pciutils and flashrom to compile on my Solaris 10 box. My biggest concern was the /dev/mem wouldn't allow the same access we get on linux... here's what I get:
bash-3.00# ./flashrom Calibrating delay loop... ok Can not mmap /dev/mem at 00000000 errno(6):No such device or address
Ideas?
It looks /dev/mem only contains ram on solaris, not the complete address space.
There's a workaround, try using /dev/xsvc instead. It is part of X (or XFree?) as it seems.
http://blogs.sun.com/dmick/entry/patch_for_dmidecode_2_6
Awesome! I think that did it. I'm not at the office right now, so I don't want to reboot my test system, but it doesn't look like anything blew up. Thanks for the help! If everything is good, I'll clean it up and make a patch. Should be fairly minimal.
-ak
whodini# ./flashrom -w /mnt/adamk/tyan/2882v309.rom Calibrating delay loop... ok No LinuxBIOS table found. Enabling flash write on AMD8111...OK Pm49FL004 found at physical address: 0xfff80000 Flash part is Pm49FL004 (512 KB) Flash image seems to be a legacy BIOS. Disabling checks. Programming Page: 0007 at address: 0x00070000
-----Original Message----- From: Stefan Reinauer [mailto:stefan.reinauer@coresystems.de] Sent: Wed 31/01/2007 20:41 To: Kaufman, Adam Cc: linuxbios@linuxbios.org Subject: Re: [LinuxBIOS] LinuxBIOS Solaris Dev
Kaufman, Adam wrote:
Well, I had to do a bit of messing around, but I got both pciutils and flashrom to compile on my Solaris 10 box. My biggest concern was the /dev/mem wouldn't allow the same access we get on linux... here's what I get:
bash-3.00# ./flashrom Calibrating delay loop... ok Can not mmap /dev/mem at 00000000 errno(6):No such device or address
Ideas?
It looks /dev/mem only contains ram on solaris, not the complete address space.
There's a workaround, try using /dev/xsvc instead. It is part of X (or XFree?) as it seems.
http://blogs.sun.com/dmick/entry/patch_for_dmidecode_2_6
Ok, here's what I came up with for a Solaris 10 patch. I don't know that it's the best way, but I tried to make somewhat clean. Feel free to rewrite/suggest anything. Note that Solaris 10 removed the ability to compile libc static, and I don't know if we think it's worth the effort, so I just made checks to disable it for SunOS.
Thanks,
Adam
________________________________
From: linuxbios-bounces@linuxbios.org [mailto:linuxbios-bounces@linuxbios.org] On Behalf Of Kaufman, Adam Sent: Wednesday, January 31, 2007 9:00 PM To: linuxbios@linuxbios.org Subject: Re: [LinuxBIOS] LinuxBIOS Solaris Dev
Awesome! I think that did it. I'm not at the office right now, so I don't want to reboot my test system, but it doesn't look like anything blew up. Thanks for the help! If everything is good, I'll clean it up and make a patch. Should be fairly minimal.
-ak
whodini# ./flashrom -w /mnt/adamk/tyan/2882v309.rom Calibrating delay loop... ok No LinuxBIOS table found. Enabling flash write on AMD8111...OK Pm49FL004 found at physical address: 0xfff80000 Flash part is Pm49FL004 (512 KB) Flash image seems to be a legacy BIOS. Disabling checks. Programming Page: 0007 at address: 0x00070000
-----Original Message----- From: Stefan Reinauer [mailto:stefan.reinauer@coresystems.de] Sent: Wed 31/01/2007 20:41 To: Kaufman, Adam Cc: linuxbios@linuxbios.org Subject: Re: [LinuxBIOS] LinuxBIOS Solaris Dev
Kaufman, Adam wrote:
Well, I had to do a bit of messing around, but I got both pciutils and flashrom to compile on my Solaris 10 box. My biggest concern was the /dev/mem wouldn't allow the same access we get on linux... here's
what
I get:
bash-3.00# ./flashrom Calibrating delay loop... ok Can not mmap /dev/mem at 00000000 errno(6):No such device or address
Ideas?
It looks /dev/mem only contains ram on solaris, not the complete address space.
There's a workaround, try using /dev/xsvc instead. It is part of X (or XFree?) as it seems.
http://blogs.sun.com/dmick/entry/patch_for_dmidecode_2_6
-- coresystems GmbH . Brahmsstr. 16 . D-79104 Freiburg i. Br. Tel.: +49 761 7668825 . Fax: +49 761 7664613 Email: info@coresystems.de . http://www.coresystems.de/
Kaufman, Adam wrote:
Ok, here’s what I came up with for a Solaris 10 patch. I don’t know that it’s the best way, but I tried to make somewhat clean. Feel free to rewrite/suggest anything. Note that Solaris 10 removed the ability to compile libc static, and I don’t know if we think it’s worth the effort, so I just made checks to disable it for SunOS.
mem.h does not look right:
#if defined(sunos) #define MEM_DEV "/dev/mem" #else #define MEM_DEV "/dev/xsvc" #endif
should it be
#if !defined(__sun)
maybe?
Please post a Signed-off-by: http://linuxbios.org/Development_Guidelines#How_to_contribute
On Fri, Feb 02, 2007 at 08:45:53AM -0500, Kaufman, Adam wrote:
Ok, here's what I came up with for a Solaris 10 patch.
Could all of the defines be compressed into one place? Maybe one mem.c per system and defines controlling the build process? Am I being overzealous about portability?
Also, it would be nice if the error messages printed the device that was being used.
//Peter
Peter Stuge wrote:
On Fri, Feb 02, 2007 at 08:45:53AM -0500, Kaufman, Adam wrote:
Ok, here's what I came up with for a Solaris 10 patch.
Could all of the defines be compressed into one place? Maybe one mem.c per system and defines controlling the build process? Am I being overzealous about portability?
Check the attached patch. The utility is, as many parts of the linuxbios source, a little bit overpopulated with includes.
There's no seperate mem.[ch] anymore, as the code is pretty much identical except it is using a define instead of a hardcode now.
With 2 lines in flash.h you could make it work on BeOS as well. :-)
Also, it would be nice if the error messages printed the device that was being used.
done.
If you're ok, please Ack this patch
Stefan