TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Johannes Stratmann
date: 1995-03-29 03:01:32
subject: Device Driver Programming

Hallo all,

und ausserdem wollte ich noch einen Device Driver basteln,
nur ein paar A/D Werte lesen und irgendwohin packen. Mit dem
Buch von Mastrianni hab ich mich schon auseinandergesetzt und
das mit dem serial-Treiber ausprobiert. Mutig mit Watcom bersetzt
und jede Menge Fehler erhalten, zb.:

'SERIAL.C(16): Error! E1054: Expression must be constant'

fr:
//----------------------------------------------
/* file sample.c
   sample OS/2 serial device driver
*/

#include "drvlib.h"
#include "uart.h"
#include "serial.h"

extern void near STRAT(); /* name of strat rout.*/
extern void near TIM_HNDLR(); /* timer handler  */
extern int  near INT_HNDLR(); /* interrupt hand */

DEVICEHDR devhdr = {
 (void far *) 0xFFFFFFFF,  /* link              */
 (DAW_CHR | DAW_OPN | DAW_LEVEL1),/* attribute  */
 (OFF) STRAT,              /* &strategy         */ < Zeile 16
 (OFF) 0,                  /* &IDCroutine       */
 "DEVICE1 "
  };
//----------------------------------------------

also, der Compiler will ne Constante fr STRAT ((OFF) ist USHORT).
Was muss beim WC anders sein ?

Tja, und zum Linken braucht man dann noch ne Mastrianni-Lib. Oder
gibt es alternativen ?
Die Devcon (jetzt mit DD-Support) ist schon bestellt, aber ob das
damit einfacher wird ?

Gibt es jemanden im Raum GE/E der sich auch mit solchen Probs
rumschl„gt ?

 
--- Blue Wave/Max v2.12 OS/2 [NR]
* Origin: Apolonia, was sonst! V32Terbo 0201-285015, 8984155 X.75 (2:2448/10)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 2448/10 69 2426/2011 2001 2449/600 2440/200 242/42 2452/110 105/42
@PATH: 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.