[HOWTO] install FreeDos as a boot option in Porteus


FreeDos (http://www.freedos.org/) is a free DOS-compatible operating system. Having FreeDOS is very useful when it comes to running (maintenance) programs that only work with DOS, for example:
* old Norton Ghost 11.5,
* Firmware updates for your Harddisk, CDRom, VGA-Card, etc.

FreeDOS is already being used in the Linux distro GRML (http://www.grml.org), that is where I got it. It only needs "memdisk" (20.068 bytes) and a DOS image called "balder10.imz (or img)" which is the size of a floppy disk (1.4 MB).


 

Steps to Install FreeDOS:


1) Download the GRML ISO from http://www.grml.org. Any version will do, for example: grml64_2010.04.iso

2) Mount the ISO so you can copy the needed files. To mount the ISO, run the following commands:

cd /path/to/grml.iso
mloop grml64_2010.04.iso
#this mounts the ISO image on a loop, at /mnt/loop


3) Create a directory inside the /boot folder of your Porteus installation, called 'freedos' (e.g. /mnt/sdb1/boot/freedos -- replace sdb1 with the storage media where you have Porteus installed) Now, go to /mnt/loop/boot/addons and copy the following files from that directory to your /boot/freedos directory:

allinone.img 1.474.560 bytes
balder10.imz 911.929 bytes
memdisk 20.304 bytes

4 (Optional) decompress the balder10.imz. You will get a file called "balder10.img". Add any DOS programs there that you need for your DOS boot disk (I use WINE and TotalCommander for this task)

5) Edit your /boot/syslinux/porteus.cfg file to add the following section:

LABEL FREEDOS
MENU LABEL Run Free DOS
KERNEL /boot/freedos/memdisk
APPEND initrd=/boot/freedos/balder10.img

TEXT HELP
          More about currently selected:
          Boot a FREEDOS with USB and Ramdisk A:
ENDTEXT

Note: use APPEND initrd=/boot/freedos/balder10.imz if you did not decompress the image in step 4.


 

Booting FreeDOS over PXE:

Sometimes, booting DOS over PXE is very convenient, for example, when you have to do 100 Firmware DOS updates on 100 computers and you do not want to run to every computer with a floppy disk and boot from that disk.
In this case, you can modify the PXE section in /boot/pxelinux.cfg/default, for example:

PROMPT 1

LABEL linux
MENU LABEL Run linux over PXE
KERNEL /vmlinuz
IPAPPEND 1
APPEND vga=769 initrd=/initrd.xz


LABEL memtest86
MENU LABEL Run Memtest utility
KERNEL /boot/tools/mt86p

LABEL dos
MENU LABEL Run FreeDOS
KERNEL /freedos/memdisk
APPEND initrd=/freedos/balder10.imz

LABEL dos2
MENU LABEL Run FreeDOS modded
KERNEL /freedos/memdisk
APPEND initrd=/freedos/balder10.img

Explanation: "Prompt 1" means you can actually type something in on the PXE-booted machine, and thus select what you want to load over PXE. In this example "dos", "dos2", "memtest86" and "linux" are your options. "plop" over PXE might be another useful option - your mileage may vary.

In this example, if you type in "dos2" and press return, a FreeDOS bootdisk will be loaded over PXE. This is very useful for doing lots of firmware updates on lots of machines.



To view the discussion about this article, to ask a question or post a suggestion, visit this thread on our forum.


[SCRIPT] Easy unpack compressed files


Do you keep forgetting the different switches for unpacking tarballs?

Paste this into a text file, save it as /usr/bin/unpack
Make it executable: chmod +x /usr/bin/unpack
Now to unpack most compressed files just use: unpack myfile.tar.bz2

 

unpack.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
 
INPUT=$1
FEXT=$(echo $1 | grep -o '\.[^.]*

 

)
case "$FEXT" in
".bz2")
tar -jxvf $INPUT;
;;
".gz")
tar -zxvf $INPUT
;;
".tar")
tar -xvf $INPUT;
;;
".zip")
unzip $INPUT;
esac