----- Original Message ----- 
From: "adrian15" <[EMAIL PROTECTED]>
To: "sburtchin" <[EMAIL PROTECTED]>
Sent: Saturday, December 23, 2006 10:03 AM
Subject: Re: "partnew" Command Writes Wrong Ending Cylinder in MPT


> sburtchin escribió:
>
> > I would like to propose the following code change to allow blanking of a
> > partition table entry
> > with a command like "partnew (hd0,3) 0x00 0 0".  New/Changed code is in
> > bold.
> >
> >    /* Convert a LBA address to a CHS address in the INT 13 format.  */
> >    auto void lba_to_chs (int lba, int *cl, int *ch, int *dh);
> >    void lba_to_chs (int lba, int *cl, int *ch, int *dh)
> >      {
> >        int cylinder, head, sector;
> >
> >        if (lba <= 0)
> >        {
> >          *cl = 0;
> >          *ch = 0;
> >          *dh = 0;
> >         }
> >         else
> >         {
> >          sector = lba % buf_geom.sectors + 1;
> >          head = (lba / buf_geom.sectors) % buf_geom.heads;
> >          cylinder = lba / (buf_geom.sectors * buf_geom.heads);
> >
> >          if (cylinder >= buf_geom.cylinders)
> >           cylinder = buf_geom.cylinders - 1;
> >
> >          *cl = sector | ((cylinder & 0x300) >> 2);
> >          *ch = cylinder & 0xFF;
> >          *dh = head;
> >        }
> >      }
>
> Hi sburtchin,
>
> Sorry about the late answer I've been very busy with Super Grub Disk and
> university lately.
>
> Currently grub legacy source code is frozen. Developers only work on
> grub2 which promises to be smarter and better than grub legacy.
>
> I am however working on a kind of grub legacy fork named Super Grub Disk.
>
> You have proposed us a source code change. Have you tried it yourself or
> were not you able to build a grub floppy or cdrom with the changes?
>
> I can build a SGD cdrom with the changes if you want to and you can try
> yourself to see if it works ok or not.
>
> About the bug do you think that if we write:
>
>        if (cylinder >= buf_geom.cylinders)
>          cylinder = buf_geom.cylinders - 1;
>
> like this:
> // cylinders correction
> buf_geom.cylinders+=2;
> if (cylinder >= buf_geom.cylinders)
>          cylinder = buf_geom.cylinders - 1;
>
> we will fix the bug?
>
>
>
>
>
> adrian15



_______________________________________________
Bug-grub mailing list
Bug-grub@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-grub

Reply via email to