RetroForum Welcome, Guest. Please login or register.
September 03, 2010, 10:46:00 PM
Home Help Search Calendar Login Register

RetroForth Discussion  |  Main  |  Discussion  |  Topic: Floppy driver for Native? « previous next »
Pages: 1 Go Down Print
Author Topic: Floppy driver for Native?  (Read 3225 times)
RogerLevy
Full Member
****

Karma: +1/-0
Offline Offline

Posts: 55


View Profile
Floppy driver for Native?
« on: October 23, 2005, 07:01:18 PM »

Recently I've gotten into Retro/Native. For me, typing 'r' causes my system to crash after a short hard drive thrash.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Floppy driver for Native?
« Reply #1 on: October 23, 2005, 07:27:30 PM »

Sadly I haven't been able to produce a working floppy driver yet. (There's just too many variable in terms of floppy controllers, timings, etc). If a VM86 subsystem existed, I'd be able to use the BIOS functions, but that's a kludge at best.

Can you send me any information on you hdd controller, hdd type/size, and cpu/memory information? This is the first report I've had of the hdd driver not working as expected  Sad
Logged
RogerLevy
Full Member
****

Karma: +1/-0
Offline Offline

Posts: 55


View Profile
Re: Floppy driver for Native?
« Reply #2 on: October 23, 2005, 07:47:02 PM »

sorry, i don't know most of those specs, and besides, i don't plan on using either of the HDD's in that computer, since I have Windows and Linux on it. Smiley

i tried it on a junk machine i have, but the bootable floppy hangs with the "floppy error" message.
Logged
RogerLevy
Full Member
****

Karma: +1/-0
Offline Offline

Posts: 55


View Profile
Re: Floppy driver for Native?
« Reply #3 on: October 23, 2005, 11:48:40 PM »

BTW are you sure about floppies, Charles?  Because I was just thinking about DOS and the BIOS and stuff - and doesn't  the BIOS offer a standard way to access the floppy drive?  Otherwise how could you boot floppy disks - and install DOS?  Do you think it would be worthwhile to try to write the driver myself?

You mentioned that there are too many variables to do it - do you mean, like, settings that you're supposed to verify with the floppy drive in some standardized way?
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Floppy driver for Native?
« Reply #4 on: October 24, 2005, 01:08:03 AM »

Quote
BTW are you sure about floppies, Charles?  Because I was just thinking about DOS and the BIOS and stuff - and doesn't  the BIOS offer a standard way to access the floppy drive?  Otherwise how could you boot floppy disks - and install DOS?  Do you think it would be worthwhile to try to write the driver myself?

The BIOS does offer a pretty standard way to read/write from floppies, but it doesn't work in a 32-bit protected mode environment. If I coded a VM86 driver, I could drop down to real mode and do the BIOS calls, then return to pmode, but it's a kludge and not all that reliable in my experience.

Quote
You mentioned that there are too many variables to do it - do you mean, like, settings that you're supposed to verify with the floppy drive in some standardized way?

Mostly the timings: different firmware and drives respond slightly differently. Without DMA, it's nearly impossible to reliably read/write from the floppy in protected mode, and I haven't even begun to code any DMA stuff under RetroForth/Native yet.
Logged
RogerLevy
Full Member
****

Karma: +1/-0
Offline Offline

Posts: 55


View Profile
Re: Floppy driver for Native?
« Reply #5 on: October 24, 2005, 01:28:44 AM »

well, i'm determined to use the floppy as a storage device for the time being, since i can't spare a harddrive.   Smiley  how come your pmode->real mode->pmode mechanism has not worked so reliably in the past? 

i agree the idea of it is kludgey in one light.  but on the other hand, the BIOS is so universal it's considered part of the platform, right?  i think sometimes you just gotta do what you gotta do.  kludge or no, if your method can be made reliable, i'd use it.

how much work would it be to add DMA?
« Last Edit: October 24, 2005, 01:31:41 AM by RogerLevy » Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Floppy driver for Native?
« Reply #6 on: October 24, 2005, 02:25:22 AM »

I stopped work on the VM86 code back in 2004. Retro4 had a floppy driver in assembly, but I was never able to get it to work on my hardware. (My biggest problem now is a lack of floppies and only one machine with a working floppy driver). I've thought about "lifting" the driver in Dex4u, but that's still problematic in licensing (Dex4u is closed source currently)

I've attached the Retro4 floppy driver to this, though I have no idea what it'd take to bring it into sync with Retro8's changes. (It's for NASM, and would need minor tweaks to the source and adaption to use the 'code' macros and such to build the dictionary entries). If anyone has the time and patience to update and debug this, I'd be thrilled to include it with RetroForth/Native once more.

I'll give try to start work on updating it myself this week, but I have a full schedule at work this week (likely 65-70 hours!), so I'm not likely to get much coding done.
Logged
RogerLevy
Full Member
****

Karma: +1/-0
Offline Offline

Posts: 55


View Profile
Re: Floppy driver for Native?
« Reply #7 on: October 24, 2005, 04:47:21 AM »

Thanks, Charles! I'll look at it.  Happy to report that 'install' worked great on the junk machine i mentioned.  That one is a 120mhz pentium with 32 mb ram and probably a 2gig hdd.  It's really exciting to be able to boot right into a usable Forth.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Floppy driver for Native?
« Reply #8 on: October 25, 2005, 12:10:21 AM »

Ok, I updated the floppy driver to work with rf8/native and linked it into the kernel (see http://retro.tunes.org/nightly to get a diskimage with it included). Under qemu it does load a cylinder from the floppy into the editor: try "there 0 readf"

A list of provided words (not all tested):

readf  ( addr cylinder -- addr+ cylinder+1 )
writef  ( addr cylinder -- addr+ cylinder+1 )
reads  ( addr cylinder n -- addr+ cylinder+n )
writes  ( addr cylinder n -- addr+ cylinder+n )
Logged
RogerLevy
Full Member
****

Karma: +1/-0
Offline Offline

Posts: 55


View Profile
Re: Floppy driver for Native?
« Reply #9 on: October 25, 2005, 02:15:37 AM »

way cool...

readf and reads both seemed to work.  i haven't tested them out that hard but i got data into the blocks so that's encouraging.  i plan on testing it thoroughly, but i have to do it later, because i have homework i should be doing ...
Logged
RaySt.Marie
Jr. Member
***

Karma: +0/-0
Offline Offline

Posts: 10

ColorForth Hobbiest


View Profile WWW
Re: Floppy driver for Native?
« Reply #10 on: July 23, 2006, 04:09:50 AM »

I wonder if the colorforth floppy driver is relevent to this problem?
Logged

Raymond A. St. Marie II
Raystm2 and raystm22 on IRC
irc.freenode.net /join
#c4th #c4th-ot #retro #forth
#concatenative
Pages: 1 Go Up Print 
RetroForth Discussion  |  Main  |  Discussion  |  Topic: Floppy driver for Native? « previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Valid XHTML 1.0! Valid CSS!