Page 1 of 2

When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Sun Sep 09, 2012 12:08 am
by Explorer09
This bug happens only in UBCD 5.1.1 (and maybe 5.1.0)

How to produce:
1. Boot UBCD 5.1.1. An ISOLINUX menu should appear.
2. Select "GRUB4DOS menu".
3. On the GRUB4DOS menu, select "UBCD FreeDOS R1.44 (Based on NwDsk V3.40)"
4. Wait until FreeDOS is loaded.
5. See that the Ultimate Boot CD version number is missing. (Symptom #1)
6. Run Volkov Commander in UBCD FreeDOS, and change to drive "T:"
7. See the directory structure of drive T is:

Code: Select all

/boot
/pmagic
/ubcd
autorun.inf
In short, drive T is UBCD instead of FDUBCD. (Symptom #2)

Expected result:
1. The version number should show properly.
2. Drive T should be FDUBCD, and the contents of UBCD should not be accessible in UBCD FreeDOS.

Workaround:
Thank to the guide here (http://diddy.boot-land.net/grub4dos/files/map.htm#swap), I can workaround this problem by making FDUBCD the first CDROM rather than the second.

There are many entries in GRUB4DOS menu that boots FDUBCD. So you need to edit many files:
  • /ubcd/menus/grub4dos/bios.lst
  • /ubcd/menus/grub4dos/cpu.lst
  • /ubcd/menus/grub4dos/hdd/bootmgmt.lst
  • /ubcd/menus/grub4dos/hdd/cloning.lst
  • /ubcd/menus/grub4dos/hdd/devmgmt.lst
  • /ubcd/menus/grub4dos/hdd/diag.lst
  • /ubcd/menus/grub4dos/hdd/editing.lst
  • /ubcd/menus/grub4dos/hdd/partmgmt.lst
  • /ubcd/menus/grub4dos/hdd/wiping.lst
  • /ubcd/menus/grub4dos/main.lst
  • /ubcd/menus/grub4dos/memory.lst
  • /ubcd/menus/grub4dos/others.lst
  • /ubcd/menus/grub4dos/periph.lst
  • /ubcd/menus/grub4dos/system.lst
For each file, search for pattern like this:

Code: Select all

map --mem /ubcd/images/fdubcd.iso.gz (hd32)
map --hook
root (hd32)
chainloader (hd32)
Add two lines inside:

map --mem /ubcd/images/fdubcd.iso.gz (hd32)
map --hook
map (hd32) (cd)
map --hook
root (hd32)
chainloader (hd32)

Update (2012-09-10): I have prepared a patch for "syslinux2grub4dos.sed", so please use the patch instead.
http://dl.dropbox.com/u/70170658/ubcd/s ... patch.diff

If you have tried my workaround before and have replaced this line:

Code: Select all

s|^LINUX.*memdisk\nINITRD \(.*\)\nAPPEND iso.*|map --mem \1 (hd32)\nmap --hook\nroot (hd32)\nchainloader (hd32)|
with

Code: Select all

s|^LINUX.*memdisk\nINITRD \(.*\)\nAPPEND iso.*|map --mem \1 (hd32)\nmap --hook\nmap (hd32) (cd)\nmap --hook\nroot (hd32)\nchainloader (hd32)|
in "syslinux2grub4dos.sed", please undo it.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Sun Sep 09, 2012 6:21 am
by ady
Are those changes giving access to both contents?

It would be interesting to have easy access to both contents, fdubcd.iso and the main content of ubcd (/boot, /pmagic, /ubcd), instead of just one of them.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Sun Sep 09, 2012 5:47 pm
by Explorer09
ady wrote:Are those changes giving access to both contents?

It would be interesting to have easy access to both contents, fdubcd.iso and the main content of ubcd (/boot, /pmagic, /ubcd), instead of just one of them.
No you can't. AFAIK, the CDROM driver in UBCD FreeDOS supports only one drive.

Use UBCD 5.0.x instead.

There may be other solution to this (for example by copying the entire UBCD to memory), but they are not easy for me to try.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Sun Sep 09, 2012 7:27 pm
by Explorer09
My patch is ready. For "syslinux2grub4dos.sed".
http://dl.dropbox.com/u/70170658/ubcd/s ... patch.diff
Please test.

Code: Select all

--- syslinux2grub4dos.sed	2011-06-21 14:31:41.000000000 +0800
+++ syslinux2grub4dos-new.sed	2012-09-10 09:08:40.546275688 +0800
@@ -1,7 +1,8 @@
 # Made by Gert Hulselmans for Ultimate Boot CD
-# http:/www.ultimatebootcd.com/
+# Patched by Explorer to correct boot commands of freedos iso image
+# http://www.ultimatebootcd.com/
 #
-# Last time edited: 2 November 2009
+# Last time edited: 10 September 2012
 #
 # sed script that converts ISOLINUX/SYSLINUX config files to GRUB4DOS config files.
 #
@@ -128,6 +129,19 @@
 #   write --offset=15 (fd0)/bin/setargs.bat ubcdcmd=aida16\r\n
 #   chainloader (fd0)+1
 #   rootnoverify (fd0)
+# Change:
+#   LINUX /boot/syslinux/memdisk
+#   INITRD /ubcd/images/fdubcd.iso.gz
+#   APPEND iso raw ubcdcmd=aida16
+# To:
+#   map --mem /ubcd/images/fdubcd.iso.gz (hd32)
+#   map --hook
+#   map (hd32) (cd)
+#   map (hd32)/fdubcd.img (fd0)
+#   map --hook
+#   write --offset=15 (fd0)/bin/setargs.bat ubcdcmd=aida16\r\n
+#   chainloader (fd0)+1
+#   rootnoverify (fd0)
 #
 # Then convert entries which use the freedos image (fdubcd.img.gz without ubcdcmd parameter):
 #
@@ -140,6 +154,18 @@
 #   map --hook
 #   chainloader (fd0)+1
 #   rootnoverify (fd0)
+# Change:
+#   LINUX /boot/syslinux/memdisk
+#   INITRD /ubcd/images/fdubcd.iso.gz
+#   APPEND iso raw
+# To:
+#   map --mem /ubcd/images/fdubcd.iso.gz (hd32)
+#   map --hook
+#   map (hd32) (cd)
+#   map (hd32)/fdubcd.img (fd0)
+#   map --hook
+#   chainloader (fd0)+1
+#   rootnoverify (fd0)
 #
 # Then convert all entries which use memdisk iso emulation:
 # Change:
@@ -170,10 +196,12 @@
 	# Freedos + ubcdcmd parameter entries
 
 	s|^LINUX.*memdisk\nINITRD /ubcd/images/fdubcd.img.gz\nAPPEND raw ubcdcmd=\(.*\)|map --mem /ubcd/images/fdubcd.img.gz (fd0)\nmap --hook\nwrite --offset=15 (fd0)/bin/setargs.bat ubcdcmd=\1\\r\\n\nchainloader (fd0)+1\nrootnoverify (fd0)|
+	s|^LINUX.*memdisk\nINITRD /ubcd/images/fdubcd.iso.gz\nAPPEND iso raw ubcdcmd=\(.*\)|map --mem /ubcd/images/fdubcd.iso.gz (hd32)\nmap --hook\nmap (hd32) (cd)\nmap (hd32)/fdubcd.img (fd0)\nmap --hook\nwrite --offset=15 (fd0)/bin/setargs.bat ubcdcmd=\1\\r\\n\nchainloader (fd0)+1\nrootnoverify (fd0)|
 
 	# Freedos without ubcdcmd parameter
 
-	s|^LINUX.*memdisk\nINITRD /ubcd/images/fdubcd.img.gz\nAPPEND raw|map --mem /ubcd/images/fdubcd.img.gz (fd0)\nmap --hook\n\nchainloader (fd0)+1\nrootnoverify (fd0)|
+	s|^LINUX.*memdisk\nINITRD /ubcd/images/fdubcd.img.gz\nAPPEND raw|map --mem /ubcd/images/fdubcd.img.gz (fd0)\nmap --hook\nchainloader (fd0)+1\nrootnoverify (fd0)|
+	s|^LINUX.*memdisk\nINITRD /ubcd/images/fdubcd.iso.gz\nAPPEND iso raw|map --mem /ubcd/images/fdubcd.iso.gz (hd32)\nmap --hook\nmap (hd32) (cd)\nmap (hd32)/fdubcd.img (fd0)\nmap --hook\nchainloader (fd0)+1\nrootnoverify (fd0)|
 
 	# MEMDISK ISO image emulation
 

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Sun Sep 09, 2012 11:34 pm
by ady
Explorer09 wrote:AFAIK, the CDROM driver in UBCD FreeDOS supports only one drive.
Well, AFAIK, the CDROM driver itself supports several drives. The "problem" might be the need to patch the scripts (batch).
Use UBCD 5.0.x instead.
Not really a solution IMHO. In 5.0.x, there was no "fdubcd.iso", thus there was no doubt nor conflict about which content was seen.

If the scripts are left as in 5.1.1, by using ISOLINUX we have access to fdubcd.iso, and by using GRUB4DOS we have access to the main content of UBCD511. This was not intentional, but I tend to think that it is "better" than using an older version of UBCD.
There may be other solution to this (for example by copying the entire UBCD to memory), but they are not easy for me to try.
Yes, the "adequate" solution is to patch the scripts, so to have an optional additional drive.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Mon Sep 10, 2012 2:36 am
by Explorer09
ady wrote:Well, AFAIK, the CDROM driver itself supports several drives. The "problem" might be the need to patch the scripts (batch).
[...]
Yes, the "adequate" solution is to patch the scripts, so to have an optional additional drive.
That will be a bug in NwDsk, and unfortunately I don't know what to do with that.

No matter how I tried (in Virtualbox), I still can't get the second and third CDROM drive shown in the FreeDOS. If you find a way to make it, let me know.
ady wrote: If the scripts are left as in 5.1.1, by using ISOLINUX we have access to fdubcd.iso, and by using GRUB4DOS we have access to the main content of UBCD511. This was not intentional, but I tend to think that it is "better" than using an older version of UBCD.
I can explain why this happens. MEMDISK by default forces its mapped ISO to be the first CD drive, and "pushes" other drives do they become the second, third, and so on. (This is documented somewhere in MEMDISK but I can't find it for now.) GRUB4DOS's mapping does not do this, hence the bug.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Mon Sep 10, 2012 7:09 pm
by ady
Explorer09 wrote:No matter how I tried (in Virtualbox), I still can't get the second and third CDROM drive shown in the FreeDOS. If you find a way to make it, let me know.
Are you talking about FDUBCD or about FreeDOS in VBox? Which version of FreeDOS and which version of VBox? Are you using FreeDOS installed (in a virtual HDD image) or as Live (ISO image connected to the VM)? Which specific CDROM driver are you using? Which version of that driver? From which developer (some forks use the same name)? Which CDROM extender?

For FreeDOS 1.1, the installation is not _that_ precise with CDROM drivers, and you also have to update some of them after the initial install. It's not straightforward, but it is possible. If you are interested, please try to answer the above questions (or present your scenario).

Hopefully we can eventually patch the scripts in FDUBCD too.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Mon Sep 10, 2012 9:50 pm
by Explorer09
I mean the FreeDOS in UBCD. I did not have FreeDOS installed on my machine or in VirtualBox, so the FreeDOS I said refer to the UBCD one.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Tue Sep 11, 2012 10:29 am
by ady
It is FDUBCD then.

The problem is that there are at least 3 booting systems involved, if not more. The first is either ISOLINUX or GRUB4DOS. Whichever is used, MEMDISK boots fdubcd.iso. Then the fork from NwDSK is used, and then MODBOOT.

As far as I can see, when booting with ISOLINUX, shsurdrv.exe "mounts" the image (from %ramdrv%).

When using GRUB4DOS as in UBCD511, I think a "fallback" method is used.

So, there are several possibilities to mount an additional image so FDUBCD could have access to its content. I mean, clearly the content of each image has already been expanded (otherwise the user couldn't get to use it), but the filesystem can't be used directly by DOS (FDUBCD), so no letter is assigned.

Maybe using MEMDISK with additional or different parameters (but I doubt it), or shsurdrv, or shsucdx (which, BTW, could also be updated with a newer version).

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Mon Nov 26, 2012 10:30 pm
by Victor Chew
map --mem /ubcd/images/fdubcd.iso.gz (hd32)
map --hook
map (hd32) (cd)
map --hook
root (hd32)
chainloader (hd32)
@Explorer09: I can't seem to get this to work. If I issue the following commands manually:
map --mem /ubcd/images/fdubcd.iso.gz (hd32)
map --hook
map (hd32) (cd)
map --hook
then
root (cd)
I get:
Error 17: Cannot mount selected partition
whereas
root (hd32)
works fine. Any idea what I am doing wrong?

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Mon Nov 26, 2012 11:11 pm
by Explorer09
@Victor

It works for me, I typed exactly what you said and didn't get an error message.

(Tested on GRUB4DOS v0.4.5c-2012-06-19 and v0.4.5b-2010-09-22)

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Tue Nov 27, 2012 2:35 am
by Victor Chew
Well I am bumped. :roll: Didn't work for both v0.4.5b-2010-09-22 and V0.4.5c-2012-11-17. But I am testing under VMPlayer V5.0.1. Which platform are you testing under?

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Tue Nov 27, 2012 2:42 am
by Victor Chew
Anyway, under isolinux, I found out how to mount both the emulated CDROM drive (fdubcd.iso) and the physical ATAPI CDROM drive (UBCD CDROM).

Under \level1\cdrom.cab, the default is "Auto, try to detect best". If I change that to "Auto, try to detect all", it will mount both the emulated CDROM drive (using the Eltorito driver) and the physical CDROM drive (using the ATAPI driver). So fdubcd.iso gets mounted as T:, while UBCD gets mounted as U:. Sweet.

To make that permanent, simply change "etc\global.set" and set:

Code: Select all

CDROM_TI=3
Under grub4dos, however, with the old mapping code:

Code: Select all

map --mem /ubcd/images/fdubcd.iso.gz (hd32)
map --hook
root (hd32)
chainloader (hd32)
I also get two drive letters, but both gets mapped to UBCD. Dunno why. Seems like the Eltorito driver is not picking up the emulated CDROM drive? More investigation required.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Tue Nov 27, 2012 4:49 am
by Explorer09
Victor Chew wrote:Well I am bumped. :roll: Didn't work for both v0.4.5b-2010-09-22 and V0.4.5c-2012-11-17. But I am testing under VMPlayer V5.0.1. Which platform are you testing under?
VirtualBox 4.2.4.

[del] I did a Google search about this and it seems that the problem is about the incorrect file system. Did you get the same error when trying the same command in UBCD 5.1.1? [/del]

EDIT: I reproduced your problem in my VMware Player, but it only happens in VMware Player.
Victor Chew wrote:Anyway, under isolinux, I found out how to mount both the emulated CDROM drive (fdubcd.iso) and the physical ATAPI CDROM drive (UBCD CDROM).
Good job. Make it happen in UBCD 5.2, please.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Tue Nov 27, 2012 7:14 am
by ady
Victor Chew wrote:Anyway, under isolinux, I found out how to mount both the emulated CDROM drive (fdubcd.iso) and the physical ATAPI CDROM drive (UBCD CDROM).

Under \level1\cdrom.cab, the default is "Auto, try to detect best". If I change that to "Auto, try to detect all", it will mount both the emulated CDROM drive (using the Eltorito driver) and the physical CDROM drive (using the ATAPI driver). So fdubcd.iso gets mounted as T:, while UBCD gets mounted as U:. Sweet.

To make that permanent, simply change "etc\global.set" and set:

Code: Select all

CDROM_TI=3
@Victor,

Please clarify if you can.

1_ I already have

Code: Select all

CDROM_TI=3
in "etc\global.set". So what's the new value to make it "all" instead of "best" as permanent setting?

2_ You say "to make that permanent". What would be the procedure to change this behavior for a specific one-time boot?

TIA,
Ady.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Tue Nov 27, 2012 9:35 pm
by Victor Chew
I did a Google search about this and it seems that the problem is about the incorrect file system. Did you get the same error when trying the same command in UBCD 5.1.1?
Yes, I will try another emulator and report.
1_ I already have CDROM_TI=3 in "etc\global.set". So what's the new value to make it "all" instead of "best" as permanent setting?
Sorry, that's what happens when you have been working on one thing for too long and lack sleep. :D

Change: CDROM_LD=1 to CDROM_LD=2
2_ You say "to make that permanent". What would be the procedure to change this behavior for a specific one-time boot?
Instead of "1 Boot UMBPCI (silent)", choose "2 Boot UMBPCI (optimal)" or one of the other options. This will allow you to config the CD-ROM settings when the corresponding dialog box pops up.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Tue Nov 27, 2012 10:02 pm
by ady
Victor Chew wrote:
1_ I already have CDROM_TI=3 in "etc\global.set". So what's the new value to make it "all" instead of "best" as permanent setting?
Change: CDROM_LD=1 to CDROM_LD=2
That makes more sense. I was already thinking that _that_ setting was the one, so the "*TI=3" suggestion confused me. Thanks.
2_ You say "to make that permanent". What would be the procedure to change this behavior for a specific one-time boot?
Instead of "1 Boot UMBPCI (silent)", choose "2 Boot UMBPCI (optimal)" or one of the other options. This will allow you to config the CD-ROM settings when the corresponding dialog box pops up.
I confess the names for the FDUBCD booting options were never completely intuitive to me. For example, "2 Boot UMBPCI (optimal)" would be related (in my mind) to the "best" option in "CDROM_LD", while "1 Boot UMBPCI (silent)" would be related (in my mind) to the "all" option in "CDROM_LD". Since the relations my mind makes are different than the ones being used in FDUBCD, then evidently those words ("optimal", "silent") can be related to other concepts that happen to differ (or oppose) the way my mind works :).

Thank you all.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Wed Nov 28, 2012 9:40 pm
by Victor Chew
OK, this is after more extensive testing.

UNDER VMWARE
(plus a physical Dell laptop and a physical HP laptop)

I got the same results. If I do:

Code: Select all

map --mem /ubcd/images/fdubcd.iso.gz (hd32)
map --hook
map (hd32) (cd)
map --hook
root (cd)
I get:

Code: Select all

Fatal! Inconsistent data read from (0x9F)0+32 (about 10 lines repeating)
Error 17: Cannot mount selected partition
If I boot FDUBCD using isolinux, both drives are accessible.

Since this is under physical hardware, I tend to think VMWare has more accurate emulation here.

UNDER VIRTUALBOX

I get map success. But when it went to mounting, T: shows the original UBCD listing, while U: shows garbage. fdubcd.iso is nowhere in sight.

Show VirtualBox does not emulate the behaviour of the physical hardware that I have, and even with map success, FDUBCD could not mount the virtual CD.

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Wed Nov 28, 2012 9:51 pm
by Victor Chew
An interesting note: I boot UBCD on one of the notebooks from a USB memory stick. GRUB4DOS was able to mount fdubcd.iso properly.

I think it is related to the behaviour of grub4dos that Explorer09 mentioned previously:

With memdisk, fdubcd.iso becomes the first CDROM drive and is mounted by eltorito.sys in FDUBCD. The ATAPI driver then mounts the physical CDROM drive.

With grub4dos, fdubcd.iso is the second CDROM drive after the physical CDROM drive. So the Eltorito driver mounts the physical CDROM drive (since it is the first in the list), then the ATAPI driver mounts the physical CDROM drive as well (since it is the only physical CDROM drive it can find).

When booting from the USB memory stick, there is no physical CDROM drive, so the Eltorito driver has no choice but to mount fdubcd.iso, which is the first CDROM drive it can find.

This is my best guess of what is going on, and I am still stuck as to how to resolve the issue. :(

Re: When booting fdubcd via grub4dos, fdubcd is not found.

Posted: Wed Nov 28, 2012 11:03 pm
by Victor Chew
I can't figure this out.

When booting FDUBCD/isolinux, eltorito.sys is producing:

Code: Select all

Drive E0 return 0800h bytes per Sector.
Device Name: CDEXELT1
Driver installed
and etdump gives:

Code: Select all

FF: CF=1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
FE: CF=1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
..
E1: CF=1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
E0: CF=0 13 00 E0 00 2B 00 00 00 00 00 00 00 00 00 04 00 FF CF FF
..
81: CF=1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: CF=1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
which looks about right because CF=0 means a device is available, and it corresponds to the virtual CDROM created by memdisk. The other entries are empty.

When booting FDUBCD/grub4dos, eltorito.sys is producing:

Code: Select all

Drive 9F return 0800h bytes per Sector.
Device Name: CDEXELT1
Driver installed
and etdump gives:

Code: Select all

FF: CF=0 13 00 9F 00 A1 00 00 00 00 00 00 00 00 00 04 00 6D 08 D7
FE: CF=0 13 00 9F 00 A1 00 00 00 00 00 00 00 00 00 04 00 6D 08 D7
..
A1: CF=0 13 00 9F 00 A1 00 00 00 00 00 00 00 00 00 04 00 6D 08 D7
A0: CF=0 13 00 A0 00 2B 00 00 00 00 00 00 00 00 00 04 00 00 00 00
..
9F: CF=0 13 00 9F 00 A1 00 00 00 00 00 00 00 00 00 04 00 6D 08 D7
..
81: CF=0 13 00 9F 00 A1 00 00 00 00 00 00 00 00 00 04 00 6D 08 D7
80: CF=0 13 00 9F 00 A1 00 00 00 00 00 00 00 00 00 04 00 6D 08 D7
All the carry flags are 0!! That can't be right. So drive 9F gets mounted, which corresponds to the physical CDROM.

Either grub4dos is not populating the drive table properly, or etdump is screwing up somehow under grub4dos.

I don't understand.