Page 1 of 1

About have many hard disk computer startup

Posted: Thu Sep 26, 2013 3:27 am
by zgxltxz
My English is poor.
Assume a PC have 3 hard disks,How to identify other hard disk ID in the BIOS boot disk's boot program.
:?:

Re: About have many hard disk computer startup

Posted: Thu Sep 26, 2013 4:29 am
by bwat
Not sure I understand the question, but, if I'm guessing right you want to map disks to identifiers used by the BIOS???
If so, there's a major clue in the documentation for BIOS int 13, function 2. Here's the documentation found in my bootstrap-loader's subroutine that uses that BIOS function.

Code: Select all

# BIOS int 13h, function 02h, Read Sector.
# Input
#	AH = 02h
#	AL = number of sectors to read
#	CH = track/cylinder
#	CL = sector
#	DL = disk (00h-7Fh floppy, 80h-FFh hard disk)
#	DH = head
#	ES:BX = segment:offset of buffer
# Output
#	CF = 0 on success, 1 on failure with AH = failure code
#	AL = number of sectors read

Re: About have many hard disk computer startup

Posted: Thu Sep 26, 2013 7:01 am
by zgxltxz
bwat wrote:Not sure I understand the question, but, if I'm guessing right you want to map disks to identifiers used by the BIOS???
If so, there's a major clue in the documentation for BIOS int 13, function 2. Here's the documentation found in my bootstrap-loader's subroutine that uses that BIOS function.

Code: Select all

# BIOS int 13h, function 02h, Read Sector.
# Input
#	AH = 02h
#	AL = number of sectors to read
#	CH = track/cylinder
#	CL = sector
#	DL = disk (00h-7Fh floppy, 80h-FFh hard disk)
#	DH = head
#	ES:BX = segment:offset of buffer
# Output
#	CF = 0 on success, 1 on failure with AH = failure code
#	AL = number of sectors read
YES,
DL = disk (00h-7Fh floppy, 80h-FFh hard disk)
BUT,How to get the other hard drive ID?

Re: About have many hard disk computer startup

Posted: Thu Sep 26, 2013 7:06 am
by djmauretto
0x80 Hard Disk (Boot)
0x81 Hard Disk
0x82 Hard Disk

Total 3 Hard Disk :-)

Re: About have many hard disk computer startup

Posted: Thu Sep 26, 2013 7:07 am
by zgxltxz
bwat wrote:Not sure I understand the question, but, if I'm guessing right you want to map disks to identifiers used by the BIOS???
If so, there's a major clue in the documentation for BIOS int 13, function 2. Here's the documentation found in my bootstrap-loader's subroutine that uses that BIOS function.

Code: Select all

# BIOS int 13h, function 02h, Read Sector.
# Input
#	AH = 02h
#	AL = number of sectors to read
#	CH = track/cylinder
#	CL = sector
#	DL = disk (00h-7Fh floppy, 80h-FFh hard disk)
#	DH = head
#	ES:BX = segment:offset of buffer
# Output
#	CF = 0 on success, 1 on failure with AH = failure code
#	AL = number of sectors read
I want to get all disks ID

Re: About have many hard disk computer startup

Posted: Thu Sep 26, 2013 8:04 am
by zgxltxz
djmauretto wrote:0x80 Hard Disk (Boot)
0x81 Hard Disk
0x82 Hard Disk

Total 3 Hard Disk :-)
For example,We set BIOS first boot disk 1,Now,We use disk 1 to boot disk 2,How to determine their own disk 2 ID,It is guided by indirect.

Re: About have many hard disk computer startup

Posted: Thu Sep 26, 2013 9:01 am
by djmauretto
For example,We set BIOS first boot disk 1,Now,We use disk 1 to boot disk 2,How to determine their own disk 2 ID,It is guided by indirect.
:?:

Code: Select all


	XOR	DX,DX
	MOV	ES,DX
	MOV	BX,0x7C00	
	MOV	CX,1			; Start Load from Sector #1     
	MOV	DL,0x81		; Hard Disk 2
	MOV	AX,0201H		; Read 1 Sector
	INT	13H			; BIOS Disk
   JC     @Error

   JMP   0x0000:0x7C00