Hello everyone!
I have a problem.
I wrote a IDE driver with the tutorials found on the osdev wiki, my can be found here: https://github.com/AdeRegt/SanderOSUSB/ ... /dev/ide.c
When the driver is initialised, it does detect the filesystem on a disk, my filesystem detection code: https://github.com/AdeRegt/SanderOSUSB/ ... l/fs/mbr.c
I decided to add a custom filesystem: https://github.com/AdeRegt/SanderOSUSB/ ... l/fs/sfs.c
The IDE-ATAPI works perfectly.
The IDE-ATA doesnt:
The system initialises the IDE-ATA, this seems to go OK
The system detects the filesystem, this goes OK
The system initialises the filesystem, this goes OK
The system wants to load sectors stored in a buffer, gotten from the filesystem. this does not go OK.
The data in the buffer is OK, but it is somehow unable to read sectors. the 0x1f7 port returns a 0xff when checking the status and does not read any sector.
Does anyone knows what is wrong?
IDE-ATA Problem
Re: IDE-ATA Problem
Emulators(especially QEMU) took really long time for reading/writing sectors with ATA (only some first sectors are faster). On real hardware is your waitng time enough, but in emulators you should wait some miliseconds.And you must acknowledge interrupt by reading from status port(0x1F7/0x177).
Re: IDE-ATA Problem
I interpret this as your ATA code actually does read some sectors, Yes? It must read some sectors if it found the file system on the disk.SanderR wrote:Hello everyone!
I have a problem.
I wrote a IDE driver with the tutorials found on the osdev wiki, my can be found here: https://github.com/AdeRegt/SanderOSUSB/ ... /dev/ide.c
When the driver is initialised, it does detect the filesystem on a disk, my filesystem detection code: https://github.com/AdeRegt/SanderOSUSB/ ... l/fs/mbr.c
I decided to add a custom filesystem: https://github.com/AdeRegt/SanderOSUSB/ ... l/fs/sfs.c
The IDE-ATAPI works perfectly.
The IDE-ATA doesnt:
The system initialises the IDE-ATA, this seems to go OK
The system detects the filesystem, this goes OK
The system initialises the filesystem, this goes OK
The system wants to load sectors stored in a buffer, gotten from the filesystem. this does not go OK.
The data in the buffer is OK, but it is somehow unable to read sectors. the 0x1f7 port returns a 0xff when checking the status and does not read any sector.
Does anyone knows what is wrong?
However, the last line states that it does not read any sectors at all.
Please be more specific. If the ATA driver does read sectors, which it would have to do to correctly read in the partition to detect the file system, but then it doesn't read other times?
Ben
- http://www.fysnet.net/media_storage_devices.htm
Re: IDE-ATA Problem
Hi,
I’m planning to write an ATA driver sometime soon, once I get a good handle on how the hardware works I’ll look over your code and see if I can spot any issues.
But my first question is how have you created the disk with your custom FS?
I’m planning to write an ATA driver sometime soon, once I get a good handle on how the hardware works I’ll look over your code and see if I can spot any issues.
But my first question is how have you created the disk with your custom FS?
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
Discord:https://discord.gg/zn2vV2Su
Re: IDE-ATA Problem
I would also note that your mbr_entry type doesn’t use the __packed__ attribute which means the compiler might be adding alignment bytes to make access quicker, so the types won’t align with your on disk structures.
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
Discord:https://discord.gg/zn2vV2Su
Re: IDE-ATA Problem
Hello,
Thank you for your answers.
I discovered I had a git branch with a working base so I restored parts of this file.
The old code had bugs but I was able to solve them by the advices you guys told me. Thank you.
I was not exactly sure where the bugs in the new system was comming from.
For the filesystem: I opened my virtual harddisk (VHD) with my hexeditor and in this way designed the filesystem base.
This system works well enough. This is the filesystemdriver link: https://github.com/AdeRegt/SanderOSUSB/ ... l/fs/sfs.c
This is the ide driver link: https://github.com/AdeRegt/SanderOSUSB/ ... /dev/ide.c
Thank you for your answers.
I discovered I had a git branch with a working base so I restored parts of this file.
The old code had bugs but I was able to solve them by the advices you guys told me. Thank you.
I was not exactly sure where the bugs in the new system was comming from.
For the filesystem: I opened my virtual harddisk (VHD) with my hexeditor and in this way designed the filesystem base.
This system works well enough. This is the filesystemdriver link: https://github.com/AdeRegt/SanderOSUSB/ ... l/fs/sfs.c
This is the ide driver link: https://github.com/AdeRegt/SanderOSUSB/ ... /dev/ide.c