Floppy driver receives no results
Posted: Mon Oct 22, 2018 1:29 pm
Hello all,
I am new to this forum but I have been reading the contents here with great pleasure for long time.
Now I decided to join the forum to possibly share my knownledge and make others profit as I have also profited from this forum often times in the past.
However I would also like to receive some help in solving a problem I have not been able to solve for a long time.
This problem is about a floppy driver for my hobby operating system which I try to get to work.
I am booting my OS from a floppy image which already works fine. However reading sectors from a protected mode floppy driver always results in bochs printing the message "port 0x3f5: no results to read".
The error message can be found in the bochs source code here: http://bochs.sourceforge.net/cgi-bin/lx ... py.cc#L475
However I cannot really deduce the error from the code snippet - Because it checks that the pending command bitand 0x4f equals to 0x46 (which allows the cmd to be 0xe6, which is the synthesis of bitflags used to read a sector in my case).
Thats fine so far for my understanding. But why does it check that the NDMA bit is set. Shouldn't it be unset when using DMA mode?
I can also observe that the PTE which identity maps the DMA buffer is probably accessed as the dirty flag is set after the read operation of the FDC.
However the data of the sector is not written to the DMA buffer.
My floppy image is actually just binary files which are appended and organized by a very primitive file table. There is no special floppy disk format applied.
I have already searched alot but I did not find anything which solves my problem and the floppy driver itself should be fine. I have compared the implementation to others and I really cannot find any error.
Can somebody give me a hint where to look for the corresponding error? Maybe there is a common reason for this behaviour?
Let me just give give You some basic info about the system which might be useful:
- Custom bootloader (no grub or anything comparable)
- GDT with flat setup, code and data descriptors for both ring0 and ring3
- IDT setup and working
- Paging is enabled and identity maps 128MB starting from physical address 0
- Currently no scheduler is implemented
- DMA buffer for the floppy driver is 0x1000 or 0x2000 (I tried both, the addresses do not conflict with other components of the OS.. e.g. no code or data is overwritten)
- Toolchain is nasm, gcc and ld
- Filesystem and floppy image are created using my own tooling (basically appends files and stores starting sectors and file sizes in a table)
- Floppy image is exactly 1.44 MB of size and bochs is configured to a 1.44 MB 3.5" floppy drive
- Bochs version is 2.6.7
- Please let me know if more information is needed ...
Thanks in advance.
Very best regards,
pointer
I am new to this forum but I have been reading the contents here with great pleasure for long time.
Now I decided to join the forum to possibly share my knownledge and make others profit as I have also profited from this forum often times in the past.
However I would also like to receive some help in solving a problem I have not been able to solve for a long time.
This problem is about a floppy driver for my hobby operating system which I try to get to work.
I am booting my OS from a floppy image which already works fine. However reading sectors from a protected mode floppy driver always results in bochs printing the message "port 0x3f5: no results to read".
The error message can be found in the bochs source code here: http://bochs.sourceforge.net/cgi-bin/lx ... py.cc#L475
However I cannot really deduce the error from the code snippet - Because it checks that the pending command bitand 0x4f equals to 0x46 (which allows the cmd to be 0xe6, which is the synthesis of bitflags used to read a sector in my case).
Thats fine so far for my understanding. But why does it check that the NDMA bit is set. Shouldn't it be unset when using DMA mode?
I can also observe that the PTE which identity maps the DMA buffer is probably accessed as the dirty flag is set after the read operation of the FDC.
However the data of the sector is not written to the DMA buffer.
My floppy image is actually just binary files which are appended and organized by a very primitive file table. There is no special floppy disk format applied.
I have already searched alot but I did not find anything which solves my problem and the floppy driver itself should be fine. I have compared the implementation to others and I really cannot find any error.
Can somebody give me a hint where to look for the corresponding error? Maybe there is a common reason for this behaviour?
Let me just give give You some basic info about the system which might be useful:
- Custom bootloader (no grub or anything comparable)
- GDT with flat setup, code and data descriptors for both ring0 and ring3
- IDT setup and working
- Paging is enabled and identity maps 128MB starting from physical address 0
- Currently no scheduler is implemented
- DMA buffer for the floppy driver is 0x1000 or 0x2000 (I tried both, the addresses do not conflict with other components of the OS.. e.g. no code or data is overwritten)
- Toolchain is nasm, gcc and ld
- Filesystem and floppy image are created using my own tooling (basically appends files and stores starting sectors and file sizes in a table)
- Floppy image is exactly 1.44 MB of size and bochs is configured to a 1.44 MB 3.5" floppy drive
- Bochs version is 2.6.7
- Please let me know if more information is needed ...
Thanks in advance.
Very best regards,
pointer