OSDev Wiki ATA read/write sectors code not working right
Posted: Wed Apr 24, 2019 10:48 am
https://wiki.osdev.org/ATA_read/write_sectors
Some of the time, it does work, some of the time it does not.
I can only read and write in one function, then the code quits working.
https://gist.github.com/iProgramMC/8328 ... 9bdfd6909f
https://gist.github.com/iProgramMC/8d92 ... 52e7b76b31
The basic code required to test the functions is here.
The code returns zeros from the FileOpen function, even though the InitFilesystem function worked beforehand and made a full tree of the filesystem.
File system is very simple, you've got the classical BPB boot-sector, then 16 sectors' worth of root directory files, and data area.
All other FAT features were stripped down as this is planned to be a read-only file system.
Its main purpose is to load other programs into memory.
I'm not sure what causes the random halt of the functioning of AtaLbaRead and AtaLbaWrite, but I have a suspicion it may be in regards to the drive not being initialized and such, even though the file system was loaded successfully.
Please help?
Some of the time, it does work, some of the time it does not.
I can only read and write in one function, then the code quits working.
https://gist.github.com/iProgramMC/8328 ... 9bdfd6909f
https://gist.github.com/iProgramMC/8d92 ... 52e7b76b31
The basic code required to test the functions is here.
The code returns zeros from the FileOpen function, even though the InitFilesystem function worked beforehand and made a full tree of the filesystem.
File system is very simple, you've got the classical BPB boot-sector, then 16 sectors' worth of root directory files, and data area.
All other FAT features were stripped down as this is planned to be a read-only file system.
Its main purpose is to load other programs into memory.
I'm not sure what causes the random halt of the functioning of AtaLbaRead and AtaLbaWrite, but I have a suspicion it may be in regards to the drive not being initialized and such, even though the file system was loaded successfully.
Please help?