Linux-Development-Sys Digest #575, Volume #8     Sun, 18 Mar 01 10:13:13 EST

Contents:
  Re: 4GB memory limit (Paul Fulghum)
  Broadcom BCM 4210 (Diamond HomeFree Phoneline 10Mbps) drivers ("Surge")
  Re: copy_to_user() question ("Jim Fischer")
  Problems with Dell 2400 loading Suse 7.1 (Richmond Dyes)
  Re: Select blocking all threads... ("Uncle Nick")
  Re: copy_to_user() question ("Peter T. Breuer")
  Re: versionless module ("Peter T. Breuer")
  help,still confused about the boot of the linux system?? ("hushui")
  !! Filename and Pathname problem !!! ("Karim A")
  Re: Unexpected scheduler behaviour ? (Luc Van Oostenryck)

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

From: Paul Fulghum <[EMAIL PROTECTED]>
Subject: Re: 4GB memory limit
Reply-To: [EMAIL PROTECTED]
Date: Sun, 18 Mar 2001 01:18:47 GMT

Ryan Storgaard wrote:

> I am running the 2.4 kernel, and originally compiled support for 64GB of
> memory and then put 6GB of RAM in the box. Linux ran fine, but I have an
> application (unfortunately I'm not at liberty to say what application)
> that upon install said "error, you have support for more than 4GB of RAM".
> I had to recompile with support for only 4GB of RAM and everything went
> fine. I really need this application to support more RAM though.
> ...
> If an application was originally developed to support 4GB of RAM, what is
> involved in order to allow it to handle more than 4GB? ( I mean in
> general... is it a simple switch or parameter during the compiling of the
> application or is it a complex rewrite of the entire application ....)
> 
> Excuse my programming incompetence and the reference to windoze but in NT,
> for example, NT tells every app that it has access to 4GB of RAM... What
> does linux do (in the 2.4 kernel)?
> 
>  Reason I ask is because the vendor mentioned it wasn't planning on
> supporting more than 4GB of RAM with Linux, and to look for their Windows
> 2000 version to support larger amounts of RAM.... I REALLY don't want to
> go down that road because that would mean I would have to purchase Win2k
> DataCenter Server to handle the RAM... I want to use Linux.

On a 32bit X86 processor, the user mode application will never get
more than 4GB of address space. The kernel can use more than 4GB
(with the 36bit PAE kernel option and processor support) to supply memory
to multiple processes, but each process is still limited to 4GB (32 bits).

You would need to use a 64bit processor (Alpha, UltraSparc, etc.)
with Linux to get support for more than 4GB per process.

The following is from the kernel configuration help:

> High Memory support
> 
>   Linux can use up to 64 Gigabytes of physical memory on x86 systems.
>   However, the address space of 32-bit x86 processors is only 4
>   Gigabytes large. That means that, if you have a large amount of
>   physical memory, not all of it can be "permanently mapped" by the
>   kernel. The physical memory that's not permanently mapped is called
>   "high memory".
> 
>   <...>
> 
>   If more than 4 Gigabytes is used then answer "64GB" here. This
>   selection turns Intel PAE (Physical Address Extension) mode on.
>   PAE implements 3-level paging on IA32 processors. PAE is fully
>   supported by Linux, PAE mode is implemented on all recent Intel
>   processors (Pentium Pro and better). NOTE: If you say "64GB" here,
>   then the kernel will not boot on CPUs that don't support PAE!

The same should be true for NT, but NT probably provides an API to
multiplex chunks of memory into a given address range to provide
access to more than 4GB (but not all at once).

-- 
Paul Fulghum
[EMAIL PROTECTED]

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

From: "Surge" <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux.mandrake
Subject: Broadcom BCM 4210 (Diamond HomeFree Phoneline 10Mbps) drivers
Date: Sun, 18 Mar 2001 04:04:02 GMT

Hello,
today I was searching (again) the Web and Usenet for the drivers for my
Diamond Homefree Phoneline 10Mbps network card drivers. Google
returned some interesting results, but, unfortunately, links were dead. As
I understood from available cached pages, there is someone privately
working on the drivers for BCM 4210, which is used in my Homefree.
There were no more information.
But may be anyone here knows anything about this? I'm really interested
in drivers of any level of support for these card (even if they will provide
only 10kbps).
It is a shame on Broadcom which grows as a pig, but can't provide its
customers any support for alternative OS (if anyone nowadays can call
Linux an "alternative OS").

Sincerely yours,
Sergei



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

From: "Jim Fischer" <[EMAIL PROTECTED]>
Subject: Re: copy_to_user() question
Date: Sat, 17 Mar 2001 20:41:58 -0800



> >So what am I missing here?  Tks...
>
> Where does the value of "len" get set?

len's value is set in the validation and range check code, just before the
for() loop / copy_to_user() call. For the sake of argument, choose len's
value as 23 bytes (the length of some arbitrary text string (22) plus its
NUL termination char '\0'). Note that the value that's stored in len is
exactly the same for both the for() loop version (i.e., the put_user()
version) and the copy_to_user() version.


Jim




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

From: Richmond Dyes <[EMAIL PROTECTED]>
Subject: Problems with Dell 2400 loading Suse 7.1
Date: Sun, 18 Mar 2001 01:30:59 -0500

I am trying to load Suse 7.1 on Dell 2400.  The problem is I have a
Adaptec 78xx scsi card and the Perc2 raid adaptor.  After the
installation, I see the 78xx module, but not the Perc2 module.  Then of
course I get a kernel panic because it can't load because /dev/sda3 is
on the raid, I can get to the drive when I use the installation CD and
load the drivers for both cards.  I got the new 2.4.2 kernel, but I
don't see the driver for the perc2 card, any help with this?  How can I
"patch" the module for this driver into the kernel that is there
already.  Any help appreciated.


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

From: "Uncle Nick" <[EMAIL PROTECTED]>
Subject: Re: Select blocking all threads...
Date: Sun, 18 Mar 2001 06:22:51 GMT

Matt,

If I am not mistaken, you should have a separate pthread_t structure for
each thread.  Sharing this structure is likely the cause of your threads not
operating independently.

I am not able to easily test this for you or to access man page.  Only this
seems logical to me.

Good Luck,
Nick


"Matt Woodyard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> As request some source code. Play with the code by placing machines in
> different orders. You'll find that if you place a pingable machine in ip1
> and down machine in ip2 and a up one in ip3, you'll see the "blocking"
> effect im talking about. try all three machines being up, all three down.
> when all three are down execution will take 20 seconds, assuming that you
> tell it to hit 3 up hosts the maximum ping time will be 10 seconds (should
> be for both scenarios). Although if its not really running in parallel
then
> the problem is not my code.
>
> I compile this on linux 2.2.16 (RH 7.0) with:
>
> g++ testthreadping.cpp -lpthread
>
> start code-->
>
> #include <stdio.h>
> #include <pthread.h>
> #include <fstream>
> #include <string>
> #include "cfgfile.h"
> #include <pthread.h>
> #include <string>
> #include <iostream>
> #include <netinet/in.h>
>
>
> pthread_mutex_t lockping = PTHREAD_MUTEX_INITIALIZER;
>
> void sendPing(unsigned long myAddr,int *state)
> {
> int numbytes,ret;
> struct sockaddr_in dest_addr;   /* will hold the destination addr */
> struct icmphdr *out,*icmpheader; /*ICMP Header Information*/
> char buff[256];
> struct timeval Timeout;
> fd_set readfs;
> unsigned int addrlen;
> char *buffer = new char[100];
> int sockfd,r;
>
> sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); /* do some error
checking!
> */
> fcntl(sockfd,F_SETFL,O_NONBLOCK);
> /*Set up select stuff */
> FD_ZERO(&readfs);
> FD_SET(sockfd,&readfs);
> /*Time out after 5 seconds*/
> Timeout.tv_sec = 5;
> Timeout.tv_usec = 0;
>
> /*Set Destination Information*/
> dest_addr.sin_family = AF_INET;        /* host byte order */
> dest_addr.sin_addr.s_addr = myAddr;
> bzero(&(dest_addr.sin_zero), 8);       /* zero the rest of the struct */
>
> /************
> Load ICMP Header
> ************/
> out = (struct icmphdr *)buff;
> bzero((char *)out,sizeof(struct icmphdr));
> out->type = ICMP_ECHO;
> out->un.echo.sequence = getpid();
> out->un.echo.id =  getpid();
> out->checksum = in_cksum((unsigned short *)out,sizeof(struct icmphdr));
>
> /*Send Packet*/
>
> if ((numbytes=sendto(sockfd,out, sizeof(struct icmphdr), 0, (struct
sockaddr
> *)&dest_addr, sizeof(struct sockaddr))) == -1) {
>             perror("Send Packet");
>             *state = -1;
>         }
>
>
>
> /*Wait for less than 5 seconds*/
> ret = select(sockfd+1,&readfs,NULL,NULL,&Timeout);
> if (ret)
>     {
>     ret = recvfrom(sockfd, buffer,100,0,(struct sockaddr
> *)&dest_addr,&addrlen);
>     if(ret == -1)
>         {
>         perror("Ping Recieve");
>         close(sockfd);
>         *state = -1;
> //        return -1;
>         }
>     else
>         {
>         icmpheader = (struct icmphdr *)(buffer +sizeof(iphdr));
>         close(sockfd);
>         *state = icmpheader->type;
>         //return icmpheader->type;
>         }
>
>
>     }
> else
>     {
>     *state = 3;
>     //return 3;
>     close(sockfd);
>     }
>
> //return -1;
> }
>
> /*
>  * I stole this from tracroute which stol it from ping
>  * in_cksum --
>  *      Checksum routine for Internet Protocol family headers (C Version)
>  */
> unsigned short in_cksum(unsigned short *addr,int len)
> {
>         register int sum = 0;
>         u_short answer = 0;
>         register u_short *w = addr;
>         register int nleft = len;
>
>         /*
>          * Our algorithm is simple, using a 32 bit accumulator (sum), we
add
>          * sequential 16 bit words to it, and at the end, fold back all
the
>          * carry bits from the top 16 bits into the lower 16 bits.
>          */
>         while (nleft > 1)  {
>                 sum += *w++;
>                 nleft -= 2;
>         }
>
>         /* mop up an odd byte, if necessary */
>         if (nleft == 1) {
>                 *(u_char *)(&answer) = *(u_char *)w ;
>                 sum += answer;
>         }
>
>         /* add back carry outs from top 16 bits to low 16 bits */
>         sum = (sum >> 16) + (sum & 0xffff);     /* add hi 16 to low 16 */
>         sum += (sum >> 16);                     /* add carry */
>         answer = ~sum;                          /* truncate to 16 bits */
>         return(answer);
> }
>
> void *ThreadPing(void *idr)
> {
> int pingret;
> unsigned long *d = (unsigned long *)idr;
> printf("%ld\n",*d);
> sendPing(*d,&pingret);
> printf("%d %d\n",pthread_self(),pingret);
> return NULL;
> }
>
>
> int main(void)
> {
> char ip1[15] = "207.246.71.2";
> char ip2[15] = "207.246.71.25";
> char ip3[15] = "207.246.71.44";
>
> unsigned long NetAddr1,NetAddr2,NetAddr3;
>
> pthread_t p_thread;
>
> int thrid;
>
>
> NetAddr1 = inet_addr(ip1);
> NetAddr2 = inet_addr(ip2);
> NetAddr3 = inet_addr(ip3);
>
> printf ("%ld, %ld\n",NetAddr1,NetAddr2);
>
> thrid =  pthread_create(&p_thread,NULL,ThreadPing,(void *)&NetAddr1);
> thrid =  pthread_create(&p_thread,NULL,ThreadPing,(void *)&NetAddr2);
> thrid =  pthread_create(&p_thread,NULL,ThreadPing,(void *)&NetAddr3);
>
> printf ("%ld, %ld\n",NetAddr1,NetAddr2);
> sleep(5);
> }
>
> <--end
>
>



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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: copy_to_user() question
Date: Sun, 18 Mar 2001 00:47:15 +0100

