Subject: /dev/MAKEDEV* - bwtwo0, cgthree0 & cgsix0 same device?
To: None <port-sparc@sun-lamp.cs.berkeley.edu>
From: - Greg Earle <earle@isolar.Tujunga.CA.US>
List: port-sparc
Date: 04/08/1994 20:42:05
I'm using the March 27th pre-"off_t" sources, and all the MAKEDEV* files in my
/dev say that /dev/bwtwo0, /dev/cgthree0 and /dev/cgsix0 are to be made with
major #27.  Is that right?  Doesn't seem like it should be ...

I thought that re-mknod'ing /dev/cgthree0 as "55, 0" would cure my "Xsun will
run, but it doesn't display anything on the screen" problem, but it gets an
EINVAL trying to mmap() the frame buffer memory.

Even though Theo warned me that this isn't trustworthy, this is the best/only
info I have to go by:

...
   125 Xsun     CALL  access(0xf7fff99e,0x6)
   125 Xsun     NAMI  "/dev/cgthree0"
   125 Xsun     RET   access 0
   125 Xsun     CALL  open(0xf7fff99e,0x2,0)
   125 Xsun     NAMI  "/dev/cgthree0"
   125 Xsun     RET   open 5
   125 Xsun     CALL  ioctl(0x5,0x40584606 ,0x17af58)
   125 Xsun     RET   ioctl 0
   125 Xsun     CALL  getpagesize
   125 Xsun     RET   getpagesize 4096/0x1000
   125 Xsun     CALL  mmap(0,0xfe000,0x3,0x80000002,0x5,0x4000000)
   125 Xsun     RET   mmap -1 errno 22 Invalid argument
   125 Xsun     CALL  mmap(0,0xfe000,0x3,0x80000001,0x5,0x4000000)
   125 Xsun     RET   mmap -1 errno 22 Invalid argument
...

If I create a /dev/bwtwo0 device it also gets an mmap() failure exactly like
the above.

Again, if I leave /dev/cgthree0 masquerading as /dev/bwtwo0 (i.e., leave it
27, 0), the server comes up (!) but it doesn't scribble on the frame buffer.
In this case the mmap() is

   230 Xsun     CALL  mmap(0,0x20000,0x3,0x80000002,0x5,0)
   230 Xsun     RET   mmap 69033984/0x41d6000

The driver probe routines certainly find it:

netbsd4me:74 # dmesg | egrep cg
cgthree0 at sbus0 slot 2 offset 0x0: SUNW,501-1718, 1152 x 900 (console)

Curiouser and curiouser,

	- Greg


------------------------------------------------------------------------------