read IDE HD physical 0 sector

Hi,

I want to know how to read IDE HD physical 0 sector. Any pointers, URL ,
suggestions are welcome.

Note: I donot want to read logical sector.

Thanks,
rdh

Why?


The personal opinion of
Gary G. Little

“EZdev” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I want to know how to read IDE HD physical 0 sector. Any pointers, URL ,
> suggestions are welcome.
>
> Note: I donot want to read logical sector.
>
> Thanks,
> rdh
>
>
>

Lots of info on that. Here’s how to find info on pretty much any topic you
might like to ask about here.

Google groups:
comp.os.ms-windows.programmer.nt.kernel-mode
microsoft.public.development.device.drivers
microsoft.public.win32.programmer.kernel

Search this list on OsrOnline.

AFTER you have exhausted the information available in those locations,
please ask any specific questions about specific issues you don’t
understand here.

Phil

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

“EZdev”
m> To
Sent by: “Windows System Software Devs
bounce-210920-643 Interest List”
xxxxx@lists.osr.com
No Phone Info cc
Available
Subject
[ntdev] read IDE HD physical 0
06/03/2005 07:46 sector
AM

Please respond to
“Windows System
Software Devs
Interest List”
com>

Hi,

I want to know how to read IDE HD physical 0 sector. Any pointers, URL ,
suggestions are welcome.

Note: I donot want to read logical sector.

Thanks,
rdh


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

You are currently subscribed to ntdev as: xxxxx@seagate.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Plain and simple, you can’t.

Physical sector 0 may or may not be logical block 0. Hard drives are not
required to map LBA 0 to always be physical sector 0. (In fact, LBA 0
could be at the very end of the drive if a sector has been remapped
because of an error)

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of EZdev
Sent: Friday, June 03, 2005 6:46 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] read IDE HD physical 0 sector

Hi,

I want to know how to read IDE HD physical 0 sector. Any pointers, URL ,

suggestions are welcome.

Note: I donot want to read logical sector.

Thanks,
rdh


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

You are currently subscribed to ntdev as: xxxxx@nvidia.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

EZdev wrote:

I want to know how to read IDE HD physical 0 sector. Any pointers, URL ,
suggestions are welcome.

Note: I donot want to read logical sector.

What are you really trying to do? This is a perfect example of the
wrong way to ask a question. You have a problem, and you think you can
solve the problem by using some specific solution, so you ask how to
implement the solution, instead of asking how to solve the original problem.

If you want to read the drive’s MBR, you can do that with
\.\PhysicalDrive0.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

CreateFile \.\PhysicalDrive0

ReadFile of 512 bytes

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “EZdev”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Friday, June 03, 2005 5:46 PM
Subject: [ntdev] read IDE HD physical 0 sector

> Hi,
>
> I want to know how to read IDE HD physical 0 sector. Any pointers, URL ,
> suggestions are welcome.
>
> Note: I donot want to read logical sector.
>
> Thanks,
> rdh
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

How about writing hardware-level diagnostics ? With all due
respect, if we’re going to freak out every time someone asks a
how-to question at hardware level, hey…

Alberto.

----- Original Message -----
From: “Tim Roberts”
To: “Windows System Software Devs Interest List”

Sent: Friday, June 03, 2005 2:14 PM
Subject: Re: [ntdev] read IDE HD physical 0 sector

> EZdev wrote:
>
>>I want to know how to read IDE HD physical 0 sector. Any
>>pointers, URL , suggestions are welcome.
>>
>>Note: I donot want to read logical sector.
>>
>
> What are you really trying to do? This is a perfect example
> of the wrong way to ask a question. You have a problem, and
> you think you can solve the problem by using some specific
> solution, so you ask how to implement the solution, instead of
> asking how to solve the original problem.
>
> If you want to read the drive’s MBR, you can do that with
> \.\PhysicalDrive0.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@ieee.org
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com

Given that ‘physical sector 0’ on current disks is essentially a meaningless
concept, the ‘what are you really trying to do’ response was not a ‘freak
out’ it was an attempt to understand what problem the poster is trying to
solve that has resulted in his posting a silly question.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alberto Moreira
Sent: Saturday, June 04, 2005 9:10 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] read IDE HD physical 0 sector

How about writing hardware-level diagnostics ? With all due
respect, if we’re going to freak out every time someone asks
a how-to question at hardware level, hey…

Alberto.

