flat assembler
Message board for the users of flat assembler.

Index > OS Construction > SOS Int 13h ah=08h - Drive Parameters

Author
Thread Post new topic Reply to topic
mkriegel



Joined: 15 Jul 2007
Posts: 19
Location: Germany
mkriegel 17 Jul 2007, 18:15
Hi to all,

Ive got a problem with finding out the TracksPerHead value by calling Int13h ah=08h. Until now, I found out the following:

Value in cx after call:
4F42h
-------------ch----- ----cl------
cly. bit: 76543210 98
sect. bit:---------------543210

Expected value in DriveInfo.TracksPerHead:
14Fh
Value in DriveInfo.TracksPerHead:
0
(if I leave away the inc at the end of the procedure it is Fh)

f_read_driveinfo:
push es
mov dl, [DriveInfo.DriveNumber]
mov ah, 8h
int 13h
xor eax, eax
mov [DriveInfo.Heads], eax
mov [DriveInfo.TracksPerHead], eax
mov [DriveInfo.SectPerTrack], eax

mov al, dh
mov WORD [DriveInfo.Heads], ax

push cx
mov BYTE [DriveInfo.TracksPerHead], ch
shr cl, 6
and cl, 3
mov BYTE [DriveInfo.TracksPerHead+1], cl
pop cx

xor eax, eax
mov al, cl
and al, 63
mov [DriveInfo.SectPerTrack], eax

inc [DriveInfo.Heads]
inc [DriveInfo.TracksPerHead]
pop es
ret

What is my mistake?

THX MK

By the way, has someone a good tool to copy sectors from a binary file to a Floppy (without filesystems...)

_________________
mkriegel@gmx.de
Post 17 Jul 2007, 18:15
View user's profile Send private message Reply with quote
mkriegel



Joined: 15 Jul 2007
Posts: 19
Location: Germany
mkriegel 18 Jul 2007, 15:08
Does nobody know a solution or can anybody try it out? For that I'll post it as ASM


Description:
Download
Filename: bootsect.ASM
Filesize: 5.27 KB
Downloaded: 280 Time(s)


_________________
mkriegel@gmx.de
Post 18 Jul 2007, 15:08
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 18 Jul 2007, 20:27
Have you taken into account that bios( Int 13h ah=08h - Drive Parameters) has got maximum size limitations? The infamous 504mb barrier...Sad

regards
Mac2004
Post 18 Jul 2007, 20:27
View user's profile Send private message Reply with quote
mkriegel



Joined: 15 Jul 2007
Posts: 19
Location: Germany
mkriegel 18 Jul 2007, 20:44
Yes, I thought about, but this cant be the prob, I think:

When I calculate the values manually, I get the following:

Heads: 2
Tracks / Head: 335
Sectors / Track: 2

That's why it seems so, that my BIOS uses a logical CHS and translates it to a physical one. The effect of this is, that u can address more sectors if u don't use the real CHS-values.

The real problem is, that the computations in this code-fragment doesnt work:

mov BYTE [DriveInfo.TracksPerHead], ch
shr cl, 6
and cl, 3
mov BYTE [DriveInfo.TracksPerHead+1], cl

cx includes the Tracks and Sectors values from int 13h call as shown above. ch contains the 8 lower bits of the tracks value and cl <7;6> are the two upper bits of the tracks value. I want to have the track's value alone, so I copy the byte in ch as the lower one to my destination, then I shift cl 6 times right to arrange bits 8 and 9 of the tracks value, set the other bit's to all zeros and copy it to the upper byte of my destination. That's the theory, but it doesnt work as I want. There must somewhere be a little stupid mistake...

MK
Post 18 Jul 2007, 20:44
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 19 Jul 2007, 08:34
mkriegel wrote:

By the way, has someone a good tool to copy sectors from a binary file to a Floppy (without filesystems...)


Partcopy by John Fine is neat tool. Smile I use it every day to write my binary files. Just use search engines to locate it...

regards,
Mac2004
Post 19 Jul 2007, 08:34
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.