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.
boot device ports
Re:boot device ports
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
i don?t want to use bios,my OS has drivers but i want to knowNelson wrote: The boot device is stored in dl on boot. Store that in a variable and use it for your int 13h reading operations.
if the boot disk is on primary or secondary ide controller .
Re:boot device ports
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.
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.
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:boot device ports
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 ...
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
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.
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.