Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Hardware Spec From BIOS OR RAM

stewardsteward Posts: 22Member
Hello

I am beginner and would like to develope a kernel that shows hardware spec
i know there is an interrupt like int 11 .but i want to show the detail specification like model,vendor ,.... for some devices such as cpu,ram,hard.... and i know there is an address in ram that holds this specification but I dont know that address and dont know how to access this segment,Please
«1

Comments

  • BretBret Posts: 114Member
    : Hello
    :
    : I am beginner and would like to develope a kernel that shows
    : hardware spec
    : i know there is an interrupt like int 11 .but i want to show the
    : detail specification like model,vendor ,.... for some devices such
    : as cpu,ram,hard.... and i know there is an address in ram that holds
    : this specification but I dont know that address and dont know how
    : to access this segment,Please

    Are you referring to the SMBIOS? If so, you can download the specs from [link=http://www.dmtf.org/standards/smbios/]Here[/Link].
  • stewardsteward Posts: 22Member
    : : Hello
    : :
    : : I am beginner and would like to develope a kernel that shows
    : : hardware spec
    : : i know there is an interrupt like int 11 .but i want to show the
    : : detail specification like model,vendor ,.... for some devices such
    : : as cpu,ram,hard.... and i know there is an address in ram that holds
    : : this specification but I dont know that address and dont know how
    : : to access this segment,Please
    :
    : Are you referring to the SMBIOS? If so, you can download the specs
    : from [link=http://www.dmtf.org/standards/smbios/]Here[/Link].

    Thanks sir.But How should i use that standard?I said i am beginner.Guid in detail please.
  • jeffleydajeffleyda Posts: 390Member
    This is a really good way to learn hardware and programming-one of the very first programs I wrote in asm was one that detected various bits of hardware and displayed them to the screen. I used int 11 and several others, and then figured out how to talk to hardware directly for more exploring. (this was way before smbios came into being)

    SMBIOS is a good resource of information. The method used to get to it is very similar to accessing ACPI information, and I have a program here:

    http://www.programmersheaven.com/download/25319/download.aspx
    (It only works under plain DOS.)

    I think with just a little bit of tweaking, this program could dump out the SMBIOS data instead of ACPI, but you'll need to read the spec to really understand what you're doing.

    The downside of SMBIOS is that it's boring. It's basically just a bunch of text sitting in memory that you parse out and display. You won't learn much with that, so I always suggest going directly to the hardware if you want to learn how to really detect things and know how to interface into all the chips on your board, and we can help.

    You'll need to go slowly at first and then ask specifics like "how do I talk to PCI devices?", so we can narrow down the scope of our responses.

    -jeff!
  • stewardsteward Posts: 22Member
    ok.I will go to Read what u say.but u should help me if i have question.

    If anyone else can help more please post his/her reply.

    thx alot
  • stewardsteward Posts: 22Member
    I have the same question.I know that there is an address in ram that holds the hardware spec.is there anyway to access that data and show it which can be readable?
  • stewardsteward Posts: 22Member
    : This is a really good way to learn hardware and programming-one of
    : the very first programs I wrote in asm was one that detected various
    : bits of hardware and displayed them to the screen. I used int 11
    : and several others, and then figured out how to talk to hardware
    : directly for more exploring. (this was way before smbios came into
    : being)
    :
    : SMBIOS is a good resource of information. The method used to get to
    : it is very similar to accessing ACPI information, and I have a
    : program here:
    :
    : http://www.programmersheaven.com/download/25319/download.aspx
    : (It only works under plain DOS.)
    :
    : I think with just a little bit of tweaking, this program could dump
    : out the SMBIOS data instead of ACPI, but you'll need to read the
    : spec to really understand what you're doing.
    :
    : The downside of SMBIOS is that it's boring. It's basically just a
    : bunch of text sitting in memory that you parse out and display. You
    : won't learn much with that, so I always suggest going directly to
    : the hardware if you want to learn how to really detect things and
    : know how to interface into all the chips on your board, and we can
    : help.
    :
    : You'll need to go slowly at first and then ask specifics like "how
    : do I talk to PCI devices?", so we can narrow down the scope of our
    : responses.
    :
    : -jeff!

    How should i use smbios.I read its PDF but there was nothing to help me.
    Guid please
  • jeffleydajeffleyda Posts: 390Member
    : How should i use smbios.I read its PDF but there was nothing to help
    : me.
    : Guid please

    Not true.
    *Everything* you need is in the PDF, you just didn't understand it.

    You are probably trying to do something too complicated, especially since you are new to x86 programming. This is not easy stuff to do, especially in assembly.

    Chapter 2 in the spec tells you how to access the SMBIOS information:

    "On non-EFI systems, the SMBIOS Entry Point structure, described below, can be located by application software by searching for the anchor-string on paragraph (16-byte) boundaries within the physical memory address range
    000F0000h to 000FFFFFh."

    That means you must write a routine to search memory looking for a key signature. That key is "_SM_"

    The code that I pointed you to does something similar with ACPI-it searches for a key named "RSD PTR" in the routine rsdptrSearch. If you change that key in my code to "_SM_" you will now have step 1 completed!

    The address you find _SM_ + 18h is the offset of a 32bit pointer to where all the SMBIOS data lives in memory. There is other information in this table that you will also want to know (SMBIOS version at _SM_+6, # of tables at _SM_+1ch)

    From DOS (or other real mode environment) in order to access the data at that high location in memory, you will need to put the CPU into protected mode. I put it into flat real mode in my example code. (routine is called himeminit)

    From there it's a matter of reading the data out of memory and displaying it the way you want. The structure of each table is defined in section 3.

    My ACPI code does the same type of work. If you download the ACPI specification you will find it is very similar in the way tables are organized in memory, and that may help you understand my code a little better too.
  • stewardsteward Posts: 22Member
    : : How should i use smbios.I read its PDF but there was nothing to help
    : : me.
    : : Guid please
    :
    : Not true.
    : *Everything* you need is in the PDF, you just didn't understand it.
    :
    : You are probably trying to do something too complicated, especially
    : since you are new to x86 programming. This is not easy stuff to do,
    : especially in assembly.
    :
    : Chapter 2 in the spec tells you how to access the SMBIOS information:
    :
    : "On non-EFI systems, the SMBIOS Entry Point structure, described
    : below, can be located by application software by searching for the
    : anchor-string on paragraph (16-byte) boundaries within the physical
    : memory address range
    : 000F0000h to 000FFFFFh."
    :
    : That means you must write a routine to search memory looking for a
    : key signature. That key is "_SM_"
    :
    : The code that I pointed you to does something similar with ACPI-it
    : searches for a key named "RSD PTR" in the routine rsdptrSearch. If
    : you change that key in my code to "_SM_" you will now have step 1
    : completed!
    :
    : The address you find _SM_ + 18h is the offset of a 32bit pointer to
    : where all the SMBIOS data lives in memory. There is other
    : information in this table that you will also want to know (SMBIOS
    : version at _SM_+6, # of tables at _SM_+1ch)
    :
    : From DOS (or other real mode environment) in order to access the
    : data at that high location in memory, you will need to put the CPU
    : into protected mode. I put it into flat real mode in my example
    : code. (routine is called himeminit)
    :
    : From there it's a matter of reading the data out of memory and
    : displaying it the way you want. The structure of each table is
    : defined in section 3.
    :
    : My ACPI code does the same type of work. If you download the ACPI
    : specification you will find it is very similar in the way tables are
    : organized in memory, and that may help you understand my code a
    : little better too.

    Thanks alot
  • stewardsteward Posts: 22Member
    Hi.

    I found DMIDecode.c Source code but it is Written in C.
    Know i want to Make a disk that in sector 0 is bootloader and in sector 1 is dmidecode.what should i do?guide please
  • jeffleydajeffleyda Posts: 390Member
    : Hi.
    :
    : I found DMIDecode.c Source code but it is Written in C.
    : Know i want to Make a disk that in sector 0 is bootloader and in
    : sector 1 is dmidecode.what should i do?guide please
    :

    Could you possibly make this any more difficult for yourself?
    Reading DMI and creating bootsector loaders are *not* beginner tasks. I'll be very impressed if you get this to work without giving up after becoming too frustrated.

    I'd make the dmicode.c into a DOS .COM program first. It's MUCH easier to debug and test your code by executing it in DOS than putting it onto a bootsector and rebooting the computer to test every change.

    Your program will not be able to use any DOS functions (ie, no INT 21h to print a text string) because from a bootsector, you only have BIOS functions available to you.

    Once you have a clean .COM program that works the way you want, it is just a matter of copying it to sector 1 (you'll likely need more than just 512 bytes). You shouldn't need to change any code between DOS .COM and a bootsector. There are lots of examples out there of bootsector code, so that should be easy to find.

    -jeff!

«1
Sign In or Register to comment.