Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

Exploring "SETUP /P I;S=detectbus" and Grub4Dos: 8½ times Win98se on USB-drive


Recommended Posts

Part 8½: Full installation of Windows 98se on a Grub4Dos Memdrive

This part is maybe a bit off-topic, but a possibility to use an USB-FDD. Especially older machines cannot boot from USB-HDD. It even turned out possible to use one 1.44MB floppy disk only - together with the Windows 98se CD-ROM!

The idea is to make an empty Memdrive with Grub4Dos by mapping an empty image file to memory (with gz-compression only 500-615 KB), and then boot the legacy USB drive first. From MS-DOS 7.1 “Command prompt only” the Memdrive can be formatted, unless the image file is formatted already. Only if installing from USB-HDD, the “System” has to be transferred with SYS [Drive letter]: and some (bootdisk) MS-DOS 7.1 files has to be copied to the Memdrive (in that stage NOT C:). These steps are simple. More difficult is to omit the Windows’ SETUP Reboots.

Omitting the first reboot after SETUP dialogues and copying files is almost undocumented (see: http://rjnoe.home.xs4all.nl/0/pc/soft/win/setup/msbt95a.txt ), but turned out to be very easy: adding “Reboot=0” to MSBATCH.INF [Setup] (no quotes). After copying files SETUP stopped, showing the  MS-DOS command-prompt started from.

To omit reboots during following phases of SETUP, I patched RUNONCE.EXE. I found the idea of patching this file in an old MSFN-tread about “Windows 98 Live-CD Project”, but nowhere a “how-to”. By trial and error and studying Windows’ Reboot and Restart commands, I succeeded at last (a HEX-editor is needed). With patched RUNONCE.EXE Windows can be restarted with “RUN » RUNONCE –q” (no quotes).

After installation of Windows 98se directly on the Memdrive, Part 8½ is identical to Part II or Part IV. Further installation can be continued in the same ways, but only as long as the Memdrive exists. Other possibilities are:
- Saving to a small, bootable USB-FDD. Later loading the USB-FDD and mapping the Memdrive to first HDD.
- Saving with WinImage 8.1 (shareware) to an image WITHOUT Master Boot Record on a bootable USB drive/partition of choice. The image file has to be loaded and mapped to first HDD (hd0).

---------------------------------------------------------------------------------
PATCH RUNONCE.EXE
------------------------------
Instead of: “rundll.exe setupx.dll,SxShowRebootDlg_RunDll 15” use “rundll.exe user.exe,exitwindowsexec            ”.
In HEX, replace:
“73 65 74 75 70 78 2E 64 6C 6C 2C 53 78 53 68 6F 77 52 65 62 6F 6F 74 44 6C 67 5F 52 75 6E 44 6C 6C 20 31 35”
with:
“75 73 65 72 2E 65 78 65 2C 65 78 69 74 77 69 6E 64 6F 77 73 65 78 65 63 00 00 00 00 00 00 00 00 00 00 00 00”
---------------------------------------------------------------------------------

I used following MENU.LST, two versions: one in case of USB-FDD and one in case of USB-HDD.

---------------------------------------------------------------------------------
MENU.LST
------------------------------
# USB-FDD/ Floppie version
# comments before a command

title Chainload IO.SYS from USB-FDD
root (fd0)
chainloader /io.sys

title Commandline
commandline

title Make empty Memdrive with Legacy USB 1.1 access - boot USB-FDD
map (hd0) (hd)
# some empty IMG files do not need formatting afterwards
# FAT16
map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd512im.gz (hd0)
# FAT32
# map --mem --heads=0 --sectors-per-track=0 (fd0)/32hd420M.img.gz (hd0)
map --hook
# working if formatting wasn’t needed
vol --write (hd0,0) SETUPMEMDRV
root (fd0)
chainloader /io.sys

title Boot IO.SYS with HIMEMX on Memdrive
map (fd1) (fd0)
map (fd0) (fd1)
map --hook
vol --write (hd0,0) MEMDRIVE982
root (hd0,0)
chainloader /io.sys 
pause Remove USB drive

title Map USB-FDD and boot IO.SYS on Memdrive
# do not use usb --init if Windows hasn’t USB drivers
# if in use add mbrint13.sys to IOS.INI [SafeList]
# usb --init
map (hd0) (hd)
# first test from commandline to find C/H/S: map --mem (fd0)+1 (hd0)
map --mem --heads=64 --sectors-per-track=32 (fd0)+1 (hd0)
map --hook
map (fd1) (fd0)
map (fd0) (fd1)
map --hook
map --floppies=2
uuid --write (hd0,0) 1234-5678
vol --write (hd0,0) MEMDRIVE982
root (hd0,0)
chainloader /io.sys
# no need to remove USB drive

title Map Win98se Image and boot IO.SYS on Memdrive
errorcheck off
map (hd0) (hd)
map --mem (fd0)/MEMDRV98.IMA (hd0)
map --hook
map (fd1) (fd0)
map (fd0) (fd1)
map --hook
uuid --write (hd0,0) 1234-5678
vol --write (hd0,0) MEMDRIVE982
map --floppies=2
root (hd0)
chainloader /io.sys

title Reboot IO.SYS on Memdrive
root (hd0,0)
chainloader /io.sys
---------------------------------------------------------------------------------

The USB-FDD has to be booted with HIMEM.SYS (!). After making and formatting the Memdrive (if still needed), and after copying at least HIMEMX.EXE, GRUB.EXE and MENU.LST to the empty Memdrive, a full Windows’ installation can be started directly with:
“SETUP [Drive][Path]MSBATCH.INF /ir /is /nf /nr /IW /p i;s=detectfloppy” (no quotes).

For a quasi-universal installation:
“SETUP [Drive][Path]MSBATCH.INF /ir /is /nf /nr /IW /p i;s =detectbus,detectfloppy”.

First five setup switches mentioned are most safe and convenient, not mandatory. If a Windows 98 installation exists on an attached hard disk, installation in a directory with another name is mandatory – otherwise there is a high risk the configuration of the existing Windows installation will be used by SETUP.

If SETUP has finished the “copy files” part, IO.SYS on the the Memdrive has to be booted from the command-prompt with Grub4Dos, while using HIMEMX.EXE. Afterwards patched RUNONCE.EXE has to be copied to C:\%winbootdir%\SYSTEM. Other desired changes can be made too.
After giving the WIN-command, SETUP will continue. I found my patched RUNONCE.EXE restarted  Windows twice, installing Windows further in the usual way - up to the Welcome screen.

---------------------------------------------------------------------------------
MENU.LST
------------------------------
# USB-HDD version
# comments before a command

title Chainload IO.SYS from USB-HDD
root (hd0,0)
chainloader /io.sys

title Commandline
commandline

title Make empty Memdrive with Legacy USB 1.1 access - boot USB-HDD
# some empty IMG files do not need formatting afterwards
# FAT16; about 500MB
map --mem --heads=0 --sectors-per-track=0 (hd0,0)/hdd-512mb.img.gz (hd)
# FAT32; about 420MB
# map --mem --heads=0 --sectors-per-track=0 (hd0,0)/32hd420M.img.gz (hd)
map --hook
map (fd1) (fd0)
map (fd0) (fd1)
map --hook
# working if formatting not needed
vol --write (hd-1,0) EMPTYMEMDRV
root (hd0,0)
chainloader /io.sys

title First boot IO.SYS on Memdrive (with HIMEM.SYS)
map (hd0) (hd-1)
map (hd-1) (hd0)
map --hook
vol --write (hd0,0) SETUPMEMDRV 
root (hd0,0)
chainloader /io.sys 

title First reboot of IO.SYS on Memdrive (with HIMEMX.EXE) 
vol --write (hd0,0) MEMDRIVE982
root (hd0,0)
chainloader /io.sys 
pause Remove USB drive 

title Reboot IO.SYS on Memdrive
root (hd0,0)
chainloader /io.sys
------------------------------------------------------------------------------------

After booting the USB-HDD, making the empty Memdrive, formatting and installation of basic MS-DOS 7.1 on the empty Memdrive, IO.SYS on the Memdrive has to be booted with HIMEM.SYS (!).

CONFIG.SYS or AUTOEXEC.BAT is not needed, only copying MSDOS.SYS (like the one below – attributes SHR), HIMEM.SYS, DBLBUFF.SYS, GRUB.EXE and MENU.LST to the root. Same in case of other real mode drivers needed.

IO.SYS will load HIMEM.SYS and DBLBUFF.SYS by default, messages about IFSHLP.SYS and WIN.COM can be ignored.
Afterwards the Memdrive is the root-drive (C:). This time a full Windows’ installation can be started, further same as USB-FDD.

------------------------------------------------------------------------------------
MSDOS.SYS
------------------------------
;SYS
[Paths]
WinDir=C:\
WinBootDir=C:\
HostWinBootDrv=C

[Options]
SystemReg=0
;
;The following lines are required for compatibility with other programs.
;Do not remove them (MSDOS.SYS needs to be >1024 bytes).
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxb
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxe
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxg
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxh
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxj
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxk
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxl
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxm
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxp
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxq
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxr
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxs
------------------------------------------------------------------------------------

BTW: About empty images: FAT16 512MB images are readily available on the web. Following is *somehow* already formatted: http://sites.google.com/site/dotalshoff/games/dosbox
With SplImgCreator.exe (Win9X compatible) unformatted FAT32 images can be created of each desired size, I used 420MB. See: http://reboot.pro/topic/15951-easy-creating-new-empty-img
Compression to Grub4Dos-compatible gz-compression with 7-Zip.

BTW2: If the Memdrive is readily available as C-drive, a Windows installation directly from CD-ROM is possible. Both the USB drive and the Memdrive should each time be booted with MS-DOS CD-ROM drivers. During ALL phases, SETUP must have access to the CD-ROM to avoid a full reboot (*somehow* different from USB-FDD/HDD, these can be removed before continuing setup).

BTW3: Windows 98se on a Memdrive can be used together with R. Loew’s 32-bit and/or 64-bit Ramdrive(s) for more space. I set the Swapfile to a 2GB Ramdrive with the 32-bit RAMDISK and used the remaining memory for another Ramdrive with the 64-bit RAMDISK.

BTW4: Following – annotated - MSBATCH.INF makes also mandatory or optional/ desired changes to MSDOS.SYS, CONFIG.SYS, AUTOEXEC.BAT and SYSTEM.INI. According to Q188101 it’s only possible to write twelve characters for filename using DevAddDev in MSBATCH.INF – no Drive/ Path, so files must reside in the Root. See: http://www.c-bit.net/Q188101/DE-DE (not found in English). Same turned out to be true for CmdAdd, but files can be in Path too.

---------------------------------------------------------------------------------
MSBATCH.INF 
------------------------------
;; MSBATCH.INF
;;
;; Copyright (c) 1995-1999 Microsoft Corporation.
;; All rights reserved.
;;
;; Comments always BEFORE a command

[BatchSetup]
Version=3.0 (32-bit)
SaveDate=01/15/20

[Version]
Signature = "$CHICAGO$"

[Setup]
Reboot=0
;; Never set System=0, MBR=0 or CleanBoot=1

[Install]
UpdateInis=Edit.Sysini,Edit.Dossys
UpdateCfgSys=Edit.Cfgsys
UpdateAutoBat=Edit.Autobat

[Edit.Sysini]
;; Mandatory - unless other methods are used
%10%\system.ini,386Enh,,"MaxPhysPage=40000"
;; Optional
;; Convenient while copying whole Memdrive
%10%\system.ini,386Enh,,"PagingDrive=C"
;; If using R. Loew’s RAMDISK
;;%10%\system.ini,386Enh,,"PagingDrive=S"
;; Watch free space on Memdrive
%10%\system.ini,386Enh,,"ConservativeSwapfileUsage=1"
%10%\system.ini,386Enh,,"DMABufferSize=64"
;; Watch use of System Arena
;; If MaxFileCache is below 1/24 of MEM, MinFileCache is mandatory
%10%\system.ini,vcache,,"MinFileCache=1024"
%10%\system.ini,vcache,,"MaxFileCache=1024"
;; If using R. Loew’s RAMDISK (simple method)
;;%10%\system.ini,386Enh,,"device=prothook.VXD"

[Edit.Dossys]
;; Optional but convenient
%30%\msdos.sys,Options,,"BootMenu=1"
%30%\msdos.sys,Options,,"BootMenuDefault=5"
%30%\msdos.sys,Options,,"BootMenuDelay=30"
%30%\msdos.sys,Options,,"SystemReg=0"
%30%\msdos.sys,Options,,"Logo=0"

[Edit.Cfgsys]
;; Mandatory
DevAddDev=HIMEMX.EXE,device,,
;; If using R. Loew’s RAMDISK
;;DevAddDev=HIMEMEX.SYS,device,,
;; One of both drivers needed in case of CD-ROM install
;;DevAddDev=XDVD2.SYS,device,,"/D:MSCD001"
;; Watch conventional memory!
;;DevAddDev=OAKCDROM.SYS,device,,"/D:MSCD001"

[Edit.Autobat]
;; Optional, very convenient
CmdAdd=doskey.com,"/insert"
;; One of both CD extensions needed in case of CD-ROM install
;;CmdAdd=Shcdx33f.com,"/D:MSCD001 /L:U /~+"
;; Optional
CmdAdd=SMARTDRV.exe,"/X C+ /B:57344 /V"
;; Grub needs enough conventional memory - smaller Smartdrive Read-Ahead buffer!
;;CmdAdd=mscdex.exe,"/D:MSCD001 /L:U /M:20"
;;CmdAdd=SMARTDRV.exe,"/X C+ /B:32768 /V"
;; If using R. Loew’s RAMDISK
;;CmdAdd=ramdsk32.com,"S: 2097152"
;;CmdAdd=ramdsk64.com,"T:"

;; Inf,Reg and BAT files need always a Carriage Return on the end! Thank you, LoneCrusader!
;; Better use two semi-colons if using Windows 10 Notepad

---------------------------------------------------------------------------------

 

Edited by deomsh
Correction
  • Like 1
Link to post
Share on other sites

JFYI, grub4dos has an external module called FAT that allows to crate a FAT filesystem directly from grub4dos, part of grubutils:

https://github.com/chenall/grubutils/releases/tag/2015-02-15

Creating the MBR partition table can be done manually or with internal command partnew and writing the Magic Bytes at the end of it can be done manually or using the small Catedit batch:

http://reboot.pro/topic/18783-release-cateditg4b-script-to-write-hex-values/

jaclaz

 

Edited by jaclaz
Link to post
Share on other sites

@jaclaz

Thanks a lot, I had some interesting hours with Grub4Dos, again. :dubbio:

On 1/23/2020 at 1:53 PM, jaclaz said:

JFYI, grub4dos has an external module called FAT that allows to crate a FAT filesystem directly from grub4dos, part of grubutils:

https://github.com/chenall/grubutils/releases/tag/2015-02-15

I didn't knew this module exists, only found that Grub4Dos wasn't able to format a drive.

I did many tests with insmod fat and fat mkfs on an empty "Part 8½ Memdrive", with following results:

  • The Memdrive was formatted directly.
  • insmod fat-command given BEFORE map --mem forced Partition ID 06 and (other CHS values than without). If given AFTER, Partition ID remained to 0E.
  • Scandisk complained about the Mediabyte and missing Second FAT, but could repair them.
  • Win98se SETUP gave a SU-0013 error (saw this one never before).
  • SETUP continued if system was transferred to the Memdrive first with SYS C: (wasn't needed in case of Part 8½: USB-FDD).

Diskedit saw an error in the Mediabyte too. About the Bootsector: BPB_SecPerClus and BPB_FATSz16 where different from what "DOS expects". Further was BPB_HiddSec zero. BPB_Media was F0h (instead of F8h).

So far the bad news. The good news: during experimenting I "discovered" that giving the command insmod fat BEFORE map --mem, and commenting out fat mkfs, resulted in a fully formatted FAT16 Memdrive with Partition ID 06 and a valid bootsector (from an empty image file)! :hello: Gimme such a tool for FAT32 too... :}

On 1/23/2020 at 1:53 PM, jaclaz said:

Creating the MBR partition table can be done manually or with internal command partnew and writing the Magic Bytes at the end of it can be done manually or using the small Catedit batch:

http://reboot.pro/topic/18783-release-cateditg4b-script-to-write-hex-values/

I am becoming more interested in your Catedit batch, because of my need to RESIZE the Memdrive in case of mapping a whole USB-FDD to a Memdrive (USB-FDD with saved Windows installation from Part 8½).

I bought two 512MB USB drives at AliExpress, incredible how cheap they are. Although seeming only different in color, they appeared to be much more different. One was effective 480MB, the other 502MB. Good with VBEMP 32MB as video driver, but a little to big with Windows' standard VGA or with the NVidia driver for my card. Better would be 400-420MB.

Is there any chance your script could be of help in this matter?

Edited by deomsh
Addition
Link to post
Share on other sites

Without knowing the exact set of commands you used is hard to say anything about the 06 and 0E type of partition, there may be different reasons why that happens, including the pre-existing values.

Latest versions of Partnew have been amended as said here:

https://msfn.org/board/topic/180597-exploring-setup-p-isdetectbus-and-grub4dos-8½-times-win98se-on-usb-drive/?do=findComment&comment=1173227

to allow to choose (if needed) between 06 and 0E.

The F0 (floppy) vs. F8 (hard disk media) is likely to be "hardcoded" in the FAT tool (but of course can be later corrected).

The geometry issues  may depend:

BPB_HiddSec zero depend on the exact procedure sey of commands you used (again it can be later corrected)

BPB_SecPerClus is "queer",  while it is possible that grubdos uses a sector per cluster table different from DOS, it is unlikely, at least for "normal" or "common" volume sizes

BPB_FATSz16 I am not sure to what field this corresponds to? :unsure:

There could be a more generic issue (unless it is explicited in the map command) with the geometry of the device, which may (or may not) be connected to the above.

The catedit script is a simple tool to more easily write hex values to given addresses, and of course it can be used to create a FAT32 formatted drive.

Essentially what the format command does on DOS (and also on later windows) for FAT 12/16/32[1] is:
1) copy a hardcoded bootsector (containing the bootcode) from itself to the target
2) make some (relatively simple but not trivial) calculations to determine which values to write in some fields of the bootsector and determine the size of each FAT
3) write, just after the reserved sectors a bunch of (fixed value) bytes and write them again at the end of the first FAT

