Re: LSA Disk Sector Read - using int 13h ah 42 (extended read)



jay wrote:
I'm just messing around here trying to learn how some of this low level
stuff works, and to my surprise I can not find a working example any
where...

Can someone please help. I'm about to pull my hair out!
I'm using visual studio 1.52 to compile my 16 bit code. I'm doing C
with inline ASM.
Note: I called check_extensions and extension are on my computer.

When i compile and run the following code bError prints out "0" so that
is no error i think? Yet when i print out my buffer the buffer is all
0's which i know is wrong because i have another functions that read
the MBR in with CHS format call and then it prints out the mbr just
fine. Any ideas?


struct disk_packet //needed for int13 42h
{
BYTE size_pack; //size of packet must be 16 or 16+
BYTE reserved1; //reserved
BYTE no_of_blocks; //no:of blocks for transfer
BYTE reserved2; //reserved
WORD offset; //offset address
WORD segment; //segment address
DWORD lba1;
DWORD lba2;
} disk_pack;

void LBASectorRead(void *buffer, unsigned long lba )
{
unsigned char bError = 0;
disk_pack.size_pack=16; //set size to 16
disk_pack.no_of_blocks=1; //1 block ie read one sector
disk_pack.reserved1=0; //reserved word
disk_pack.reserved2=0; //reserved word
disk_pack.segment=FP_SEG(buffer); //segment of buffer
disk_pack.offset=FP_OFF(buffer); //offset of buffer
disk_pack.lba1=0; //lba first 32 bits
disk_pack.lba2=0; //last 32 bit address

_asm
{
mov dl, 80h;
mov [disk_pack.segment], ds;
mov si, disk_pack;

I'm not familiar with the syntax you're using... Should this be "offset disk_pack"?

Best,
Frank

.



Relevant Pages

  • Re: 8031 question
    ... AUXBUF EQU 0; TRICK - BAFER ... BUFFER EQU 100H; PREPARE FOR OUTPUT ... MOV R0,#TEMPDIV; TEMPERATURU CITA SAMO U KRUGU 1 ... JMP EQSEC; ...
    (sci.electronics.design)
  • Re: HLA Lib
    ... The are all based around readln. ... // as there is still additional data in the input buffer. ... mov(InputIndex, ebx); ... mov(CharsInBuf, ecx); ...
    (alt.lang.asm)
  • Re: Completely confused. Please send help. :)
    ... I was backward in my thinking on which was the start of my buffer. ... mov ebx, %1 ... mov eax, SYSCODE_write ... mov ebx, EXIT_FAILURE ...
    (comp.lang.asm.x86)
  • Re: GIDE interface kits
    ... ASM86 MBR $ SZ PZ ... mov dx,0B800h;set color video address in DX ... Read the MBR of the first hard disk into our local buffer, ...
    (comp.os.cpm)
  • Re: Confusing stack effects
    ... ASM86 MBR $ SZ PZ ... mov dx,0B800h;set color video address in DX ... Read the MBR of the first hard disk into our local buffer, ...
    (alt.lang.asm)