Jim Fischer <[EMAIL PROTECTED]> wrote:

> I'm a newby kernel hacker who's unable to get the copy_to_user() function to
> write data from kernel space to user space. I'm working with a 2.4.2 smp
> kernel and am compiling the module code with the following command line:

>     gcc -O2 -D__KERNEL__ -DMODULE -c xyz.c

and what happened to -D__SMP__ or whatever it was?

Peter

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: versionless module
Date: Sun, 18 Mar 2001 12:20:14 +0100

Michael Andrew Posadas <[EMAIL PROTECTED]> wrote:

> I am trying to write a loadable driver module that will run on multiple
> kernel versions.  Can someone explain how to do this or point me to 

It will run anywhere you put it. Whether it works is another question.

> references that will.  Thanks

What, precisely, is your question? Are you asking about writing
style? The existence of backward-compatibility libraries? Are you
asking how to get insmod to load it? ...

Peter

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

From: "hushui" <[EMAIL PROTECTED]>
Subject: help,still confused about the boot of the linux system??
Date: Sun, 18 Mar 2001 22:09:20 +0800

Hi folks:
 I am still confused about the boot of the linux system??
1.Is bootsect.S and setup.S are only needed in boot with floppy??
But they are compiled and linked in the kernel image file.
2.read 512bytes (which is MBR) is done by BIOS POST program??
3.If lilo is installed in mbr (hda2 is linux's / , hda1 is msdos,and the
 active partion is hda1) then why not BIOS boot the active partion of msdos
