Boot records Intel Architecture

Discussion in 'C Programming' started by Ravi, May 18, 2005.

  1. Ravi

    Ravi Guest

    Hi,

    Is there any way to capture the boot record information on the disk?
    For example, assume that I have 3 different operating systems installed
    on a hard drive. I want to be able to run a program/utility and get the
    boot record information, like address on the drive or contents at that
    specific location, for all the 3 operating systems.

    Is this possible using C?

    Thanks in advance,
    Ravi
    Ravi, May 18, 2005
    #1
    1. Advertising

  2. Ravi

    Rvde Guest

    "Ravi" <> wrote in message
    news:...
    > Hi,
    >
    > Is there any way to capture the boot record information on the disk?
    > For example, assume that I have 3 different operating systems
    > installed
    > on a hard drive. I want to be able to run a program/utility and get
    > the
    > boot record information, like address on the drive or contents at
    > that
    > specific location, for all the 3 operating systems.
    >
    > Is this possible using C?
    >
    > Thanks in advance,
    > Ravi
    >


    That's more of an operating system question than a C question.
    Under Linux you would just open /dev/hda (replace hda with the device
    name of the drive you want to look at) as a file and start reading
    from it.
    Rvde, May 18, 2005
    #2
    1. Advertising

  3. Ravi

    Ravi Guest

    Can't we program that using assembly language and C?
    I want capture the boot record binary into a variable. In Linux
    everything is a file. So it is easy there to get that information. Let
    us talk about Windows. How can I do it in Windows?
    Ravi, May 18, 2005
    #3
  4. In article <>,
    Ravi <> wrote:
    >Can't we program that using assembly language and C?


    Perhaps, but assembly language is not C and this is a C newgroup.
    You mention "Intel Architecture" in your subject heading, but you
    should realize that Intel makes hundreds of different CPUs
    with different assembly languages.

    >I want capture the boot record binary into a variable. In Linux
    >everything is a file.


    Urr, no it isn't. You cannot, for example, create a new
    file by simply appending something to a directory -- something which
    you would be able to do if "everything is a file" since then
    a directory would be a file.

    Most of /proc are *pseudo-files* rather than files.

    > So it is easy there to get that information. Let
    >us talk about Windows. How can I do it in Windows?


    That would seem to me more appropriate to ask in a Windows newsgroup.

    --
    Look out, there are llamas!
    Walter Roberson, May 18, 2005
    #4
  5. Ravi

    Alan Balmer Guest

    On 18 May 2005 09:57:26 -0700, "Ravi" <>
    wrote:

    >Can't we program that using assembly language and C?
    >I want capture the boot record binary into a variable. In Linux
    >everything is a file. So it is easy there to get that information. Let
    >us talk about Windows. How can I do it in Windows?


    Why don't you ask on a Windows programming group?

    --
    Al Balmer
    Balmer Consulting
    Alan Balmer, May 18, 2005
    #5
  6. Ravi

    jacob navia Guest

    Ravi wrote:

    > Can't we program that using assembly language and C?
    > I want capture the boot record binary into a variable. In Linux
    > everything is a file. So it is easy there to get that information. Let
    > us talk about Windows. How can I do it in Windows?
    >

    Under windows you can do the same thing. Open the disk as a raw device
    and read from it. You should go to the Microsoft site and search the
    documentation. Specifically look for the API CreateFile and look at
    the documentation for Physical Disks and Volumes in there.
    jacob navia, May 18, 2005
    #6
  7. In article <>,
    Ravi <> wrote:
    >Hi,
    >
    >Is there any way to capture the boot record information on the disk?
    >For example, assume that I have 3 different operating systems installed
    >on a hard drive. I want to be able to run a program/utility and get the
    >boot record information, like address on the drive or contents at that
    >specific location, for all the 3 operating systems.
    >
    >Is this possible using C?


    Everyone will tell you that this is OT for this newsgroup, but there is
    a simple, concise, on-topic, accurate and all-inclusive answer to your
    question. The answer is given below...

    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE
    SPOILER SPACE

    Yes.
    Kenny McCormack, May 18, 2005
    #7
  8. Ravi

    Malcolm Guest

    "Ravi" <> wrote
    >
    > Can't we program that using assembly language and C?
    > I want capture the boot record binary into a variable. In Linux
    > everything is a file. So it is easy there to get that information. Let
    > us talk about Windows. How can I do it in Windows?
    >

    The answer is that ANSI C doesn't allow this sort of low-level interaction
    with the disk drive. However typically C compilers come with libraries of
    platform-specific functions which can do all sorts of useful things.
    Assemblers generally allow you to do even more. You need to ask in a group
    devoted to your platform about this, not here.
    Malcolm, May 18, 2005
    #8
  9. Ravi

    Ravi Guest

    Oops.....I did not even think about all these responses. Malcolm's
    answer was simple and straight forward....anyways...thanks guys....

    Ravi
    Ravi, May 19, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Muhammad Khan
    Replies:
    4
    Views:
    1,210
    Mike Treseler
    Jul 10, 2003
  2. Replies:
    3
    Views:
    502
    Malcolm
    Sep 29, 2005
  3. rashmi
    Replies:
    2
    Views:
    445
    Grumble
    Jul 5, 2005
  4. whatnext
    Replies:
    9
    Views:
    405
  5. Kazik�
    Replies:
    4
    Views:
    1,302
    Jonathan Lee
    Jul 6, 2009
Loading...

Share This Page