boot device ports

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
octavio

boot device ports

Post 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.
Warrior

Re:boot device ports

Post 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.
octavio

Re:boot device ports

Post 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 .
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:boot device ports

Post 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.
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:boot device ports

Post 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 ...
octavio

Re:boot device ports

Post 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.
Post Reply