flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > Menuet HD Question

Author
Thread Post new topic Reply to topic
Gomer73



Joined: 29 Nov 2003
Posts: 151
Gomer73
Below is a section of the code used to read info off of the HD. Same code for this part for both CHS and LBA access.

mov al,[esp+15]
and al,1+2+4+8
mov bl,byte [hdid]
add al,bl
add al,128+64+32
out dx,al
inc edx
mov al,20h
out dx,al

My question is: Why is the top nyble 128+64+32? My understanding is this port has the following format:

; 1f6 r/w drive/head
; bit 7 = 1
; bit 6 = 0
; bit 5 = 1
; bit 4 = 0 drive 0 select
; = 1 drive 1 select
; bit 3-0 head select bits

Which would indicate bit 6(64 decimal) should be clear. What is the reason it is set in Menuetos?

Thanks,

...Gomer
Post 26 Jan 2004, 22:09
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 230
Ville
From: http://mudlist.eorbit.net/~adam/pickey/ports.html
Code:
Bitfields for hard disk controller drive/head specifier:
Bit(s)        Description      (Table P084)
 7             =1
 6             LBA mode enabled, rather than default CHS mode
 5             =1
 4             drive select (0 = drive 0, 1 = drive 1)
 3-0           head select bits (CHS mode)
    
Post 26 Jan 2004, 22:43
View user's profile Send private message Reply with quote
Gomer73



Joined: 29 Nov 2003
Posts: 151
Gomer73
Cool, thanks.
Post 27 Jan 2004, 00:03
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 can attach files in this forum
You can download files in this forum


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

Website powered by rwasa.