tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Questions around adding a monochrome graphics/ascii display driver over gpio framework

Hello, I am new to NetBSD and have a couple general NetBSD/autoconf related 

1) I wrote my first NetBSD device driver and would like to verify that my code 
has been poperly organized among the rest of the kernel sources and that it 
follows the traditional "NetBSD" driver development way of doing things.  
Please review my high-level driver details and comment/advise as you see 

To begin, a high-level description of the device function and physical 
configuration/layout on the computer is as follows:

- The device for which my newly developed driver supports is a monochrome 
CrystalFontz graphical and character display
- The CrystalFontz display uses an internal EPSON s1d13700 chip to drive the 
- I currently have the EPSON s1d13700 end of the CrystalFontz display plugged 
into some GPIO on my motherboard
- The GPIO on my hardware happens to be found at "gpio0 at nsclpcsio0"

To implement my driver, I broke develpment down into two sections and therefore 
added code to the two following sections of my NetBSD kernel:

- The /usr/src/sys/dev/ic section
- The /usr/src/sys/dev/gpio section

My goal was to abstract the bus specifics away from the EPSON display driver to 
keep it portable.  Specifically, I added the following EPSON display driver 

- /usr/src/sys/dev/ic/s1d13700_subr.c
- /usr/src/sys/dev/ic/s1d13700reg.h
- /usr/src/sys/dev/ic/s1d13700var.h

...and the following gpio source file:

- /usr/src/sys/dev/gpio/gpiocfag.c

I added the following content to /usr/src/sys/dev/gpio/files.gpio:

device  gpiocfag: s1d13700, wsemuldisplaydev
attach  gpiocfag at gpio
file    dev/gpio/gpiocfag.c                     gpiocfag

and I added the following content to /usr/src/sys/dev/DEVNAMES:

s1d13700                MI              Attribute

Finally, I added the following configuration information to my kernel config:

nsclpcsio0      at isa0
gpio0           at nsclpcsio0
gpiocfag0       at gpio0 offset 0 mask 0xffffff

The system boots up and the device gets recognized/initialized properly.  Did I 
leave out any obvious/important steps?

2) I do not intend to operate the display as a terminal.  I intend to operate 
the display as a status display which will contain a mix of ascii and bitmap 
images.  Ideally, I'd like to see a usermode appliation/service drive the 
display, but I am unsure how the usermode code will interfae with the driver.  

- Should I implement a character or block device or both (one for ascii and one 
for graphics)?
- Should the open/read/write ioctl's be handled in the /usr/src/sys/dev/ic/ or 
the /usr/src/sys/gpio code?  

Thank you for your patience and support.  I am very new but so far love the 
NetBSD project. :-)



Home | Main Index | Thread Index | Old Index