LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-02-2012, 07:40 AM   #1
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Rep: Reputation: Disabled
getting BIOS information


Hello everyone. My task is to get BIOS settings/information like vendor and so on using C/C++ but without using something like this system("dmidecode").

Thanks in advance
 
Old 05-03-2012, 06:39 AM   #2
cgtueno
Member
 
Registered: Jul 2003
Posts: 363

Rep: Reputation: 50
Hi

An interesting question.

In the days of XT's and Turbo C, Turbo Pascal, Assembler, yes, it was possible.
Simply by looking at the BIOS physical address space in the system
memory map and knowing the field offsets ( peekb() ).

However, now days things are not so simple.
Modern BIOS code is paged in and out of the system memory space.
In some cases the BIOS code can be compressed or even encrypted.

In a modern multi-process OS a single process is limited
to addressing memory within it's own local (virtual) address space.
So attempting to directly read the BIOS physical address range
will fail, unless the process reads BIOS information that has been previously been stored in accessible system memory (by other system processes) that it can, if sufficiently privileged, access.

The good news is that it is possible to obtain information about the system hardware in Linux using the following programs (tools)

lshw
biosdecode Reads the system's DMI table data and reports lot's of detail
dmidecode Reads the system's DMI table data and reports lot's of detail
including the BIOS vendor and BIOS version, etc
$ dmidecode --type 0

There is an excellent discussion of biosdecode and dmidecode here:
http://www.cyberciti.biz/tips/queryi...nd-prompt.html

Further reading
http://en.wikipedia.org/wiki/SMBIOS
http://en.wikipedia.org/wiki/Desktop...ment_Interface
http://linux.die.net/man/8/biosdecode
http://linux.die.net/man/8/dmidecode

Looking into the source code for either biosdecode or dmicode, and researching the operation and use of the DMI tables would seem to be an excellent place to start.

Hope that assists

Chris
 
Old 05-04-2012, 09:16 AM   #3
Edward18
LQ Newbie
 
Registered: Dec 2011
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cgtueno View Post
Hi

An interesting question.

In the days of XT's and Turbo C, Turbo Pascal, Assembler, yes, it was possible.
Simply by looking at the BIOS physical address space in the system
memory map and knowing the field offsets ( peekb() ).

However, now days things are not so simple.
Modern BIOS code is paged in and out of the system memory space.
In some cases the BIOS code can be compressed or even encrypted.

In a modern multi-process OS a single process is limited
to addressing memory within it's own local (virtual) address space.
So attempting to directly read the BIOS physical address range
will fail, unless the process reads BIOS information that has been previously been stored in accessible system memory (by other system processes) that it can, if sufficiently privileged, access.

The good news is that it is possible to obtain information about the system hardware in Linux using the following programs (tools)

lshw
biosdecode Reads the system's DMI table data and reports lot's of detail
dmidecode Reads the system's DMI table data and reports lot's of detail
including the BIOS vendor and BIOS version, etc
$ dmidecode --type 0

There is an excellent discussion of biosdecode and dmidecode here:
http://www.cyberciti.biz/tips/queryi...nd-prompt.html

Further reading
http://en.wikipedia.org/wiki/SMBIOS
http://en.wikipedia.org/wiki/Desktop...ment_Interface
http://linux.die.net/man/8/biosdecode
http://linux.die.net/man/8/dmidecode

Looking into the source code for either biosdecode or dmicode, and researching the operation and use of the DMI tables would seem to be an excellent place to start.

Hope that assists

Chris
Thank you very much for such a good information, unfortunately i have already looked through dmidecode source code and could not find anything useful for me. I think it could be done easily using assembler, but not in my case. So we can consider this impossible, since there is no C/C++ API for BIOS.
 
Old 05-04-2012, 02:59 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
We used to use dos debug to read bios memory locations. It should still work if you were to read the memory location.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bios Information Lescordonniers Linux - Newbie 7 12-05-2011 07:35 AM
BIOS information jackd1000 Red Hat 3 07-13-2009 01:03 PM
Information On BIOS Chronothread Linux - Newbie 2 12-02-2007 01:19 PM
BIOS information merlin23 Linux - Newbie 2 12-07-2004 02:14 AM
How to get BIOS information? whepin Programming 1 04-06-2002 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration