flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Floppy problem - How to read FDD in PM mode?

Author
Thread Post new topic Reply to topic
A$M



Joined: 29 Feb 2012
Posts: 94
A$M
What do I do? I was using BIOS interrupt 13h in my 2nd bootloader and then I went into the PM. But it has a size limit. So what do I to access floppy or hard disk in PM, reading more than 64KB? Rolling Eyes
Post 27 Sep 2012, 18:11
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
The BIOS int 0x13 ah=2 reads to es:bx so you can load up to 1MB if you increment es by 0x1000 every time bx wraps to 0x0000 (and align your reads to this boundary). For protected mode BIOS calls are not available so you have to write a- (or load an existing-) driver for it. Normally, it easiest to start with a PIO driver to control floppy/hdd as this is both small and relatively simple - ATA HDD more so than floppy.
Post 27 Sep 2012, 18:59
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC
you would use segment registers to access more than 64k. in Real Mode BIOS Services accept
ES:BX = 20-bit Pointer to data.

simply increment ES each iteration rather than BX (setting BX to zero each iteration).

_________________
byte me.
Post 27 Sep 2012, 20:27
View user's profile Send private message Visit poster's website Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC
there are alternatives if you want efficiency. namely unrolling (multiple sectors per BIOS call). however they get complicated due to alignment with the boundary.
Post 27 Sep 2012, 20:29
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Just code a PM fdd driver, or read/write one sector at a time going back and forth to realmode only about 10% slower than doing it full in realmode, its simple.


Last edited by Dex4u on 28 Sep 2012, 20:46; edited 1 time in total
Post 28 Sep 2012, 18:22
View user's profile Send private message Reply with quote
A$M



Joined: 29 Feb 2012
Posts: 94
A$M
I am now studying floppy controllers. I will to construct a driver for it in a few days. Wait me and see... Cool
Post 28 Sep 2012, 19:11
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
A$M wrote:
I am now studying floppy controllers. I will to construct a driver for it in a few days. Wait me and see... Cool

Two days, it took two hours Laughing


Description:
Download
Filename: Fdd.inc
Filesize: 32.72 KB
Downloaded: 138 Time(s)

Post 28 Sep 2012, 20:45
View user's profile Send private message Reply with quote
A$M



Joined: 29 Feb 2012
Posts: 94
A$M
Thanks for this code, but, how I already says, I am studying the floppy controller. I will see this code after I write my own code. Cool
Post 29 Sep 2012, 00:30
View user's profile Send private message 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.