Jump to content











Photo
- - - - -

Chainloading AUTOEXEC/COMMAND.COM?


  • Please log in to reply
36 replies to this topic

#1 delicatepc

delicatepc

    Member

  • Members
  • 42 posts
  •  
    United States

Posted 23 July 2010 - 05:08 PM

Hi Folks,

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 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 July 2010 - 06:15 PM

With that being explained is it possible to chainload the AUTOEXEC.bat (or is it COMMAND.COM we want to chainload?)?

NO.
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
and you run different set of commands depending on the choices you make in the menu.

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. B)

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. :cheers:

:dubbio:
Wonko

#3 delicatepc

delicatepc

    Member

  • Members
  • 42 posts
  •  
    United States

Posted 23 July 2010 - 08:19 PM

Thank you for the reply Wonko. I think it may have went *woosh* over my head*

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.SYS
2. 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 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 23 July 2010 - 10:34 PM

Did you try to add 'raw', 'bigraw' or 'int' to the APPEND line?

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.BIN
You can also use:
APPEND msdos=/DELLBIO.BIN
But it will hang at this stage:
Loading DRMX V8.00...



Can't load kernel file
Probably 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 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 24 July 2010 - 12:02 PM

Well, the .iso works allright in grub4dos under Qemu.

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



:dubbio:
Wonko

#6 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 24 July 2010 - 01:26 PM

@ Wonko the Sane
It works with MEMDISK too in qemu.
It only seems to fail on some models.

#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

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. :merc:

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. :dubbio:


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 :cheers:).

Thus thought that maybe giving explicitly the possible grub4dos entries may not "whoosh over" (but of course cannot say if it will work).

What :cheers: is the point? :merc:

:merc:
Wonko

#8 delicatepc

delicatepc

    Member

  • Members
  • 42 posts
  •  
    United States

Posted 27 July 2010 - 02:51 PM

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 :cheers:)

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 :cheers:>

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 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 27 July 2010 - 03:12 PM

@delicatepc
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=grldr
Contents of menu.lst:
title DELL Diagnostics

map (hd0) (hd1)

map --mem /diags.img (hd0)

map --hook

root (hd0,0)

chainloader ()+1


#10 delicatepc

delicatepc

    Member

  • Members
  • 42 posts
  •  
    United States

Posted 27 July 2010 - 03:15 PM

I will try when I get a chance but it may be a while - i get a chance every once in a while.

thank you,
dpc

#11 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2010 - 03:32 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 :cheers:>

Why two? :cheers:

Syslinux or grub4dos can live together with the "DOS based" menu-system.

:cheers:
Wonko

#12 delicatepc

delicatepc

    Member

  • Members
  • 42 posts
  •  
    United States

Posted 27 July 2010 - 03:34 PM

How do you load one or the other? I assume syslinux/grub would be the bootloader correct? So then you would have an entry saying "DOS Mode"?

Thank you,
dpc

#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2010 - 03:46 PM

So then you would have an entry saying "DOS Mode"?

Yep. :cheers:

That's exactly the idea of a bootloader/bootmanager, allow to load and boot several different Operating Systems. :cheers:

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.

:cheers:
Wonko

#14 delicatepc

delicatepc

    Member

  • Members
  • 42 posts
  •  
    United States

Posted 27 July 2010 - 03:49 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.BIN
You can also use:
APPEND msdos=/DELLBIO.BIN
But it will hang at this stage:
Loading DRMX V8.00...



Can't load kernel file
Probably 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'

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....

thank you,
dpc

#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2010 - 04:41 PM

Yep, but the tests should be made on the actual DELL machines, if both syslinux/memdisk and grub4dos posted methods fail, then you can chainload the bootsector.

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:

label DELL DOS Mode
kernel dosstick.bss

or in grub4dos .lst

title DELL DOS Mode
chainloader dosstick.bss


:cheers:
Wonko

#16 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 27 July 2010 - 04:59 PM

LABEL chain_DELLBIO

MENU LABEL Boot DELLBIO.BIN with chain.c32

COM32 chain.c32

APPEND freedos=/DELLBIO.BIN
For 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 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2010 - 05:51 PM

Yes, it seems like some check is performed on the actual bootsector or filesystem. :cheers:

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.

:cheers:
Wonko

#18 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 27 July 2010 - 06:59 PM

I tried with the FreeDOS kernel (kernel.sys) before, but it didn't work, because I forgot to replace command.com with the FreeDOS version too.

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=1
Install Syslinux to the first parition inside the diags.img hard disk image:
./syslinux-4.02/mtools/syslinux --install --offset 32256 ./dell-syslinux/diags-syslinux.img
Create or edit the file .mtoolsrc for manipulating the hard disk image with mtools:
drive x&#58; file=&#34;/home/icecube/dell-syslinux/diags-syslinux.img&#34; partition=1
You 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.sys
Create the syslinux.cfg file (MSDOS based floppy):
DEFAULT delldiags



LABEL delldiags

COM32 chain.c32

APPEND swap msdos=/io.sys
Get 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&#58;

mcopy ./dell-syslinux/syslinux.cfg x&#58;

mcopy ./dell-syslinux/kernel.sys x&#58;

mcopy ./dell-syslinux/command.com x&#58;

mcopy ./dell-syslinux/himem.sys x&#58;

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&#58;

mcopy ./dell-syslinux/syslinux.cfg x&#58;

mcopy ./dell-syslinux/io.sys x&#58;

mcopy ./dell-syslinux/command.com x&#58;

mcopy ./dell-syslinux/himem.sys x&#58;

For both:
You can remove the unneeded dellbio.bin file, if you want:
mdel x&#58;dellbio.bin
You 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=notrunc
It should be possible to combine the FreeDOS, MSDOS and DELLBIO images.

Note 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.

http://sourceforge.n...#Known_problems

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 geneC

geneC

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 28 July 2010 - 04:28 PM

@Icecube
@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 geneC

geneC

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 28 July 2010 - 05:26 PM

@delicatepc

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 geneC

geneC

    Newbie

  • Members
  • 12 posts
  •  
    United States

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 geneC

geneC

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 28 July 2010 - 11:56 PM

@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).

#23 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 29 July 2010 - 06:32 AM

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).

I tried that before with chain.c32 too and it worked:
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 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

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? :dubbio:

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 geneC

geneC

    Newbie

  • Members
  • 12 posts
  •  
    United States

Posted 29 July 2010 - 12:20 PM

Really? :)


:cheers:
Wonko


Ooops, must have missed that in my reading....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users