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.
Hi all, i post this code for reading sectors of the floppy. My question is... why the emulator Bochs show 'partial read() on floppy image returns 510/512' (usually when it does is OK) and doesn't read the next sector with 'call'? Through 'int 13h' is allowed, strange or something wrong?
Neo92 wrote:Hi all, i post this code for reading sectors of the floppy. My question is... why the emulator Bochs show 'partial read() on floppy image returns 510/512' (usually when it does is OK) and doesn't read the next sector with 'call'? Through 'int 13h' is allowed, strange or something wrong?
How large if the floppy disk image you're using (and can I guess that the floppy image itself is 510 bytes, and not 1474560 bytes or any other multiple of 512 bytes)?
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Hi Brendan, i must to read the second sector's floppy by first. The image is large 1024 bytes (exactly 1022 bytes) divided into 512 bytes for sector. I wouldn't want that there are the mistakes into initialization ports or DMA, i don't know... i will try of read back functions, also if is strange that with interrupt 0x13 read it.
A floppy image must be exactly the 1.4M size of an actual floppy, anything else makes VMs trip - in different fashions depending on the emulator in question.
"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 ]
Just add zeros to the end of your image until it is 1474560 bytes long, and see if the problem goes away. If not, let us know.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
The BIOSes in a lot of emulators don't implement int 13 through the standard FDC subsystem; they work through a "back door" route which may or may not be able to handle incorrectly sized images.
Now can you please increase the size of your image before posting again, and repeatedly posting the same (or very similar) code is not going to fix your problem.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.
Neo92 wrote:I increase the size of my image (1474560 byte=1 Mbyte) but without reply.
Then let us know so we don't all criticise you .
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.
since you don't have the 2 byte magic number (0xaa55) at the end of that sector. Only the first sector has that.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
I moved the code out of your posts into Pastebin, so the thread is readable again. Please try to use some other code hosting site - can I suggest version control as well - when you want to paste something that's more than a few lines long?
Thanks Candy, i don't knowed this rule, in the future i'll try don't repeat this action and i'm sorry. But i still don't understand why the floppy reading into second sector is slow. I don't want to read the second sector with interrupt 0x13 (that works) but through ports with DMA, that's all.