ts-7000
[Top] [All Lists]

[ts-7000] Re: Cannot read PC104 from kernel space

To:
Subject: [ts-7000] Re: Cannot read PC104 from kernel space
From: "elliotbuller" <>
Date: Sun, 02 Dec 2007 18:39:27 -0000
Thanks for the reply Dave. I am doing the read inside the interrupt
service routine:
> > > // interrupt handler
> > > static int interrupt_handler(void)
> > > {
> > >
> > > interruptcount++;
> > > printk(">>> PC104 BUS INT: interruptcount=%d\n",
interruptcount);
> > >
> > > printk("PC104 Samples: 0x%04X\n", PEEK16(base)); <--
> > >
> > > /* Data ready. Wake up userspace process */
> > > data_not_ready = 0;
> > > wake_up_interruptible(&pc104_wait);
> > >
> > > return IRQ_HANDLED;
> > > }

I agree it must be a software problem but I'm not sure where? Should I
be using the inline macros or is there a different way to access in
kernel space? 

Thanks,
Elliot
--- In  David Hawkins <> wrote:
>
> Hi Elliot,
> 
> > Thanks for the info Frank. My PC104 daughterboard is actually a home  
> > brew FPGA board. If you wouldn't mind sharing the source to your hack 
> > that would give me something to try as I'm running out of ideas...
> 
> The fact that mmap works and kernel code doesn't would lead
> me to believe its a software issue, not the hardware.
> 
> >>>> Here is my kernel module:
> 
> >>>> static ssize_t pc104_read (struct file *file, char *buf,
> >>>>                     size_t count, loff_t *ppos) {
> >>>>   int len, err;
> >>>>   
> >>>>   // check if we have data - if not, sleep
> >>>>   // wake up in interrupt_handler
> >>>>   while (data_not_ready) {
> >>>>     interruptible_sleep_on(&pc104_wait);
> >>>>   }
> >>>>   data_not_ready = 1;
> >>>>
> >>>>   /* Add read code here */
> >>>>   return len;
> >>>> }
> 
> Where are you 'reading'. There's no code here to access
> the PC104 base address?
> 
> >>>> // write function called when to /dev/skeleton is written
> >>>> static ssize_t pc104_write (struct file *file, const char *buf,
> >>>>                      size_t count, loff_t *ppos) {
> >>>>   int err;
> >>>>   err = copy_from_user(string,buf,count);
> >>>>   if (err != 0)
> >>>>     return -EFAULT;
> >>>>   counter += count;
> >>>>   return count;
> >>>> }
> 
> You wrote to a buffer, not to PC104.
> 
> Perhaps this is not the correct code. Send the code that
> actually accesses the PC104 bus :)
> 
> Cheers,
> Dave
>




 
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