Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Asm: Общие вопросы > Int 13(48h)


Автор: Nos 14.4.2004, 16:13
Ув. коллеги! Может кто-то работал и знает что и куда возвращается при вызове 13-го прерывания (48-я функция)?

Автор: Jin X 14.4.2004, 20:23
Код
--------d-1348-------------------------------
INT 13 - IBM/MS INT 13 Extensions - GET DRIVE PARAMETERS
AH = 48h
DL = drive (80h-FFh)
DS:SI -> buffer for drive parameters (see #00273)
Return: CF clear if successful
    AH = 00h
    DS:SI buffer filled
CF set on error
    AH = error code (see #00234)
BUGS: several different Compaq BIOSes incorrectly report high-numbered
  drives (such as 90h, B0h, D0h, and F0h) as present, giving them the
  same geometry as drive 80h; as a workaround, scan through disk
  numbers, stopping as soon as the number of valid drives encountered
  equals the value in 0040h:0075h
Dell machines using PhoenixBIOS 4.0 Release 6.0 fail to correctly
  handle this function if the flag word at DS:[SI+2] is not 0000h
  on entry
SeeAlso: AH=08h,AH=41h,AH=49h,MEM 0040h:0075h

Format of IBM/MS INT 13 Extensions drive parameters:
Offset Size Description (Table 00273)
00h WORD (call) size of buffer
     (001Ah for v1.x, 001Eh for v2.x, 42h for v3.0)
 (ret) size of returned data
02h WORD information flags (see #00274)
04h DWORD number of physical cylinders on drive
08h DWORD number of physical heads on drive
0Ch DWORD number of physical sectors per track
10h QWORD total number of sectors on drive
18h WORD bytes per sector
---v2.0+ ---
1Ah DWORD -> EDD configuration parameters (see #00278)
 FFFFh:FFFFh if not available
---v3.0 ---
1Eh WORD signature BEDDh to indicate presence of Device Path info
20h BYTE length of Device Path information, including signature and this
   byte (24h for v3.0)
21h  3 BYTEs reserved (0)
24h  4 BYTEs ASCIZ name of host bus ("ISA" or "PCI")
28h  8 BYTEs ASCIZ name of interface type
 "ATA"
 "ATAPI"
 "SCSI"
 "USB"
 "1394" IEEE 1394 (FireWire)
 "FIBRE" Fibre Channel
30h  8 BYTEs Interface Path (see #00275)
38h  8 BYTEs Device Path (see #00276)
40h BYTE reserved (0)
41h BYTE checksum of bytes 1Eh-40h (two's complement of sum, which makes
   the 8-bit sum of bytes 1Eh-41h equal 00h)
Note: if the size is less than 30 on call, the final DWORD will not be
  returned by a v2.x implementation; similarly for the Device Path info
SeeAlso: #00277,#03196

Bitfields for IBM/MS INT 13 Extensions information flags:
Bit(s) Description (Table 00274)
0 DMA boundary errors handled transparently
1 cylinder/head/sectors-per-track information is valid
2 removable drive
3 write with verify supported
4 drive has change-line support (required if drive >= 80h is removable)
5 drive can be locked (required if drive >= 80h is removable)
6 CHS information set to maximum supported values, not current media
15-7 reserved (0)
Note: bits 4-6 are only valid if bit 2 is set
SeeAlso: #00273

Format of EDD v3.0 Interface Path:
Offset Size Description (Table 00275)
---ISA---
00h WORD 16-bit base address
02h  6 BYTEs reserved (0)
---PCI---
00h BYTE PCI bus number
01h BYTE PCI device number
02h BYTE PCI function number
03h  5 BYTEs reserved (0)
SeeAlso: #00273,#00276

Format of EDD v3.0 Device Path:
Offset Size Description (Table 00276)
---ATA---
00h BYTE flag: 00h = master, 01h = slave
01h  7 BYTEs reserved (0)
---ATAPI---
00h BYTE flag: 00h = master, 01h = slave
01h BYTE logical unit number
02h  6 BYTEs reserved (0)
---SCSI---
00h BYTE logical unit number
01h  7 BYTEs reserved (0)
---USB---
00h BYTE to be determined
01h  7 BYTEs reserved (0)
---IEEE1394---
00h QWORD 64-bit FireWire General Unique Identifier (GUID)
---FibreChannel---
00h QWORD Word Wide Number (WWN)
SeeAlso: #00273,#00275

Format of Phoenix Enhanced Disk Drive Spec translated drive parameter table:
Offset Size Description (Table 00277)
00h WORD number of cylinders
02h BYTE number of heads
03h BYTE A0h (signature indicating translated table)
04h BYTE number of physical sectors per track
05h WORD starting write precompensation cylinder number
07h BYTE reserved
08h BYTE control byte (see #03198 at INT 41"DISK 0")
09h WORD number of physical cylinders
0Bh BYTE number of physical heads
0Ch WORD cylinder number of landing zone
0Eh BYTE number of logical sectors per track
0Fh BYTE checksum
Program: the Phoenix Enhanced Disk Drive Specification is an addition to the
  IBM/MS INT 13 extensions
SeeAlso: #00278,#03196

Format of Phoenix Enhanced Disk Drive Spec Fixed Disk Parameter Table:
Offset Size Description (Table 00278)
00h WORD physical I/O port base address
02h WORD disk-drive control port address
04h BYTE drive flags (see #00279)
05h BYTE proprietary information
 bits 7-4 reserved (0)
 bits 3-0: Phoenix proprietary (used by BIOS)
06h BYTE IRQ for drive (bits 3-0; bits 7-4 reserved and must be 0)
07h BYTE sector count for multi-sector transfers
08h BYTE DMA control
 bits 7-4: DMA type (0-2) as per ATA-2 specification
 bits 3-0: DMA channel
09h BYTE programmed I/O control
 bits 7-4: reserved (0)
 bits 3-0: PIO type (1-4) as per ATA-2 specification
0Ah WORD drive options (see #00280)
0Ch  2 BYTEs reserved (0)
0Eh BYTE extension revision level (high nybble=major, low nybble=minor)
 (currently 10h for v1.0 and 11h for v1.1-3.0)
0Fh BYTE 2's complement checksum of bytes 00h-0Eh
 8-bit sum of all bytes 00h-0Fh should equal 00h
Note: this structure is also called the Device Paramter Table Extension
  (DPTE)
SeeAlso: #00277

Bitfields for Phoenix Enhanced Disk Drive Spec drive flags:
Bit(s) Description (Table 00279)
7 reserved (1)
6 LBA enabled
5 reserved (1)
4 drive is slave
3-0 reserved (0)
SeeAlso: #00278,#00280

Bitfields for Phoenix Enhanced Disk Drive Spec drive options:
Bit(s) Description (Table 00280)
0 fast PIO enabled
1 fast DMA access enabled
2 block PIO (multi-sector transfers) enabled
3 CHS translation enabled
4 LBA translation enabled
5 removable media
6 ATAPI device (CD-ROM)
7 32-bit transfer mode
---v1.1+ ---
8 ATAPI device uses DRQ to signal readiness for packet command
(must be 0 if bit 6 is 0)
10-9 translation type (must be 00 if bit 3 is 0)
00 Phoenix bit-shifting translation
01 LBA-assisted translation
10 reserved
11 proprietary translation
---v3.0---
11 Ultra DMA access enabled
15-12 reserved (0)
SeeAlso: #00278,#00279

Автор: Nos 15.4.2004, 13:09
Цитата
INT 13 - IBM/MS INT 13 Extensions - GET DRIVE PARAMETERS
AH = 48h
DL = drive (80h-FFh)
DS:SI -> buffer for drive parameters (see #00273)
Return: CF clear if successful
    AH = 00h
    DS:SI buffer filled

DS:SI до вызова обработчика нужно как-то инициализировать?

Автор: Akina 15.4.2004, 14:25
Цитата
DS:SI до вызова обработчика нужно как-то инициализировать?

непременно. нужно зарезервировать место, в которое поместится таблица, и в DS:SI записАть ее адрес...

Автор: Nos 15.4.2004, 15:29
Цитата
непременно. нужно зарезервировать место, в которое поместится таблица, и в DS:SI записАть ее адрес...

А можно чуточку подробнее...?

Автор: Akina 15.4.2004, 17:21
.....

buffer_for_DPT db 42h dup (?)

.....

mov ax,segment buffer_for_DPT
mov ds,ax
mov si, offset buffer_for_DPT
mov ah,48h
mov dl,80h
int 13h
jc error

.....

Автор: Jin X 15.4.2004, 17:31
Код
mov ah,48h
mov dl,80h  ; первый диск
lea si,Buffer
; ds = сегмент буффера
int 13h
. . .
. . .
Buffer:
Size dw 1Ah  ; здесь должен быть записан (до вызова!) размер буффера
Flags dw ?
Cyls dd ?
Heads dd ?
Secs dd ?
Total dq ?
SecSize dw ?

Автор: Nos 15.4.2004, 18:17
Угу... а если Си'шный компилятор ругается (я в Си вставляю Asm'овский код) на все варианты, ещё есть какая-то возможность?

Автор: Akina 16.4.2004, 08:31
Nos
ну средствами С создай строку длиной в 42h байт и используй ее как буфер... в чем проблема-то? хотя более грамотно - скомпилить АСМовскую процедуру и подстегивать в С-прогу объектник...

Автор: Jin X 16.4.2004, 18:52
В данном случае 0x1A байт (но можно и 0x42, см.описание).
И тогда пиши так.
Если Buf - массив, то:
Код
mov ah,48h
mov dl,80h; первый диск
mov si,offset Buf
int 13h
;jc @@Error
Если Buf - указатель, то:
Код
push ds
mov ah,48h
mov dl,80h; первый диск
lds si,Buf
int 13h
;jc @@Error
pop ds

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)