Unix Programming - how to read bios version using C/C++

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2006 > how to read bios version using C/C++





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author how to read bios version using C/C++
felix

2006-03-07, 7:49 am

I need to get the BIOS version using a C program. According to
SMBIOS - specification it is present at offset 15h from 0x000F13CB . I
get segmentation fault when I try to access this memory location.

Please help.

- felix

Ian Collins

2006-03-07, 5:54 pm

felix wrote:
> I need to get the BIOS version using a C program. According to
> SMBIOS - specification it is present at offset 15h from 0x000F13CB . I
> get segmentation fault when I try to access this memory location.
>

Could be your program doesn't know you are accessing a physical address
and assumes it is a virtual address. The address given probably isn't
valid in your applications virtual address space.

You will have to use the mechanism appropriate to your OS for reading
physical addresses.

--
Ian Collins.
Maxim Yegorushkin

2006-03-07, 5:54 pm


felix wrote:
> I need to get the BIOS version using a C program. According to
> SMBIOS - specification it is present at offset 15h from 0x000F13CB . I
> get segmentation fault when I try to access this memory location.


On Linux you can use /dev/mem to access the physical memory.
man mem(4).

felix

2006-03-09, 2:49 am

Maxim Yegorushkin wrote:
>On Linux you can use /dev/mem to access the physical memory.
>man mem(4).


I could have used /dev/mem, but one needs to have root previleges to
open that file. But I need to do this using normal login. I need to
discover this [ BIOS version ] on a client machine and display that
information.

David Schwartz

2006-03-09, 2:49 am


"felix" <ckpradip@gmail.com> wrote in message
news:1141880162.910083.287750@i40g2000cwc.googlegroups.com...

> Maxim Yegorushkin wrote:


[vbcol=seagreen]
> I could have used /dev/mem, but one needs to have root previleges to
> open that file. But I need to do this using normal login. I need to
> discover this [ BIOS version ] on a client machine and display that
> information.


Any method will require root privileges. No Linux distribution I know of
makes this information available to normal users by default.

DS


Ian Collins

2006-03-09, 2:49 am

felix wrote:
> Maxim Yegorushkin wrote:
>
>
>
> I could have used /dev/mem, but one needs to have root previleges to
> open that file. But I need to do this using normal login. I need to
> discover this [ BIOS version ] on a client machine and display that
> information.
>

For security reasons if nothing else, access to physical memory requires
root privileges.

--
Ian Collins.
Ian Zimmerman

2006-03-19, 12:02 pm


felix> I need to get the BIOS version using a C program. According to
felix> SMBIOS - specification it is present at offset 15h from
felix> 0x000F13CB . I get segmentation fault when I try to access this
felix> memory location.

Look up the biosconfig project on either Sourceforge or Savannah.
The project is hibernating but it contains code to autodetect BIOS brand
version via SMBIOS.

--
A true pessimist won't be discouraged by a little success.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com