partion directly ?? Is it because lilo program which select which partion to
boot ,
so the active mark in the partion table is no use??
Thank you all!



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

From: "Karim A" <[EMAIL PROTECTED]>
Subject: !! Filename and Pathname problem !!!
Date: Sun, 18 Mar 2001 15:41:55 +0100

Hi all,

where, I've to developp a linux application module for my job and I need a
function that maniplautes filenames and pathname.
Let me explain you my problem:

under windows, there is win32 function called splitpath().
this functiontakes a pathname as first parameter (i.e.
c:\myapps\projectx\myapps.cxx)
and the functions retrieves the driver name, the directory, the file title
and the file extension (if any).

I really need a function such like this one for linux / unix.

in fact, i may have to code it manually but i've short deadlines and i can't
take the time to write one perfectly and to test it.
I just need to retrive the file title from a full path name.

Can somebody help me please ?!!


Thanks a lot.

Regards,


Karim




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

Date: Sun, 18 Mar 2001 16:01:07 +0100
From: Luc Van Oostenryck <[EMAIL PROTECTED]>
Subject: Re: Unexpected scheduler behaviour ?


==============18C1E1CD1C663728FA96A351
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I am not to fully understand your problem but it remember a problem that I
encounter some times ago:
I was doing some "experimentation" in device driver and I had very strange
scheduling behaviour.
What was happening:
1) some code in user space that always run for less than a clock tick
2) then a call to my "device driver" (ioctl()) that do almost nothing but a
call to sleep_on_timeout()
3) repeat this forever

