LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-15-2004, 09:50 PM   #1
Tafta
Member
 
Registered: Jan 2003
Location: Bandung, Indonesia
Distribution: Mandrake, SUSE, RedHat
Posts: 55

Rep: Reputation: 15
accessing hardware configuration stored in BIOS


Hi there,

I'm planning to make a utility to detect hardware configuration. I need more than just hardwares specification but i also need their brand (creative, AMD, asus, elsa, etc.).
I've read the /proc content but it doesn't display hardware brand.
My 2nd option is to read directly from BIOS. Can somebody tell me how to read BIOS information? Or is there anyother way to do it?

Thank you
 
Old 07-16-2004, 01:14 PM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
open up /dev/mem, lseek to the physical address, read.
Code:
[root@localho.outernet] cat read_devmem.c 
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>

int main(int argc, char **argv)
{
    size_t  foo;
    int fd;

    fd = open("/dev/mem", O_RDONLY);
    lseek(fd, 0x400, SEEK_SET);
    read(fd, &foo, sizeof(foo));
    printf("foo = %x\n", foo);
    return 0;
}
[root@localho.outernet] gcc read_devmem.c 
[root@localho.outernet] ./a.out 
foo = 3f8
0x3f8 corresponds with base i/o address for serial port 1.
 
Old 07-16-2004, 03:46 PM   #3
laceupboots
Member
 
Registered: Dec 2003
Location: Houston
Distribution: Knoppix,lenova yoga 3, Samsung s6 -android
Posts: 307

Rep: Reputation: 30
You can also use the dmesg command from a terminal and it will give you the hardware information.
 
Old 08-13-2004, 01:46 PM   #4
Tafta
Member
 
Registered: Jan 2003
Location: Bandung, Indonesia
Distribution: Mandrake, SUSE, RedHat
Posts: 55

Original Poster
Rep: Reputation: 15
Thank you infamous41md
i'll try to use the /dev/mem

What i need now is the map of bios content within the memory. Where can i get such information and does each bios has it's own unique content or there is a standard?

thanks in advance
 
Old 08-13-2004, 02:29 PM   #5
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
i dont really know, i just happened to know where the serial port info and pararell is stored. google.
 
Old 08-13-2004, 03:02 PM   #6
laceupboots
Member
 
Registered: Dec 2003
Location: Houston
Distribution: Knoppix,lenova yoga 3, Samsung s6 -android
Posts: 307

Rep: Reputation: 30
Try using the dmeg command it shold give you your BIOS settings.
 
  


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
Accessing Bios Problem, useing LILO BlackRob Linux - Newbie 2 04-26-2004 11:51 PM
Accessing / Mounting Hardware Help! mudelf Linux - Hardware 0 11-12-2003 04:34 AM
Where is the network configuration stored??? david_wliu Linux - Networking 2 03-06-2003 10:54 AM
Where is networking configuration stored? gonus Linux - Networking 4 11-04-2002 05:40 AM
hardware question about bios philfighter General 17 08-24-2001 05:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:26 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