linux uart driver

Prashanth Mundkur pmundkur.l4 at ...9...
Thu Feb 16 20:12:07 CET 2017


Hi Norman,

> > I'm exploring writing a simple uart driver for linux in order
> > to get terminal_mux working on linux.  When I disable the linux spec
> > check in terminal_mux.run, the build always picks up:
> > 
> >   Program drivers/uart/spec/x86/uart_drv
> > 
> > even though I created a drivers/uart/spec/linux/
> > 
> > and changed drivers/uart/spec/linux/target.mk to read
> > 
> >  REQUIRES = linux
> > 
> > and the etc/specs.conf in the build directory to read:
> > 
> >  SPECS += linux x86_64
> > 
> > I'd like to know how I can get the build to say
> > 
> >   Program drivers/uart/spec/linux/uart_drv
> 
> I suspect that the build system actually picks up and builds both
> targets because each of them meets the SPECS as defined for the build
> directory. The problem is that the targets are named the same. So the
> symlink in '<build-dir>/bin' is overwriten by the target last visited.
> To check this assumption, you may have a look at the content of the
> build locations for the two drivers in question:
> 
>   <build-dir>/drivers/uart/spec/linux
>   <build-dir>/drivers/uart/spec/x86
> 
> I presume that each of those locations contains the respective
> executable.

In my case, I only had <build-dir>/drivers/uart/spec/x86 built, and no
sign of spec/linux.

> 
> The best way to solve the ambiguity would be to give your driver a
> distinct name, e.g., by adding the following line in your
> 'spec/linux/target.mk' file:
> 
>   TARGET = linux_uart_drv
> 
> Now, both drivers should appear in the bin/ directory side by side.

I did try this, but it didn't quite work because of the

 include $(REP_DIR)/src/drivers/uart/target.inc

line at the bottom of spec/linux/target.mk which was copied over from
the spec/x86/target.mk.  The target.inc itself defines TARGET to
uart_dev.  Perhaps this might have something to do with the
spec/linux/ driver not getting built.

When I removed that include line and copied over the target.inc
contents minus the TARGET line, it indeed functioned like you said,
with both drivers being built.

Thanks for the suggestions!

--prashanth




More information about the users mailing list