News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Starting DOS from USB drive

Started by Gunther, September 06, 2010, 11:49:15 PM

Previous topic - Next topic

Gunther

I've searched inside the forum and found no answer. So here is my - probably a bit silly - question. Has anyone experiences with starting a native DOS (MSDOS, PCDOS, DRDOS or whatever) at a machine without floppy disk drive. I suppose it should be possible from an USB stick - but how?

What's the background of my question? Several years ago, I've fired up a 16 bit PowerBASIC application into 32 bit Protected Mode. All the authorities, including Bob Zale and Dave Navarro, did say: that's not possible. In fact. it was a bit tricky, but it did work without crash under several operating systems.

My plan is now, to screw up a DOS application into 64 bit long mode. Therefore, I need a plain DOS; emulations will not help, because one hasn't direct access to the hardware.

Gunther
Forgive your enemies, but never forget their names.

japheth

There's a free tool from HP, called DriveKey. It is meant to be used with HP hardware, but works with most (all?) other PCs as well. It will format the USB stick as a Hard Drive, so it contains a MBR.

I have no link available, but should be no problem to find it.

Btw, here's a sample how to switch to long-mode from DOS and back: http://www.japheth.de/JWasm/Dos64.html


redskull

If you can find/make a floppy image of a DOS boot disk, you can use a standard hex editor to copy it right to the USB stick, starting at sector 0.  Of course, your BIOS must support legacy USB emulation and booting for it to work.

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

Gunther

Quote from: redskull September 07, 2010, at 12:46:59 PMOf course, your BIOS must support legacy USB emulation and booting for it to work.

Yes, my BIOS allows booting from USB drive.

Quote from: japheth September 07, 2010, at 07:53:37 AMBtw, here's a sample how to switch to long-mode from DOS and back:

:8) Well done. It seems, that JWasm is a cool tool. Thank you for the hint.

Gunther
Forgive your enemies, but never forget their names.

daydreamer

I dont remember exactly what tool I used to make myself a win98(dos) startdisk copy on usb working, but first it was required to partition the drive to a small startpartition with the right tool it makes it also writes bootsector and you only need to copy some old dos files on it and it starts as A: drive
I did it with my old 128mb flash drive, think I had to make a 2mb partition for it
good luck

anunitu

I know that FreeDos has a bootable cd image you can get, and I think they "Might" have something for booting from USB stick,not sure.

There is this.

http://download.cnet.com/DOS-on-USB/3000-2094_4-10795476.html

Also this.

http://genetikayos.livejournal.com/43998.html

Haven't tried this,as my older system won't boot from USB

TASMUser

What you need:
- Any bootable DOS media
- A motherboard with a BIOS which supports "legacy USB" properly (newest BIOSes should do)
- A drive where you can insert the DOS bootable media
- A compatible card reader
- Partitioning software like "Partition Magic" for DOS

How to install the DOS on USB (it is a way I do for almost 20 years):

- Allow "legacy USB support" for all drives in the BIOS
- Put the DOS bootable media in the boot drive
- Switch off the computer
- Insert the card into the cardreader
- plug the cardreader into any USB connector
- Switch on the computer
- Let the computer boot from the DOS bootable media, the computer should recognize all cards
- Partition the card as you wish
- Reboot with same conditions
- Invoke the "sys" command to the USB card

Gunther

Okay, thank you guys for your hints. I'll check that out and let you know, if I had success.

Gunther
Forgive your enemies, but never forget their names.

Farabi

Is all kernel loaded at 0x7C0000? I want to load a linux kernel.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Tedd

BIOS loads the boot program (from the first sector) to 0x7C00 and jumps to it.
Beyond that, depends what the boot program does.

Usually, it's several more stages before the kernel gets loaded properely.
No snowflake in an avalanche feels responsible.

redskull

Does set CS to 7C00 and load it at CS:0000, or keep CS at 0000 and load it to CS:7C00?  I can never remember...

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

FORTRANS

Quote from: redskull on September 09, 2010, 05:01:52 PM
Does set CS to 7C00 and load it at CS:0000, or keep CS at 0000 and load it to CS:7C00?  I can never remember...

Hi,

   It can be either 07C0:0000 or 0000:7C00 depending on
the BIOS in use.  0000:7C00 is more common.

Regards,

Steve N.

Tedd

It could technically be any of the many combinations that result in the linear address of 0x7C00, but 07C0:0000 and 0000:7C00 are most common.
The only safe thing to do is start with an immediate far jump to whichever you prefer (plus destination offset) -- 07C0:0000 is nicer because it gives you origin 0.
No snowflake in an avalanche feels responsible.

Gunther

Problem solved. DOS starts now from USB drive. If anyone is interested, how to do that, please check out the following link: http://bootdisk.com/pendrive.htm It works.

The only problem is: My mouse isn't supported, because it's an USB mouse. I've to search for a solution.

Gunther
Forgive your enemies, but never forget their names.

sinsi

There is a settting in the BIOS for legacy USB for the mouse and keyboard, enable it and they should both show up as PS/2 devices.
Light travels faster than sound, that's why some people seem bright until you hear them.