----- Original Message -----
From: “Tim Roberts”
> To: “Windows System Software Devs Interest List”
>
> Sent: Friday, June 03, 2005 2:14 PM
> Subject: Re: [ntdev] read IDE HD physical 0 sector
>
>
> > EZdev wrote:
> >
> >>I want to know how to read IDE HD physical 0 sector. Any
> >>pointers, URL , suggestions are welcome.
> >>
> >>Note: I donot want to read logical sector.
> >>
> >
> > What are you really trying to do? This is a perfect example
> > of the wrong way to ask a question. You have a problem, and
> > you think you can solve the problem by using some specific
> > solution, so you ask how to implement the solution, instead of
> > asking how to solve the original problem.
> >
> > If you want to read the drive’s MBR, you can do that with
> > \.\PhysicalDrive0.
> >
> > –
> > Tim Roberts, xxxxx@probo.com
> > Providenza & Boekelheide, Inc.
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@ieee.org
> > To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

It may or may not be a meaningless concept, depending on where
one sits in the feeding chain. The eye-to-eye response isn’t
“what you’re trying to do”, but exactly what you just wrote to
me now: “dude, there’s translation going on inside the disk
subsystem itself, so, you may not be able to reach that sector.”
Yet I can look at the drive and say, well, whatever the driver
gives me when I throw “physical sector 0” at it, or whatever the
addressing mechanism requires (h-t-s, whatever), that’s “sector
0” to me - and how do I get there without having the OS putting
in yet another layer of translation ?

In other words, my question is, what if I want to access the
hardware subsystem directly and not have the OS do anything but
transmit the request and give me the answer ?

In fact, the question “what you’re trying to do” must only come
after serious and to-the-point justification, in technical and
professional terms, of why the question is coming. Humility,
guy, that’s the key to meaningful professional interaction.

You know, I might have asked the very same question, and it
wouldn’t have been one bit silly. So, again: humility is the
word. If you want a confirmation, look at Max’s answer, direct
and to the point: an honest one. Maybe that’s not what the OP
wants or needs, but hey, better than nothing.

Alberto.

----- Original Message -----
From: “Mark Roddy”
To: “Windows System Software Devs Interest List”

Sent: Saturday, June 04, 2005 9:36 AM
Subject: RE: [ntdev] read IDE HD physical 0 sector

> Given that ‘physical sector 0’ on current disks is essentially
> a meaningless
> concept, the ‘what are you really trying to do’ response was
> not a ‘freak
> out’ it was an attempt to understand what problem the poster
> is trying to
> solve that has resulted in his posting a silly question.
>
> =====================
> Mark Roddy DDK MVP
> Windows 2003/XP/2000 Consulting
> Hollis Technology Solutions 603-321-1032
> www.hollistech.com
>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of
>> Alberto Moreira
>> Sent: Saturday, June 04, 2005 9:10 AM
>> To: Windows System Software Devs Interest List
>> Subject: Re: [ntdev] read IDE HD physical 0 sector
>>
>> How about writing hardware-level diagnostics ? With all due
>> respect, if we’re going to freak out every time someone asks
>> a how-to question at hardware level, hey…
>>
>> Alberto.
>>
>>
>> ----- Original Message -----
>> From: “Tim Roberts”
>> To: “Windows System Software Devs Interest List”
>>
>> Sent: Friday, June 03, 2005 2:14 PM
>> Subject: Re: [ntdev] read IDE HD physical 0 sector
>>
>>
>> > EZdev wrote:
>> >
>> >>I want to know how to read IDE HD physical 0 sector. Any
>> >>pointers, URL , suggestions are welcome.
>> >>
>> >>Note: I donot want to read logical sector.
>> >>
>> >
>> > What are you really trying to do? This is a perfect
>> > example
>> > of the wrong way to ask a question. You have a problem,
>> > and
>> > you think you can solve the problem by using some specific
>> > solution, so you ask how to implement the solution, instead
>> > of
>> > asking how to solve the original problem.
>> >
>> > If you want to read the drive’s MBR, you can do that with
>> > \.\PhysicalDrive0.
>> >
>> > –
>> > Tim Roberts, xxxxx@probo.com
>> > Providenza & Boekelheide, Inc.
>> >
>> >
>> > —
>> > Questions? First check the Kernel Driver FAQ at
>> > http://www.osronline.com/article.cfm?id=256
>> >
>> > You are currently subscribed to ntdev as: xxxxx@ieee.org
>> > To unsubscribe send a blank email to
>> > xxxxx@lists.osr.com
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as:
>> xxxxx@hollistech.com
>> To unsubscribe send a blank email to
>> xxxxx@lists.osr.com
>>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@ieee.org
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com

The poster explicitly stated he was not interested in LBA 0 - which is not
some OS induced translation, it is the disk firmware induced translation.
How to get at some ‘physical sector 0’ when the disk firmware both
translates and remaps as it sees fit remains an odd question.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alberto Moreira
Sent: Saturday, June 04, 2005 9:55 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] read IDE HD physical 0 sector

