About have many hard disk computer startup

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
zgxltxz
Posts: 9
Joined: Mon Apr 15, 2013 4:31 am
Location: China
Contact:

About have many hard disk computer startup

Post 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.
:?:
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: About have many hard disk computer startup

Post 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
Every universe of discourse has its logical structure --- S. K. Langer.
zgxltxz
Posts: 9
Joined: Mon Apr 15, 2013 4:31 am
Location: China
Contact:

Re: About have many hard disk computer startup

Post 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?
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: About have many hard disk computer startup

Post by djmauretto »

0x80 Hard Disk (Boot)
0x81 Hard Disk
0x82 Hard Disk

Total 3 Hard Disk :-)
zgxltxz
Posts: 9
Joined: Mon Apr 15, 2013 4:31 am
Location: China
Contact:

Re: About have many hard disk computer startup

Post 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
zgxltxz
Posts: 9
Joined: Mon Apr 15, 2013 4:31 am
Location: China
Contact:

Re: About have many hard disk computer startup

Post 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.
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: About have many hard disk computer startup

Post 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    

Post Reply