Subject: console, XFree and such
To: None <port-sparc64@netbsd.org>
From: Michael <macallan18@earthlink.net>
List: port-sparc64
Date: 01/01/2005 03:08:50
Hello,

I just started with NetBSD 2.0 on an Ultra 10 ( Thanks Michael! ) - 
works fine so far - and had a look at XFree86, mainly to get the 
onboard ATI Rage to work. After some fiddling I got it compiled just to 
find out that it expects wscons and sparc64 apparently doesn't have 
that.
To overcome this I did a quick but hopefully not too dirty port of 
macppc's ofb driver - basically a dumb framebuffer driver which gets 
its information from OpenFirmware - surprisingly I got it to work 
without too much hassle. It should work with any PCI framebuffer 
supported by OBP, with some (probably minor) additional hacking it 
should also work with SBus devices.

Here's the kernel output with some debugging info...

NetBSD 2.99.11 (INISHOWEN) #10: Fri Dec 31 17:02:24 EST 2004
         root@Inishowen:/data/src/sys/arch/sparc64/compile/INISHOWEN
total memory = 256 MB
avail memory = 242 MB
bootpath: /pci@1f,0/pci@1,0/scsi@3,0/disk@1,0
mainbus0 (root): SUNW,Ultra-5_10: hostid 80b32d5d
cpu0 at mainbus0: SUNW,UltraSPARC-IIi @ 333 MHz, version 0 FPU
cpu0: 32K instruction (32 b/l), 16K data (32 b/l), 2048K external (64 
b/l)
psycho0 at mainbus0 addr 0xfffc4000
SUNW,sabre: impl 0, version 0: ign 7c0 bus range 0 to 2; PCI bus 0
DVMA map: c0000000 to e0000000
IOTSB: 10438000 to 104b8000
pci0 at psycho0
pci0: i/o space, memory space enabled
ppb0 at pci0 dev 1 function 1: Sun Microsystems Simba PCI bridge (rev. 
0x13)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
ebus0 at pci1 dev 1 function 0
ebus0: Sun Microsystems PCIO Ebus2, revision 0x01
auxio0 at ebus0 addr 726000-726003, 728000-728003, 72a000-72a003, 
72c000-72c003, 72f000-72f003
power at ebus0 addr 724000-724003 ipl 37 not configured
SUNW,pll at ebus0 addr 504000-504002 not configured
sab0 at ebus0 addr 400000-40007f ipl 43: rev 3.2
sabtty0 at sab0 port 0
sabtty1 at sab0 port 1
com0 at ebus0 addr 3083f8-3083ff ipl 41: ns16550a, working fifo
com0: console
kbd0 at com0 (console input)
wskbd0 at kbd0: console keyboard
com1 at ebus0 addr 3062f8-3062ff ipl 42: ns16550a, working fifo
ms0 at com1
wsmouse0 at ms0 mux 0
lpt0 at ebus0 addr 3043bc-3043cb, 30015c-30015d, 700000-70000f ipl 34
fdthree at ebus0 addr 3023f0-3023f7, 706000-70600f, 720000-720003 ipl 
39 not configured
clock0 at ebus0 addr 0-1fff: mk48t59
flashprom at ebus0 addr 0-fffff not configured
audiocs0 at ebus0 addr 200000-2000ff, 702000-70200f, 704000-70400f, 
722000-722003 ipl 35 ipl 36: CS4231A
audio0 at audiocs0: full duplex
hme0 at pci1 dev 1 function 1: Sun Happy Meal Ethernet, rev. 1
hme0: interrupting at ivec 3021
hme0: Ethernet address 08:00:20:b3:2d:5d
nsphy0 at hme0 phy 1: DP83840 10/100 media interface, rev. 1
nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ofb0 at pci1 dev 2 function 0attaching
wsfont_init
are we the console? ...no
node: f0076018
name: /pci@1f,0/pci@1,1/SUNW,m64B@2
1152 x 900, 8 @ fe000000
: ATI Technologies 3D Rage Pro
ofb0: 1152 x 900, 8bpp
wsdisplay0 at ofb0 kbdmux 1
wsmux1: connecting to wsdisplay0
cmdide0 at pci1 dev 3 function 0
cmdide0: CMD Technology PCI0646 (rev. 0x03)
cmdide0: bus-master DMA support present
cmdide0: primary channel configured to native-PCI mode
cmdide0: using ivec 1820 for native-PCI interrupt
atabus0 at cmdide0 channel 0
cmdide0: secondary channel configured to native-PCI mode
atabus1 at cmdide0 channel 1
ppb1 at pci0 dev 1 function 0: Sun Microsystems Simba PCI bridge (rev. 
0x13)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled
esiop0 at pci2 dev 3 function 0: Symbios Logic 53c875 (ultra-wide scsi)
esiop0: using on-board RAM
esiop0: interrupting at ivec 18
scsibus0 at esiop0: 16 targets, 8 luns per target
ohci0 at pci2 dev 4 function 0: CMD Technology USB0673 (rev. 0x05)
ohci0: interrupting at ivec 1c
ohci0: OHCI version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: CMD Technology OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
pcons at mainbus0 not configured
No counter-timer -- using %tick at 333MHz as system clock.
scsibus0: waiting 2 seconds for devices to settle...
uhub1 at uhub0 port 2
uhub1: vendor 0x03eb Standard USB Hub, class 9/0, rev 1.10/3.00, addr 2
uhub1: 4 ports with 4 removable, self powered
sd0 at scsibus0 target 1 lun 0: <SEAGATE, ST34520N, 1281> disk fixed
sd0: 4340 MB, 9006 cyl, 4 head, 246 sec, 512 bytes/sect x 8888924 
sectors
sd0: sync (50.00ns offset 15), 8-bit (20.000MB/s) transfers, tagged 
queueing
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: <CRD-8322B, 1998/09/24, 1.05> cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2
cd0(cmdide0:1:0): using PIO mode 4, DMA mode 2 (using DMA)
root on sd0a dumps on sd0b
root file system type: ffs

this gives:
- faster output
- different fonts ( well, at least we can compile in different fonts, 
loading them at runtime doesn't work, but it's unsupported on macppc 
too )
- colour if we want that
- proper terminal emulation.
Now my question - how much work from others did I duplicate? ( well, 
this hack took 2h or so, most of the time spent getting used to 64bit ) 
How much work would it be to make keyboard and mouse wscons-friendly?

After that XFree86 should be fairly easy.

have fun
Michael