On Mon, 2004-03-29 at 15:10, fl...@bg... wrote:
> > What we really want to know is how Windows determines the geometry?
> > Anyone know?
>
> see http://www.kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.5-rc1
> search for "Get Legacy Parameters"
Interesting. But that doesn't really help because we also need some way
of telling which device we are looking at. I.e. say the user is working
with /dev/hdb3. But in sysfs we have for example
firmware/edd/int13_dev80 and presumably int13_dev81, etc? Not sure how
it goes with more than one disk...
How do we tell whether /dev/hdb3 belongs to int13_dev80 or int13_dev81
or ...?
Looking at this a bit more, it is I guess possible to find that out by
looking inside int13_dev80/pci_dev/ide0/0.0/block/. Somewhat convoluted
but I guess it would work reasonably well as long as the strings don't
change too much across kernel versions, etc...
Best regards,
Anton
> here is a snapshot (hopefully it will be formatted ok
> ----------------------------------------------------
> <ak...@os...>
> [PATCH] EDD: Get Legacy Parameters
>
> From: Matt Domsch <Mat...@de...>
>
> Patch below from Patrick J. LoPresti and myself. Patrick describes:
>
> Why this patch? The problem is that the legacy BIOS interface
> (INT13/AH=3D08) for querying the disk geometry returns different values
> than the extended INT13 interface which the EDD code currently uses. This
> is because the legacy interface only provides a 10-bit cylinder field, so
> modern BIOSes "lie" about the head/sector counts in order to make more of
> the disk visible within the first 1024 cylinders.
>
> Many non-Linux applications, including the stock Windows boot loader, DOS
> fdisk, etc., rely upon the legacy interface and geometry. So it is useful
> to be able to obtain the legacy values from a running Linux kernel.
>
> What this patch does is to add new entries under
> /sys/firmware/edd/int13_devXX named "legacy_cylinders", "legacy_heads", and
> "legacy_sectors". These provide the geometry given by the legacy
> INT13/AH=3D08 BIOS interface, just like the current "default_cylinders"
> etc. provide the the geometry given by the INT13/AH=3D48 interface.
>
> Without this patch, I cannot use Linux to partition a drive and install
> Windows, which happens to be my application.
>
> - Pat
> http://unattended.sourceforge.net/
>
> In addition, this adds two buggy BIOS workarounds in the EDD int13
> calls as suggested by Ralf Brown's interrupt list.
>
> I'm also interested in moving this code out of arch/i386/kernel/edd.c and
> include/asm-i386/edd.h, as I believe it is applicable on x86-64 as well.
> However, there's no good place under drivers/ to put edd.c when it's not
> tied to a bus, but to several CPU architectures and their firmwares...
> Maybe a new directory drivers/firmware?
> -------------------------------------------------------
> especially notice:
> "Many non-Linux applications, including the stock Windows boot loader, DOS fdisk, etc., rely upon the legacy interface and geometry. So it is useful"
>
> also notice the header: "changes ... to v2.6.5-rc1"
>
> a detailed explenation (the diff file) is found at:
> http://www.zytor.com/pipermail/syslinux/2004-February/003269.html
>
> have a nice day.
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ &
http://www-stu.christs.cam.ac.uk/~aia21/
|