I've made a mistake. I thought that I could write a Device-driver to
access my Hard-disks.
The problem is that I can't seem to find much about writing them. Iv'e
bought a book that supposedly "the best" (Writing MS-DOS device-drivers -
second edition. Robert S. Lai), but it's written 10 years ago, and does not
give the info I need. (it stops at writing a RAM-Drive)
I'm looking for examples that will show how I can address a drive larger
than 32 MByte (meaning : having 32 bit sector-adressing). The
Request-record structure for the Read-sector call (Command-code 4) jumps
from 22 to 30 bytes. That means that something more has been added than the
extra two bytes for the Sector-number (expanding it from 16 to 32 bits).
All I found at the moment are examples that use 16-bit sector adressing.
So, if anyone knows of documents, or a site, that hold examples (in any
language, but Assembly is preferred) to writing block-device drivers I would
*really* like to know.
Regards,
Rudy Wieser
"R.Wieser" <rwi...@xs4all.nl> schreef in bericht
news:3bf7a4ea$0$11871$e4fe...@tyrannewsaurus.xs4all.nl...
Hello Bernd,
> you might want to have a look at the source of the Freedos kernel. I know
> nothing about programming, but FreeDOS has fat32 support, so that's way
> beyond 32MB.
> www.freedos.org
You're right, it is. But I am looking for FAT16, with 32-bit
*sector-adressing* . Older device-drivers have a 16-bit sector-adressing,
limiting it (when using the normal sector-size of 512 bytes) to about 32
MByte. My current (logical) drives are somewhat larger ... <grin>
The problem is that I can't seem to find much about Device-drivers in
general, and next-to-nothing about device-drivers utilizing 32-bit sector
addressing in specific.
Regards,
Rudy Wieser
First what are you trying to accomplish.
If all you want to do is add ports to your ATA(EIDE) list that is
used during boot the easiest way to do that is to load before
dos loads. This way all you have to do is give dos itself access
to the sectors and it will do the work for you.
If you want other filesystems then the fun really begins.
I ran into the same problem and wound up programming
my way into a corner then back out of it.
The gist is that if you want to access the drive after dos
boots then you have to decide if you want dos to see it or not.
My Favorite/Stupidest way of doing this is to use my ADD168
program. It is a TSR that adds one to the bios HD count at 40:72
(If you don't follow that address then go find ralf browns list. You
can't really do any of this kind of stuff without it.)
I typically have 4 HDs in my systems and use a tray hooked to
an ISA controller. This gives 40:72 a value of 0x83.
This means HDs Numberd 0-3. Then my program increments
this count and takes over INT13 calls with DL=0x84 and does
what ever needs to be done. Typically I do data recovery with
a diskeditor (my own or another depending on what I need.).
The diskeditor sees a drive number and makes BIOS calls to
INT13 and my program responds as though it were BIOS itself.
However don't run FDISK while this is loaded. That really gets messy.
Had to do data recovery on my own stuff after I glitched that one.
I use BOOT168 when I want to access the drive thru dos. Sourcecodes
on my site if it will do you anygood. The code is sloppy and written
more for following the spec than for size or speed. Everything is
pure brute force. It does only PIO and seems to work fine under
DOS 6.22(4.01&Later Tested) and gives some problems under
WIN95 dos 7.0x
I get either 1.7 Meg/s or 2.1 Meg/s thru an ISA adapter.
(Depends on the mood my system is in.)
And about 6.5 Meg/s thru a promise ata-33/66/100(All Tested same).
However setup is not for the faint of heart as you will be moving your
primary Partition/Boot sector and installing your own. Fortunately I
listened when someone complained and I added some comments
to the source code and it now even vaguelly readable.
Good luck with your project.
--
Doors - Dont look at the future in a window.
just walk to the door http://walk.to/doors
- Open it and go there.
http://www.tidepool.com/~doors/doors.htm
OR SEARCH AT
http://www.tidepool.com/~doors/search.htm
Hello Doors (?)
> First what are you trying to accomplish.
What I want is to write a Block-Device driver that can access a logical
drive on my Hard-disk like any of the standard ones. It should be able to
Read/Write a sector, and format a logical drive.
I have to say that, although I have not found the actual calling-structure
to the read/write access with a 32-bit sector adressing, I've solved my own
question by looking at the call-structures that where delivered to my
Device-driver.
At the moment my device-driver read's the targetted logical drive correctly.
> If all you want to do is add ports to your ATA(EIDE) list that is
> used during boot the easiest way to do that is to load before
> dos loads. This way all you have to do is give dos itself access
> to the sectors and it will do the work for you.
>
> If you want other filesystems then the fun really begins.
No. I do not want to add anothe physical drive, nor do I want to use
another file-system. All I want is to be able to access a normal logical
drive.
My major problem is that I'm running into lack of information at about every
step I try to do.
- I have the general layout of a basic (Block-) Device-driver, but can find
next to nothing about the request-record structures for 32-bit
sector-adressing.
- I can find (and have) some source-files that will create a RAM-Drive, but
those examples do support the GenericIO call (command 13h)
- I can find stuff about Generic IOCTRL (INT 21h, AX=440Dh - from Ralf
Brown's Interrupt-list), but can't seem to find where the Device-driver
should get the answer(s) to such call's.
[Snip]
I will take a look on your site. Thanks for the offer.
Thanks for your response,
Rudy Wieser
> --
> Doors - Dont look at the future in a window.
> just walk to the door http://walk.to/doors
> - Open it and go there.
>
> http://www.tidepool.com/~doors/doors.htm
> OR SEARCH AT
> http://www.tidepool.com/~doors/search.htm
>
> do...@tidepool.com
> mailto:do...@tidepool.com
> Hello All,
>
> I've made a mistake. I thought that I could write a Device-driver to
> access my Hard-disks.
Ask on comp.arch...half of the people have the words "PhD" and "computer
engineering/science" in their sigs