Page 1 of 1

INT 13h

Posted: Sat Mar 26, 2011 4:00 am
by BOTOKILLER
Hello everyone,
What function of INT 13h should i use to read my kernel from CD?

Re: INT 13h

Posted: Sat Mar 26, 2011 4:04 am
by MDM
2 and 0x42

Re: INT 13h

Posted: Sat Mar 26, 2011 4:14 am
by BOTOKILLER
will it read cd??

Re: INT 13h

Posted: Sat Mar 26, 2011 4:18 am
by Chandra
BOTOKILLER wrote:will it read cd??
Look for Int 13h Extensions in Ralf Brown's Interrupt List. You'll find your answer there.

Re: INT 13h

Posted: Sat Mar 26, 2011 4:33 am
by BOTOKILLER
http://www.ctyme.com/intr/rb-0717.htm
i found this interrupt in that copy of table, I've got a few questions
what is CD-ROM controller number? Is 'Logical Block Address of disk image to emulate' - LBA of the sector, I need to read. what is '0Ch WORD load segment for initial boot image'?.

Re: INT 13h

Posted: Sat Mar 26, 2011 5:21 am
by Chandra
Do you want to initiate disk emulation?
I mean, do you want your CD device to behave as a floppy or hard disk?
If no, that is not for you.
If yes, you can use third party softwares (MagicISO etc.) to do that job for you. :wink:

Anyway, here's what you need.

Code: Select all

INT 13 - IBM/MS INT 13 Extensions - EXTENDED READ
	AH = 42h
	DL = drive number         ; Let BIOS fill this value
	DS:SI -> disk address packet (see #00272)
Return: CF clear if successful
	    AH = 00h
	CF set on error
	    AH = error code (see #00234)
	    disk address packet's block count field set to number of blocks
	      successfully transferred
SeeAlso: AH=02h,AH=41h"INT 13 Ext",AH=43h"INT 13 Ext"

Format of disk address packet:
Offset	Size	Description	(Table 00272)
 00h	BYTE	size of packet (10h or 18h)
 01h	BYTE	reserved (0)
 02h	WORD	number of blocks to transfer (max 007Fh for Phoenix EDD)
 04h	DWORD	-> transfer buffer             ; Destination address
 08h	QWORD	starting absolute block number
		(for non-LBA devices, compute as
		  (Cylinder*NumHeads + SelectedHead) * SectorPerTrack +
		  SelectedSector - 1
 10h	QWORD	(EDD-3.0, optional) 64-bit flat address of transfer buffer;
		  used if DWORD at 04h is FFFFh:FFFFh
It is always wise to check the availability of Int13h Extensions before you continue.

AFAIK, Bochs, Qemu and Virtual PC don't report the availability of Int13h Extensions. In that case, you need to manually start disk emulation (in which case, the link you posted, comes handy). I think Linux does something similar as I can run my Linux Distribution Live CD under Emulators.

Re: INT 13h

Posted: Sat Mar 26, 2011 6:07 am
by BOTOKILLER
all right guys, Ill try all this stuff....

Re: INT 13h

Posted: Sat Mar 26, 2011 6:56 am
by BOTOKILLER
will that one work http://www.ctyme.com/intr/rb-0708.htm ??????????

Re: INT 13h

Posted: Sat Mar 26, 2011 8:53 am
by thepowersgang
How about you go try for your self? And here's a tip - adding extra question marks does not make people more likely to help you, in fact, it makes you a big target for the banhammer.
Learning about forum etiquette before posting is always a nice thing.