Xref: utzoo comp.lang.pascal:6954 comp.os.msdos.programmer:5368 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!maytag!watstat.waterloo.edu!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Newsgroups: comp.lang.pascal,comp.os.msdos.programmer Subject: Writing a device driver in TP Message-ID: <1991May29.140429.11384@maytag.waterloo.edu> Date: 29 May 91 14:04:29 GMT Sender: news@maytag.waterloo.edu (News Owner) Organization: University of Waterloo Lines: 25 I've heard (and said!) repeatedly that it's impossible to write a DOS device driver in Turbo Pascal. Not true - I've written a simple one entirely in TP 6, and uploaded it to garbo.uwasa.fi (TPDEV.ZIP). It would be harder, but probably possible, to do the same thing in earlier versions of TP. I imagine it would require careful byte counting, external assembler code, patching, or some other trick I can't think of. TP 6 has the inline assembler, assembler procedures, and allows constants to be initialized with the address of code, so it was relatively easy there. Take a look at it. It makes prototyping a device driver much easier than writing it from scratch in assembler. One limitation: it produces .EXE format drivers. I asked the other day about limitations on these, and got two responses: - They work in MSDOS, but not PCDOS, because the .EXE loader is part of COMMAND.COM in PCDOS. - They only work in version 3 or higher. Thanks to those who responded! I can confirm that the .EXE format is fine in MSDOS 3.2, but haven't tested it anywhere else. Duncan Murdoch dmurdoch@watstat.waterloo.edu