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

Re: Writing printer port based driver...

On Wed, 22 Dec 2004 17:55:28 +0300
Alexander Yurchenko <grange_(_at_)_rt_(_dot_)_mipt_(_dot_)_ru> wrote:

> device lcd
> file dev/ic/lcd.c lcd & lcd_isa needs-flag
> attach lcd at isa with lcd_isa
> file dev/isa/lcd_isa.c lcd_isa needs-flag
> Clone lpt_isa.c into the lcd_isa.c like you did with lpt.c.

Thanks for the reply.

I ended up simply changing lpt.c and lptvar.h, as it seemed that two drivers (lpt and lcd) could not share the same bus space. 

So now I only need to replace two files and then kernel rebuild if I want to use the lcd on other obsd boxes.. instead of mincing around with all the other files.i386 and conf.c and all the rest of it if i were to write a new driver. Weee :) 

So now it is functioning... and I have another question.

The lcd display needs a quite few DELAY calls while talking to it.

I have a simple perl script; for each line on the lcd display (4 lines) I opened /dev/lpt0 and printed an incimented number. This happened every second.

This machine is a p166, and while running this perl script, top had the load at around 1.2, 90% idle, and the other 10% was system. I am wondering if the time spent with DELAY is counted as 'system' ?

Does DELAY block the entire kernel, or does it kinda work like userland usleep type functions? 

If DELAY blocks the entire kernel, would it be worth trying to use some other function that lets the kernel do other stuff? Or is that wasting time?


Visit your host, monkey.org