To my surprise, you can run this code as long that you want the system and
user usage time for this
process is never updated! (in kernel 2.2.x and 2.4.0)
Of course I suspected the code of my "device driver", but I discover that I
had exactely the same behaviour
if I replace the call to my device by a call to usleep() (which also do
almost nothing but something like a sleep with a timeout).

Was I understand is that in this process is never preempted (user code run
less than a clock tick, kernel code sleeping),
but the user and system time usage are only updated when a process is
preempted (anyway in the kernel all the time usage are done in clock ticks
and the process run always less than a clock and sleeping time doesn't
count), and of course the scheduling priority
depend on the user/system time usage.

Hope that this can help you.


Pieter Thysebaert wrote:

> Don't know if this the right group but anyway, here goes :
>
> I'm trying to time some CORBA-related code in function of CPU load as
> follows :
>
> On the computer the servant is located , I run a self-written utility that
> uses processor time - all it does is execute a loop with floating-point
> instructions followed by a usleep() , and these things are themselves
> contained within an infinite loop.
>
> I run the client o nanother computer.
> This client calls the same function on the servant object 1000 times, and
> measures how long each call takes.
>
> In the end it divides the accumulated time by 1000 to get an estimate of
> the average time a call needs.
>
> So what I do is execute the utility, specifying the number of iterations
> for the inner loop on  the command line, when the servant is still idle
> (no function called), then start the client.
>
> (Running the utility with higher numbers will increase the cpu load)
>
> Now I would expect that the average time for one call increases as the cpu
> load increases.
>
> However, when reaching about 40% load, the time just drops back to its
> initial value i.e. the time it takes to handle a call when no extra
> cpu-load is generated using my utility. (and stays there for loads > 40
> %...)
>
> So it seems that at some point, the utility is suppressed in favour of the
> servant object's methods....
>
> I have really no clue as to why this is happening...
>
> Is there some kind of scheduling policy I am not aware of ?
>
> This is Debian 2.2 Linux, using TAO as my orb.
>
> The "load values" are just taken from top's output (as load = 100 -
> "idle"-value - that's good enough for me)
>
> Pieter
>