#1 above (and complications of it, see note [1] can be done with the internal dd of grub4dos 
#2 is ? :w00t: and then catedit can be used to write the calculated values
#3 can be done no problem via dd or via catedit

  So what remains to be written explicited is "only" the calculation part, which may in itself be "easy" for a given set of sizes/geometries or more complex if the idea is that of a "generic" formatting tool. capable of formatting *any* volume. 

I made some time ago a couple spreadsheets and a small batch (though it won't run on DOS) that may be of inspiration to you for FAT 12/16, start around here:

https://msfn.org/board/topic/152097-on-superfloppies-and-their-images/?do=findComment&comment=988732

you might need to read more of the topic to understand the genesis of the spreadsheet, however.

Using the same approach/method for FAT32 is entirely possible.

jaclaz

[1] FAT32 is a tad bit more complicated as the bootsector code is multi-sector (but the sector past the first one are "static" in content if I recall correctly) and there is a backup copy of the bootsector(s)

Link to post
Share on other sites
On 1/27/2020 at 9:12 AM, jaclaz said:

Without knowing the exact set of commands you used is hard to say anything about the 06 and 0E type of partition, there may be different reasons why that happens, including the pre-existing values.

I used following commands:

title Map hdd-512mb.img.gz and boot USB-FDD 
# BEFORE
# insmod fat
map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd-512mb.img.gz (hd)
map --hook
# AFTER
# insmod fat
# fat mkfs (hd0,0)
root (fd0)
chainloader /io.sys

I experimented further with four different USB-FDD's and a handfull of USB-HDD´s. The results I described earlier where only existent on USB-FDD's and only if the image was located on an USB-FDD too. On USB-HDD Grub4Dos made out of all empty DosBox images perfect Memdrives. With Partition ID 06, OEM ID MSDOS5.0 and standard FAT16 formatting (Diskedit, Scandisk and SETUP gave no errors).

At last I found that in case of USB-FDD setting root (fd0) BEFORE the map-commands had exactly the same effects as sole insmod fat, so the FAT module doesn't seem to be needed in Part 8½ of my project.

On 1/27/2020 at 9:12 AM, jaclaz said:

BPB_FATSz16 I am not sure to what field this corresponds to?

Same as "Sectors per FAT" (as a layman I have to rely on authority, I use Scott Mueller's Repairing and Upgrading PC's for my terminology).

On 1/27/2020 at 9:12 AM, jaclaz said:

The catedit script is a simple tool to more easily write hex values to given addresses, and of course it can be used to create a FAT32 formatted drive.

I will have to study these things first more carefully. I will go mainly for FAT16 - because of map --mem my USB-FDD's.

Thanks a lot for all info. :thumbup

Link to post
Share on other sites

I still don't understand what you did (nor what you wanted to obtain :w00t:), what (the heck) does it mean the "before" and "after" and the half commented commands?

An insmod is an installable module, you only need to install it once per session, but it is pretty much binary, either it is installed or is it not.

You should NOT use menu.lst entries, but rather commands on command line, as they will give you some feedback. (and report that feedback as well as the commands actualy issued)

If the set of commands you are using are these ones:

Quote

map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd-512mb.img.gz (hd)

map --hook

 root (fd0)

chainloader /io.sys

They make no sense whatsoever. :ph34r:

1) you map an existing (compressed) image residing on floppy to current hard disk (which may be *whatever* depending on what has been run before and on the setup) and the result could be anything (and the contary of it) depending on the contents of the image
2) you hook the mapping
3) you set root to the floppy
4) you chainload the OS file on floppy

In those the image is simply mapped and is not changed by any of the commands you listed, and BTW you never access it from grub4dos. :dubbio:

As it is now it seems to me like the classic recipe for making a vodka filled watermelon[1] in the shorter version if you have not 12-24 h time :unsure: 

jaclaz

[1]

https://www.tablespoon.com/recipes/vodka-infused-watermelon/cbc4b24f-2748-4f52-af7b-b804cbf070d7

Follow steps 1-3, then, at step 4, just drink the vodka.  ;)

 

 

  

Link to post
Share on other sites
12 hours ago, jaclaz said:

I still don't understand what you did (nor what you wanted to obtain :w00t:)

I needed an empty Memdrive, accessable by MS-DOS and by Grub4Dos. While using an empty gzipped DosBox image, sometimes the Memdrive was "ready", sometimes had to be formatted first in MS-DOS.

12 hours ago, jaclaz said:

 

Quote

map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd-512mb.img.gz (hd)

map --hook

 root (fd0)

chainloader /io.sys

They make no sense whatsoever. :ph34r:

1) you map an existing (compressed) image residing on floppy to current hard disk (which may be *whatever* depending on what has been run before and on the setup) and the result could be anything (and the contary of it) depending on the contents of the image
2) you hook the mapping
3) you set root to the floppy
4) you chainload the OS file on floppy

In those the image is simply mapped and is not changed by any of the commands you listed, and BTW you never access it from grub4dos. :dubbio:

There is no bootsector in the uncompressed image as far I can judge (which is not so far) :}

Further: I have no need to access the content of the image from Grub4Dos.

12 hours ago, jaclaz said:

You should NOT use menu.lst entries, but rather commands on command line, as they will give you some feedback. (and report that feedback as well as the commands actualy issued)

All right, here they are. For convenience I added parttype (hd-1,0).

USB-FDD; first set of commands(no HDD’s attached; one real Floppy)

map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd-512mb.img.gz (hd)

Autodetect number-of-heads failed. Use default value 255
Autodetect sectors-per-track failed. Use default value 63
[xxxM/511M]
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1

map --hook
parttype (hd-1,0)

Partition type for (hd0,0) is 0x0E.

root (fd0)

Filesystem type is fat16, using whole disk
Volume Name is “USBFDSILVER”.

chainloader /io.sys

Will boot MS-DOS 7.x from drive=0x0, partition=0xff(hidden sectors=0x0)

boot

Memdrive accessed with MS-DOS 7.1:
A:\ >VOL C:        gives (Dutch!):
Het mediumtype is ongeldig. Bezig met lezen station C
Afbreken, Opnieuw proberen, Mislukt
(same as “Invalid mediatype” and “Abort/Retry/Fail”)

The Memdrive need to be formatted. Bootsector is filled out in a way unknown to me (as shown by PTEDIT).

USB-FDD; second set of commands

map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd-512mb.img.gz (hd)

Autodetect number-of-heads failed. Use default value 255
Autodetect sectors-per-track failed. Use default value 63
[xxxM/511M]
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1

map --hook
parttype (hd-1,0)

Partition type for (hd0,0) is 0x0E.

insmod fat

fat loaded

fat mkfs (hd-1,0)

FAT subtype:    FAT16
Sectors per cluster: 32
Sectors per FAT:128
Number of free clusters: 32755
Total clusters: 32755
FAT start sector: 1
524080 KB total drive space.
524080 KB available.

root (fd0)

Filesystem type is fat16, using whole disk
Volume Name is “USBFDSILVER”.

chainloader /io.sys

Will boot MS-DOS 7.x from drive=0x0, partition=0xff(hidden sectors=0x0)

Memdrive accessed with MS-DOS 7.1:
A:\>VOL C:         gives normal output

Bootsector is like described in my post of https://msfn.org/board/topic/180597-exploring-setup-p-isdetectbus-and-grub4dos-8½-times-win98se-on-usb-drive/?do=findComment&comment=1176826 (Scandisk did found errors).

USB-FDD; third set of commands

insmod fat

fat loaded

map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd-512mb.img.gz (hd)

Autodetect number-of-heads failed. Use default value 255
Autodetect sectors-per-track failed. Use default value 63
[xxxM/511M]
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1

map --hook
parttype (hd-1,0)

Partition type for (hd0,0) is 0x06.

root (fd0)

Filesystem type is fat16, using whole disk
Volume Name is “USBFDSILVER”.

chainloader /io.sys

Will boot MS-DOS 7.x from drive=0x0, partition=0xff(hidden sectors=0x0)

Memdrive accessed with MS-DOS 7.1:
>A:\VOL C:         gives normal output

Bootsector is “normal” (mediatype: F8), Scandisk didn’t found errors.

USB-FDD; fourth set of commands

insmod fat

fat loaded

map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd-512mb.img.gz (hd)

Autodetect number-of-heads failed. Use default value 255
Autodetect sectors-per-track failed. Use default value 63
[xxxM/511M]
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1

map --hook
parttype (hd-1,0)

Partition type for (hd0,0) is 0x06.

fat mkfs (hd-1,0)

FAT subtype:    FAT16
Sectors per cluster: 32
Sectors per FAT:128
Number of free clusters: 32755
Total clusters: 32755
FAT start sector: 1
524080 KB total drive space.
524080 KB available.

root (fd0)

Filesystem type is fat16, using whole disk
Volume Name is “USBFDSILVER”.

chainloader /io.sys

Will boot MS-DOS 7.x from drive=0x0, partition=0xff(hidden sectors=0x0)

Memdrive accessed with MS-DOS 7.1:
A:\>VOL C:         gives normal output

Bootsector is NOT “normal” (mediatype: F0) Scandisk did found errors as described earlier.

USB-FDD; fifth set of commands

root (fd0)

Filesystem type is fat16, using whole disk
Volume Name is “USBFDSILVER”.

map --mem --heads=0 --sectors-per-track=0 (fd0)/hdd-512mb.img.gz (hd)

Autodetect number-of-heads failed. Use default value 255
Autodetect sectors-per-track failed. Use default value 63
[xxxM/511M]
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1

map --hook
parttype (hd-1,0)

Partition type for (hd0,0) is 0x06.

chainloader /io.sys

Will boot MS-DOS 7.x from drive=0x0, partition=0xff(hidden sectors=0x0)

Memdrive accessed by MS-DOS 7.1:
>A:\VOL C:         gives normal output

Bootsector is “normal”, (mediatype: F8). Scandisk didn’t found errors.

 

It appears that if an USB-FDD is used, I solved my problem giving the command root (fd0) before map --mem.

In case of USB-HDD the first set of commands above is enough to obtain an empty Memdrive, ready for the next steps of Part 8½ of my project.

Edited by deomsh
Addition
Link to post
Share on other sites

Ok, so you have three five slightly different set of commands.

It makes no sense to provide --heads=0 --sectors-per-track=0 to have then grub4dos default to 255/63, use instead, (and you can well specify (to avoid possibel issues a definite disk drive number), i.e.

map --mem --heads=255 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz (hd0)

The result of parttype (hd-1,0) may also be an artifact of some kind, if the source image is all 00's you shouldn't have neither 0E nor 06 until a partition table is established.

even here, use an explicit disk number (to be sure) and, besides the:

parttype (hd0,0)

Run also:

geometry (hd0)

and:

cat --hex --skip=446 (hd0)+1

and (you will need to add to the floppy the batch) try using mbrview.g4b (reboot.pro is down right now, I am attaching a copy to this post):

https://web.archive.org/web/20170826082957/http://reboot.pro/topic/17728-release-mbrviewg4b-a-bat-tool-for-grub4dos/

/mbrview.g4b (hd0)

These three methods will confirm (or deny) that there is actually a (valid) partition table on the (hd0).

It is as well possible that the fat mkfs is not really-really making a volume in a partitioned device, but rather a superfloppy.

after (in the fourth set of commands) you run:

fat mkfs (hd0,0)

run again the three commands before (geometry/cat/mbrview) to check the differences.

UNLESS you run (on the mem mapped device) a partnew command, *like*:

partnew (hd0,0) 0x06 63 1048289

I doubt that a proper partition table will be made on the disk.

To recap, try the following:

insmod fat

map --mem --heads=255 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz (hd0)

map --hook

parttype (hd0,0)

geometry (hd0)

cat --hex --skip=446 (hd0)+1

/mbrview.g4b (hd0)

fat mkfs (hd0,0)

parttype (hd0,0)

geometry (hd0)

cat --hex --skip=446 (hd0)+1

/mbrview.g4b (hd0)

then, from fresh, try this instead:

insmod fat

map --mem --heads=255 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz (hd0)

map --hook

parttype (hd0,0)

geometry (hd0)

cat --hex --skip=446 (hd0)+1

/mbrview.g4b (hd0)

partnew (hd0,0) 0x06 63 1048289

geometry (hd0)

cat --hex --skip=446 (hd0)+1

/mbrview.g4b (hd0)

fat mkfs (hd0,0)

parttype (hd0,0)

geometry (hd0)

cat --hex --skip=446 (hd0)+1

/mbrview.g4b (hd0)

and see if you find any difference.

jaclaz

 

mbrview-no-wenv.zip

Edited by jaclaz
Link to post
Share on other sites
On 1/30/2020 at 11:36 AM, jaclaz said:

It makes no sense to provide --heads=0 --sectors-per-track=0 to have then grub4dos default to 255/63, use instead, (and you can well specify (to avoid possibel issues a definite disk drive number), i.e.

Grub4Dos "asked" me for it, else the image won't load.

On 1/30/2020 at 11:36 AM, jaclaz said:

The result of parttype (hd-1,0) may also be an artifact of some kind, if the source image is all 00's you shouldn't have neither 0E nor 06 until a partition table is established.

I examined the source image more closely. The DosBox image seems to have partition table, exactly the same as first cat --hex below.

First set of commands

>insmod fat
Fat loaded 
>map --mem --heads=255 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz (hd0) 
Autodetect number-of-heads failed. Use the specified 255
Autodetect sectors-per-track failed. Use the specified 63
[xxxM/511M]
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1
>map --hook 
>parttype (hd0,0)
Partition type for (hd0,0) is 0x06
>geometry (hd0)
drive 0x80(LBA): C/H/S=66/255/63, Sector Count/Size=1048320/512
>cat --hex --skip=446 (hd0)+1
000001BE:  80 01 01 00   06 1F BF 08   3F 00 00 00   C1 FE 0F 00
000001CE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001DE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001EE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001FE:  55 AA
>/mbrview.g4b (hd0) 
Drive=(hd0), Signature=737365E3
Part Type   Boot   Begin CHS End   CHS LBA Start LBA Sectors
#0     06     80       0/1/1 520/31/63        63     1048257
#1     00     00       0/0/0     0/0/0         0           0
#2     00     00       0/0/0     0/0/0         0           0
#3     00     00       0/0/0     0/0/0         0           0
>fat mkfs (hd0,0) 
FAT sub-type:    FAT16
Sectors per cluster: 32
Sectors per FAT:128
Number of free clusters: 32753
Total clusters: 32753
FAT start sector: 1
524080 KB total drive space.
524080 KB available.
>parttype (hd0,0) 
NOTHING ON SCREEN (only if mbrview was loaded before)
>geometry (hd0) 
drive 0x80(LBA): C/H/S=66/255/63, Sector Count/Size=1048320/512
>cat --hex --skip=446 (hd0)+1 
000001BE:  80 01 01 00   06 1F BF 08   3F 00 00 00   C1 FE 0F 00
000001CE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001DE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001EE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001FE:  55 AA
>/mbrview.g4b (hd0) 
Drive=(hd0), Signature=737365E3
Part Type Boot Begin CHS End   CHS LBA Start LBA Sectors
#0     06   80     0/1/1 520/31/63        63     1048257
#1     00   00     0/0/0     0/0/0         0           0
#2     00   00     0/0/0     0/0/0         0           0
#3     00   00     0/0/0     0/0/0         0           0
 
Second set of commands
>insmod fat
Fat loaded 
>map --mem --heads=255 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz (hd0) 
Autodetect number-of-heads failed. Use the specified 255
Autodetect sectors-per-track failed. Use the specified 63
[xxxM/511M]
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1
>map --hook 
>parttype (hd0,0)
Partition type for (hd0,0) is 0x06
>geometry (hd0)
drive 0x80(LBA): C/H/S=66/255/63, Sector Count/Size=1048320/512
>cat --hex --skip=446 (hd0)+1
000001BE:  80 01 01 00   06 1F BF 08   3F 00 00 00   C1 FE 0F 00
000001CE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001DE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001EE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001FE:  55 AA
>/mbrview.g4b (hd0) 
Drive=(hd0), Signature=737365E3
Part Type Boot Begin CHS End   CHS LBA Start LBA Sectors
#0     06   80     0/1/1 520/31/63        63     1048257
#1     00   00     0/0/0     0/0/0         0           0
#2     00   00     0/0/0     0/0/0         0           0
#3     00   00     0/0/0     0/0/0         0           0
>partnew (hd0,0) 0x06 63 1048289 
>geometry (hd0) 
drive 0x80(LBA): C/H/S=66/255/63, Sector Count/Size=1048320/512
       Partition num: 0, active,  Filesystem type is fat16, partition type 0x06
>cat --hex --skip=446 (hd0)+1 
000001BE:  80 01 01 00   06 41 20 41   3F 00 00 00   E1 FE 0F 00
000001CE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001DE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001EE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001FE:  55 AA
>/mbrview.g4b (hd0) 
Drive=(hd0), Signature=737365E3
Part Type Boot Begin CHS End    CHS LBA Start LBA Sectors
#0     06   80     0/1/1   65/65/32        63     1048289
#1     00   00     0/0/0      0/0/0         0           0
#2     00   00     0/0/0      0/0/0         0           0
#3     00   00     0/0/0      0/0/0         0           0
>fat mkfs (hd0,0) 
FAT sub-type:    FAT16
Sectors per cluster: 32
Sectors per FAT:128
Number of free clusters: 32754
Total clusters: 32754
FAT start sector: 1
524064 KB total drive space.
524064 KB available.
>parttype (hd0,0) 
NOTHING ON SCREEN
>geometry (hd0) 
drive 0x80(LBA): C/H/S=66/255/63, Sector Count/Size=1048320/512
       Partition num: 0, active,  Filesystem type is fat16, partition type 0x06
>cat --hex --skip=446 (hd0)+1 
000001BE:  80 01 01 00   06 41 20 41   3F 00 00 00   E1 FE 0F 00
000001CE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001DE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001EE:  00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00
000001FE:  55 AA
>/mbrview.g4b (hd0) 
Drive=(hd0), Signature=737365E3
Part Type Boot Begin CHS End    CHS LBA Start LBA Sectors
#0     06   80     0/1/1   65/65/32        63     1048289
#1     00   00     0/0/0      0/0/0         0           0
#2     00   00     0/0/0      0/0/0         0           0
#3     00   00     0/0/0      0/0/0         0           0

No changes in the First set of cammands after fat mkfs (hd0,0)

Changes after partnew (hd0,0) 0x06 63 1048289 in Bold:

>geometry (hd0)
drive 0x80(LBA): C/H/S=66/255/63, Sector Count/Size=1048320/512
       Partition num: 0, active,  Filesystem type is fat16, partition type 0x06

>cat --hex --skip=446 (hd0)+1
000001BE:  80 01 01 00   06 41 20 41   3F 00 00 00   E1 FE 0F 00

>/mbrview.g4b (hd0)
Drive=(hd0), Signature=737365E3
Part Type Boot Begin CHS End    CHS LBA Start LBA Sectors
#0     06   80     0/1/1   65/65/32        63     1048289

>fat mkfs (hd0,0)
FAT sub-type:    FAT16
Sectors per cluster: 32
Sectors per FAT:128
Number of free clusters: 32754
Total clusters: 32754
FAT start sector: 1
524064 KB total drive space.
524064 KB available.

Afterwards no changes.

 

Edited by deomsh
Ckecked for possible mistake regarding original DosBox image
Link to post
Share on other sites

Yep :), you see, you said you had a 00ed image, while you had an image with ALREADY both a valid partition table entry and the Magic Bytes signature in the MBR (and also - irrelevant for non NT systems - a Disk Signature).

Not only, the  actual entry values in that partition table lead us to the fact that it was created using NOT a 255/63 geometry, but rather a 32/63 one (which is appropriate for the overall size of the image).

Which makes me think that not only the image is partitioned, but it is also formatted.

I.e. run

insmod fat

map --mem --heads=32 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz (hd0)

map --hook

geometry (hd0)

then, since we already know that the partition table exists, and leads to a bootsector on sector 63, try:

cat --hex (hd0)63+1

if it is all 00's then the base image is partitioned but the volume/partition in it is not formatted, if you see non 00's values it is likely that also the FAT filesystem exists.

try also:

root (hd0,0)

then, go anyway on:

fat mkfs (hd0,0)

geometry (hd0)

then, try again, this time making sure that the image is actually all 00's, like this:

insmod fat

map --mem --heads=32 --sectors-per-track=63 (fd0)/hdd-512mbALL_00s.img.gz (hd0)

map --hook

geometry (hd0)

partnew (hd0,0) 0x06 63 1048257

makeactive (hd0,0)

geometry (hd0)

/mbrview.g4b (hd0)

fat mkfs (hd0,0)

geometry (hd0)

You should get, from a completely blank image, the same results.

jaclaz

Edited by jaclaz
Link to post
Share on other sites
1 hour ago, jaclaz said:

Yep :), you see, you said you had a 00ed image, while you had an image with ALREADY both a valid partition table entry and the Magic Bytes signature in the MBR

I am afraid there is some misunderstanding. I said following:

On 1/22/2020 at 11:49 PM, deomsh said:

BTW: About empty images: FAT16 512MB images are readily available on the web. Following is *somehow* already formatted: http://sites.google.com/site/dotalshoff/games/dosbox

and:

On 1/29/2020 at 11:31 PM, deomsh said:

needed an empty Memdrive, accessable by MS-DOS and by Grub4Dos. While using an empty gzipped DosBox image, sometimes the Memdrive was "ready", sometimes had to be formatted first in MS-DOS.

but also:

On 1/29/2020 at 11:31 PM, deomsh said:

There is no bootsector in the uncompressed image as far I can judge (which is not so far) :}

For now I will return to my labarotory to run the tests you gave so friendly.

BTW in the meantime I found out that I can open the uncompressed DosBox images with HxD, so I hopefully I can deliver some more info.

Link to post
Share on other sites

No problem :), it is just a matter of terminology, I read "empty image" as "empty image" (which is what I call an image consisting of only 00's), mainly to distinguish it from:

1) not completely empty images
2) images that are empty BUT for the MBR
3) images that are empty BUT for the MBR and PBR
4) images that are empty BUT for the MBR the PBR and the filesystem
5) other kinds of empty images that are different from the above but still are not fully empty (i.e. composed entirely of 00's)

The whole point that surprised/perplexed me was this one:

On 1/26/2020 at 11:39 PM, deomsh said:

@jaclaz

The good news: during experimenting I "discovered" that giving the command insmod fat BEFORE map --mem, and commenting out fat mkfs, resulted in a fully formatted FAT16 Memdrive with Partition ID 06 and a valid bootsector (from an empty image file)! :hello:

Which I would now translate tentatively to:

Surprisingly, giving the command insmod fat before map --mem and commenting out fat mkfs (or - in other words - without touching at all the gzipped image and only copying/expanding it to RAM), resulted in a fully formatted FAT16 Memdrive with partition ID 06 and a valid bootsector (from a non-empty image that was most probably  already partitioned and containing a FAT 16 type 06 formatted partition)

Anyway the idea (mine) was to assist you into making the thingy work from scratch, i.e. from an "empty image", if the image is pre-made, as you later found, there is no need to have the insmod fat, and if the pre-made image is all 00's ...(see spoiler) .

Most probably (and this is what should be confirmed by the experiments :dubbio:) at least some of the "different" behaviours you reported (that you connected to issuing this or that command before or after another one or by loading the fat module. or making root to (fd0), etc.) are side-effects (or collateral damages) deriving from the "wrong" geometry used to map the image.

jaclaz

 

 

once you can do with an empty (all 00's image) maybe you don't actually need an image at all:

# set rd-base address to be 32MB
map --rd-base=33554432
# set rd-size to 256MB
map --rd-size=268435456
map --heads=32 --sectors-per-track=63 (rd)+1 (hd0)
map --hook
#create a partition (524225=268435456/512-63)
partnew (hd0,0) 0x06 63 524225
makeactive (hd0,0)
#format it
insmod fat
fat mkfs (hd0,0)
geometry (hd0)

 

 

Edited by jaclaz
  • Like 1
Link to post
Share on other sites
  • 2 weeks later...
On 1/31/2020 at 6:57 PM, jaclaz said:

Anyway the idea (mine) was to assist you into making the thingy work from scratch, i.e. from an "empty image", if the image is pre-made, as you later found, there is no need to have the insmod fat, and if the pre-made image is all 00's ...(see spoiler) .

I am very grateful for this, your idea to map the Grub4Dos ramdrive to a harddrive is very promising. I am still busy testing. It appears the bootsector is write protected, but mapping with --unsafe-boot did the trick.

The FAT module gives still the wrong mediabyte (F0 instead of F8), but can be useful because of the possibility to write an uuid and/or an volume to the drive for easier identification. No problem to install Windows 98se on the drive after running SCANDISK and SYS!

On 1/31/2020 at 6:57 PM, jaclaz said:

Most probably (and this is what should be confirmed by the experiments :dubbio:) at least some of the "different" behaviours you reported (that you connected to issuing this or that command before or after another one or by loading the fat module. or making root to (fd0), etc.) are side-effects (or collateral damages) deriving from the "wrong" geometry used to map the image.

I tried other --heads=64/32/16 to change the geometry of the Memdrive while mapping the Dosbox image, but that didn't make any difference. But I think I found how the "bad" Memdrive is different from the "good" one. Thanks to the homework you gave me, I became more aware of the hex representation of MBR's, bootsectors and starting bytes of the FAT.

BAD mapping to a Memdrive of Dosbox image in hdd-512mb.img.gz

map --mem --unsafe-boot --heads=32 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz
 (hd0)                                                                          
                                                                            
Autodetect number-of-heads failed. Use the specified 32                         
                                                                                
Autodetect sectors-per-track failed. Use the specified 63                       
                                                                                
floppies_orig=1, harddrives_orig=0, floppies_curr=1, harddrives_curr=1          
map --hook                                                                      
parttype (hd0,0)                                                                
Partition type for (hd0,0) is 0x0E.                                             
geometry (hd0)                                                                  
drive 0x80(LBA): C/H/S=521/32/63, Sector Count/Size=1048384/512                 
   Partition num: 0, active,  Filesystem type unknown, partition type 0x0E      
grab.g4b                                                                        
cat --hex --length=256 (hd0)+1                                                  
00000000: FA 33 C0 8E  D0 BC 00 7C  FB 50 1F 50  07 FC BE 1C ; .3.....|.P.P.... 
00000010: 7C BF 1C 06  50 57 B9 E4  01 F3 A4 CB  1E BB 00 7C ; |...PW.........| 
00000020: 53 BA 80 01  52 B8 01 02  53 41 CD 13  5F BE BE 07 ; S...R...SA.._... 
00000030: 56 5D 5A FA  CB 00 00 00  00 00 00 00  00 00 00 00 ; V]Z............. 
00000040: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000050: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000060: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000070: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000080: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000090: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
grab.g4b 1                                                                      
cat --hex --skip=256 --length=256 (hd0)+1                                       
00000100: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000110: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000120: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000130: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000140: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000150: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000160: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000170: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000180: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000190: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001B0: 00 00 00 00  00 00 00 00  80 00 00 00  00 00 80 01 ; ................ 
000001C0: 01 00 0E 01  81 08 3F 00  00 00 01 FF  0F 00 00 00 ; ......?......... 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA ; ..............U. 
grab.g4b 2                                                                      
cat --hex --length=256 (hd0)63+1                                                
00000000: 33 C0 8E C0  8E D8 8E D0  BC 00 7C FC  8B F4 BF 00 ; 3.........|..... 
00000010: 06 B9 00 01  F2 A5 EA 67  06 00 00 8B  3F 00 00 00 ; .......g....?... 
00000020: 07 3C 35 74  23 B4 10 F6  E4 05 AE 04  8B F0 80 7C ; .<5t#..........| 
00000030: 04 00 74 44  80 7C 04 05  74 3E C6 04  80 E8 DA 00 ; ..tD.|..t>...... 
00000040: 8A 74 01 8B  4C 02 EB 08  E8 CF 00 B9  01 00 32 D1 ; .t..L.........2. 
00000050: BB 00 7C B8  01 02 CD 13  72 1E 81 BF  FE 01 55 AA ; ..|.....r.....U. 
00000060: 75 16 EA 00  7C 00 00 80  FA 81 74 02  B2 80 8B EA ; u...|.....t..... 
00000070: 42 80 F2 B3  88 16 41 07  BF BE 07 B9  04 00 C6 06 ; B.....A......... 
00000080: 34 07 31 32  F6 88 2D 8A  45 04 3C 00  74 23 3C 05 ; 4.12..-.E.<.t#<. 
00000090: 74 1F FE C6  BE 31 07 E8  71 00 BE 4F  07 46 46 8B ; t....1..q..O.FF. 
000000A0: 1C 0A FF 74  05 32 7D 04  75 F3 8D B7  7B 07 E8 5A ; ...t.2}.u...{..Z 
000000B0: 00 83 C7 10  FE 06 34 07  E2 CB 80 3E  75 04 02 74 ; ......4....>u..t 
000000C0: 0B BE 42 07  0A F6 75 0A  CD 18 EB AC  BE 31 07 E8 ; ..B...u......1.. 
000000D0: 39 00 E8 36  00 32 E4 CD  1A 8B DA 83  C3 60 B4 01 ; 9..6.2.......`.. 
000000E0: CD 16 B4 00  75 0B CD 1A  3B D3 72 F2  A0 4F 07 EB ; ....u...;.r..O.. 
000000F0: 0A CD 16 8A  C4 3C 1C 74  F3 04 F6 3C  31 72 D6 3C ; .....<.t...<1r.< 
grab.g4b 3                                                                      
cat --hex --skip=256 --length=256 (hd0)63+1                                     
00000100: 35 77 D2 50  BE 2F 07 BB  1B 06 53 FC  AC 50 24 7F ; 5w.P./....S..P$. 
00000110: B4 0E CD 10  58 A8 80 74  F2 C3 56 B8  01 03 BB 00 ; ....X..t..V..... 
00000120: 06 B9 01 00  32 F6 CD 13  5E C6 06 4F  07 3F C3 0D ; ....2...^..O.?.. 
00000130: 8A 0D 0A 46  35 20 2E 20  2E 20 2E A0  64 69 73 6B ; ...F5 . . ..disk 
00000140: 20 32 0D 0A  0A 44 65 66  61 75 6C 74  3A 20 46 31 ;  2...Default: F1 
00000150: A0 00 01 00  04 00 06 03  07 07 0A 0A  63 0E 64 0E ; ............c.d. 
00000160: 65 14 80 19  81 19 82 19  83 1E 93 24  A5 2B 9F 2F ; e..........$.+./ 
00000170: 75 33 52 33  DB 36 40 3B  F2 41 00 44  6F F3 48 70 ; u3R3.6@;.A.Do.Hp 
00000180: 66 F3 4F 73  B2 55 6E 69  F8 4E 6F 76  65 6C EC 4D ; f.Os.Uni.Novel.M 
00000190: 69 6E 69 F8  4C 69 6E 75  F8 41 6D 6F  65 62 E1 46 ; ini.Linu.Amoeb.F 
000001A0: 72 65 65 42  53 C4 42 53  44 E9 50 63  69 F8 43 70 ; reeBS.BSD.Pci.Cp 
000001B0: ED 56 65 6E  69 F8 44 6F  73 73 65 E3  3F BF 80 01 ; .Veni.Dosse.?... 
000001C0: 01 00 06 1F  BF 08 3F 00  00 00 C1 FE  0F 00 00 00 ; ......?......... 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA ; ..............U. 
grab.g4b 4                                                                      
cat --hex --length=256 (hd0,0)+1                                                
00000000: 33 C0 8E C0  8E D8 8E D0  BC 00 7C FC  8B F4 BF 00 ; 3.........|..... 
00000010: 06 B9 00 01  F2 A5 EA 67  06 00 00 8B  3F 00 00 00 ; .......g....?... 
00000020: 07 3C 35 74  23 B4 10 F6  E4 05 AE 04  8B F0 80 7C ; .<5t#..........| 
00000030: 04 00 74 44  80 7C 04 05  74 3E C6 04  80 E8 DA 00 ; ..tD.|..t>...... 
00000040: 8A 74 01 8B  4C 02 EB 08  E8 CF 00 B9  01 00 32 D1 ; .t..L.........2. 
00000050: BB 00 7C B8  01 02 CD 13  72 1E 81 BF  FE 01 55 AA ; ..|.....r.....U. 
00000060: 75 16 EA 00  7C 00 00 80  FA 81 74 02  B2 80 8B EA ; u...|.....t..... 
00000070: 42 80 F2 B3  88 16 41 07  BF BE 07 B9  04 00 C6 06 ; B.....A......... 
00000080: 34 07 31 32  F6 88 2D 8A  45 04 3C 00  74 23 3C 05 ; 4.12..-.E.<.t#<. 
00000090: 74 1F FE C6  BE 31 07 E8  71 00 BE 4F  07 46 46 8B ; t....1..q..O.FF. 
000000A0: 1C 0A FF 74  05 32 7D 04  75 F3 8D B7  7B 07 E8 5A ; ...t.2}.u...{..Z 
000000B0: 00 83 C7 10  FE 06 34 07  E2 CB 80 3E  75 04 02 74 ; ......4....>u..t 
000000C0: 0B BE 42 07  0A F6 75 0A  CD 18 EB AC  BE 31 07 E8 ; ..B...u......1.. 
000000D0: 39 00 E8 36  00 32 E4 CD  1A 8B DA 83  C3 60 B4 01 ; 9..6.2.......`.. 
000000E0: CD 16 B4 00  75 0B CD 1A  3B D3 72 F2  A0 4F 07 EB ; ....u...;.r..O.. 
000000F0: 0A CD 16 8A  C4 3C 1C 74  F3 04 F6 3C  31 72 D6 3C ; .....<.t...<1r.< 
grab.g4b 5                                                                      
cat --hex --skip=256 --length=256 (hd0,0)+1                                     
00000100: 35 77 D2 50  BE 2F 07 BB  1B 06 53 FC  AC 50 24 7F ; 5w.P./....S..P$. 
00000110: B4 0E CD 10  58 A8 80 74  F2 C3 56 B8  01 03 BB 00 ; ....X..t..V..... 
00000120: 06 B9 01 00  32 F6 CD 13  5E C6 06 4F  07 3F C3 0D ; ....2...^..O.?.. 
00000130: 8A 0D 0A 46  35 20 2E 20  2E 20 2E A0  64 69 73 6B ; ...F5 . . ..disk 
00000140: 20 32 0D 0A  0A 44 65 66  61 75 6C 74  3A 20 46 31 ;  2...Default: F1 
00000150: A0 00 01 00  04 00 06 03  07 07 0A 0A  63 0E 64 0E ; ............c.d. 
00000160: 65 14 80 19  81 19 82 19  83 1E 93 24  A5 2B 9F 2F ; e..........$.+./ 
00000170: 75 33 52 33  DB 36 40 3B  F2 41 00 44  6F F3 48 70 ; u3R3.6@;.A.Do.Hp 
00000180: 66 F3 4F 73  B2 55 6E 69  F8 4E 6F 76  65 6C EC 4D ; f.Os.Uni.Novel.M 
00000190: 69 6E 69 F8  4C 69 6E 75  F8 41 6D 6F  65 62 E1 46 ; ini.Linu.Amoeb.F 
000001A0: 72 65 65 42  53 C4 42 53  44 E9 50 63  69 F8 43 70 ; reeBS.BSD.Pci.Cp 
000001B0: ED 56 65 6E  69 F8 44 6F  73 73 65 E3  3F BF 80 01 ; .Veni.Dosse.?... 
000001C0: 01 00 06 1F  BF 08 3F 00  00 00 C1 FE  0F 00 00 00 ; ......?......... 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA ; ..............U. 
grab.g4b 6                                                                      
cat --hex --length=256 (hd0,0)63+1                                              
00000000: EB 3C 90 4D  53 44 4F 53  35 2E 30 00  02 10 01 00 ; .<.MSDOS5.0..... 
00000010: 02 00 02 00  00 F8 00 01  3F 00 20 00  3F 00 00 00 ; ........?. .?... 
00000020: C1 FE 0F 00  80 00 29 24  0C 11 00 4E  4F 20 4E 41 ; ......)$...NO NA 
00000030: 4D 45 20 20  20 20 46 41  54 31 36 20  20 20 00 00 ; ME    FAT16   .. 
00000040: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000050: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000060: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000070: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000080: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000090: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
grab.g4b 7                                                                      
cat --hex --skip=256 --length=256 (hd0,0)63+1                                   
00000100: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000110: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000120: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000130: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000140: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000150: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000160: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000170: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000180: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000190: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA ; ..............U. 
grab.g4b 8                                                                      

Watch the sector count of the "good" mapping, 64 sectors less.

GOOD mapping of Dosbox image in hdd-512mb.img.gz

find /hdd-512mb.img.gz                                                          
 (fd0)                                                                          
map --mem --unsafe-boot --heads=32 --sectors-per-track=63 /hdd-512mb.img.gz (hd0
)                                                                               
                                                                                
Autodetect number-of-heads failed. Use the specified 32                         
                                                                                
Autodetect sectors-per-track failed. Use the specified 63                       
map --hook                                                                      
parttype (hd0,0)                                                                
Partition type for (hd0,0) is 0x06.                                             
geometry (hd0)                                                                  
drive 0x80(LBA): C/H/S=520/32/63, Sector Count/Size=1048320/512                 
grab.g4b                                                                        
cat --hex --length=256 (hd0)+1                                                  
00000000: 33 C0 8E C0  8E D8 8E D0  BC 00 7C FC  8B F4 BF 00 ; 3.........|..... 
00000010: 06 B9 00 01  F2 A5 EA 67  06 00 00 8B  D5 58 A2 4F ; .......g.....X.O 
00000020: 07 3C 35 74  23 B4 10 F6  E4 05 AE 04  8B F0 80 7C ; .<5t#..........| 
00000030: 04 00 74 44  80 7C 04 05  74 3E C6 04  80 E8 DA 00 ; ..tD.|..t>...... 
00000040: 8A 74 01 8B  4C 02 EB 08  E8 CF 00 B9  01 00 32 D1 ; .t..L.........2. 
00000050: BB 00 7C B8  01 02 CD 13  72 1E 81 BF  FE 01 55 AA ; ..|.....r.....U. 
00000060: 75 16 EA 00  7C 00 00 80  FA 81 74 02  B2 80 8B EA ; u...|.....t..... 
00000070: 42 80 F2 B3  88 16 41 07  BF BE 07 B9  04 00 C6 06 ; B.....A......... 
00000080: 34 07 31 32  F6 88 2D 8A  45 04 3C 00  74 23 3C 05 ; 4.12..-.E.<.t#<. 
00000090: 74 1F FE C6  BE 31 07 E8  71 00 BE 4F  07 46 46 8B ; t....1..q..O.FF. 
000000A0: 1C 0A FF 74  05 32 7D 04  75 F3 8D B7  7B 07 E8 5A ; ...t.2}.u...{..Z 
000000B0: 00 83 C7 10  FE 06 34 07  E2 CB 80 3E  75 04 02 74 ; ......4....>u..t 
000000C0: 0B BE 42 07  0A F6 75 0A  CD 18 EB AC  BE 31 07 E8 ; ..B...u......1.. 
000000D0: 39 00 E8 36  00 32 E4 CD  1A 8B DA 83  C3 60 B4 01 ; 9..6.2.......`.. 
000000E0: CD 16 B4 00  75 0B CD 1A  3B D3 72 F2  A0 4F 07 EB ; ....u...;.r..O.. 
000000F0: 0A CD 16 8A  C4 3C 1C 74  F3 04 F6 3C  31 72 D6 3C ; .....<.t...<1r.< 
grab.g4b 1                                                                      
cat --hex --skip=256 --length=256 (hd0)+1                                       
00000100: 35 77 D2 50  BE 2F 07 BB  1B 06 53 FC  AC 50 24 7F ; 5w.P./....S..P$. 
00000110: B4 0E CD 10  58 A8 80 74  F2 C3 56 B8  01 03 BB 00 ; ....X..t..V..... 
00000120: 06 B9 01 00  32 F6 CD 13  5E C6 06 4F  07 3F C3 0D ; ....2...^..O.?.. 
00000130: 8A 0D 0A 46  35 20 2E 20  2E 20 2E A0  64 69 73 6B ; ...F5 . . ..disk 
00000140: 20 32 0D 0A  0A 44 65 66  61 75 6C 74  3A 20 46 31 ;  2...Default: F1 
00000150: A0 00 01 00  04 00 06 03  07 07 0A 0A  63 0E 64 0E ; ............c.d. 
00000160: 65 14 80 19  81 19 82 19  83 1E 93 24  A5 2B 9F 2F ; e..........$.+./ 
00000170: 75 33 52 33  DB 36 40 3B  F2 41 00 44  6F F3 48 70 ; u3R3.6@;.A.Do.Hp 
00000180: 66 F3 4F 73  B2 55 6E 69  F8 4E 6F 76  65 6C EC 4D ; f.Os.Uni.Novel.M 
00000190: 69 6E 69 F8  4C 69 6E 75  F8 41 6D 6F  65 62 E1 46 ; ini.Linu.Amoeb.F 
000001A0: 72 65 65 42  53 C4 42 53  44 E9 50 63  69 F8 43 70 ; reeBS.BSD.Pci.Cp 
000001B0: ED 56 65 6E  69 F8 44 6F  73 73 65 E3  3F BF 80 01 ; .Veni.Dosse.?... 
000001C0: 01 00 06 1F  BF 08 3F 00  00 00 C1 FE  0F 00 00 00 ; ......?......... 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA ; ..............U. 
grab.g4b 2                                                                      
cat --hex --length=256 (hd0)63+1                                                
00000000: EB 3C 90 4D  53 44 4F 53  35 2E 30 00  02 10 01 00 ; .<.MSDOS5.0..... 
00000010: 02 00 02 00  00 F8 00 01  3F 00 20 00  3F 00 00 00 ; ........?. .?... 
00000020: C1 FE 0F 00  80 00 29 24  0C 11 00 4E  4F 20 4E 41 ; ......)$...NO NA 
00000030: 4D 45 20 20  20 20 46 41  54 31 36 20  20 20 00 00 ; ME    FAT16   .. 
00000040: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000050: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000060: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000070: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000080: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000090: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
grab.g4b 3                                                                      
cat --hex --skip=256 --length=256 (hd0)63+1                                     
00000100: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000110: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000120: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000130: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000140: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000150: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000160: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000170: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000180: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000190: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA ; ..............U. 
grab.g4b 4                                                                      
cat --hex --length=256 (hd0,0)+1                                                
00000000: EB 3C 90 4D  53 44 4F 53  35 2E 30 00  02 10 01 00 ; .<.MSDOS5.0..... 
00000010: 02 00 02 00  00 F8 00 01  3F 00 20 00  3F 00 00 00 ; ........?. .?... 
00000020: C1 FE 0F 00  80 00 29 24  0C 11 00 4E  4F 20 4E 41 ; ......)$...NO NA 
00000030: 4D 45 20 20  20 20 46 41  54 31 36 20  20 20 00 00 ; ME    FAT16   .. 
00000040: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000050: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000060: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000070: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000080: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000090: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
grab.g4b 5                                                                      
cat --hex --skip=256 --length=256 (hd0,0)+1                                     
00000100: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000110: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000120: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000130: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000140: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000150: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000160: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000170: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000180: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000190: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA ; ..............U. 
grab.g4b 6                                                                      
cat --hex --length=256 (hd0,0)63+1                                              
00000000: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000010: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000020: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000030: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000040: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000050: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000060: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000070: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000080: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000090: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000000F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
grab.g4b 7                                                                      
cat --hex --skip=256 --length=256 (hd0,0)63+1                                   
00000100: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000110: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000120: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000130: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000140: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000150: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000160: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000170: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000180: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
00000190: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001A0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001B0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001C0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
grab.g4b 8                                                                      

The MBR and the bootsector of the "good" 06-mapping are identical to what's inside the image; checked with HxD.

The MBR of the "bad" 0E-mapping is the one that Grub4Dos generates while mapping a partition to a Memdrive.

Somehow it seems that Grub4Dos has find/read/timing problems in case of USB-FDD. With or without real floppy attached made no difference.

About the two first commands of the "good mapping": with or without --unsafe-boot made no difference either.

I tested the two command chains on three machines with different chipsets, all same results. Also on one machine with the USB-FDD in three different ways formatted.

Link to post
Share on other sites

I am missing something, what are the differences in the commands you issue (between the ones that end up with a "bad" mapping and the ones that end up with a "good" mapping")?

They seem to me exactly the same, at first sight :dubbio:

 this one:

Quote

map --mem --unsafe-boot --heads=32 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz (hd0)  

is a "hardcoded/absolute" path to the image, this one:

Quote

find /hdd-512mb.img.gz                                                          
 (fd0)                                                                          
map --mem --unsafe-boot --heads=32 --sectors-per-track=63 /hdd-512mb.img.gz (hd0)     

is a "relative" path.

Both are "wrong" (theorically/philosophically), what happens with the "right" one?:

Quote

find --set-root /hdd-512mb.img.gz                                                                                                                    
map --mem --unsafe-boot --heads=32 --sectors-per-track=63 /hdd-512mb.img.gz (hd0)     

Or there are other differences that I missed?

Anyway the MBR partition table of the two (bad vs. good) mapped drives is different, what is actually in the original image?

If it is the one in the  "good" mapped image, at least part of the issue is likely in the "unbalanced" CHS vs. LBA values.

The geometry is clearly 32/63 (as it is confirmed in the bootsector BPB data)

The data in CHS values is:

Start: 0/1/1, that translates to 63, OK

End: 520/31/63 that translates to 1050335 (521*32*63-1=1050335) from which you subtract the 63 and obtain the amount of sectors 1050335-63+1=1050273 sectors in the partition, 1050273 converts to 0x001006A1 BUT the MBR partition table LBA has 0x000FFEC1 instead that is decimal 1048257

So, THAT partition table entry is NOT balanced CHS vs. LBA, and as such it won't "behave" correctly in a number of cases.

Then, as a matter of fact, the actual bootsector has in its BPB data 1048257 sectors.

You should try starting with a CORRECT image.

To correct the image, you need to change the end cyl in the partition table from 520 to 519, i.e . change the:

80010100061FBF083F000000C1FE0F00

to:

80010100061FBF073F000000C1FE0F00

Or you can get to where you have the image "badly" mapped and issue in grub4dos a 

partnew (hd0,0) 0x06 63 1048257

geometry (hd0)

What happens to the partition table entry CHS values?

jaclaz

 

Link to post
Share on other sites
10 hours ago, jaclaz said:

this one:

Quote

map --mem --unsafe-boot --heads=32 --sectors-per-track=63 (fd0)/hdd-512mb.img.gz (hd0)  

is a "hardcoded/absolute" path to the image, this one:

Quote

find /hdd-512mb.img.gz                                                          
 (fd0)                                                                          
map --mem --unsafe-boot --heads=32 --sectors-per-track=63 /hdd-512mb.img.gz (hd0)     

is a "relative" path.

Both are "wrong" (theorically/philosophically), what happens with the "right" one?:

Quote

find --set-root /hdd-512mb.img.gz                                                                                                                    
map --mem --unsafe-boot --heads=32 --sectors-per-track=63 /hdd-512mb.img.gz (hd0)     

Or there are other differences that I missed?

No other differences :ph34r: The "good" one gives exactly same results as giving find --set-root /hdd-512mb-img-gz first. I tried that too earlier. Both GRAB1TXT and GRAB2.TXT are identical

find --set-root /hdd-512mb.img.gz                                               
 (fd0)                                                                          
map --mem --unsafe-boot --heads=32 --sectors-per-track=63 /hdd-512mb.img.gz (hd0
)                                                                               
                                                                                
Autodetect number-of-heads failed. Use the specified 32                         
                                                                                
Autodetect sectors-per-track failed. Use the specified 63                       
                                                                                
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1          
map --hook                                                                      
parttype (hd0,0)                                                                
Partition type for (hd0,0) is 0x06.                                             
geometry (hd0)                                                                  
drive 0x80(LBA): C/H/S=520/32/63, Sector Count/Size=1048320/512                 
grab.g4b                                                                        
cat --hex --length=256 (hd0)+1                                                  
00000000: 33 C0 8E C0  8E D8 8E D0  BC 00 7C FC  8B F4 BF 00 ; 3.........|..... 
00000010: 06 B9 00 01  F2 A5 EA 67  06 00 00 8B  D5 58 A2 4F ; .......g.....X.O 
00000020: 07 3C 35 74  23 B4 10 F6  E4 05 AE 04  8B F0 80 7C ; .<5t#..........| 
00000030: 04 00 74 44  80 7C 04 05  74 3E C6 04  80 E8 DA 00 ; ..tD.|..t>...... 
00000040: 8A 74 01 8B  4C 02 EB 08  E8 CF 00 B9  01 00 32 D1 ; .t..L.........2. 
00000050: BB 00 7C B8  01 02 CD 13  72 1E 81 BF  FE 01 55 AA ; ..|.....r.....U. 
00000060: 75 16 EA 00  7C 00 00 80  FA 81 74 02  B2 80 8B EA ; u...|.....t..... 
00000070: 42 80 F2 B3  88 16 41 07  BF BE 07 B9  04 00 C6 06 ; B.....A......... 
00000080: 34 07 31 32  F6 88 2D 8A  45 04 3C 00  74 23 3C 05 ; 4.12..-.E.<.t#<. 
00000090: 74 1F FE C6  BE 31 07 E8  71 00 BE 4F  07 46 46 8B ; t....1..q..O.FF. 
000000A0: 1C 0A FF 74  05 32 7D 04  75 F3 8D B7  7B 07 E8 5A ; ...t.2}.u...{..Z 
000000B0: 00 83 C7 10  FE 06 34 07  E2 CB 80 3E  75 04 02 74 ; ......4....>u..t 
000000C0: 0B BE 42 07  0A F6 75 0A  CD 18 EB AC  BE 31 07 E8 ; ..B...u......1.. 
000000D0: 39 00 E8 36  00 32 E4 CD  1A 8B DA 83  C3 60 B4 01 ; 9..6.2.......`.. 
000000E0: CD 16 B4 00  75 0B CD 1A  3B D3 72 F2  A0 4F 07 EB ; ....u...;.r..O.. 
000000F0: 0A CD 16 8A  C4 3C 1C 74  F3 04 F6 3C  31 72 D6 3C ; .....<.t...<1r.< 
grab.g4b 1                                                                      
cat --hex --skip=256 --length=256 (hd0)+1                                       
00000100: 35 77 D2 50  BE 2F 07 BB  1B 06 53 FC  AC 50 24 7F ; 5w.P./....S..P$. 
00000110: B4 0E CD 10  58 A8 80 74  F2 C3 56 B8  01 03 BB 00 ; ....X..t..V..... 
00000120: 06 B9 01 00  32 F6 CD 13  5E C6 06 4F  07 3F C3 0D ; ....2...^..O.?.. 
00000130: 8A 0D 0A 46  35 20 2E 20  2E 20 2E A0  64 69 73 6B ; ...F5 . . ..disk 
00000140: 20 32 0D 0A  0A 44 65 66  61 75 6C 74  3A 20 46 31 ;  2...Default: F1 
00000150: A0 00 01 00  04 00 06 03  07 07 0A 0A  63 0E 64 0E ; ............c.d. 
00000160: 65 14 80 19  81 19 82 19  83 1E 93 24  A5 2B 9F 2F ; e..........$.+./ 
00000170: 75 33 52 33  DB 36 40 3B  F2 41 00 44  6F F3 48 70 ; u3R3.6@;.A.Do.Hp 
00000180: 66 F3 4F 73  B2 55 6E 69  F8 4E 6F 76  65 6C EC 4D ; f.Os.Uni.Novel.M 
00000190: 69 6E 69 F8  4C 69 6E 75  F8 41 6D 6F  65 62 E1 46 ; ini.Linu.Amoeb.F 
000001A0: 72 65 65 42  53 C4 42 53  44 E9 50 63  69 F8 43 70 ; reeBS.BSD.Pci.Cp 
000001B0: ED 56 65 6E  69 F8 44 6F  73 73 65 E3  3F BF 80 01 ; .Veni.Dosse.?... 
000001C0: 01 00 06 1F  BF 08 3F 00  00 00 C1 FE  0F 00 00 00 ; ......?......... 
000001D0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA ; ..............U. 
grab.g4b 2                                                                      

However, your correction of the C/H/S counting did the trick. I added the partition table and first few lines of the boot sector, with corresponding bytes of the original image.

"Better" DosBox 512MB image with Jaclaz' proposal to correct CHS/LBA unbalance

map --mem --unsafe-boot --heads=32 --sectors-per-track=63 (fd0)/mod512j1.img.gz 
(hd0)                                                                      
                                                                              
probed C/H/S = 520/32/63, probed total sectors = 1048320                        
                                                                                
floppies_orig=2, harddrives_orig=0, floppies_curr=1, harddrives_curr=1          
map --hook                                                                      
parttype (hd0,0)                                                                
Partition type for (hd0,0) is 0x06.                                             
geometry (hd0)                                                                  
drive 0x80(LBA): C/H/S=520/32/63, Sector Count/Size=1048320/512                 
   Partition num: 0, active,  Filesystem type is fat16, partition type 0x06     
grab.g4b                                                                        
cat --hex --skip=446 (hd0)+1                                                    
000001BE: 80 01 01 00  06 1F BF 07  3F 00 00 00  C1 FE 0F 00 ; ........?....... 
000001CE: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001DE: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001EE: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001FE: 55 AA                                              ; U.               
cat --hex --skip=446 --length=66 (fd0)/hdd512mb.img                             
000001BE: 80 01 01 00  06 1F BF 08  3F 00 00 00  C1 FE 0F 00 ; ........?....... 
000001CE: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001DE: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001EE: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
000001FE: 55 AA                                              ; U.               
grab.g4b 1                                                                      
cat --hex --length=80 (hd0,0)+1                                                 
00000000: EB 3C 90 4D  53 44 4F 53  35 2E 30 00  02 10 01 00 ; .<.MSDOS5.0..... 
00000010: 02 00 02 00  00 F8 00 01  3F 00 20 00  3F 00 00 00 ; ........?. .?... 
00000020: C1 FE 0F 00  80 00 29 24  0C 11 00 4E  4F 20 4E 41 ; ......)$...NO NA 
00000030: 4D 45 20 20  20 20 46 41  54 31 36 20  20 20 00 00 ; ME    FAT16   .. 
00000040: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
cat --hex --skip=32256 --length=80 (fd0)/hdd512mb.img                           
00007E00: EB 3C 90 4D  53 44 4F 53  35 2E 30 00  02 10 01 00 ; .<.MSDOS5.0..... 
00007E10: 02 00 02 00  00 F8 00 01  3F 00 20 00  3F 00 00 00 ; ........?. .?... 
00007E20: C1 FE 0F 00  80 00 29 24  0C 11 00 4E  4F 20 4E 41 ; ......)$...NO NA 
00007E30: 4D 45 20 20  20 20 46 41  54 31 36 20  20 20 00 00 ; ME    FAT16   .. 
00007E40: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 ; ................ 
grab.g4b 2                                                                      

Jaclaz, you are a genius, correcting the CHS/LBA unbalance solved the problem. :worship:

Edited by deomsh
Correction
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...