> Hi! I've been meaning to ask these questions concerning GRUB2 and > drivemappings for a while. > > It's my understanding that the BIOS (and maybe EFI does this too?) scans for > hard drives and makes a drivemapping for each in memory. > > When one gets to the Grub command line and runs "ls", those things it lists > (like (hd0), (hd0,msdos1), (hd1), (hd1,gpt1), etc.), are those the > drivemappings? Or are only the "drive only" ones drivemappings (ones for the > whole drive, no partition specified)? > > If the BIOS (or EFI?) doesn't detect a hard drive or for some reason doesn't > make a drivemapping for it, can Grub detect the hard drive, period? If it > can, can it step in and make the drivemapping? > > As I was beginning to touch on earlier, are drivemappings typically made for > each partition, or only for whole drives? Does the BIOS make drivemappings > for every partition, provided it knows the partitioning scheme used? > > I know that Grub has a part_msdos module and a part_gpt module. This leads me > to believe Grub is detecting partitions itself, thus drivemappings given by > the BIOS are whole-disk only? Does Grub go in and make a drivemapping for > each partition once it detects them, or does it just know for itself where > they are? > > I know that Grub4DOS allows the user to actually create new drivemappings. > For example, you could give a partition its own "whole disk" drivemapping, > such as "(hd32)". You can even give an iso (optical disc image file) its own > "whole-disk" drivemapping, like "(hd32)" or something. The image must be > continuous on the disk, of course. These custom drivemappings can then be > chainloaded. > > Does Grub2 allow for custom drivemapping creation? > > I'm thinking about FreeDOS. I can make a partition on a GPT schemed disk, and > this one partition be like an entire MBR schemed hard drive. What's > interesting is that the GPT specification actually includes such a stunt with > the partition type code EF01. That's right. An EF01 partition in a GPT > schemed hard drive is like an entire MBR schemed hard drive. It's kind of > like GPT's version of an extended partition, in that you have partitions > within a partition. > > If I installed FreeDOS to a hard drive image, and blew this whole image onto > just a partition within a GPT scheme, could I give this one partition its own > "whole disk" drivemapping, like "(hd32)" or something, and chainload it as a > whole disk? > > I know I could just chainload the partition without giving it a whole disk > drivemapping, but DOS needs to have that drivemapping in memory to read and > write to its "hard drive", which is really only a partition. It's not > GPT-aware, but it could see and use the MBR-schemed partition as a whole, > separate hard drive if the partition has it's own whole disk drivemapping. > > If the BIOS makes drivemappings for each partition, then I would also need to > make drivemappings for each partition in the EF01 partition for DOS to work > out of it, because that'd be what DOS expects. If not, then just the whole > disk mapping for the partition would be good, because DOS wouldn't have been > made dependant on something that usually doesn't exist, that something being > drivemappings for each partition. (I.e., would I need to then make something > like "(hd32,msdos1)"?) If DOS expects each partition within the hard drive to > have a drivemapping, I would need to make drivemappings for each partition > within the EF01 partition, whereas if DOS parsed the partition table for > itself or had some interrupt handle partitions in a non-drivemapping fashion, > or something like that, I wouldn't need to have drivemappings for each > sub-EF01 partition, and just the drivemapping for the whole EF01 partition as > a whole disk would suffice. > > Also, how is GRUB's freedos command used? > > I know it's easy to boot a floppy image with DOS on it using memdisk, but > it'd be nice to have DOS on an actual partition, for several reasons. One, > saving stuff back to disk from within DOS. With memdisk, everything is done > to a copy of the image in RAM, and then lost on shutdown. Two, if it was on > its own partition, I could put stuff on and take stuff off DOS's partition, > from another OS, without having to mount an image. Also, if there's a bunch > of stuff I want to use with DOS, I could avoid having all that RAM used up > (with memdisk, all those tools would have to be in an image and copied to > RAM). > > Cheers, > Jake
_______________________________________________ Help-grub mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-grub
