ASE Labs
Welcome Guest. Please register or log in now. There are 40 people online (0 Friends).
  • Home
  • Articles
  • News
  • Forum
  • Register/Login
You are at ASE Labs » Articles » Reviews Index » DOS USB Bootable Drive

DOS USB Bootable Drive

Author
Aron Schatz
Posted
March 3, 2008
Views
65208
DOS USB Bootable Drive
We all use flash drives instead of the older floppy disk standard of last century. The problem with USB is that it isn't made to boot like a floppy disk. Motherboards now support booting from USB drives made to look like hard drives. This guide is a step by step process running on Ubuntu.
Tags Guides USB DOS Boot

Page 1: USB Boot

Intro:

Flash drives are really ubiquitous. If you look around your computer desk, you will probably find a few USB mass storage devices near your work area. They are a boon for taking documents from one computer to the next and are fast and simple to use. They replaced the floppy that the ZIP disk could not supplant. The one area that USB flash drives are lacking is the ability to boot. Even though many computer motherboards support USB booting, it is difficult to get the right combination. Using this guide, you will be able to make a bootable USB "hard drive."

Hard Drive:

There are a few ways to boot USB devices today. The first way (and the one we will be using in this guide) is to make the USB flash drive look like a regular hard drive. Most flash drives are already setup this way. What does a regular hard drive "look" like? It has a master boot record as well as individual partitions on the drive each with their own boot sector. The other type of bootable USB is known as the supperfloppy type. This makes a flash drive act as one huge floppy disk. A floppy disk is the partition. There is no master boot record. There is only a boot sector. If you have a flash drive formated this way, it won't show any partitions in Linux. Instead it will look like /dev/sdb whereas a normal drive with a partition would be /dev/sdb1. Motherboard support is getting better for booting USB, but some of my motherboards still refuse to boot using this guide. Once I find a way to do the super-floppy method, I will make an additional guide. If you know how to do this, please email me.

Why DOS?:

