|
-
January 17th, 2005, 01:49 AM
#1
accessing hard disk with assembly
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.
-
January 28th, 2005, 04:16 AM
#2
Re: accessing hard disk with assembly
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:
Code:
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!!
-
February 5th, 2005, 03:14 PM
#3
Re: accessing hard disk with assembly
Get HDPARM's source code and try to understand it. There's no need for assembly.
http://freshmeat.net/projects/hdparm/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|