Int 0x13 error: 0xff - "sense operation failed"

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
danielbj
Member
Member
Posts: 36
Joined: Thu Dec 16, 2010 3:08 pm

Int 0x13 error: 0xff - "sense operation failed"

Post by danielbj »

I am currently working on a really simple file system for UNICORN OS, called UNES.

I got all my disk drivers working, so i can read and write through system calls.

So i wrote a formatter first of all. It sets up the FAT and the root folder, and of course sector 0: Disk Data.
This is the part containing the disk name and format mark.

So i tried making it write the disk name to 0x0020, and a loop code at 0x0000 (if the disk is booted from).
All this went well and reading and writing was successful.

Here comes the point where my problem started:
I wanted to make a format-mark, simply writing the fou letters "UNES" to 0x0010. This will work as an identification string of a UNES formatted disk.

BUT!
After making the formatter write "UNES" to 0x0010 of the disk, the int 0x13 have begun giving me an error 0xff (sense operation failed) every time i try to read from the disk.
I then erase sector 0 of the disc... and then i can read again with no errors!

So... what went wrong?
Why cant i use 0x0010 to write "UNES"? This seems very wierd, right?
Also... What is sense operation, and how can it fail?

EDIT:
I tried moving the "UNES"-string to 0x0030, and it works great. So from that i will now conclude that using 0x0010 for storing "UNES" on a disk, triggers error 0xff... Which is very confusing. :S

Daniel Broder Jensen
UNICORN OS
User avatar
MDM
Member
Member
Posts: 57
Joined: Wed Jul 21, 2010 9:05 pm

Re: Int 0x13 error: 0xff - "sense operation failed"

Post by MDM »

You say you erase sector 0... Are you aware that sector begins at 1? Also, what interrupts are you using?
danielbj
Member
Member
Posts: 36
Joined: Thu Dec 16, 2010 3:08 pm

Re: Int 0x13 error: 0xff - "sense operation failed"

Post by danielbj »

I made my system call to convert from sectors starting at 0, to CHS-address. And that system call is using int 0x13, ah=0x02 and ah=0x03.

Daniel Broder Jensen
UNICORN OS
Post Reply