Embedded linux w/msdos hdimage file

Nov 11, 2003 1 Replies

This is related to an embedded environs where an MSDOS partition image written to a file and then executed by dosemu. I need to mount this as a block device on some ramdrive directory, so that I can export it with samba.



The file containing the msdos partition image works fine with dosemu and I can also use mtools to see the file as drive m: from a linux shell, but I need to mount it under /dosc so that windows can also see and write to it via tcp as myhost://dosc



Basically, does anyone know how I can mount this hdimage (now a file) also as /dosc. I tried using the loop device: mount filname /mnt -t msdos -o loop, but it complains about the file's format.



Thanks TonyB


__ __ _ I N C. http://www.sysdev.org / __|\\// __|| \ __ __ / tonyb@sysdev.org \__ \ \/\__ \||)|/ O_)\/ / \/ System Tools / Utilities |___/ || ___/|_ /\___|\_/ WIntel / Linux Device Drivers

By looking at hdimage file created by mkfatimage16m I noticed that the boot sector was at offset 0x2280, rather than at 0, if it was a device /dev/hda1. So I truncated the hdimage file by cutting off the first 8832 bytes and redid the mount command above and it worked!

However, dosemu will not work if $_hdimage is set to the truncated image. So I need a way to specify the file starting at offset 0x2280, while leaving it intact... But I do not know how to specify a file starting at a byte offset, for use by the mount command ???

TonyB

__ __ _ I N C. http://www.sysdev.org / __|\\// __|| \ __ __ / tonyb@sysdev.org \__ \ \/\__ \||)|/ O_)\/ / \/ System Tools / Utilities |___/ || ___/|_ /\___|\_/ WIntel / Linux Device Drivers

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required