Re: [rtl] Unix & Linux

2000-02-29 Thread Santhosh Kumar M [CEC-S]


Hi Yiwei,

There is an entry "struct fs_struct *fs" in the task_struct
structure. fs_struct contains "struct dentry * root, * pwd;". For more
info look in /usr/inlcude/linux/sched.h file

Regards
Santhosh

> there are the following attributes in usr structure of UNIX:
> 
> struct user{
> ..
> 
> struct inode*u_cdir;/*  inode pointer to current dir */
> struct inode*u_rdir;/*   inode pointer to root dir */
> ...
> };
> 
> but where are they in Linux ?

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[rtl] uClinux-coldfire Interrupt Processing

2000-02-29 Thread Yiwei Zhao

In uClinux-coldfire, does ISR begin with SAVE_ALL (entry.s) ?

if so, i have a question : How does it restore its interrupt level while ISR
is running?

Because in SAVE_ALL, the first instruction,

move #0x2700,%sr;  /* disable intrs */

has changed the current SR, that is , current interrupt level has been
losted.



BR

Yiwei Zhao



-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[rtl] Unix & Linux

2000-02-29 Thread Yiwei Zhao




there are the following attributes in usr structure 
of UNIX:
 
struct user{
..
 
struct 
inode    *u_cdir;    
/*  inode pointer to current dir */
struct 
inode    *u_rdir;    
/*   inode pointer to root dir */
...
};
 
but where are they in Linux ?
 
Thanks !
 
 


[rtl] rt_com questions

2000-02-29 Thread Willem Atsma

