CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Assembly
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Assembly Questions and Answers for Assembly here!

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old January 17th, 2005, 01:49 AM
    yasumi yasumi is offline
    Junior Member
     
    Join Date: Jan 2005
    Posts: 1
    yasumi is an unknown quantity at this point (<10)
    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.
    Reply With Quote
      #2    
    Old January 28th, 2005, 04:16 AM
    lurner lurner is offline
    Junior Member
     
    Join Date: Jan 2005
    Posts: 8
    lurner is an unknown quantity at this point (<10)
    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!!
    Reply With Quote
      #3    
    Old February 5th, 2005, 03:14 PM
    Thingol Thingol is offline
    Member
     
    Join Date: May 2004
    Posts: 45
    Thingol is an unknown quantity at this point (<10)
    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/
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Assembly


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 03:56 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009