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.
Unfortuantely this code doesnt work... In bochs, i get the error... read sectors issued to non-disk. I belive i am getting this because i am either not putting in the right drive id, or it cannot find the drive. The error pops up in the console on this command outportb(0x1F7, 0x20); (Tells the controller to read). This is probably a simple issue. Any support would be greatly appreciated!
If bochs is giving you that message, it is most likely because the drive was never defined.
Are you sure you have activated ATA channel 0 and defined a primary master drive in your bochsrc file?
I also see a potential future mistake in your code, but it has no negative effect in this case. A cast has a much higher precedence than a shift operator, so it happens first. So your LBA calculations are truncating your LBA to 8 bits and THEN shifting down 8, 16, or 24. Which will always result in a value of 0. You need parentheses after the cast.
00218432312i[HD ] ata0-0: : read from 0/0/0, aborting command
00218435215e[HD ] IO read(0x01f0) with drq == 0: last command was 00h
00218435241e[HD ] IO read(0x01f0) with drq == 0: last command was 00h
00218435267e[HD ] IO read(0x01f0) with drq == 0: last command was 00h
either use proper CHS (which doesn't start from all zeroes), or set the LBA bit.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]