On Sat, Mar 15, 2008 at 1:28 AM, Pavel Roskin <[EMAIL PROTECTED]> wrote: > On Fri, 2008-03-14 at 13:33 +0800, Bean wrote: > > > thanks a lot for your testing. if nobody objects, i would like to > > commit it soon. > > It would be great if you posted the ChangeLog entry and explained the > reason for the patch. I checked the thread, but I don't see it.
Sorry, forget about the log, here is it: 2008-03-15 Bean <[EMAIL PROTECTED]> * disk/i386/pc/biosdisk.c (cd_start): Removed. (cd_count): Removed. (grub_biosdisk_get_drive): Use (hdN) for both disk and cdrom. (grub_biosdisk_call_hook): Likewise. (grub_biosdisk_iterate): Detect cdrom device. (grub_biosdisk_open): Use grub_biosdisk_get_cdinfo_int13_extensions to detect cdrom. (GRUB_MOD_INIT): Don't scan cdrom device. * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_MACHINE_CDROM_START): Changed to 0x9f. (GRUB_BIOSDISK_CDTYPE_NO_EMUL): New macro. (GRUB_BIOSDISK_CDTYPE_1_2_M): Likewise. (GRUB_BIOSDISK_CDTYPE_1_44_M): Likewise. (GRUB_BIOSDISK_CDTYPE_2_88_M): Likewise. (GRUB_BIOSDISK_CDTYPE_HARDDISK): Likewise. (GRUB_BIOSDISK_CDTYPE_MASK): Likewise. (grub_biosdisk_cdrp): New structure. (grub_biosdisk_get_cdinfo_int13_extensions): New function. * include/grub/i386/pc/kernel.h (grub_boot_drive): Export this variable. * kern/i386/pc/init.c (make_install_device): Use (hdN) for both disk and cdrom. * kern/i386/pc/startup.S (grub_biosdisk_get_cdinfo_int13_extensions): New function. > Is it just going to affect access to the CD in the "no emulation" mode? > Or maybe you are trying to make CD-ROM accessible if booting from the > hard drive or another medium? Yes, it only have effect when booting from "no emulation" CD. In fact, most bios doesn't export int 13 function if you boot from hard drive. > What is the problem you are trying to solve? And what's wrong with the > (cd0) name? I think it's more descriptive, and I don't care much if > some other device like LS-120 is going to get such name. > it's just that we need to map bios drive number to device name in init.c, and create the device in biosdisk.c. In init.c, we can only use heuristic to decide whether or not the boot device is cdrom. while in biosdisk.c, the detection is more accurate, and it's not necessary the same as init.c. If we force them to be the same, some cdrom drive would appear as (cd0), some would be (hdN), the result is inconsistent. > As for passing the boot driver data to multiboot kernels, I don't think > it's useful to pass data about emulated drives. Besides, it should be > easy to keep the BIOS number in memory for every drive, even if it's > called (cd0). > Actually, many cdboot loaders need to know about the bios drive number of emulation cdrom. such as isolinux, setupldr.bin, etc. grub2 may support these loaders one day. in such situation, the easiest way to pass it around is to code it in the device name. if we keep it in biosdisk, then those loaders would need to depend on biosdisk explicitly. Also, the name (cd0) is a little misleading, even if there is more than one cdrom, bios would only export the boot one. so there won't be a (cd1). > Compare how Linux is changing from naming CD-ROMs by the bus location > (/dev/hdc, /dev/hdd) to naming by functionality with sequential numbers > (/dev/scd0, /dev/scd1). Things like bus location should be transparent > to the user. > > Better yet, all partitions should be identified by a unique ID, which is > what serious distros should be doing. Still, (cd0) is more reliable and > descriptive than (hd96) for casual use. > When booting from cdrom, the root would be set properly, so users may never need to know about the name of root device. It's only relevant when they enter the commands manually. -- Bean _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel