VOGONS


First post, by HappyGuy7

User metadata
Rank Newbie
Rank
Newbie

Hi,
I am trying to boot a disk image created using Qemu tools. But this doesn't go beyond the message "Booting from drive C...". Please find the details below :

I am able to mount using the command :
imgmount c j:\downloads\pintos\as.dsk

Following I execute the command :
boot -l c

This starts to boot with the message "Booting from drive C...". There after, the dosbox hangs and does nothing.

I also could figure out the fragment of the DosBox code which tries to boot my disk image :


WriteOut(MSG_Get("PROGRAM_BOOT_BOOT"), drive);
for(i=0;i<512;i++) real_writeb(0, 0x7c00 + i, bootarea.rawdata);

/* revector some dos-allocated interrupts */
real_writed(0,0x01*4,0xf000ff53);
real_writed(0,0x03*4,0xf000ff53);


When I tried to debug this behavior, I guess while performing the disk read/write operations some thing is going wrong. But still, beyond this I am unable to understand the reason for this problem.

In fact, after executing the below assembler instructions the DosBox hangs :
mov sp, 0400 <---- debug boot -l c
mov bx, 0040
mov ah, 4A
int 21
callback 0006 <---- Hangs here....


And here is my DosBox specific details :
* DosBox Version : 0.73
* DosBox Config : Default Config.
* Processor type and speed --- Intel Dual Core - 2.8Ghz
* Amount and type of RAM --- 1GB - DDR2
* Operating system and version --- Windows XP professional, 2002 service pack 1.
* Reproducibility of problem --- always

And I am attaching the snapshots of my problem - Non-debug and debug. Please have a look if it can give a clue about the problem.

Thanks and any help would be of great appreciation 😀

Misc Info : The raw disk image is of a custom OS. This OS takes a maximum of 65MB RAM. This has been successfully tested on VMware and Qemu and on bare hardware as well.

Last edited by HappyGuy7 on 2010-02-12, 13:29. Edited 1 time in total.

Reply 1 of 17, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

thought we only supported bximage from bochs,.
maybe specify the layout and don't trust on dosbox its autoguessing code for bootdisks not created by bximage

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 17, by HappyGuy7

User metadata
Rank Newbie
Rank
Newbie

Ok. Sorry didn't get you - "specify the layout"...
To add, I tried converting this dsk image into other formats like ISO etc... But of no use.

Reply 3 of 17, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

imgmount 2 C:\image.img -size bps,spc,hpc,cyl -fs fat

bps=bypes per sector (512 always)
spc=sectors per cylinder
hpc=heads per cylinder
cyl=total cylinders

Last edited by DosFreak on 2010-02-12, 16:47. Edited 1 time in total.

How To Ask Questions The Smart Way
Make your games work offline

Reply 4 of 17, by HappyGuy7

User metadata
Rank Newbie
Rank
Newbie

OK. I used this command to mount my image as the master :
imgmount 2 j:\downloads\pintos\as.dsk -t hdd -fs none -size 512,63,16,142

But, I don't know how to boot from this master!

Reply 5 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I think the "2" was supposed to be a drive letter.

Reply 6 of 17, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

No, type it like that with the 2 and then do the normal "boot -l c"
AFAIR when you don't give the file system (-fs none) you can't mount it to a letter, you need to mount it to a number or so. I *think* in the area of mounting an image to boot from it are currently some inconsistencies or it's currently not that documented 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 7 of 17, by robertmo

User metadata
Rank l33t++
Rank
l33t++

of course you cannot boot an image without system (not to mention without file system)
so
boot floppy.img -l c

Reply 8 of 17, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

huh? Before the autosize detection, it was supposed to be that you mount the image with -fs none to boot from it...
AND the purpose was to have the OP mount the hd image with the -size option, not to boot from a floppy image...

Reply 9 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I don't know how the "-fs none" thing came to be added in this, no one recommended it. In the original post the FAT type is clearly being autodetected in the image.

Reply 10 of 17, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

You can leave out the -fs none, but then you have to imgmount it to "c" and not to "2".
So what works is
imgmount 2 j:\downloads\pintos\as.dsk -t hdd -fs none -size 512,63,16,142
boot -l c

or
imgmount c j:\downloads\pintos\as.dsk -t hdd -size 512,63,16,142
boot -l c

When you mount to number you NEED -fs none or it won't boot of it and I *think* in ancient times it wouldn't work with specifying -size, mounting to c and booting off it. That's where the -fs none comes from 😀

Reply 11 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

OK, then maybe the -fs none was added to compensate for "2" instead of "C"...

Anyway, the autosize shown in the status window log message has the standard 512,63,16 parameters with 40 cylinders being derived from the size of the image file. Makes me wonder if 142 cylinders being specified is correct...

Reply 12 of 17, by HappyGuy7

User metadata
Rank Newbie
Rank
Newbie

@Dominus :
I just tried :
imgmount 2 j:\downloads\pintos\as.dsk -t hdd -fs none -size 512,63,16,40
boot -l c
and
imgmount c j:\downloads\pintos\as.dsk -t hdd -size 512,63,16,40
boot -l c

But, of no help as the dosbox doesn't move ahead after saying "Booting from drive C..."

@ripsaw8080
Oh my bad... it has to be 40 cylinders. Thanks for correcting me 😀

Reply 13 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Specifying the same geometry as the automatic one doesn't seem like it would make a difference. 😀

From the warning messages in the status window, it seems that the partition structure of the image is not understood, so the boot sector is not found, and therefore no boot. Maybe you can compare what drive_fat.cpp is doing to analyze the partition compared to what's in your image. A bit technical, but your initial post seems fairly technical, so maybe you'll find it an interesting challenge.

Reply 14 of 17, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

btw. lock stock Dosbox did have some problems with images larger than 512 MB (or somewhere around that size). Maybe this applies here. I *think* Hal's Megabuild does have a patch applied to allow larger images http://home.arcor.de/h-a-l-9000/

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 15 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

FYI, multiply all the geometry parameters together to get the disk size.

Maybe hal's build has some different/improved handling of the MBR, which could help.

Reply 16 of 17, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author
In fact, after executing the below assembler instructions the DosBox hangs : mov sp, 0400 <---- debug boot -l c mov bx, 0040 […]
Show full quote

In fact, after executing the below assembler instructions the DosBox hangs :
mov sp, 0400 <---- debug boot -l c
mov bx, 0040
mov ah, 4A
int 21
callback 0006 <---- Hangs here....

Please trace with f11 at that point (twice if needed), the callback should direct
the code flow to the mbr code.

Looking at the status window, your OS is most likely requiring portlevel access
to the hard disk, which dosbox does not provide.

Reply 17 of 17, by HappyGuy7

User metadata
Rank Newbie
Rank
Newbie

wd : Thanks for the suggestion.

Yeah, the boot loader of my OS is indeed waiting for the data at a certain data-port of the hard-disk and hence is indefinitely waiting due to the lack of port-level access to the hard-disk which is in fact the OS-Kernel binary image mounted internally to DOSbox as a virtual hard-drive.

Actually, I tried the same on my Symbian Smartphone with the the S60 port of DOSBox by kolijoco and witnessed the same result. And I understand the respective cause to be the same as that of the Desktop version of DOSBox as mentioned above.

Cheers.