It may or may not be a meaningless concept, depending on
where one sits in the feeding chain. The eye-to-eye response
isn’t “what you’re trying to do”, but exactly what you just
wrote to me now: “dude, there’s translation going on inside
the disk subsystem itself, so, you may not be able to reach
that sector.”
Yet I can look at the drive and say, well, whatever the
driver gives me when I throw “physical sector 0” at it, or
whatever the addressing mechanism requires (h-t-s, whatever),
that’s “sector 0” to me - and how do I get there without
having the OS putting in yet another layer of translation ?

In other words, my question is, what if I want to access the
hardware subsystem directly and not have the OS do anything
but transmit the request and give me the answer ?

In fact, the question “what you’re trying to do” must only
come after serious and to-the-point justification, in
technical and professional terms, of why the question is
coming. Humility, guy, that’s the key to meaningful
professional interaction.

You know, I might have asked the very same question, and it
wouldn’t have been one bit silly. So, again: humility is the
word. If you want a confirmation, look at Max’s answer,
direct and to the point: an honest one. Maybe that’s not what
the OP wants or needs, but hey, better than nothing.

Alberto.

----- Original Message -----
From: “Mark Roddy”
> To: “Windows System Software Devs Interest List”
>
> Sent: Saturday, June 04, 2005 9:36 AM
> Subject: RE: [ntdev] read IDE HD physical 0 sector
>
>
> > Given that ‘physical sector 0’ on current disks is essentially
> > a meaningless
> > concept, the ‘what are you really trying to do’ response was
> > not a ‘freak
> > out’ it was an attempt to understand what problem the poster
> > is trying to
> > solve that has resulted in his posting a silly question.
> >
> > =====================
> > Mark Roddy DDK MVP
> > Windows 2003/XP/2000 Consulting
> > Hollis Technology Solutions 603-321-1032
> > www.hollistech.com
> >
> >> -----Original Message-----
> >> From: xxxxx@lists.osr.com
> >> [mailto:xxxxx@lists.osr.com] On Behalf Of
> >> Alberto Moreira
> >> Sent: Saturday, June 04, 2005 9:10 AM
> >> To: Windows System Software Devs Interest List
> >> Subject: Re: [ntdev] read IDE HD physical 0 sector
> >>
> >> How about writing hardware-level diagnostics ? With all due
> >> respect, if we’re going to freak out every time someone asks
> >> a how-to question at hardware level, hey…
> >>
> >> Alberto.
> >>
> >>
> >> ----- Original Message -----
> >> From: “Tim Roberts”
> >> To: “Windows System Software Devs Interest List”
> >>
> >> Sent: Friday, June 03, 2005 2:14 PM
> >> Subject: Re: [ntdev] read IDE HD physical 0 sector
> >>
> >>
> >> > EZdev wrote:
> >> >
> >> >>I want to know how to read IDE HD physical 0 sector. Any
> >> >>pointers, URL , suggestions are welcome.
> >> >>
> >> >>Note: I donot want to read logical sector.
> >> >>
> >> >
> >> > What are you really trying to do? This is a perfect
> >> > example
> >> > of the wrong way to ask a question. You have a problem,
> >> > and
> >> > you think you can solve the problem by using some specific
> >> > solution, so you ask how to implement the solution, instead
> >> > of
> >> > asking how to solve the original problem.
> >> >
> >> > If you want to read the drive’s MBR, you can do that with
> >> > \.\PhysicalDrive0.
> >> >
> >> > –
> >> > Tim Roberts, xxxxx@probo.com
> >> > Providenza & Boekelheide, Inc.
> >> >
> >> >
> >> > —
> >> > Questions? First check the Kernel Driver FAQ at
> >> > http://www.osronline.com/article.cfm?id=256
> >> >
> >> > You are currently subscribed to ntdev as: xxxxx@ieee.org
> >> > To unsubscribe send a blank email to
> >> > xxxxx@lists.osr.com
> >>
> >>
> >> —
> >> Questions? First check the Kernel Driver FAQ at
> >> http://www.osronline.com/article.cfm?id=256
> >>
> >> You are currently subscribed to ntdev as:
> >> xxxxx@hollistech.com
> >> To unsubscribe send a blank email to
> >> xxxxx@lists.osr.com
> >>
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@ieee.org
> > To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

> The poster explicitly stated he was not interested in LBA 0 - which is not

some OS induced translation, it is the disk firmware induced translation.
How to get at some ‘physical sector 0’ when the disk firmware both
translates and remaps as it sees fit remains an odd question.

Well, if one wants to get (meta)physical about this, where physical sector
zero is on most media is an accident of timing of when the format operation
started. The days when the disk had a physical position sensor to tell you
where the track gap should be are long gone.

On top of that, there are some relocation algorithms that don’t necessarily
mark a bad physical sector zero as bad and then store it in a spare
sector/track/cylinder somewhere else - they just rewrite the whole track and
play timing games to gap over the badspot on the disk. So physical sector
zero physically moves, as it were.

Magna-See™. That’s the answer!

Loren