Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site drivax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!amdahl!drivax!alan From: alan@drivax.UUCP (Alan Fargusson) Newsgroups: net.micro.pc,net.unix-wizards Subject: Re: Xenix Device Drivers Message-ID: <155@drivax.UUCP> Date: Sun, 16-Jun-85 00:37:19 EDT Article-I.D.: drivax.155 Posted: Sun Jun 16 00:37:19 1985 Date-Received: Wed, 19-Jun-85 04:28:46 EDT References: <267@tellab3.UUCP> Organization: Digital Research, Monterey, CA Lines: 25 Xref: watmath net.micro.pc:4291 net.unix-wizards:13569 > Next step was to write a driver where the xxwrite() routine just used > cpass() to get a character from the user and stuff it into memory > starting at 0xb8000. > > Sounds simple, right? When trying to write though, the kernel panics > with a "General Protection Fault". What does this REALLY mean? I > thought that once inside xxwrite(), I would be in kernel mode. Am I > still in user mode? Do I have to write a "bottom half" to get to > kernel mode (yeechy way because there are no interrupts, per se)? > Or is there something else going on that I haven't thought of? > Do I really want to use /dev/color instead? Boy is there something you haven't thought of. The problem is that kernel address are relocated by the on chip memory management of the 286. XENIX runs in protected mode. The protection violation is because there is no valid address on a 286 of 0xb8000. You will have to make a GDT, or LDT entry (see the iNTEL manual) that has a base of 0xb8000 and construct a pointer that uses that GDT entry. This is not very easy and you will probably need the source to do it. Don't you just love segmentation. -- Alan Fargusson. { ihnp4, amdahl, mot }!drivax!alan