From: Marius Vollmer <[EMAIL PROTECTED]>
Subject: BUGFIX (sort of): Accessing the CD-ROM
Date: 15 Aug 2000 02:05:08 +0200
> After some investigation, I came up with the following patch to GNU
> Mach that solves this problem for me:
What "solves" means? Don't you just get "Invalid argument" any
longer, or "cat" succeeds?
> Index: block.c
> ===================================================================
> RCS file: /cvs/gnumach/linux/dev/glue/block.c,v
> retrieving revision 1.3
> diff -u -r1.3 block.c
> --- block.c 1999/06/27 23:51:47 1.3
> +++ block.c 2000/08/15 00:02:54
> @@ -1597,7 +1597,17 @@
> case DEV_GET_SIZE:
> if (disk_major (MAJOR (bd->dev)))
> {
> + unsigned real_minor;
> +
> assert (bd->ds->gd);
> +
> + real_minor = MINOR (bd->dev) >> bd->ds->gd->minor_shift;
> + if ((real_minor << bd->ds->gd->minor_shift) != MINOR (bd->dev))
> + real_minor = MINOR (bd->dev);
> +
> + printf ("dev %x, minor_shift %d, minor %d, real_minor %d\n",
> + bd->dev, bd->ds->gd->minor_shift,
> + MINOR(bd->dev), real_minor);
>
> if (bd->part >= 0)
> {
> @@ -1611,7 +1621,7 @@
> }
> else
> (status[DEV_GET_SIZE_DEVICE_SIZE]
> - = bd->ds->gd->part[MINOR (bd->dev)].nr_sects << 9);
> + = bd->ds->gd->part[real_minor].nr_sects << 9);
> }
> else
> {
??? As far as I see, your patch does nothing. REAL_MINOR always
equals to MINOR (BD->DEV). What was the motivation that you introduced
this code?
> accessed bd->ds->gd->part[64], and that I needed to shift the minor
> number to get to the right index, which is 1. However, shifting
> always made the system fail in other ways, when calling
> device_get_status for a dev number of 0x301, which apparantly refers
> to my root partition hd0s1.
Please be more specific. What really happens? "fail" has too many
meanings. You can use the same word, when gnumach panics, when a
translator died, when gnumach hangs, or others.
BTW, when Hurd accesses to the CD-ROM drive, what values are stored
in BD->DEV and BD->DS->GD->PART[0]? I suspect that VMware just doesn't
provide the correct capacity of a CD-ROM.
Okuji