Test for boot drive
Test for boot drive
Does any one know how to test for boot drive, let me explane, i do not mean if you boot from a floppy disk etc, i know how to do that, but say i am booting from a CD, that emulats the floppy.
I need a way to know that its the CD and not the floppy.
So i can put D:\> at the prompt and not A:\>.
Thanks in advance.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
I need a way to know that its the CD and not the floppy.
So i can put D:\> at the prompt and not A:\>.
Thanks in advance.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
Re:Test for boot drive
http://www.phoenix.com/NR/rdonlyres/56E ... bbs101.pdf
According to this, the BIOS Drive Number will be passed in in DL. But as far as I can tell, it's Phoenix specific which is probably why the FAT BIOS Block has the drive number placed in by the format utility
According to this, the BIOS Drive Number will be passed in in DL. But as far as I can tell, it's Phoenix specific which is probably why the FAT BIOS Block has the drive number placed in by the format utility
Re:Test for boot drive
Hi,
After that you could try INT 0x13, AX = 0x4B00 (http://www.ctyme.com/intr/rb-0718.htm) to disable the emulated floppy, restoring the system back to normal so that the real floppy is no longer B:.
I'd load the entire OS into memory, use the first BIOS function to detect the emulated floppy from the CD and then the second to disable the emulated floppy, and then boot the OS. That way all device letters will be the same regardless of how you boot.
In any case D: should refer to the real CD rather than the emulated floppy from the CD.
Cheers,
Brendan
How about INT 0x13, AX = 0x4B01 (http://www.ctyme.com/intr/rb-0719.htm)?ASHLEY4 wrote: Does any one know how to test for boot drive, let me explane, i do not mean if you boot from a floppy disk etc, i know how to do that, but say i am booting from a CD, that emulats the floppy.
I need a way to know that its the CD and not the floppy.
So i can put D:\> at the prompt and not A:\>.
After that you could try INT 0x13, AX = 0x4B00 (http://www.ctyme.com/intr/rb-0718.htm) to disable the emulated floppy, restoring the system back to normal so that the real floppy is no longer B:.
I'd load the entire OS into memory, use the first BIOS function to detect the emulated floppy from the CD and then the second to disable the emulated floppy, and then boot the OS. That way all device letters will be the same regardless of how you boot.
In any case D: should refer to the real CD rather than the emulated floppy from the CD.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:Test for boot drive
Thank you both for your help.
I know and you know it emulats a floppy, but to them they are booting for a CD.
But all test for boot drive, show 00 for the first floppy drive.
What do you think about testing for a b: drive as not many PC have them these days ??.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
The probem is people boot from a CD, it loads my OS, but once it enter pmode emulation stops, all of the files on the CD can be run from the built in CD driver, but before they can do a dir command they need to change from the A:\ to the D:\ .In any case D: should refer to the real CD rather than the emulated floppy from the CD.
I know and you know it emulats a floppy, but to them they are booting for a CD.
But all test for boot drive, show 00 for the first floppy drive.
What do you think about testing for a b: drive as not many PC have them these days ??.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
Re:Test for boot drive
Hi,
The traditional way of solving this is with a "PATH = D:" environment variable (which could be preset by the OS). You'll need something like this when the OS is installed on the hard drive anyway. In general the user should be able to type something like:
A:
dir
D:
dir
format c: /u /s
mkdir c:\os
cp d:\os\* c:\os
set path=c:\os
dir
Cheers,
Brendan
ASHLEY4 wrote:The probem is people boot from a CD, it loads my OS, but once it enter pmode emulation stops, all of the files on the CD can be run from the built in CD driver, but before they can do a dir command they need to change from the A:\ to the D:\ .In any case D: should refer to the real CD rather than the emulated floppy from the CD.
The traditional way of solving this is with a "PATH = D:" environment variable (which could be preset by the OS). You'll need something like this when the OS is installed on the hard drive anyway. In general the user should be able to type something like:
A:
dir
D:
dir
format c: /u /s
mkdir c:\os
cp d:\os\* c:\os
set path=c:\os
dir
If you detect if the CD is emulating a floppy (see my previous message) you'll know if "device 0x00" is the emulated floppy or a real floppy. This method also works for emulated hard disks too (where "device 0x80" is actually a fake hard drive from the boot CD).ASHLEY4 wrote: But all test for boot drive, show 00 for the first floppy drive.
What do you think of restricting your OS to one floppy drive only? What if the user has got 4 floppy drives (let's see, A:, B:, um, err)? I guess they can still use Unix (/dev/fd0 to /dev/fd3).ASHLEY4 wrote: What do you think about testing for a b: drive as not many PC have them these days ??.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:Test for boot drive
Thanks Brendan, I will give your ideas a try.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
Re:Test for boot drive
I suppose that you could look for (on a Hard Drive) for the bootable flag and on other devices look for the 0xAA00 (or is it something else???) flag somewhere near the beginning of the filesystem. Hope this can [somehow] help ;P
Cheers, DH.
Cheers, DH.
Re:Test for boot drive
Thanks DH,
I will give all methods a try tonight and see which work, or which works best.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
I will give all methods a try tonight and see which work, or which works best.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
Re:Test for boot drive
Update: Just in case any one else, may need this info.
http://www.ctyme.com/intr/rb-0719.htm
Works in finding wether the drive is emulatored or no.
This int works on all my test PC, other than a old p100, which gives a error, eg: set the CF to 1.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
http://www.ctyme.com/intr/rb-0719.htm
Works in finding wether the drive is emulatored or no.
This int works on all my test PC, other than a old p100, which gives a error, eg: set the CF to 1.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.