Re: linux-2.4.0 breaks grub install into partition

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Tue Jul 11 2000 - 10:42:00 EST


On Tue, 11 Jul 2000, Horst von Brand wrote:

> Olivier Galibert <galibert@pobox.com> said:
> > On Mon, Jul 10, 2000 at 05:42:25PM -0700, H. Peter Anvin wrote:
> > > Yes, for a good reason: performance.
>
> > Performance of what? I'm not asking for a cache flush, I'm just
> > asking for write(/dev/hda1) being identical (would it be working or
> > non-working) to write(/dev/hda+appropriate sector offset). Nothing
> > more, nothing less. This has nothing to do with whether there is a
> > mounted filesystem in the given partition. It is only the presence of
> > the mounted filesystem shows the difference.
>
> This means the mounted filesystem has to have mechanisms to check if
> something has been changed beneath it, the block device drivers have to
> agree on using the same buffer cache (or keeping them in sync), etc. Bloat
> and performance loss for something that is done once in a blue moon (you
> aren't installing new kernels several times per second, are you?). In this
> case, making life a bit more difficult for writers of bootloaders for the
> sake of making the rest go fast is entirely justified.
> --

I think it's a bug. It's been in the floppy disk code for a long time
and I guess it's now been moved to the hard disks.

If I want to copy the contents of /dev/fd0 to a file, the first 512
bytes (boot loader) will not be what was on that floppy. I had to
make a work-around tool so that I could obtain the exact physical image
of the floppy.

This bug was reported last January. It was declared to be a feature
so I had to make a work-around.

/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
/*
 * File resetfd.c Created 13-JAN-2000 Richard B. Johnson
 *
 * This resets the floppy so we can get a correct image of the floppy
 * contents. This is a work-around for a bug in recent kernels. What
 * was written to the first 512 bytes (the boot loader) was not
 * synchronized with what is cached in RAM. This synchronizes it.
 */

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <ioctls.h>
#include <fcntl.h>
#include <linux/fd.h>
int main(int args, char *argv[]);

int main(int args, char *argv[])
{
    int fd;
    if(args < 2)
    {
        fprintf(stderr, "Usage:\n%s <device>\n", argv[0]);
        exit(EXIT_FAILURE);
    }
    if((fd = open(argv[1], O_RDWR)) < 0)
    {
        fprintf(stderr, "Can't open %s\n", argv[1]);
        exit(EXIT_FAILURE);
    }
    if(ioctl(fd, FDFLUSH, NULL) < 0)
    {
        fprintf(stderr, "Bad ioctl(FDFLUSH)\n");
        exit(EXIT_FAILURE);
    }
    (void)close(fd);
    return 0;
}
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/

Cheers,
Dick Johnson

Penguin : Linux version 2.2.15 on an i686 machine (797.90 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:13 EST