You may be asking why I'm going to boot into DOS. The simple reason is that most computers don't come with a floppy drive and many motherboard manufactures still require DOS to flash their boards. While it is true that some boards have a flashing utility in the BIOS, others (such as Intel's) require you to boot into DOS. Using DOS is the safest way to flash a motherboard. I wouldn't trust using Windows or even Linux (if such flashing programs were made). Too much stuff is running in the background to cause trouble.

System Setup:

This guide will demonstrate how to make a DOS USB boot drive using FreeDOS. We are going to use Ubuntu 7.10 which you can download for free at http://www.ubuntu.com. You can use the Live CD to follow this guide if you are still using Windows. The only software that you will need to install is the package called "dosemu" which is very simple to install from Synaptic or the console.

Open up Applications -> Accessories - > Terminal.

That prompt you see will look something like this...

aronschatz@asetest2:~$

And that is how you will enter commands in.

aronschatz@asetest2:~$ sudo apt-get install dosemu

The above command will install dosemu as well as the FreeDOS component automatically. Now you are set to follow the guide. The other thing you need to worry about is where the USB flash drive shows up in /dev. Mine was mounted as /dev/sdb, but yours may be completely different. This guide uses /dev/sdb as the flash drive but if you are unsure if its location on your computer, be sure to »post in the forums.

The flash drive will be completely erased so be sure to back up the contents before proceeding with this guide.

Step 1: Prepare the drive

The first step will wipe the MBR of the drive as well as the partition table information on it. dd is a dangerous command if you don't know what you are doing. If you make a mistake, you can wipe your regular hard drive out.

Code

aronschatz@asetest2:~$ sudo dd if=/dev/zero of=/dev/sdb bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00124495 seconds, 411 kB/s
aronschatz@asetest2:~$


Now you are finished preparing the drive and can continue.

Step 2: Partition the drive


This will be the pictorial step. The basic layout is to use cfdisk to create a single bootable partition of FAT16 and write the information to the drive.

aronschatz@asetest2:~$ sudo cfdisk /dev/sdb

1.png


The flash drive is ready to be partitioned. We want to add a "New" partition.

2.png


You are adding a new "Primary" partition. Then it will ask for the size and such, just accept the defaults and press enter until you get to the main screen.

3.png


You want to mark the partition as "Bootable."

4.png


Now you need to change the "Type" of the partition to a FAT16. It would be 06 for FAT16.

5.png


Once you are back to the make screen, you need to "Write" the changes to the disk and accept any prompts that come up. Then you can "Quit" cfdisk and return which will show this...

Code

Disk has been changed.

WARNING: If you have created or modified any
DOS 6.x partitions, please see the cfdisk manual
page for additional information.
aronschatz@asetest2:~$


Step 3: Format the partition

With the partition made in the previous step, you know need to put a filesystem on it. The command mkdosfs is pretty easy to figure out.

Code

aronschatz@asetest2:~$ sudo mkdosfs -I /dev/sdb1
mkdosfs 2.11 (12 Mar 2005)
aronschatz@asetest2:~$


Step 4: Edit .dosemurc

You need to make the USB flash drive show up in dosemu. To do this, you need to make a file called ".dosemurc" in your home directory. The easiest way is to use gedit and save the file. You can use any text editor of your choice.

aronschatz@asetest2:~$ gedit ~/.dosemurc

The file should look like this...

Code

$_hdimage = "drives/* /dev/sdb1"


Basically that means to parse the directories in ./drives/ and then use /dev/sdb1. It will make everything into a fixed disk. Save and close the file.

Step 5: sys the drive

You need to start the emulator for dos. If the command brings up errors such as below, you need to unmount the flash drive.

Code

aronschatz@asetest2:~$ dosemu
In file included from built-in global.conf:677
                 from built-in global.conf:634
                 from built-in global.conf:648
Error in : (line 648)

You specified '/dev/sdb1' for read-write Direct Partition Access,
it is currently mounted read-write on '/media/disk' !!!

1 error(s) detected while parsing the configuration-file
aronschatz@asetest2:~$


Here we see the problem. The flash drive is mounted. This command will unmount the drive.

aronschatz@asetest2:~$ sudo umount /dev/sdb1

Now try to start dosemu again...

aronschatz@asetest2:~$ dosemu

This command should bring up another prompt that is basically FreeDOS. In this new window, type the series of commands...

Code

C:\> z:
Z:\> sys f:
FreeDOS System Installer v3.2, Aug 18 2006

Processing boot sector...
Reading old bootsector from drive F:
FAT type: FAT16
Old boot sector values: sectors/track: 62, heads: 4, hidden: 62
Default and new boot sector values: sectors/track: 62, heads: 4, hidden: 62
Root dir entries = 512
FAT starts at sector (62 + 1)
Root directory starts at sector (PREVIOUS + 245 * 2)
Boot sector kernel name set to KERNEL  SYS
Boot sector load segment set to 60h
writing new bootsector to drive F:

Copying KERNEL.SYS...
45341 Bytes transferred
Copying COMMAND.COM...
66945 Bytes transferred
System transferred.
Z:\>exitemu


First you type "Z:" to get into the Z drive which holds all the FreeDOS tools and binaries. Then the command "sys f:" tells it to make the F: drive a system drive by copying kernerl.sys and command.com. Once that is completed, "exitemu" exits out of the dosemu program.

Step 6: Copy your own utilities to the drive and boot

Now the drive is usable for booting. You can now copy files onto the FAT16 partition. This is a pure DOS boot, so you can include any sort of DOS utilities. Once you are finished loading the drive up, restart the computer and force the BIOS to boot off the USB flash drive. With any luck, you will see a FreeDOS screen telling you to input the date and time. Just press enter and you now have a working DOS system off of your flash drive.

Conclusion:

With a working DOS USB flash drive, you can perform a number of useful tasks including flashing ROMs and using other DOS utilities. FreeDOS is an example of free and open source software. When using bootdisks that contain MS-DOS, you are not licensed to use it since you didn't pay for it. Stay tuned to find out why I needed a DOS USB bootable drive in the first place. Buy a flash drive!

Thanks for reading and if you have any questions, please »post in the forum or send me an email.
 
Page 1
View As Single Page Print This Page Print Entire Article
Related Articles
  • OpenLDAP Installation On Ubuntu
  • RAID Technology Part 2: RAID Levels
  • Cisco IOS: Home Router Configuration
  • RAID Technology Part 1
  • Video Card Recommendations
members/attachments/upload/2008/03/03/2396m.png 1.png members/attachments/upload/2008/03/03/2397m.png 2.png members/attachments/upload/2008/03/03/2398m.png 3.png members/attachments/upload/2008/03/03/2399m.png 4.png members/attachments/upload/2008/03/03/2400m.png 5.png

Title

Medium Image View Large
Login
Welcome Guest. Please register or log in now.
Forgot your password?
Navigation
  • Home
  • Articles
  • News
  • Register/Login
  • Shopping
  • ASE Forums
  • Anime Threads
  • HardwareLogic
  • ASE Adnet
Latest News
  • Welcome to the new server
  • Gmail Gets Optional Preview Pane
  • HBO Go on Consoles
  • HP Touchpad Update
  • Happy System Administrator Day!
  • Apple Releases OS X 10.7 Lion
  • More Android Apps Found to be Malware
  • This Weeks News
  • Happy Birthday USA!
  • Windows Phone Gets Angry Birds, Custom Rings Coming To Mango
Latest Articles
  • Sapphire Edge HD4 Mini PC
  • Logitech G710+ Mechanical Gaming Keyboard
  • EnerPlex Kickr IV And Jumpr Solar Power Pack
  • Kingston Wi-Drive
  • Kingston SDX10V/128GB SDXC Memory
  • In-Win K1 All In One Convertible Case
  • Kingston MobileLite G3 USB3 SDXC Card Reader
  • Synology DS712+ Network Application Server
  • Rapoo Wireless Touchpad Keyboard E9080
  • Netgear NeoTV NTV200 Streaming Player
Latest Topics
  • Many children accidentally end up touching
  • Yoon Hee had no choice but to live
  • She was born in a village near North
  • Random Fact of the Day
  • What are you listening to now?
  • Pokemon: The Ongaku Region
  • Lets talk
  • We Are C A R E E R S [64th Hunger Games!]
  • Review Nokia Lumia 800 V.S. iPhone 4S: Convert DVD/Video to mobile phone devices.
  • You're a Fanfiction?!
  • hello every one
  • Hp Z1 Workstation Benchmarks
  • Euro-Zone Recession Extends Into 2013
  • Sapphire Edge HD4 Mini PC at ASE Labs
  • HTC 8X
Advertisement
Advertisement
Affiliate Reviews
  • NetBSD 6.1 Brings In More Features at Phoronix
  • Using Six Monitors With AMD's Open-Source Linux Driver at Phoronix
  • Benchmarking The Intel P-State, CPUfreq Changes at Phoronix
  • FreeBSD Still Working On Next-Gen Package Manager at Phoronix
  • Sumo Lounge Emperor at Phoronix
  • DNF Still Advancing As Experimental Yum For Fedora at Phoronix
  • Logitech Begins Supporting Linux Users at Phoronix
  • Modern Intel Gallium3D Driver Still Being Toyed With at Phoronix
  • Linux 3.10 Kernel Benchmarks On A Core i7 Laptop at Phoronix
  • GCC 4.8.1 Compiler Due To Be Out Next Week at Phoronix
  • Btrfs vs. EXT4 vs. XFS vs. F2FS On Linux 3.10 at Phoronix
  • Linux 3.10 Kernel Benchmarks For Intel Ivy Bridge at Phoronix
  • Linux's "Ondemand" Governor Is No Longer Fit at Phoronix
  • Firefox 22 Beta Enables WebRTC Support at Phoronix
Press Release
  • =?ISO-8859-1?Q?Nissan_And_Sony_PlayStation=AE_Announce_B?= =?ISO-8859-1?Q?iggest_Ever_GT_Academy_Program_For_2013?=
  • Google TV Devices with Vivante GPU Cores Ready for Android Jelly Bean Update
  • Audio Precision Adds Rub & Buzz And Leak Detection For Comprehensive Electro-Acoustic Test
  • Key-Systems is on the Spot at WHD.india 2013
  • Motivity Labs Launches New Cloud-based Mobile Testing Services
  • RadioShack Expands Partnership with Maker Media, Reveals Dozens of New Do-It-Yourself Products
  • =?ISO-8859-1?Q?K-TOR=AE_Announces_Pocket_Socket_2_Hand_Crank_Generator?=
  • Troy Apps Bets It All on Native Apps for Mobile Business, Rejects HTML5
  • Razer Launches Atrox Arcade Stick With Support From Fighting Game Community
  • Bang & Olufsen Launches New all-inclusive, Surround Sound Speaker System
Home - ASE Publishing - About Us
© 2010 Aron Schatz (ASE Publishing) [Queries: 20 (8 Cached)] [Rows: 324 Fetched: 67] [Page Generation time: 0.47318601608276]