Jump to content











Photo
- - - - -

Boot with grub4dos a DOS image


  • Please log in to reply
8 replies to this topic

#1 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 25 May 2007 - 01:15 PM

ps.i want to make a folder to insert bios upgrades files and how can i use grub to boot and give a command line prompt to do it? (we already talked about this in pm´s)



Interesting results. :confused1:

A question, when you say:

if i use fat it boots from all groups - group1: a:\ group2: c:\

You mean DOS booted through Grub4dos, don't you?
If yes, can you post the relevant menu.lst entry?

Anyway I'll have a night sleep on these results and see what I can find. :confused1:

About BIOS upgrades, usually they run under plain DOS, so maybe easiest thing is to make a floppy image with dos, load it normally or to ramdisk with Grub4dos and have in it an autoexec.bat pointing to the directory with the updates (and the Award or AMI flash utility).

Can you post a more detailed example of what you want to do?
i.e. how you normally perform these upgrades.

(the only drawback I can see in such an approach is some possible "timing" problem, but if one passes through a choice menu there shouldn't be any)

jaclaz

Note:
this is a "splitted" thread from this one:
http://www.boot-land...?...f=12&t=2246

#2 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 25 May 2007 - 03:55 PM

You mean DOS booted through Grub4dos, don't you?
If yes, can you post the relevant menu.lst entry?


no, i mean using hp format utility format it in fat and using w98 boot files

Can you post a more detailed example of what you want to do?
i.e. how you normally perform these upgrades.



i now have the in ntfs format
and a folder called bios (i put in it bios flash tools, bios files)
so new different bios files can be easilly put in that folder
and when i start grub menu entry it would go directly to that folder in a dos enviremont
so i could lauch "afudos /ibios.rom"

#3 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 May 2007 - 12:08 PM

Hmmm, the problem is that the Root directory where DOS (7.1 aka Win98 suggested) files reside needs to be either FAT16 or FAT32.
So the use of a (floppy , HD or partition) image for the booting is necessary anyway.
One could use on the floppy image either NTFSDOS (BIG, read only) from Sysinternals/Microsoft or NTFS4DOS Datapol/Avira (smallish, R/W).
Since it is a good practice to backup the existing BIOS before flashing the new one I guess that R/W support on the "main" NTFS partition would be needed.

The alternative is using a larger image file, formatted as FAT that contains BOTH the DOS system files and the two subdirs \bios (for new BIOS) and \oldbios (for the backups).

Besides this has the advantage of being easily portable between different sticks and updating it is easy, by mounting the image file with VDK, filedisk or IMDISK.

As said the easiest would be to put the needed commands in a batch automatically invoked by autoexec.bat.

What I would do is to use Qemu/QemuManager as a base:
1) Create a new VM
2) Create a RAW image of suitable size, I guess that 20 Mbytes would be adequate to contain ALL the files you need, name it, say, bios.dsk
3) Add in the VM Control Panel a Win98 boot floppy and set it at boot
4) boot the VM, FDISK
5) reboot VM, format C: /s
6) shut down VM, untick boot from floppy and boot VM to check it boots from C:
7) try mounting the image with either VDK/VDKmanager or IMDISK, for IMDISK you will need to specify an offset of 32256 bytes
8) create directory structure, add whatever files you need, unmount the image
9) Start the VM using the image as boot media
10) if everything works, shutdown the VM, copy bios.dsk file to the stick, add to the stick menu.lst the following entries:
title DOS for BIOS upgrade 1
map --mem (hd0,0)/bios.dsk (hd0)
map --hook
root (hd0,0)
chainloader +1

title DOS for BIOS upgrade 2
map --mem (hd0,0)/bios.dsk (hd0)
map --hook
root (hd0,0)
chainloader /io.sys
Both the above entries are interchangeable, I made two just to show how grub4dos can chainload a system file without using a bootsector

this leads to the simplified method below (the above method creates a whole harddisk image that is perfecty "valid" in itself, i.e. it can be "dd"ed to a hard disk and should boot normally without grub4dos or any other bootmanager)

Simplified method with IMDISK:
1) Open IMDISK control panel input C:\bios.dsk as filename and 20 Mbytes as size and press OK
2) double click the corresponding drive letter in Explorer and at the prompt format it either FAT16 or 32
3) copy to it:
IO.SYS
MSDOS.SYS
COMMAND.COM
(you can mount a WIN98 bootfloppy image with IMDISK to get the files)
create needed directory structure and add any other needed file
4) unmount the drive image, copy bios.dsk to the stick
5) add to the stick menu.lst the following entries:
title DOS for BIOS upgrade 1
map --mem (hd0,0)/bios.dsk (hd0,0)
map --hook
root (hd0,0)
chainloader +1

title DOS for BIOS upgrade 2
map --mem (hd0,0)/bios.dsk (hd0,0)
map --hook
root (hd0,0)
chainloader /io.sys

the added ",0" in the above is due to the fact that the IMDISK image is NOT a Drive image, but rather a Partition one, or to use the same terms used before in this thread the IMDISK image is a Logical drive, NOT a Physical one, as it has NO MBR nor hidden sectors before bootsector.

Of the two menu entries above, ONLY second one will work, as the bootsector on bios.dsk, having the virtual drive been formatted under 2K/XP has a bootsector invoking NTLDR, rather than IO.SYS.

This can eventually be later corrected by booting from bios.dsk image and using BOOTPART on it.

