Chainloading AUTOEXEC/COMMAND.COM?
#1
Posted 23 July 2010 - 05:08 PM
Dell offers several diagnostic packages (each one supports a different set of machines). For my question I will use CWA1384A0 that can be found here: LINK
Once "installed" the utility offers a user an option to Create ISO, Create HDD/Floppy image of the diagnostics, and or install it to a USB stick.
The HDD/Floppy image works well with MEMDISK on most of the dell machines. However certain models (Dell E6400 for example) hang when attempting to run the DRMK kernel that the Dell Diagnostics use (BIOS is up to date on these machines). Using Syslinux 4.01 - issue has been since the syslinux 3.8x days maybe even before then.
So my next step is to use the "Install to USB stick" option. This copies the Dell diagnostics files to a USB stick and uses AUTOEXEC.bat to kick off the diagnostics. AUTOEXEC.bat loads all the diagnostics into the RAM.
A ZIPPED version of the USB stick contents can be found here (4MB): ZIPPED LINK
With that being explained is it possible to chainload the AUTOEXEC.bat (or is it COMMAND.COM we want to chainload?)?
Thank you,
dpc
#2
Posted 23 July 2010 - 06:15 PM
NO.With that being explained is it possible to chainload the AUTOEXEC.bat (or is it COMMAND.COM we want to chainload?)?
You don't "chainload" ANY file, you only "chainload" System files (or kernels), in the case of DOS, it is IO.SYS, COMMAND.COM being the Command Interpreter, and AUTOEXEC.BAT a simple batch file which is executed autoamtically, as well as CONFIG.SYS at boot time.
So what you want is to have a MENU inside Autoexec.bat that allows you to choose the particular machine (and the particular set of commands you need on that machine), or, in other words, you have to "put together" the various autoexec.bat's (and maybe config.sys) of the different versions of the utility files.
You have only one:
- IO.SYS
- MSDOS:SYS
- COMMAND.COM
Some examples:
http://www.shiningst...ulticonfig.html
http://www.mindsprin...iman/Bootup.htm
http://http-server.c...mcfet/menu.html
http://www.symantec....dos-menu-system
This has nothing to do with Syslinux and a lot to do with DOS.
You can use a menu system, like:
http://surf.to/AccessDosMenu
more:
http://www.bttr-soft...eesoft/menu.htm
You can anyway try using grub4dos instead of memdisk, to map the images, but I doubt that it will work where memdisk failed.
Wonko
#3
Posted 23 July 2010 - 08:19 PM
I will be honest it doesn't seem make sense to me at the moment. Just not clicking in my head.
Here is my logic.
1. Create Menu entry in syslinux for a certain Dell Diag version:
LABEL - MENU LABEL Dell Diagnostics CW1384A0 - Extracted Version COM32 /boot/syslinux/chain.c32 APPEND fs ntldr=/cw1384A0/IO.SYS2. CHAIN.C32 loads the DOS?? environment. Loads up Command.com/config.sys and then goes to AUTOEXEC.bat to execute....
3. AUTOEXEC.bat is pretty simple it just sends all the files into RAM (no need for menu/machine selection - have only one set of instructions I want it to run - namely the dell diagnostic).
4. The Dell Diagnostics appear.
I Am guessing..... it appears the Dell uses a custom version of IO.SYS? called DellRMK.BIN or DellBIO.bin... see the attached zip archive - there is no IO.SYS there.....
Does this make sense?
thank you,
dpc
#4
Posted 23 July 2010 - 10:34 PM
I partly succeeded in booting DELLBIO.BIN from SYSLINUX:
LABEL chain_DELLBIO MENU LABEL Boot DELLBIO.BIN with chain.c32 COM32 chain.c32 APPEND freedos=/DELLBIO.BINYou can also use:
APPEND msdos=/DELLBIO.BINBut it will hang at this stage:
Loading DRMX V8.00... Can't load kernel fileProbably DELLBIO.BIN expects the DELLRMK.BIN file at a certain location in the FAT table, but installing SYSLINUX to this disk image, will move some files around in the FAT table.
Trying to chainload the partition boot sector (C:\Dell\Drivers\R271134\BOOT\DRMK12.BS) which normally loads DELLBIO.BIN, fails when Syslinux is installed: ==> returns 'DISK error'
#5
Posted 24 July 2010 - 12:02 PM
title Dell R271134 iso
map --mem (hd0,0)/dell/drivers/R271134/diags.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
As well the disk image:
title Dell R271134 img
map --mem (hd0,0)/dell/drivers/R271134/diags.img (hd1)
map --hook
root (hd1,0)
chainloader +1
Wonko
#6
Posted 24 July 2010 - 01:26 PM
It works with MEMDISK too in qemu.
It only seems to fail on some models.
#7
Posted 24 July 2010 - 01:44 PM
@ Wonko the Sane
It works with MEMDISK too in qemu.
It only seems to fail on some models.
Sure.
I just posted what works on the whatever I can test it in.
I also previously posted:
You can anyway try using grub4dos instead of memdisk, to map the images, but I doubt that it will work where memdisk failed.
I also already posted a suggestion about a possible workaround to use multiple versions of the utilities on the same "flat" bootable USB stick, (but it "wooshed" over the head of the OP ).
Thus thought that maybe giving explicitly the possible grub4dos entries may not "whoosh over" (but of course cannot say if it will work).
What is the point?
Wonko
#8
Posted 27 July 2010 - 02:51 PM
I see what you mean now. Create a Non-syslinux USB stick and then create a menu system to access various dell diagnostics in native form. All things considered not a bad idea but that means two usb sticks >I also already posted a suggestion about a possible workaround to use multiple versions of the utilities on the same "flat" bootable USB stick, (but it "wooshed" over the head of the OP )
That is correct it fails to load on certain model machines only (Dell E6400 for example has some issues).
Icecube: I have also had just about the same luck. end up with "Cannot locate Kernel file" or a "Cannot divide by zero" and similar error whether raw bigraw iso or int.
Might need a dell bio specific hack in syslinux to make it work properly....
thank you,
dpc
#9
Posted 27 July 2010 - 03:12 PM
Can you tell on which exact PCs with which BIOS versions the image doesn't work?
Try with the last MEMDISK version (4.02).
Try all entries in the syslinux.cfg and also try to boot the image with grub4dos and tell me what works/doesn't work.
Contents of syslinux.cfg:
UI menu.c32 LABEL delldiag1 MENU LABEL DELL Diagnostics (normal) LINUX memdisk INITRD diags.img LABEL delldiag2 MENU LABEL DELL Diagnostics (raw) LINUX memdisk INITRD diags.img APPEND raw LABEL delldiag3 MENU LABEL DELL Diagnostics (bigraw) LINUX memdisk INITRD diags.img APPEND bigraw LABEL delldiag4 MENU LABEL DELL Diagnostics (int) LINUX memdisk INITRD diags.img APPEND int LABEL grub4dos MENU LABEL Boot grub4dos COM32 chain.c32 APPEND fs grldr=grldrContents of menu.lst:
title DELL Diagnostics map (hd0) (hd1) map --mem /diags.img (hd0) map --hook root (hd0,0) chainloader ()+1
#10
Posted 27 July 2010 - 03:15 PM
thank you,
dpc
#11
Posted 27 July 2010 - 03:32 PM
Why two?I see what you mean now. Create a Non-syslinux USB stick and then create a menu system to access various dell diagnostics in native form. All things considered not a bad idea but that means two usb sticks >
Syslinux or grub4dos can live together with the "DOS based" menu-system.
Wonko
#12
Posted 27 July 2010 - 03:34 PM
Thank you,
dpc
#13
Posted 27 July 2010 - 03:46 PM
Yep.So then you would have an entry saying "DOS Mode"?
That's exactly the idea of a bootloader/bootmanager, allow to load and boot several different Operating Systems.
What you will have to try is if it is possible to directly chainload the DELL .sys file or if you will need an "intermediate" bootsector, but the Dell utility already has them "extracted" so it will be easy to make one for your stick inserting the specific DATA.
Wonko
#14
Posted 27 July 2010 - 03:49 PM
It looks like Icecube attempted this approach but the Dell .sys file was not playing nice. Likely some odd hacked around solution in the dell .sys file....I partly succeeded in booting DELLBIO.BIN from SYSLINUX:
LABEL chain_DELLBIO MENU LABEL Boot DELLBIO.BIN with chain.c32 COM32 chain.c32 APPEND freedos=/DELLBIO.BINYou can also use:APPEND msdos=/DELLBIO.BINBut it will hang at this stage:Loading DRMX V8.00... Can't load kernel fileProbably DELLBIO.BIN expects the DELLRMK.BIN file at a certain location in the FAT table, but installing SYSLINUX to this disk image, will move some files around in the FAT table.
Trying to chainload the partition boot sector (C:\Dell\Drivers\R271134\BOOT\DRMK12.BS) which normally loads DELLBIO.BIN, fails when Syslinux is installed: ==> returns 'DISK error'
thank you,
dpc
#15
Posted 27 July 2010 - 04:41 PM
Easy:
- install to a USB stick
- create a backup copy the bootsector of the stick, say "dosstick.bss"
- install syslinux (or grub4dos, or both)
Add an entry in syslinux .cfg:
or in grub4dos .lstlabel DELL DOS Mode
kernel dosstick.bss
title DELL DOS Mode
chainloader dosstick.bss
Wonko
#16
Posted 27 July 2010 - 04:59 PM
LABEL chain_DELLBIO MENU LABEL Boot DELLBIO.BIN with chain.c32 COM32 chain.c32 APPEND freedos=/DELLBIO.BINFor this approach I installed Syslinux 4.02 to the original DELL Diagnostics image (diags.img). diags.img is a hard disk image, with a FAT16 formatted partition (AFAI remember). DELLBIO.BIN contains the string D
DELLBIO.BIN contains the following strings (deleted some strings that are completely inrelevant):
Real Mode Kernel
CON B
AUX T
PRN
CLOCK$
COM1
COM2
LPT1
Unlabeled FAT12 W2
Insert diskette for drive
: and strike any key when ready...
Division by zero at ????:????
Loading DRMK V8.00...
<carry> set reading MBR on disk
; status =
System halted
PROTMAN$
DELLRMK BIN#
A: /P
VDISK3.3
CONFIG.SYS
COUNTRY
SHELL
LASTDRIVE
HILASTDRIVE
BREAK
BUFFERS
HIBUFFERS
FCBS
HIFCBS
FILES
HIFILES
STACKS
HISTACKS
FASTOPEN
DRIVPARM
HISTORY
INSTALL
HIINSTALL
INSTALLLAST
HIINSTALLLAST
DOSDATA
DPBS
XBDA
SWITCHES
DEVICE
HIDEVICE
CHAIN
GOTO
GOSUB
RETURN
CPOS
TIMEOUT
SWITCH
ONERROR
ECHO
EXIT
ERROR
GETKEY
YESCHAR
DEBLOCK
NUMLOCK
BOOTNEXT
QUIET
($) ? $
$/L:
SIZE
HIGH
NOUMB
Invalid command in CONFIG.SYS file$
Bad or missing file $
Invalid SHELL filename $
Invalid LASTDRIVE character (use A..Z)$
Invalid BREAK switch (use ON or OFF)$
Invalid QUIET switch (use ON or OFF)$
Invalid number of buffers$
Invalid number of files (use 5..255)
Invalid number of FCBS
Invalid number of FASTOPEN entries (use 128..32768)
Invalid or missing DRIVPARM parameters, usage:
DRIVPARM = /D:d [/C] [/F:f] [/H:h] [/N] [/S:s] [/T:t]
Invalid HISTORY parameters, usage:
HISTORY = ON|OFF [,nnn[, ON|OFF]]
Invalid country code$
Bad or missing command interpreter
Please enter a valid filename
Can't load kernel file
DRMK
A:\COMMAND.COM
#17
Posted 27 July 2010 - 05:51 PM
Anyway, again in QEMU, if I SYS a DOS 7.1 the test program seems like running normally using "chainloader /io.sys".
On the same modified image chainloading the bootsector copy fails.
BUT only replacing the bootsector from the SYSed image on the "untouched one" it works chainloading the (original) saved bootsector copy.
So, the bootsector approach should work, unless syslinux changes something else (I am not familiar with it) during install.
In the worst case one can install grub4dos to the MBR (+hidden sectors), leaving the bootsector and system files placement untouched.
Wonko
#18
Posted 27 July 2010 - 06:59 PM
In Linux, you can create this image with the following commands:
You can save the partition boot sector of the diags.img disk image if you want
dd if=/dell-syslinux/diags-syslinux.img of=/dell-syslinux/diags.bs skip=63 bs=512 count=1Install Syslinux to the first parition inside the diags.img hard disk image:
./syslinux-4.02/mtools/syslinux --install --offset 32256 ./dell-syslinux/diags-syslinux.imgCreate or edit the file .mtoolsrc for manipulating the hard disk image with mtools:
drive x: file="/home/icecube/dell-syslinux/diags-syslinux.img" partition=1You can create a FreeDOS based floppy or a MSDOS based floppy.
Create the syslinux.cfg file (FreeDOS based floppy):
DEFAULT delldiags LABEL delldiags COM32 chain.c32 APPEND swap freedos=/kernel.sysCreate the syslinux.cfg file (MSDOS based floppy):
DEFAULT delldiags LABEL delldiags COM32 chain.c32 APPEND swap msdos=/io.sysGet the necessary FreeDOS files: kernel.sys, command.com and maybe himem.sys.
Copy all needed files (chain.c32, syslinux.cfg, kernel.sys, command.com and maybe himem.sys) inside the disk image with mtools:
mcopy ./syslinux-4.02/com32/modules/chain.c32 x: mcopy ./dell-syslinux/syslinux.cfg x: mcopy ./dell-syslinux/kernel.sys x: mcopy ./dell-syslinux/command.com x: mcopy ./dell-syslinux/himem.sys x:
Get necessary MSDOS files: io.sys, maybe command.com and maybe himem.sys
Copy all needed files (chain.c32, syslinux.cfg, io.sys, maybe command.com and maybe himem.sys) inside the disk image with mtools:
mcopy ./syslinux-4.02/com32/modules/chain.c32 x: mcopy ./dell-syslinux/syslinux.cfg x: mcopy ./dell-syslinux/io.sys x: mcopy ./dell-syslinux/command.com x: mcopy ./dell-syslinux/himem.sys x:
For both:
You can remove the unneeded dellbio.bin file, if you want:
mdel x:dellbio.binYou can also add a Syslinux MBR to the image (not necessary):
dd if=./syslinux-4.02/mbr/mbr.bin of=./dell-syslinux/diags-syslinux.img conv=notruncIt should be possible to combine the FreeDOS, MSDOS and DELLBIO images.
http://sourceforge.n...#Known_problemsNote that FreeDOS can use c:\fdconfig.sys and c:\yourfreedosdirectory\fdauto.bat instead of c:\config.sys and c:\autoexec.bat - this is meant to make it easier to install FreeDOS and other DOS versions on the same C:, letting each of the two have a separate configuration. FreeDOS will look for fdconfig.sys first and will only use config.sys if fdconfig.sys is not present! The SHELL line in your config file is where alternative batch files instead of autoexec.bat can be linked.
So if you copy autoexec.bat to fdauto.bat and config.sys to fdconfig.sys and modify them a bit, you can get around the problem of the need of 2 different command.com files (you can put the FreeDOS one in its own directory).
#19
Posted 28 July 2010 - 04:28 PM
@delicatepc
I've got both a Dell Latitude E6400 and a Dell OptiPlex 760 that, when I used the CD made from an ISO (made by CW1384A0.exe) it works but using SYSLINUX-4.02 to a harddisk image (made by the same), it seems to hardlock when working with the RAMDRIVE setup.
I'm going to try a few experiments.
#20
Posted 28 July 2010 - 05:26 PM
So far it appears that safeint (the default) in EDD or non-EDD mode is broken but everything else seems OK. I've tested raw, bigraw, and int (with no edd/noedd options to force it either way) and all is well.
@icecube
Now to try the chainloading.... :-D
#21
Posted 28 July 2010 - 11:36 PM
@icecube
Now to try the chainloading.... :-D
I'm almost certain that at this time using the DRMK (Dell Real Mode Kernel) will require a unique chain.c32 option as there is a lot more data pre-loaded into the registers when entering DELLBIO.BIN on a normal Dell Diag disk (at 0x700). For instance, the length of DELLBIO.BIN is in there.
#22
Posted 28 July 2010 - 11:56 PM
@Icecube
Success (sort-of). If you save the original boot sector first as a .bss and then load the .bss file as a kernel to SYSLINUX, it works.
It's not chainloading but it's better than nothing (for now).
#23
Posted 29 July 2010 - 06:32 AM
I tried that before with chain.c32 too and it worked:Success (sort-of). If you save the original boot sector first as a .bss and then load the .bss file as a kernel to SYSLINUX, it works.
It's not chainloading but it's better than nothing (for now).
dd if=/dell-syslinux/diags-syslinux.img of=/dell-syslinux/diags.bs skip=63 bs=512 count=1
LABEL delldiagsbootsector COM32 chain.c32 APPEND hd0,1 file=/diags.bs
#24
Posted 29 July 2010 - 07:48 AM
@delicatepc
@Icecube
Success (sort-of). If you save the original boot sector first as a .bss and then load the .bss file as a kernel to SYSLINUX, it works.
It's not chainloading but it's better than nothing (for now).
Really?
BUT only replacing the bootsector from the SYSed image on the "untouched one" it works chainloading the (original) saved bootsector copy.
So, the bootsector approach should work, unless syslinux changes something else (I am not familiar with it) during install.
Wonko
#25
Posted 29 July 2010 - 12:20 PM
Really?
Wonko
Ooops, must have missed that in my reading....
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users