Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


beginner for finding boot sector info

nayan_Kumarnayan_Kumar Member Posts: 98
hi all,
i want to know how i can get boot sector information for doing fat
analysis of any storage device like hard disk cd etc.any sample linkor
tutorial that can help me will be ok.

if there is any sample in the ddk that could be helpful for my work plz let
me know because you people have better idea about this.

Thanks
Nayan

_________________________________________________________________
Connect with your friends who use Yahoo! Messenger with Voice. Click!
http://www.msnspecials.in/wlmyahoo/index.asp

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,832
    nayan kumar wrote:
    > hi all,
    > i want to know how i can get boot sector information for doing
    > fat analysis of any storage device like hard disk cd etc.any sample
    > linkor tutorial that can help me will be ok.
    >
    > if there is any sample in the ddk that could be helpful for my work
    > plz let me know because you people have better idea about this.

    What kind of information are you after? The boot sector info isn't
    usually very interesting.

    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Software Wizard Emeritus

  • nayan_Kumarnayan_Kumar Member Posts: 98
    Hi Tim,
    Thanks for your response.i have been assigned a work to read the
    boot sector information for fetching the MBR and partition table info and
    the result that i will get after doing some calculation on the data of some
    field that i will get after reading the MBR and partition table structure i
    will have to calculate the offset or find the address of the input file for
    reading the contents of that file of particular storage device like sd
    card,hard disk etc.

    i would be thankful for any help in this regard.



    Thanks
    Nayan

    >From: Tim Roberts <[email protected]>
    >Reply-To: "Windows System Software Devs Interest List"
    ><[email protected]>
    >To: "Windows System Software Devs Interest List" <[email protected]>
    >Subject: Re: [ntdev] beginner for finding boot sector info
    >Date: Mon, 13 Nov 2006 10:25:29 -0800
    >
    >nayan kumar wrote:
    > > hi all,
    > > i want to know how i can get boot sector information for doing
    > > fat analysis of any storage device like hard disk cd etc.any sample
    > > linkor tutorial that can help me will be ok.
    > >
    > > if there is any sample in the ddk that could be helpful for my work
    > > plz let me know because you people have better idea about this.
    >
    >What kind of information are you after? The boot sector info isn't
    >usually very interesting.
    >
    >--
    >Tim Roberts, [email protected]
    >Providenza & Boekelheide, Inc.
    >
    >
    >---
    >Questions? First check the Kernel Driver FAQ at
    >http://www.osronline.com/article.cfm?id=256
    >
    >To unsubscribe, visit the List Server section of OSR Online at
    >http://www.osronline.com/page.cfm?name=ListServer

    _________________________________________________________________
    Discover. Explore. Connect-Windows Live Spaces. Check out!
    http://www.msnspecials.in/windowslive/livespaces.asp
  • David_J._CraigDavid_J._Craig Member Posts: 1,885
    Read the MSDN Library entry for CreateFile() at least five times. Pay
    attention to ALL options and the comments. Hint: PhysicalDrive0, and C:.
    Learn the difference between logical and physical drives. Also learn the
    requirements for your program so you can know which should be your target.

    "nayan kumar" wrote in message news:xxxxx@ntdev...
    >
    > Hi Tim,
    > Thanks for your response.i have been assigned a work to read the
    > boot sector information for fetching the MBR and partition table info and
    > the result that i will get after doing some calculation on the data of
    > some field that i will get after reading the MBR and partition table
    > structure i will have to calculate the offset or find the address of the
    > input file for reading the contents of that file of particular storage
    > device like sd card,hard disk etc.
    >
    > i would be thankful for any help in this regard.
    >
    >
    >
    > Thanks
    > Nayan
    >
    >>From: Tim Roberts
    >>Reply-To: "Windows System Software Devs Interest List"
    >>
    >>To: "Windows System Software Devs Interest List"
    >>Subject: Re: [ntdev] beginner for finding boot sector info
    >>Date: Mon, 13 Nov 2006 10:25:29 -0800
    >>
    >>nayan kumar wrote:
    >> > hi all,
    >> > i want to know how i can get boot sector information for doing
    >> > fat analysis of any storage device like hard disk cd etc.any sample
    >> > linkor tutorial that can help me will be ok.
    >> >
    >> > if there is any sample in the ddk that could be helpful for my work
    >> > plz let me know because you people have better idea about this.
    >>
    >>What kind of information are you after? The boot sector info isn't
    >>usually very interesting.
    >>
    >>--
    >>Tim Roberts, [email protected]
    >>Providenza & Boekelheide, Inc.
    >>
    >>
    >>---
    >>Questions? First check the Kernel Driver FAQ at
    >>http://www.osronline.com/article.cfm?id=256
    >>
    >>To unsubscribe, visit the List Server section of OSR Online at
    >>http://www.osronline.com/page.cfm?name=ListServer
    >
    > _________________________________________________________________
    > Discover. Explore. Connect-Windows Live Spaces. Check out!
    > http://www.msnspecials.in/windowslive/livespaces.asp
    >
    >
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,832
    nayan kumar wrote:
    >
    > Hi Tim,
    > Thanks for your response.i have been assigned a work to read
    > the boot sector information for fetching the MBR and partition table
    > info and the result that i will get after doing some calculation on
    > the data of some field that i will get after reading the MBR and
    > partition table structure i will have to calculate the offset or find
    > the address of the input file for reading the contents of that file of
    > particular storage device like sd card,hard disk etc.

    This takes way more than reading the boot sector! The boot sector can
    tell you where a partition begins. After that, you have to find out
    what type of file system it is. After THAT, you have to understand the
    table formats for the file systems you might encounter, first to find
    the root directory, then to parse the root directory to find the folder
    you need, then to find the table of sectors to know where your file
    actually lives. This is a very complicated project.

    Google is much faster than this mailing list, especially for reference
    information like this. I Googled for "format mbr partition table" and
    got 362,000 hits, including a very good Wikipedia article.

    Why can't you just mount your disk normally and use the standard
    operating system services to access your file? That's what they are
    there for.

    (This post gave me quite a feeling of deja vu; we had essentially the
    exact same question come up on the libusb mailing list a few weeks ago.)

    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Software Wizard Emeritus

  • nayan_Kumarnayan_Kumar Member Posts: 98
    Hi Tim,

    yes you got my point i exactly have to perform similiar action
    through my driver.Time is not constraint for us.although i google about this
    topic i got several tutorial and useful stuff regarding this but still a kid
    infront of you great people.as far as working on driver is concern i am
    absolutly beginner so far i finished one filter driver for pci device and
    absolutly blank paper for this file system driver .even though at this stage
    after reading some stuff about this i got some idea about this but still
    clueless about from where to start and how to proceed.if its possible for
    you to guide me for this work i will be very thankfull to you .

    Regards
    Nayan

    >From: Tim Roberts <[email protected]>
    >Reply-To: "Windows System Software Devs Interest List"
    ><[email protected]>
    >To: "Windows System Software Devs Interest List" <[email protected]>
    >Subject: Re: [ntdev] beginner for finding boot sector info
    >Date: Tue, 14 Nov 2006 10:05:14 -0800
    >
    >nayan kumar wrote:
    > >
    > > Hi Tim,
    > > Thanks for your response.i have been assigned a work to read
    > > the boot sector information for fetching the MBR and partition table
    > > info and the result that i will get after doing some calculation on
    > > the data of some field that i will get after reading the MBR and
    > > partition table structure i will have to calculate the offset or find
    > > the address of the input file for reading the contents of that file of
    > > particular storage device like sd card,hard disk etc.
    >
    >This takes way more than reading the boot sector! The boot sector can
    >tell you where a partition begins. After that, you have to find out
    >what type of file system it is. After THAT, you have to understand the
    >table formats for the file systems you might encounter, first to find
    >the root directory, then to parse the root directory to find the folder
    >you need, then to find the table of sectors to know where your file
    >actually lives. This is a very complicated project.
    >
    >Google is much faster than this mailing list, especially for reference
    >information like this. I Googled for "format mbr partition table" and
    >got 362,000 hits, including a very good Wikipedia article.
    >
    >Why can't you just mount your disk normally and use the standard
    >operating system services to access your file? That's what they are
    >there for.
    >
    >(This post gave me quite a feeling of deja vu; we had essentially the
    >exact same question come up on the libusb mailing list a few weeks ago.)
    >
    >--
    >Tim Roberts, [email protected]
    >Providenza & Boekelheide, Inc.
    >
    >
    >---
    >Questions? First check the Kernel Driver FAQ at
    >http://www.osronline.com/article.cfm?id=256
    >
    >To unsubscribe, visit the List Server section of OSR Online at
    >http://www.osronline.com/page.cfm?name=ListServer

    _________________________________________________________________
    Spice up your IM conversations. New, colorful and animated emoticons. Get
    chatting! http://server1.msn.co.in/SP05/emoticons/
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Hi,

    if you're still clueless I think that David gave you good advice:
    ...
    Learn the difference between logical and physical drives.
    Also learn the requirements for your program so you can
    know which should be your target.

    Will you need to access the MBR which is physical, or the BS ?

    Else





    "nayan kumar"

    om> cc:
    Sent by: Subject: Re: [ntdev] beginner for finding boot sector info (Unsigned Mail)
    bounce-270048-16691@li
    sts.osr.com


    11/15/2006 05:13 PM
    Please respond to
    "Windows System
    Software Devs Interest
    List"





    Hi Tim,

    yes you got my point i exactly have to perform similiar action
    through my driver.Time is not constraint for us.although i google about
    this
    topic i got several tutorial and useful stuff regarding this but still a
    kid
    infront of you great people.as far as working on driver is concern i am
    absolutly beginner so far i finished one filter driver for pci device and
    absolutly blank paper for this file system driver .even though at this
    stage
    after reading some stuff about this i got some idea about this but still
    clueless about from where to start and how to proceed.if its possible for
    you to guide me for this work i will be very thankfull to you .

    Regards
    Nayan

    >From: Tim Roberts
    >Reply-To: "Windows System Software Devs Interest List"
    >
    >To: "Windows System Software Devs Interest List"
    >Subject: Re: [ntdev] beginner for finding boot sector info
    >Date: Tue, 14 Nov 2006 10:05:14 -0800
    >
    >nayan kumar wrote:
    > >
    > > Hi Tim,
    > > Thanks for your response.i have been assigned a work to read
    > > the boot sector information for fetching the MBR and partition table
    > > info and the result that i will get after doing some calculation on
    > > the data of some field that i will get after reading the MBR and
    > > partition table structure i will have to calculate the offset or find
    > > the address of the input file for reading the contents of that file of
    > > particular storage device like sd card,hard disk etc.
    >
    >This takes way more than reading the boot sector! The boot sector can
    >tell you where a partition begins. After that, you have to find out
    >what type of file system it is. After THAT, you have to understand the
    >table formats for the file systems you might encounter, first to find
    >the root directory, then to parse the root directory to find the folder
    >you need, then to find the table of sectors to know where your file
    >actually lives. This is a very complicated project.
    >
    >Google is much faster than this mailing list, especially for reference
    >information like this. I Googled for "format mbr partition table" and
    >got 362,000 hits, including a very good Wikipedia article.
    >
    >Why can't you just mount your disk normally and use the standard
    >operating system services to access your file? That's what they are
    >there for.
    >
    >(This post gave me quite a feeling of deja vu; we had essentially the
    >exact same question come up on the libusb mailing list a few weeks ago.)
    >
    >--
    >Tim Roberts, [email protected]
    >Providenza & Boekelheide, Inc.
    >
    >
    >---
    >Questions? First check the Kernel Driver FAQ at
    >http://www.osronline.com/article.cfm?id=256
    >
    >To unsubscribe, visit the List Server section of OSR Online at
    >http://www.osronline.com/page.cfm?name=ListServer

    _________________________________________________________________
    Spice up your IM conversations. New, colorful and animated emoticons. Get
    chatting! http://server1.msn.co.in/SP05/emoticons/


    ---
    Questions? First check the Kernel Driver FAQ at
    http://www.osronline.com/article.cfm?id=256

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Nayan,

    As we have said on this forum many, many times, "What is the real problem
    you are trying to solve?"

    What you are describing by insisting that you are going to start from the
    MBR and eventually read a file is implementing a read-only version of
    every known file system. Do you think that's a reachable solution to your
    real problem?

    Again, what is the problem that you are really trying to solve? It may be
    that someone here has a simple solution to *that* problem, but you need to
    state that problem in order to find out if a simple solution is available.

    Phil

    Philip D. Barila
    Seagate Technology LLC
    (720) 684-1842


    From: [email protected]
    [mailto:[email protected]] On Behalf Of "nayan kumar"

    Sent: Wednesday, November 15, 2006 9:14 AM
    To: "Windows System Software Devs Interest List"
    Subject: Re: [ntdev] beginner for finding boot sector info

    Hi Tim,

    yes you got my point i exactly have to perform similiar action
    through my driver.Time is not constraint for us.although i google about
    this
    topic i got several tutorial and useful stuff regarding this but still a
    kid
    infront of you great people.as far as working on driver is concern i am
    absolutly beginner so far i finished one filter driver for pci device and
    absolutly blank paper for this file system driver .even though at this
    stage
    after reading some stuff about this i got some idea about this but still
    clueless about from where to start and how to proceed.if its possible for
    you to guide me for this work i will be very thankfull to you .

    Regards
    Nayan
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,832
    nayan kumar wrote:
    >
    > yes you got my point i exactly have to perform similiar action
    > through my driver.Time is not constraint for us.although i google
    > about this topic i got several tutorial and useful stuff regarding
    > this but still a kid infront of you great people.as far as working on
    > driver is concern i am absolutly beginner so far i finished one filter
    > driver for pci device and absolutly blank paper for this file system
    > driver .

    Wait a minute. Why do you think you need a file system driver? That's
    not the task you described.

    I'll echo the other two responses this morning: what are you REALLY
    trying to do? "Reading the MBR" is not a task. It is one minor step on
    the way to some larger goal. "Reading a file from disk" is also not a
    task, you can do that today without writing any driver code at all.
    What is the long-term goal?

    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Software Wizard Emeritus

  • nayan_Kumarnayan_Kumar Member Posts: 98
    Hi Tim Philip kluger
    i apologize if i made you confuse.what ever method
    i mention in my previous post that was my view to acomplish that assigned
    task. as i told you i am unware about this, my view may be wrong.

    the task that i have to acomplish is as follows.

    After intializing the SD Memory card if i will send CMD 17 with Arg 0 then i
    will get the data block of 512 byte .This 512 byte of data will contain the
    information such as

    Bytes Per Sector 11 2
    Sectors Per Cluster 13 1
    Reserved Sectors 14 2
    FATs 16 1
    Root Entries 17 2
    Small Sectors 19 2
    Media Descriptor 21 1
    Sectors Per FAT 22 2
    Sectors Per Track 24 2
    Heads 26 2
    Hidden Sectors 28 4
    Large Sectors 32 4

    some field of BPB. after this i will get either name of the file as a input
    or address of any data as a result of communication with SD memory card
    .Based on input either that address or file name i will have to jump at that
    particular address and read the data from that address.

    this is the task that i have to complete if you can guide me what i should
    do to acomplish this and how i should proceed it would be great help.

    Thanks to all of you for your response

    Nayan

    _________________________________________________________________
    Headache during sex? Ask Dr. Prakash & Rachna
    http://content.msn.co.in/Lifestyle/AskExpert/Default03.htm
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,832
    nayan kumar wrote:
    > Hi Tim Philip kluger
    > i apologize if i made you confuse.what ever
    > method i mention in my previous post that was my view to acomplish
    > that assigned task. as i told you i am unware about this, my view may
    > be wrong.
    >
    > the task that i have to acomplish is as follows.
    >
    > After intializing the SD Memory card if i will send CMD 17 with Arg 0
    > then i will get the data block of 512 byte .This 512 byte of data will
    > contain the information such as
    >
    > Bytes Per Sector 11 2
    > Sectors Per Cluster 13 1
    > Reserved Sectors 14 2
    > FATs 16 1
    > Root Entries 17 2
    > Small Sectors 19 2
    > Media Descriptor 21 1
    > Sectors Per FAT 22 2
    > Sectors Per Track 24 2
    > Heads 26 2
    > Hidden Sectors 28 4
    > Large Sectors 32 4

    Much of that information will only be present if the memory card is
    formatted with a FAT file system. Not all of them are.


    > some field of BPB. after this i will get either name of the file as a
    > input or address of any data as a result of communication with SD
    > memory card .Based on input either that address or file name i will
    > have to jump at that particular address and read the data from that
    > address.
    >
    > this is the task that i have to complete if you can guide me what i
    > should do to acomplish this and how i should proceed it would be great
    > help.

    Sure. To accomplish this task, you should forget completely about
    writing a driver, and instead let the standard operating system drivers
    mount the card and assign a drive letter. Then, use the standard
    operating system features to find your file. That's what those drivers
    are THERE for.

    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Software Wizard Emeritus

  • nayan_Kumarnayan_Kumar Member Posts: 98
    Hi Tim,
    Thanks a lot for your help.

    Regards
    Nayan

    >From: Tim Roberts <[email protected]>
    >Reply-To: "Windows System Software Devs Interest List"
    ><[email protected]>
    >To: "Windows System Software Devs Interest List" <[email protected]>
    >Subject: Re: [ntdev] beginner for finding boot sector info
    >Date: Thu, 16 Nov 2006 12:09:16 -0800
    >
    >nayan kumar wrote:
    > > Hi Tim Philip kluger
    > > i apologize if i made you confuse.what ever
    > > method i mention in my previous post that was my view to acomplish
    > > that assigned task. as i told you i am unware about this, my view may
    > > be wrong.
    > >
    > > the task that i have to acomplish is as follows.
    > >
    > > After intializing the SD Memory card if i will send CMD 17 with Arg 0
    > > then i will get the data block of 512 byte .This 512 byte of data will
    > > contain the information such as
    > >
    > > Bytes Per Sector 11 2
    > > Sectors Per Cluster 13 1
    > > Reserved Sectors 14 2
    > > FATs 16 1
    > > Root Entries 17 2
    > > Small Sectors 19 2
    > > Media Descriptor 21 1
    > > Sectors Per FAT 22 2
    > > Sectors Per Track 24 2
    > > Heads 26 2
    > > Hidden Sectors 28 4
    > > Large Sectors 32 4
    >
    >Much of that information will only be present if the memory card is
    >formatted with a FAT file system. Not all of them are.
    >
    >
    > > some field of BPB. after this i will get either name of the file as a
    > > input or address of any data as a result of communication with SD
    > > memory card .Based on input either that address or file name i will
    > > have to jump at that particular address and read the data from that
    > > address.
    > >
    > > this is the task that i have to complete if you can guide me what i
    > > should do to acomplish this and how i should proceed it would be great
    > > help.
    >
    >Sure. To accomplish this task, you should forget completely about
    >writing a driver, and instead let the standard operating system drivers
    >mount the card and assign a drive letter. Then, use the standard
    >operating system features to find your file. That's what those drivers
    >are THERE for.
    >
    >--
    >Tim Roberts, [email protected]
    >Providenza & Boekelheide, Inc.
    >
    >
    >---
    >Questions? First check the Kernel Driver FAQ at
    >http://www.osronline.com/article.cfm?id=256
    >
    >To unsubscribe, visit the List Server section of OSR Online at
    >http://www.osronline.com/page.cfm?name=ListServer

    _________________________________________________________________
    Connect with your friends who use Yahoo! Messenger with Voice. Click!
    http://www.msnspecials.in/wlmyahoo/index.asp
  • vinayakvinayak Member Posts: 1

    i need to implement the SD FAT32 file system IP without the kernel involved
    Please provide any reference to implement that that has to support three commands
    1. Format
    2. write
    3. read

    Regards,
    Vinayak

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,832

    It's considered bad form here to resurrect old threads, and this one is 17 years old.

    If you had Googled "fat32 file system source code", you would have seen at least 3 references to repositories, and it would have been much faster than asking this group.

    Tim Roberts, [email protected]
    Software Wizard Emeritus

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online