More detailed example of how I use guestmount on a virtual disk image.

When I boot FreeDOS 1.3rc5 in QEMU, I use a disk image called rc5.img.
Here's an example of "mounting" the DOS partition (the first disk
partition, or /dev/sda1) from the rc5.img disk image, and copying a
file off it so I can work with it locally. In this example, I've
copied off my (modified) FDAUTO.BAT file and used Linux to perform a
case-insensitive grep for all "SET" commands:


$ mkdir /tmp/freedos
$ guestmount -a rc5.img -m /dev/sda1 /tmp/freedos
$ ls -l /tmp/freedos
total 208
drwxr-xr-x.  2 root root  8192 Dec 31 13:57 APPINFO
drwxr-xr-x.  4 root root  8192 Dec 27 15:02 APPS
-rwxr-xr-x.  1 root root 85480 Jul 10  2021 COMMAND.COM
drwxr-xr-x.  5 root root  8192 Dec 27 14:55 DEVEL
-rwxr-xr-x.  1 root root   494 Dec 27 15:17 FDAUTO.BAT
-rwxr-xr-x.  1 root root  1795 Dec 27 14:54 FDAUTO.SAV
-rwxr-xr-x.  1 root root   872 Dec 27 14:54 FDCONFIG.SYS
drwxr-xr-x. 10 root root  8192 Dec 27 14:53 FREEDOS
-rwxr-xr-x.  1 root root 46256 Dec  8 06:39 KERNEL.SYS
drwxr-xr-x.  2 root root  8192 Dec 31 13:58 LINKS
drwxr-xr-x.  3 root root  8192 Dec 28 17:55 TEMP
$ cp /tmp/freedos/FDAUTO.BAT .
$ guestunmount /tmp/freedos
$ dos2unix FDAUTO.BAT
dos2unix: converting file FDAUTO.BAT to Unix format...
$ grep -i '^set' FDAUTO.BAT
set DOSDIR=C:\FreeDOS
set LANG=EN
set TZ=EST
set PATH=%dosdir%\BIN
set NLSPATH=%dosdir%\NLS
set HELPPATH=%dosdir%\HELP
set TEMP=%dosdir%\TEMP
set TMP=%TEMP%
set BLASTER=A220 I5 D1 H5 P330
set DIRCMD=/O:GNE /Y
set COPYCMD=/-Y
set OS_NAME=FreeDOS
set OS_VERSION=1.3-RC5


When I boot FreeDOS using VirtualBox, I use a virtual disk image
("VDI") file that was initialized to full size when I installed
FreeDOS on VirtualBox (see video). In this example, I move off (delete
from disk image) a text file called FILE.TXT, and put it in my Linux
home directory where I can work on it.

$ ls ~/VirtualBox\ VMs/
FreeDOS
$ ls ~/VirtualBox\ VMs/FreeDOS/
FreeDOS.vbox  FreeDOS.vbox-prev  FreeDOS.vdi  Logs
$ ls /tmp/freedos
$ guestmount -a ~/VirtualBox\ VMs/FreeDOS/FreeDOS.vdi -m /dev/sda1 /tmp/freedos
$ ls /tmp/freedos
COMMAND.COM  FDCONFIG.SYS  FREEDOS  KERNEL.SYS
FDAUTO.BAT   FILE.TXT      GAMES    TEMP
$ mv -v /tmp/freedos/FILE.TXT .
copied '/tmp/freedos/FILE.TXT' -> './FILE.TXT'
removed '/tmp/freedos/FILE.TXT'
$ guestunmount /tmp/freedos/
$ dos2unix FILE.TXT
dos2unix: converting file FILE.TXT to Unix format...
$ cat FILE.TXT
When you edit with Pico, you're really editing with an email composer.
Pico stands for the Pine Composer.  Pine was an email client that replaced
another email client called Elm.  Pine stands for Pine Is Not Elm.



Jim


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to