Xenix Device Drivers

Alan Fargusson alan at drivax.UUCP
Sun Jun 16 14:37:19 AEST 1985


> 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



More information about the Comp.unix.wizards mailing list