ts-7000
[Top] [All Lists]

[ts-7000] Re: TS7250 2.6 Kernel No such device or address (6)

To:
Subject: [ts-7000] Re: TS7250 2.6 Kernel No such device or address (6)
From: "gbwtfo" <>
Date: Fri, 04 Jul 2008 21:08:36 -0000
--- In  "Vijay" <> wrote:
>
> Greg,
> 
> I compiled and insmod-ed the hello module and tried to run the test
> application from my native linux pc and I am getting the same No
> device or address (6) error. I think I am doing something
> fundamentally wrong here.


Vijay, in glcd.c are you aware that if you replace your calls to
alloc_chrdev_region(), cdev_init(), and cdev_add() with a simple
call to register_chrdev() (and cdev_dev(), unregister_chrdev_region()
with unregister_chrdev()) that your driver will get into glcd_open()?

I've not had any need to muck with the cdev_* calls, so I can't
even guess as to what might the problem might be...  In fact,
it's not clear to me why a driver would want to register only
a partial range of minor numbers, unless perhaps it its able
to specify a different operations structure for different
ranges within the same major.  Perhaps someone will clue me in :-)

If you really need to take this approach, I would suggest
taking a good luck at the implementation of register_chrdev()
which probably does what you want, albeit over the entire
minor device space.

Not sure about the hello module, where's the source?  Does it
have an open() routine?

Greg




