INT 13h

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
User avatar
BOTOKILLER
Member
Member
Posts: 28
Joined: Tue Jan 04, 2011 10:25 am
Location: Ukraine

INT 13h

Post by BOTOKILLER »

Hello everyone,
What function of INT 13h should i use to read my kernel from CD?
User avatar
MDM
Member
Member
Posts: 57
Joined: Wed Jul 21, 2010 9:05 pm

Re: INT 13h

Post by MDM »

2 and 0x42
Last edited by MDM on Sat Mar 26, 2011 5:24 pm, edited 1 time in total.
User avatar
BOTOKILLER
Member
Member
Posts: 28
Joined: Tue Jan 04, 2011 10:25 am
Location: Ukraine

Re: INT 13h

Post by BOTOKILLER »

will it read cd??
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: INT 13h

Post 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.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
BOTOKILLER
Member
Member
Posts: 28
Joined: Tue Jan 04, 2011 10:25 am
Location: Ukraine

Re: INT 13h

Post 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'?.
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: INT 13h

Post 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.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
BOTOKILLER
Member
Member
Posts: 28
Joined: Tue Jan 04, 2011 10:25 am
Location: Ukraine

Re: INT 13h

Post by BOTOKILLER »

all right guys, Ill try all this stuff....
User avatar
BOTOKILLER
Member
Member
Posts: 28
Joined: Tue Jan 04, 2011 10:25 am
Location: Ukraine

Re: INT 13h

Post by BOTOKILLER »

will that one work http://www.ctyme.com/intr/rb-0708.htm ??????????
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: INT 13h

Post 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.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply