| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Assembly Questions and Answers for Assembly here! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#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. |
|
#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
|
|
#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/ |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|