if "%?_BOOT:~0,3%"=="(hd" map (hd0) (hd1) if "%?_BOOT:~0,3%"=="(hd" map (hd1) (hd0) if "%?_BOOT:~0,3%"=="(hd" map --hook rootnoverify (hd0) chainloader (hd0)+1Is it correct?
Yes. The usage is OK.
BTW, in my VM simulation, earlier piece of code works fine, too.
"works fine in some cases" != "works fine in all cases"
If the boot device is (fd0), then the root also defaults to (fd0). And in such a case, the boot command will set DL=00 (for floppy) and transfer control to the boot sector (hd0)+1. If the boot sector is of grldr.mbr, then there will be no problems(in most cases). Otherwise, you could encounter a failure.