flat assembler
Message board for the users of flat assembler.

Index > OS Construction > floppy dma problem

Author
Thread Post new topic Reply to topic
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 14 Nov 2004, 23:39
hello, i'm writing a floppy driver and read operations already work ok, but when writing data 1024 bytes are writen to floppy but dma transfer 1025 bytes and the last byte is lost ,i have take a look a others sources and the only difference that i see is that i´m using dma in autoinitialize mode (56h for read, 5ah to write floppy) while others use single mode,also floppy fifo and automatic seek is enabled i suppose that i forget something in dma setup, but what?
Post 14 Nov 2004, 23:39
View user's profile Send private message Visit poster's website Reply with quote
Gomer73



Joined: 29 Nov 2003
Posts: 151
Gomer73 18 Nov 2004, 22:03
Allignment is sometimes the issue.
If you are not on an even word boundary you will get that issue.
Post 18 Nov 2004, 22:03
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 18 Nov 2004, 22:40
Gomer73 wrote:
Allignment is sometimes the issue.
If you are not on an even word boundary you will get that issue.

write bufer is at address 98000h .
Now i´m using simple dma transfer not autoinitialized and it works.
perhaps the floppy does not support autoinitialized dma on write operations.
Post 18 Nov 2004, 22:40
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 09 Dec 2004, 20:24
Now i have a floppy driver that works well on two computers but not on the 3rd ,i have tested the disk unit on another computer and it's ok so the problem is related to the mainboard controller.
Only sectors that have been previously readed by the bios are readed also
by my driver from other sectors i only get zeros.
when debuging i observed that after send 0 to port 3f2h (initialization)
the status port 3f4h returns 0d0h meaning that i have to read some byte from data port but this is not explained on the manuals that i have.
some idea?
Post 09 Dec 2004, 20:24
View user's profile Send private message Visit poster's website Reply with quote
thomasantony



Joined: 18 Aug 2004
Posts: 8
Location: Kerala, India
thomasantony 20 Jan 2005, 12:17
Hi,
I read in a DMA tutorial at www.osdever.net that all the lengths sent to DMA is read +1. Thatis if you send 0 1 byte is read, if you send length, length+1 bytes are read. So you need to send actual length-1 to read. So you try sending 1023. BTW I am working on a basic DMA and FDC driver for my Os. It is not in working condition and I have built enough to test it.
My Os is at: (This one has no DMA, FDC etc.)
http://www.tomasm.tk
Thomas Antony

_________________
C is Moronic, C Programers are morons!! Very Happy

My website : http://www.tomasm.tk
Post 20 Jan 2005, 12:17
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 21 Jan 2005, 18:40
thomasantony wrote:
Hi,
I read in a DMA tutorial at www.osdever.net that all the lengths sent to DMA is read +1.

Yes i know i also read tutorials, but tutorials always are missing some important details, so to develop a drive we have to do a lot of tests on different machines and try with different variations of the driver.
Now the sources are available on my web page, pehaps you can find the bug Confused
Post 21 Jan 2005, 18:40
View user's profile Send private message Visit poster's website Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 21 Jan 2005, 20:08
BTW the Floppy is supposed to use 512bytes sectors.

I know it can use different sector sizes but virtually all PC machines use a 512bytes sector size.

Unfortunately Octavio i find myself unable to read OctASM source code...
it is too complicated for me Sad
Post 21 Jan 2005, 20:08
View user's profile Send private message Visit poster's website Reply with quote
thomasantony



Joined: 18 Aug 2004
Posts: 8
Location: Kerala, India
thomasantony 23 Jan 2005, 05:29
Hi octavio,
I just completed my FDC driver yesterday. Get it in teh OSdev section of my site, http://www.tomasm.tk . Download v1.1 of RooOs. See the floppy.asm file and the dma.asm. The DMA sets up the buffer for floppy IO only
BTW, I didn't understand the language at your site. It is espanol right? I only know 3 human languages which we have to learn at school frm the beginning. English, Hindi(our national language) and Malayalam(our regional language) The lanst two can be found in the Unicode list Laughing
Thomas Antony
Post 23 Jan 2005, 05:29
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 25 Jan 2005, 17:58
thomasantony wrote:
Hi octavio,
I just completed my FDC driver yesterday.

I tested the 'read' command it turns on the fd, but nothing else.
Post 25 Jan 2005, 17:58
View user's profile Send private message Visit poster's website Reply with quote
thomasantony



Joined: 18 Aug 2004
Posts: 8
Location: Kerala, India
thomasantony 30 Jan 2005, 04:47
Hi octavio,
That floppy driver had some problems. Icompletely rebuilt the driver. The new driver is available at;

http://www.myfilebucket.com/u/tomasm/floppy.asm
http://www.myfilebucket.com/u/tomasm/dma.asm
http://www.myfilebucket.com/u/tomasm/fat12.asm

The last one is a simple FAT12 driver whci can read a file from the disk.
The filename supplied to the loadfile function should be in the format it is stored in the directory. eg logo.txt will be LOGO TXT .

Thomas Antony

Thomas Antony
Post 30 Jan 2005, 04:47
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.