Author Topic: DOS driver tutorial  (Read 10803 times)

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
DOS driver tutorial
« on: June 15, 2014, 02:38:29 AM »
I've to program for an embedded DOS system. Where can I find a DOS driver tutorial?

Gunther
You have to know the facts before you can distort them.

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1196
Re: DOS driver tutorial
« Reply #1 on: June 15, 2014, 03:45:38 AM »
If I recall correctly Ray Duncan’s Advanced MS-DOS Programming, and the MS-DOS Encyclopedia (Ray Duncan editor), both published by Microsoft, covered device drivers in detail and included example code.

Also Geoff Chappell’s book DOS Internals is a good possibility.

And the MS-DOS Programmer’s Reference, at least for versions 5 and 6, included a chapter but nothing in the way of code details or example code.


Well Microsoft, here’s another nice mess you’ve gotten us into.

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: DOS driver tutorial
« Reply #2 on: June 15, 2014, 04:56:12 AM »
maybe quicker...
i believe Ralf Brown had some information on drivers

i still remember some of that stuff - lol
i learned from Ray Duncan's book
one of the first things to decide is whether you are writing a character device or a block device
there is also a CLOCK$ device, a special case of a character device
a typical character device replaces system defined devices, like CON, PRN, NUL, etc
typical block devices are RAMDRIVES, and so on
any driver that doesn't fit one of the character device models is usually written as a block device

if you have specific questions, let me know - i may be able to help

are you writing a driver for a piece of hardware ?

FORTRANS

  • Member
  • *****
  • Posts: 1238
Re: DOS driver tutorial
« Reply #3 on: June 15, 2014, 05:17:34 AM »
Hi,

   "Advanced Assembly Language", by Allen L. Wyatt, Sr. has a
chapter on device drivers.  Both character and block device
drivers were built.

HTH,

Steve N.

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Re: DOS driver tutorial
« Reply #4 on: June 15, 2014, 07:09:59 PM »
Thanks to all. I've Ray Duncan's books in my book shelf - probably in the basement. I don't know the books by Geoff Chappell and Allen L. Wyatt, Sr. Are they worth reading?

It seems that web tutorials don't exist.

Gunther
You have to know the facts before you can distort them.

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1196
Re: DOS driver tutorial
« Reply #5 on: June 15, 2014, 07:59:12 PM »
I don't know the books by Geoff Chappell and Allen L. Wyatt, Sr. Are they worth reading?

DOS Internals is well written and was a useful reference for me at the time, but I don't have any clear memory of device driver-related information in it. I would start with the Ray Duncan books.
Well Microsoft, here’s another nice mess you’ve gotten us into.

sinsi

  • Guest
Re: DOS driver tutorial
« Reply #6 on: June 15, 2014, 08:10:38 PM »
This is shareware (I think), but it's from 1994...
CHAPTER.009 is the one you want.

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: DOS driver tutorial
« Reply #7 on: June 15, 2014, 09:14:36 PM »
if you have Ray Duncan's Advanced MS-DOS Programming book, you have everything you need   :t

FORTRANS

  • Member
  • *****
  • Posts: 1238
Re: DOS driver tutorial
« Reply #8 on: June 15, 2014, 11:00:30 PM »
I don't know the books by Geoff Chappell and Allen L. Wyatt, Sr. Are they worth reading?


Hi Gunther,

   The book by Wyatt is somewhere between okay and good.
It is sort of a  "Advanced Assembly for Beginners" style of book.
Good explanations, and nicely commented code.  Some redundancy.
But not very deep if used as a reference.  Worthwhile, but not
mandatory in my opinion, if you have other sources to work with.

Regards,

Steve N.

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Re: DOS driver tutorial
« Reply #9 on: June 15, 2014, 11:32:06 PM »
Dave, Michael and Steve,

thank you for the fast answers. Special thanks to Sinsi for providing the material.  :t

Gunther
You have to know the facts before you can distort them.

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Re: DOS driver tutorial
« Reply #10 on: June 16, 2014, 12:54:02 AM »
I've checked my basement and found: Advanced MS-DOS Programming. The Microsoft(R) Guide for Assembly Language and C Programmers. By Ray Duncan. Chapter 14 presents a skeleton example for a driver. I found furthermore Extending DOS. A Programmers Guide to Protected-Mode DOS. It has two working driver examples for an EMS and a XMS ram disk.

I think that'll be my starting point.

Gunther
You have to know the facts before you can distort them.

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: DOS driver tutorial
« Reply #11 on: June 16, 2014, 01:26:39 AM »
deleted
« Last Edit: February 25, 2022, 07:59:50 AM by nidud »

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Re: DOS driver tutorial
« Reply #12 on: June 16, 2014, 04:23:07 AM »
Hi nidud,

Here is the last device driver I wrote if that helps.

thank you.  :t

Gunther
You have to know the facts before you can distort them.

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: DOS driver tutorial
« Reply #13 on: June 16, 2014, 04:32:55 AM »
suggestion, Gunther....

boot from a floppy to test your driver   :t
if it hangs, you can still boot the hard drive

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Re: DOS driver tutorial
« Reply #14 on: June 16, 2014, 06:04:26 AM »
Dave,

boot from a floppy to test your driver   :t
if it hangs, you can still boot the hard drive

that's my plan.

Gunther
You have to know the facts before you can distort them.