(I may be sending this twice, but my first posting doesn't show.)


Hi,

Two questions:

1 - How can I use rt_com to generate a line break?
2 - From the code it seems like no handshaking is used for communication, is
that correct? Will this give trouble with ports that do or don't expect
hardware handshaking?

note -> 1
I tried the following, which didn't seem to work:
-
void send_line_break(void)
{
char zeros[20] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ;

rt_com_setup(0, -1, 0, 0, 0);   /* decrease module count */
rt_com_setup(0, 75, 0, 0, 8);   /* a "raw" setting */
rt_com_write(0, zeros,20);
rt_com_setup(0, -1, 0, 0, 0);   /* decrease module count */
rt_com_setup(0, RT_CF_DEFAULT_BAUD, RT_CF_PARITY, RT_CF_STOPBITS, RT_CF_WORDLENGTH);
}
- 


many thanks,
Willem

-- 

__
Willem J Atsma
[EMAIL PROTECTED]
http://www.mech.ubc.ca/~watsma
__

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[rtl] rt_com questions

2000-02-29 Thread Willem Atsma

Hi,
Two questions:

1 - How can I use rt_com to generate a line break?


2 - From the code it seems like no handshaking is used for communication, is
that correct? Will this give trouble with ports that do or don't expect
hardware handshaking?

note -> 1
I tried the following, which didn't seem to work:
-
void send_line_break(void)
{
 char zeros[20] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ;
 
 rt_com_setup(0, -1, 0, 0, 0);   /* decrease module count */
 rt_com_setup(0, 75, 0, 0, 8);   /* a "raw" setting */
 rt_com_write(0, zeros,20);
 rt_com_setup(0, -1, 0, 0, 0);   /* decrease module count */
 rt_com_setup(0, RT_CF_DEFAULT_BAUD, RT_CF_PARITY, RT_CF_STOPBITS, RT_CF_WORDLENGTH);
}
- 


many thanks,
Willem

-- 

__
Willem J Atsma
[EMAIL PROTECTED]
http://www.mech.ubc.ca/~watsma
__

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



Re: [rtl] timers

2000-02-29 Thread David Schleef

On Tue, Feb 29, 2000 at 06:34:50PM +0100, Jens Lauer wrote:
> Hi folks,
> 
[...]
> What could be the reason for the misbehaviour of sleep, usleep and
> select in a function?
> 

This is slightly off your topic, but the following source code shows
some of the issues involved in using usleep() and select() functions
in Linux.  Run the program and graph the results.  Oviously, since
the Linux timer granularity is (typ) 10 ms, you see this effect show
up in the graph.


dave...



#include 
#include 
#include 

void test1(void);
void test2(void);

int main(int argc,char *argv[])
{
test1();

return 0;
}

void test1(void)
{
struct timeval tv1;
struct timeval tv2;
int usec;
int actual;

for(usec=0;usec<1;usec+=100){
gettimeofday(&tv1,NULL);
usleep(usec);
gettimeofday(&tv2,NULL);

actual=(tv2.tv_sec-tv1.tv_sec)*100+
(tv2.tv_usec-tv1.tv_usec);
//actual=tv2.tv_sec*100+tv2.tv_usec;
printf("%d %d\n",usec,actual);
}
}

void test2(void)
{
struct timeval now;
struct timeval targ,t;
int usec,sec;
int actual;
int i;

usec=(1.0e6/230.0);
sec=0;
gettimeofday(&targ,NULL);
for(i=0;i<1000;i++){
targ.tv_usec+=usec;
if(targ.tv_usec>=100){
targ.tv_usec-=100;
targ.tv_sec++;
}
t=targ;
gettimeofday(&now,NULL);
t.tv_sec-=now.tv_sec;
if(t.tv_usec" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[rtl] rt_com questions

2000-02-29 Thread Willem Atsma

Hi,

Two questions:

1 - How can I use rt_com to generate a line break?


2 - From the code it seems like no handshaking is used for communication, is
that correct? Will this give trouble with ports that do or don't expect
hardware handshaking?

note -> 1
I tried the following, which didn't seem to work:
-
void send_line_break(void)
{
char zeros[20] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ;

rt_com_setup(0, -1, 0, 0, 0);   /* decrease module count */
rt_com_setup(0, 75, 0, 0, 8);   /* a "raw" setting */
rt_com_write(0, zeros,20);
rt_com_setup(0, -1, 0, 0, 0);   /* decrease module count */
rt_com_setup(0, RT_CF_DEFAULT_BAUD, RT_CF_PARITY, RT_CF_STOPBITS, 
RT_CF_WORDLENGTH);
}
- 


many thanks,
Willem
__
Willem J Atsma
[EMAIL PROTECTED]
http://www.mech.ubc.ca/~watsma
__

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[rtl] timers

2000-02-29 Thread Jens Lauer

Hi folks,

some questions about waiting in RTLinux.

I have an application using the old evoC library for evolutionary
computation combined with communication with a external machine via
RS232 and realtime sampling of  an incremental rotary encoder.
Sometimes the machine needs to handled with care and I have to wait for
its answer. So I tried to use simple sleep and usleep calls and found
they not working in the fuction called by evo(), the main part of
evolutionary computing. In ´main´ all sleep and usleep calls work - in
´quality´, the mentioned function called by evo again and again, it
doesnt.
Select works neither.
Some stuff leads sleep to an immediate return without have sleeped.
printf("return_value:  %d", sleep(2));
-> "0" in the terminal when called in main
-> "20" in the terminal when called in quality
I have no handler, exepted for SIGIO and CTRL-C, which could catch an
timer Signal at all and this handlers do not.

So I tried to do an quick hack and used my RT Module as an timer. I
added an case TIMER_SET to the handler and this code calls:

case TIMER_SET:
  timer_intervall = msg.value;
  printk("(IGR-Timer Set) Timer soll in so vielen nsec feuern (ueberg)
%d %ld\n", timer_intervall, (gethrtime() + NSECS_PER_SEC *
timer_intervall));
  //pthread_make_periodic_np(timertask, rt_get_time() + NSECS_PER_SEC *
timer_intervall, 10);
  //pthread_make_periodic_np(timertask, gethrtime() + NSECS_PER_SEC *
timer_intervall, 10);
  pthread_make_periodic_np(timertask, clock_gethrtime() +
timer_intervall, 10);
  break;

The init_module got an new task to initialize:

 //Timer Task
  pthread_attr_init(&attr_timer);
  sched_param_timer.sched_priority = 3;
  pthread_attr_setschedparam(&attr_timer, &sched_param_timer);
  pthread_create(&timertask,  &attr, eieruhr, (void *)1);
  //pthread_setfp_np(timertask,1);

And the new task was made public with:

void *eieruhr(void *t)
{
int   timer_dummy_data, timer_hilfe;
pthread_wait_np();

timer_hilfe = 0x00ff;
timer_dummy_data = 0x30;
if (rtf_put(10, (char *) &timer_dummy_data, 2) < 0)
   {
   printk("konnte Dummy Data des Timers nicht loswerden");
   rtf_put(9, (char *) &timer_hilfe, sizeof(timer_hilfe));
   }
printk("(Eieruhr) es ist jetzt: %ld\n", clock_gethrtime() );
pthread_exit(0);
//pthread_wait_np();
} //void eieruhr

The intention is to create an task after request in the handler which
lives only one period - killed after its work is done.
The Task should start some useconds after now - the wished delay - write
some sensless stuff to a rtfifo (the  application waits for this) and at
last kill itself.

But this doesnt work propper too.

Will I have to call pthread_wait_np() once in the entry section of the
thread ?
What is the cleanest way to solve the given problem - making a timer in
the module for some useconds?
What are the examples for that?
What could be the reason for the misbehaviour of sleep, usleep and
select in a function?

thanks in advance

--jens

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



[rtl] astonished?

2000-02-29 Thread kissg

What this error message does mean?

RTL is astonished to announce out of fake regs  
RTL is astonished to announce out of fake regs  
RTL is astonished to announce out of fake regs  
RTL is astonished to announce out of fake regs  
RTL is astonished to announce out of fake regs  
RTL is astonished to announce out of fake regs  
RTL is astonished to announce out of fake regs  
write_chars() 0 
write_chars() <1>Unable to handle kernel paging request at virtual address 0a302
029 
current->tss.cr3 = , %cr3 = 00ac9000
*pde =  
Oops:   
CPU:0   
EIP:0010:[<0a302029>]   
EFLAGS: 00010092
eax: ff10   ebx: 0092   ecx:    edx: 0a302029   
esi: c0a9ca6c   edi:    ebp: c0a9ca64   esp: c0a9ca44   
ds: 0018   es: 0018   ss: 0018  
Process  (pid: 0, process nr: 23, stackpage=c0a9d000)   
Stack:   c0109be0  c0a9ca6c 000f41e8 000e c01c2ced  
   02fd c0108df0 000f41e8  02fd 000e c01c2ced 02fd  
    0018 c0170018 ff00 c018feee 0010 0287 c01b449c  
...
[blahblahblah]
...
Code: 0f b6 0c 03 89 4c 24 38 51 68 44 5f 19 c0 e8 26 af 00 00 83   
RTL is astonished to announce out of fake regs  
Aiee, killing interrupt handler 
RTL is astonished to announce out of fake regs  
Kernel panic: Attempted to kill the idle task!  
RTL is astonished to announce out of fake regs  
In interrupt handler - not syncing  
RTL is astonished to announce out of fake regs  
RTL is astonished to announce out of fake regs  
RTL is astonished to announce out of fake regs  
[crash]


Background info
A 5 ms periodical task every time called [unintentionally]
rtl_printf("write_chars() %d"...); on a 100 MHz 486DX4.

Yes, I can imagine, that this can freeze the host.
I guess rtl_printf lasted more than 5 msec and scheduler had to
do something. But what happens in this case exactly?
I wonder what are the fake regs? 

Gabor
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/



»Ø¸´£ºRe: [rtl] How to map the memory into the users' memory space

2000-02-29 Thread liangjiangang

>Looking in arch/i386/mm/ioremap.c, it says that the functions prefixed
>with 'remap_area' are primarily for remapping a high PCI range to kernel
>space.  Where as the ioremap function are for remapping any high memory
>area to kernel space.

what's this high memory means?  Address > 0xA ?
i was intend to use this share memory in users space.can i
pass the pointer getting from ioremap to user space by using
ioctl()? 

>These functions are to be called once to cause linux to perform a
>remapping.

>The functions phys_to_virt and virt_to_phys are faster one line
>functions defined in include/asm-i386/page.h. and accessible in io.h,
>but they do not remap to kernel space so that a Linux program can access
>the the memory range.  They just convert one address per function call. 

>Looking at the driver, drivers/net/wan/cycx_drv.c, shows an ISA device
>using ioremap.

i can't find it in my drivers/net/,  can you send a copy for me.

>- Cheers,Kal.

>Tomasz Motylewski wrote:
> 
> > > > How can i do this, can i use ioremap/iounmap function in my driver?
> > >
> > > Yes, these are the correct functions to use in your device driver.
> 
> Just looking in arcnet driver shows that phys_to_virt is used like:
> 
> union ArcPacket *arcpacket = (union ArcPacket *) phys_to_virt(dev->mem_start
> + recbuf * 512);
> 
> saddr = arcpacket->hardheader.source;
> 
> dev->mem_start is usually around 0xd. ioremap/iounmap are probably used
> rather for PCI memory (high addresses).
> 
> --
> Tomek
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/


___
ÍƼö£¡EaseBand( http://easeband.163.com )ÈÃÄãÇáËÉÉÏÍø¡£




___
ÍƼö£¡EaseBand( http://easeband.163.com )ÈÃÄãÇáËÉÉÏÍø¡£

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl " | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/