Thread: biosdisk's error code

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158

    Exclamation biosdisk's error code

    While using biosdisk() to write a boot sector to a floppy, it returned 2. winerror.h defines this as File Not Found, but a dos library and windows library most likely do not use the same error definetions. After trying to boot from the floppy, the system said it was a Non-System Or Corrupt Disk. So what exactely does 2 mean in this case? Please help.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I googled for "biosdisk error code" and found this. http://www.delorie.com/djgpp/doc/libc/libc_71.html

    It redirects you to here for error codes. http://www.delorie.com/djgpp/doc/libc/libc_63.html
    Return Value

    Return value of AX register. The meaning of high-order byte (AH):


    0x00 No error
    0x01 Invalid request or a bad command
    0x02 Address mark not found
    0x03 Disk write protected
    0x04 Sector not found
    0x05 Reset failed
    0x06 Floppy disk removed
    0x07 Drive parameter activity failed
    0x08 Direct Memory Access (DMA) overrun
    0x09 DMA crossed 64K boundary
    0x0A Bad sector flag detected
    0x0B Bad track flag detected
    0x0C Media type not found
    0x0D Invalid number of sectors on format
    0x0E Control data access mark detected
    0x0F DMA arbitration level out of range
    0x10 Data read (CRC or ECC) error
    0x11 Corrected data read (ECC) error
    0x20 Controller failure
    0x40 Seek error
    0x80 Disk timed out or failed to respond
    0xAA Drive not ready
    0xBB Undefined error
    0xCC Write fault on drive
    0xE0 Status error
    0xFF Sense operation failed
    Your error code is this one.
    Code:
    0x02  Address mark not found
    What does that mean? Off to google! Googling for "address mark floppy disk" found this page: http://www.microsoft.com/technet/pro....mspx?mfr=true

    Typical help support. "Dunno, try over there."

    This isn't much better. http://www.sheffieldforum.co.uk/showthread.php?t=57900
    Ditto. http://forums.civfanatics.com/showthread.php?t=173002

    However, everything seems to suggest that it's something wrong with your floppy drive or at least the disk itself. Can you read/write other floppy disks? What happens if you try to re-format this disk?

    What are you trying to do, anyway, using non-standard functions to write directly to floppy disks? Are you out of your mind?

    Also, this thread might have been better off in the Tech Forum.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Thanks for responce. But I am sure the floppy drive is still in good working order though, in fact, it can read diskettes that other computers think are corrupt.

    I just might be out of my mind, I am trying to make a boot disk so that I may build an OS off of it. I know making an OS isn't a walk in the park, but I'm trying anyway.
    After learning basic asm, I found a 512 boot sector, and edited it to assemble and work how I like, when I try to read it, windows says it must be formated, and then it says it can't do it. Typical for corrupt floppys. And I thought biosdisk() overwrote the file system, which is why windows thought it was corrupt. But bios says it's not a valid bootdisk, so I got the idea to check the error code. But now it seems like biosdisk() didn't even write to the floppy. So why is it corrupt now?

    In a different field, I want to make my OS bootable from a CD anyway, so why am I even toying with floppys?? You might know this, when bios boots from a CD, what files does it look for? I was thinking autorun.inf, but again, thats a windows dohicky. I'll try autoexec.bat first.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Yarin View Post
    Thanks for responce. But I am sure the floppy drive is still in good working order though, in fact, it can read diskettes that other computers think are corrupt.

    I just might be out of my mind, I am trying to make a boot disk so that I may build an OS off of it. I know making an OS isn't a walk in the park, but I'm trying anyway.
    After learning basic asm, I found a 512 boot sector, and edited it to assemble and work how I like, when I try to read it, windows says it must be formated, and then it says it can't do it. Typical for corrupt floppys. And I thought biosdisk() overwrote the file system, which is why windows thought it was corrupt. But bios says it's not a valid bootdisk, so I got the idea to check the error code. But now it seems like biosdisk() didn't even write to the floppy. So why is it corrupt now?

    In a different field, I want to make my OS bootable from a CD anyway, so why am I even toying with floppys?? You might know this, when bios boots from a CD, what files does it look for? I was thinking autorun.inf, but again, thats a windows dohicky. I'll try autoexec.bat first.
    Try getting for exmple "memtest86" - it contains a boot-from-CD piece of GPL licensed code, so you can use that. It's pretty much the same as booting from floppies, but the disk is bigger.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    memtest86 sounds good. I download the floppy setup and cd iso. But now I am confused, where do I go from here? Using the downloaded files, I know how to do this with the floppy now, but not the CD. Am I supposed to burn the BOOT.CAT file along with my own MEMTEST.IMG program??

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Yarin View Post
    memtest86 sounds good. I download the floppy setup and cd iso. But now I am confused, where do I go from here? Using the downloaded files, I know how to do this with the floppy now, but not the CD. Am I supposed to burn the BOOT.CAT file along with my own MEMTEST.IMG program??
    If you get the source-code, it contains a bit of shell-script that generates an ISO image.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Okay, thanks.

Popular pages Recent additions subscribe to a feed