jaclaz

#4 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 28 May 2007 - 08:41 AM

if i understand correctly, in both cases we have to insert bios files into the image right?

#5 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 28 May 2007 - 10:06 AM

Yep, but using IMDISK or VDK it will be a snap, here is a simple batch for image updating (with VDK), assuming your current bios files are in C:\Biosfiles, your stick is connected as S:\ and you have drive letter V:\ unused, just wrote this in a .cmd file and double click on it:
@Echo OFF

Set source=C:\Biosfiles

Set dest=V:\Biosfiles

vdk.exe OPEN 0 "S:\Bios.dsk" /RW /p:0 /l:V

ECHO Do you want to update files in %dest% from files in %source%?

ECHO ( Press Ctrl+C to break)

PAUSE

copy /Y /V %source%\*.* %dest%

ECHO Image file S:\Bios.dsk is currently mounted as V:\

ECHO If you need to manage any other file, do it before pressing any key.

PAUSE

vdk.exe REMOVE
(of course this is just an example)

jaclaz

#6 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 28 May 2007 - 11:27 AM

i dont know if this is possible but here it goes:

create a image file with ntfs4dos
then grub would boot to dos
change autoexec.bat to launch ntfs4dos
so the folder "bios" on the ntfs formated pen would be readable
copy c:\bios\*.* to the letter assigned to boot the image

this way i would have the bios files of the root folder in the booted dos image file


what do you think?

#7 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 28 May 2007 - 12:00 PM

Yes, this could be a very good alternative to the original "first" solution, that would allow working around possible "timimg" problems or whatever due to the use of NTFS4DOS, however, when the actual BIOS update takes place, NTFS4DOS would be loaded/resident in memory, cannot say if this can lead to problems of any kind.

I always like, whenever possible, to play it safe, and I guess that the above should be thoroughly tested, usually "real" floppy disks for BIOS upgrade boot really "clean".

A possible alternative, that however introduces a further degree of complexity is the following:
Have a floppy image "A" with NTFS4DOS enabled, GRUB.EXE and a menu.lst with default entry to boot from floppy image "B".

Have an empty floppy image "B"

On floppy "A" the autoexec.bat needs to perform the following:
a. load the NTFS4DOS driver
b. perform a FORMAT /S on the "B" image
c. give a menu option to choose which files to copy from C:\biosfiles to the "B" image and copy them
d. optionally create a simple autoexec.bat on "B" with commands to perform the BIOS update automatically, just like when the BOOTBLOCK feature is used:
http://www.wimsbios.com/faq.jsp#q9
(if Award)
e. invoke GRUB.EXE with the correct menu.lst as --config-file

This way the BIOS update is performed from booted floppy "B" (thus from an "as clean as possible" environment")

The (suggested) backup of existing BIOS is however NOT covered in the above scheme, though most probably just saving it between d. and e. steps above should not pose any threat to integrity of BIOS.

jaclaz

#8 Mike69

Mike69

    Member

  • Members
  • 59 posts
  • Location:Hell

Posted 28 May 2007 - 12:50 PM

is there a way to unload ntfs4dos?

#9 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 28 May 2007 - 01:28 PM

No, not that I know of, but maybe you can use the /C switch invoking it from command line (or batch), NOT installing it in CONFIG.SYS:

NTFS4DOS from the command line

NTFS4DOS is also able to start from the command-line.

NTFS4DOS supports the following command parameters:

· /lX - defines the first drive letter used by NTFS4DOS. So i.e. "lG", will use G: as the first volume for drives mounted by NTFS4DOS.

· /rX - defines the size of the RAM-Disk. So i.e. "r4", will create a 4 MB RAM-Disk

· /? - Shows a help-screen.



NTFS4DOS automatically loads a new shell or a program that is started as shell.
If no shell is defined NTFS4DOS uses the standard-shell (command.com).

After you finished the work with NTFS4DOS you can terminate the created shell with the "Exit" command and free all memory that NTFS4DOS has occupied.

Some samples how to start NTFS4DOS from the command line:

NTFS4DOS /lF /r8 command.com /C mybatch.bat

This starts NTFS4DOS, creates a RAM-Drive with the drive letter "F" and mounts all found NTFS volumes starting from the drive letter "G".
The RAM-Disk always gets the first defined drive letter.
After the mounting process is completed a new shell is started and <mybatch.bat> is executed.
After the <mybatch.bat> is finished NTFS4DOS is ended as well because the shell has been started with the parameter "/C".

The available parameters of the DOS shell are described in the DOS documentation.

NTFS4DOS F:\AV\AVSCAN.exe

This command starts NTFS4DOS and mounts all found NTFS-volumes assigning drive-letters starting from the first found free drive-letter. NTFS4DOS will not create a RAM-DISK. After the volumes are mounted a new shell is started and AVSCAN.EXE is started inside this shell. As soon as AVSCAN.EXE is ended NTFS4DOS ends as well and frees all occupied memory.


NTFS4DOS /lE /r4 command.com /K f:\vc\vc.com

This starts NTFS4DOS, creates a RAM-Drive with the drive letter "E" and mounts all found NTFS volumes starting from the drive letter "F".
The RAM-Disk always gets the first defined drive letter.
After the mounting process is completed a new shell is started and the Volkov Commander is executed.
After the Volkov Commander is ended NTFS4DOS isn't ended as well because the shell has been started with the parameter "/K".


jaclaz




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users