From: "Richard B. Johnson" <root@chaos.analogic.com>
To: "Thomas S. Iversen" <zensonic@zensonic.dk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to do IO across hardsector boundries
Date: Sun, 1 Aug 2004 09:10:23 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.53.0408010903020.16215@chaos> (raw)
In-Reply-To: <410C37B7.3010504@zensonic.dk>
On Sun, 1 Aug 2004, Thomas S. Iversen wrote:
> Hi There
>
> As part of an assignment I am trying to port a piece of software from
> FreeBSD to linux. Essentially this software (crypto) makes a virtual
> blockdevice with "virtual" sectors on top. Under FreeBSD these virtual
> sectors are just read/written using a simple command:
>
> buf=g_read(dev, offset, len)
> error=g_write(dev,offset,buf,len)
>
> In linux however I have only seen the BIO layer which operates on IO on
> hardsector boundaries.
>
> So my question really is, how do I go about updating for instance the
> 512 bytes located for at byte 64 to 64+511 on the actual media without
> getting in trouble regarding the data from offset 0-63 and 64+512->1023?
>
> Regards Thomas
There are no hard-sector boundaries in Linux. The geometry of a drive
is really ignored. It's just used to determine the size of a disk
partition, etc. The stated Heads/cylinders/sectors is a throw-back
to the old int 0x13, DOS days where stuff had to fit into registers
for access.
If your driver expects to write physical sectors, it's broken.
Even physical sectors (on the media) don't really exist anymore.
They are now "logical" sectors and they are never really accessed
as a single unit (except in floppies). They are "extracted" from a
sector-buffer that could contain nearly a whole track.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
Note 96.31% of all statistics are fiction.
prev parent reply other threads:[~2004-08-01 13:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-01 0:22 Thomas S. Iversen
2004-07-31 23:32 ` Alan Cox
2004-08-01 8:53 ` Arjan van de Ven
2004-08-01 13:10 ` Richard B. Johnson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.53.0408010903020.16215@chaos \
--to=root@chaos.analogic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zensonic@zensonic.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®