> 
> --- In  "Vijay" <osembedded@> wrote:
> >
> > Greg,
> >  I have added the (2.6) modified code to the following location.
> > 
> >
>
http://code.google.com/p/toobo/source/browse/trunk/drivers/modules/glcd-2.6
> > 
> >  The test application I am using is the same that I wrote for the 2.4
> > version. 
> > 
> >
>
http://code.google.com/p/toobo/source/browse/trunk/drivers/modules/glcd/test
> > 
> >  Currently, I do not have a script to automatically invoke insmod and
> > grab the major number and mknod. I do this step by hand.
> > 
> >  For example, when I insmod, I print out what major number was
> > allocated and then manually type in 
> >  mknod /dev/glcd0 c 252 0
> > [The above example assumes that I got a major number of 252 back when
> > I insmod. I also make sure the major number is correct by cat-ing the
> > /proc/devices file.]
> > 
> >  I have added a helloworld module and a test application and I see the
> > same results with it. i.e. NO such device or address (6)
> > 
> >  I have uploaded it at, 
> >  
> >
>
http://code.google.com/p/toobo/source/browse/trunk/drivers/modules/hello-2.6
> > 
> >  I still haven't tried running it on my native linux box (x86) for
> > comparison. But, I will keep you posted.
> > 
> > Thanks for your help!
> > -Vijay
> > 
> > --- In  "gbwtfo" <greg@> wrote:
> > >
> > > Vijay, please make available the 2.6 code.  Additionally, please
> > > double check the major number you gave to mknod as bungling it would
> > > quite likely yield the same problem you are seeing.
> > > 
> > > Greg
> > > 
> > > 
> > > --- In  "Vijay" <osembedded@> wrote:
> > > >
> > > > Guys,
> > > >  Could any of you help me with the following? I am creating a very
> > > > basic 'hello world' driver module and a test app to make sure I
> am not
> > > > doing anything fundamentally wrong. But, if you guys have
> experienced
> > > > this issue before, please shed some light on it.
> > > > 
> > > > Thanks,
> > > > -Vijay
> > > > 
> > > > --- In  "Vijay" <osembedded@> wrote:
> > > > >
> > > > > Hi,
> > > > >  I had previously created a graphic lcd driver module and a test
> > > > > application to run on the TS7250 on the 2.4 Kernel. Now, I have
> > > > > installed 2.6 Kernel after compiling it. I am using nfsroot to
> point
> > > > > my root file system to my laptop.
> > > > > 
> > > > >  The board boots fine. I am able to insmod my 'ported' device
> driver
> > > > > using insmod and I see a major number being allocated
> dynamically. I
> > > > > then try to do lsmod and I am able to see the module in there. I
> > used
> > > > > mknod /dev/glcd0 c [MAJOR_NUM] 0 to create my device node. I
> am able
> > > > > to see it in the /proc/devices as well.
> > > > > 
> > > > >  But when I run the test app that I had written for the 2.4
kernel
> > > > > version, I was expecting the same system calls like
> open,close,ioctl
> > > > > to work. But, for some reason, I cannot seem to open the device
> > > > > located at /dev/glcd0. I get the following error message. 
> > > > > 
> > > > > Could not open /dev/glcd0: No such device or address (6)!
> > > > > 
> > > > >  See the following debug from "./strace display-test" [where
> > > > > display-test is my test application which opens the device and
> tries
> > > > > to perform some ioctl commands]
> > > > > 
> > > > >  Any help is appreciated! I have been trying to solve this for a
> > week
> > > > > now in vain... I know tmpfs is a virtual file system in RAM.
But,
> > > > > could this issue be related to me mouting my rootfs via nfs?
> > > > > 
> > > > > Thanks in Advance!
> > > > > -Vijay
> > > > > 
> > > > > ----- strace output [./strace display-test] -----
> > > > > 
> > > > > execve("/home/proj/base/app/display-test/display-test",
> > > > > ["/home/proj/base/app/display-test"...], [/* 14 vars */]) = 0
> > > > > uname({sys="Linux", node="ts7800", ...}) = 0
> > > > > brk(0)                                  = 0x14000
> > > > > access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such
> file or
> > > > > directory)
> > > > > mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
> > MAP_PRIVATE|MAP_ANONYMOUS, -1,
> > > > > 0) = 0x2aac0000
> > > > > access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such
> file or
> > > > > directory)
> > > > > open("/etc/ld.so.cache", O_RDONLY)      = 3
> > > > > fstat64(3, {st_mode=S_IFREG|0644, st_size=11247, ...}) = 0
> > > > > mmap2(NULL, 11247, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2aac1000
> > > > > close(3)                                = 0
> > > > > access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such
> file or
> > > > > directory)
> > > > > open("/lib/libc.so.6", O_RDONLY)        = 3
> > > > > read(3,
> "\177ELF\1\1\1a\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0HO\1\0004"...,
> > > > > 512) = 512
> > > > > fstat64(3, {st_mode=S_IFREG|0755, st_size=1091040, ...}) = 0
> > > > > mmap2(NULL, 1128068, PROT_READ|PROT_EXEC,
> MAP_PRIVATE|MAP_DENYWRITE,
> > > > > 3, 0) = 0x2aac9000
> > > > > mprotect(0x2abd0000, 50820, PROT_NONE)  = 0
> > > > > mmap2(0x2abd7000, 12288, PROT_READ|PROT_WRITE,
> > > > > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x106) = 0x2abd7000
> > > > > mmap2(0x2abda000, 9860, PROT_READ|PROT_WRITE,
> > > > > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2abda000
> > > > > close(3)                                = 0
> > > > > mprotect(0x2abd7000, 8192, PROT_READ)   = 0
> > > > > mprotect(0x2aac7000, 4096, PROT_READ)   = 0
> > > > > munmap(0x2aac1000, 11247)               = 0
> > > > > fstat64(1, {st_mode=S_IFREG|0644, st_size=1463, ...}) = 0
> > > > > mmap2(NULL, 32768, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_ANONYMOUS,
> > > > > -1, 0) = 0x2abdd000
> > > > > open("/dev/glcd0", O_RDWR)              = -1 ENXIO (No such
> > device or
> > > > > address)
> > > > > write(1, "\nmain(+):\nopen_display(+):\nCould"..., 116
> > > > > main(+):
> > > > > open_display(+):
> > > > > Could not open /dev/glcd0: No such device or address (6)!
> > > > > main(): Could not Open display!) = 116
> > > > > munmap(0x2abdd000, 32768)               = 0
> > > > > exit_group(-1)                          = ?
> > > > > Process 803 detached
> > > > >
> > > >
> > >
> >
>



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

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU