Click to See Complete Forum and Search --> : accessing hard disk with assembly


yasumi
January 17th, 2005, 01:49 AM
Hello,
I'm sort of n00b in assembly.

What I'm trying to do is to get the harddisk information with asm program and display it on the terminal. The environment is Fedora Core 3 linux, with NASM and I have su access to the machine. Harddisk is connected via IDE. Something like what you can get with "hdparm /dev/hda"

This is what i've gotten so far, by searching on the google and try to put together what I found there.

Section .text
global _start
_start:
mov eax, 4
xor ebx, ebx
mov ebx, 1

mov ah, 08h
mov dl, 80h

But, how would I output this to terminal?

Any kind of input would be appreciated.
Thanks in advance.

lurner
January 28th, 2005, 04:16 AM
you have to intERRUPT the DOS Service 21h.. I just started learning myself and I use a different assembler on a different OS but I will give it a shot, one line:


Section .text
global _start
_start:
mov eax, 4
xor ebx, ebx
mov ebx, 1

mov ah, 08h
mov dl, 80h
int 21h


Hope that helps .. more people should code in ASM!! :)

Thingol
February 5th, 2005, 03:14 PM
Get HDPARM's source code and try to understand it. There's no need for assembly.
http://freshmeat.net/projects/hdparm/