Page 1 of 1

boot device ports

Posted: Tue Oct 25, 2005 2:35 am
by octavio
Hello, the bios interrupt int 13h ax=4801h can be used to get
info about the boot device like ide ports used ,very useful if the program wants to use it's own driver instead of bios services ,i have tested it and it works as expected for hard disk but after booting my OS. from cd without emulation if i try
int 13h ax=4801h dl=0f9h (device number) the computer reboots. Is there another way to know wich is the disk the OS. is booting from?
currently the OS. search a string in a file on all disks but this method is a bit slow if there are many files.

Re:boot device ports

Posted: Tue Oct 25, 2005 4:59 am
by Warrior
The boot device is stored in dl on boot. Store that in a variable and use it for your int 13h reading operations.

Re:boot device ports

Posted: Tue Oct 25, 2005 7:57 am
by octavio
Nelson wrote: The boot device is stored in dl on boot. Store that in a variable and use it for your int 13h reading operations.
i don?t want to use bios,my OS has drivers but i want to know
if the boot disk is on primary or secondary ide controller .

Re:boot device ports

Posted: Tue Oct 25, 2005 8:05 am
by Solar
Erm... your post quoted the BIOS interrupt you've been using so far, but you don't want to use the BIOS?

Reading DL and storing it somewhere is "how it's done". You might want to have a look at the stage1 source of GRUB; there is some trickery involved as some crappy old BIOS don't set the value correctly.

I can't think of a way to do this without the BIOS. The BIOS is what's doing the boot, and the BIOS knows where it did boot from. The device itself surely doesn't.

Re:boot device ports

Posted: Tue Oct 25, 2005 8:16 am
by Pype.Clicker
what sounds strange with your problem is that i don't see any reference to INT13, service 4801 in RBIL. or are you using
service 48 ?

This one also says something about wrong devices at 0x90, etc. So i would fear this is yet another poorly stressed BIOS function that sometimes misbehaves. I'd at least use service 0x41 to make sure it is actually supported ...

Re:boot device ports

Posted: Wed Oct 26, 2005 3:53 am
by octavio
Mi mistake, i meant that the computer crash with int 13h
ah=48 dl=9fh (bios drive number)
but i have also tested int 13h ax=4b01h dl=9fh si=bufer, this service returns a data structure ,at offset 8 is the device number that i was searching for.
In RBIL they call this the bus number instead of ide number
because there are scsi devices too.