bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "partnew" Command Writes Wrong Ending Cylinder in MPT


From: sburtchin
Subject: Re: "partnew" Command Writes Wrong Ending Cylinder in MPT
Date: Thu, 15 Feb 2007 19:16:21 -0800 (PST)

NOTE: Adding message of adrian15 Jan 21, 2007; 7:07am to Nabble thread.

Did you receive this email?

adrian15

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
-- 
View this message in context: 
http://www.nabble.com/%22partnew%22-Command-Writes-Wrong-Ending-Cylinder-in-MPT-tf2599372.html#a8998320
Sent from the Grub - Bugs mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]