--
Luc Van Oostenryck



==============18C1E1CD1C663728FA96A351
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi,
<p>I am not to fully understand your problem but it remember a problem
that I encounter some times ago:
<br>I was doing some "experimentation" in device driver and I had very
strange scheduling behaviour.
<br>What was happening:
<br>1) some code in user space that always run for less than a clock tick
<br>2) then a call to my "device driver" (ioctl()) that do almost nothing
but a call to sleep_on_timeout()
<br>3) repeat this forever
<p>To my surprise, you can run this code as long that you want the system
and user usage time for this
<br>process is never updated! (in kernel 2.2.x and 2.4.0)
<br>Of course I suspected the code of my "device driver", but I discover
that I had exactely the same behaviour
<br>if I replace the call to my device by a call to usleep() (which also
do almost nothing but something like a sleep with a timeout).
<p>Was I understand is that in this process is never preempted (user code
run less than a clock tick, kernel code sleeping),
<br>but the user and system time usage are only updated when a process
is preempted (anyway in the kernel all the time usage are done in clock
ticks
<br>and the process run always less than a clock and sleeping time doesn't
count), and of course the scheduling priority
<br>depend on the user/system time usage.
<p>Hope that this can help you.
<br>&nbsp;
<p>Pieter Thysebaert wrote:
<blockquote TYPE=CITE>Don't know if this the right group but anyway, here
goes :
<p>I'm trying to time some CORBA-related code in function of CPU load as
<br>follows :
<p>On the computer the servant is located , I run a self-written utility
that
<br>uses processor time - all it does is execute a loop with floating-point
<br>instructions followed by a usleep() , and these things are themselves
<br>contained within an infinite loop.
<p>I run the client o nanother computer.
<br>This client calls the same function on the servant object 1000 times,
and
<br>measures how long each call takes.
<p>In the end it divides the accumulated time by 1000 to get an estimate
of
<br>the average time a call needs.
<p>So what I do is execute the utility, specifying the number of iterations
<br>for the inner loop on&nbsp; the command line, when the servant is still
idle
<br>(no function called), then start the client.
<p>(Running the utility with higher numbers will increase the cpu load)
<p>Now I would expect that the average time for one call increases as the
cpu
<br>load increases.
<p>However, when reaching about 40% load, the time just drops back to its
<br>initial value i.e. the time it takes to handle a call when no extra
<br>cpu-load is generated using my utility. (and stays there for loads
> 40
<br>%...)
<p>So it seems that at some point, the utility is suppressed in favour
of the
<br>servant object's methods....
<p>I have really no clue as to why this is happening...
<p>Is there some kind of scheduling policy I am not aware of ?
<p>This is Debian 2.2 Linux, using TAO as my orb.
<p>The "load values" are just taken from top's output (as load = 100 -
<br>"idle"-value - that's good enough for me)
<p>Pieter
<br>&nbsp;</blockquote>

<pre>--&nbsp;
Luc Van Oostenryck</pre>
&nbsp;</html>

==============18C1E1CD1C663728FA96A351==


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


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to