Linux-Development-Sys Digest #555, Volume #8     Sat, 10 Mar 01 15:13:11 EST

Contents:
  linux kernel #, linux release #, ??? ("johng12")
  Re: Why is this process swapping? ([EMAIL PROTECTED])
  Re: Can linux be trusted? (Mark McIntyre)
  Is bootsect.s the code of MBR?? ("hushui")
  Re: Can linux be trusted? (Robert Redelmeier)
  Using old kernel modules under a new kernel ("thomas a. anderson")
  Re: linux kernel #, linux release #, ??? ("J. E. Garrott Sr")
  Re: Why is this process swapping? (Kaelin Colclasure)
  Re: Why is this process swapping? (Kaelin Colclasure)
  Re: Is bootsect.s the code of MBR?? (Kaz Kylheku)
  Re: Using old kernel modules under a new kernel ("tlin")
  Re: Can linux be trusted? (pete)
  Where are inw and outw? (Matt)
  Re: Can linux be trusted? (Erik Max Francis)

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

From: "johng12" <[EMAIL PROTECTED]>
Subject: linux kernel #, linux release #, ???
Date: Sat, 10 Mar 2001 09:38:43 GMT

i wanted to know more about
1  different linux distributions like red hat, suse, etc etc have their
versions of linux OS. what is the difference between them
2  how to find, or what are the differences between variuos linux kernels eg
kernel 2.0.34
  if linux is an open source software , then its kernel is code is free...
right ??

eg rehat calls its Linux release 5.1 as Manhattan. what are the differences
between each release.
Please point me to relevant docs.



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

From: [EMAIL PROTECTED]
Subject: Re: Why is this process swapping?
Date: Sat, 10 Mar 2001 10:58:00 -0000

| And finally, change your code so that instead of mapping every number
| to a bit (4B numbers = 0.5B bits) try mapping EVERY OTHER NUMBER to a
| bit (2B numbers = 0.25B).  Every 3rd bit is still the multiples of 3
| (but now represents 3,9,15,21,.... instead of 3,6,9,12,...) and every
| Nth bit (where N is not 2) is still multiples of N.  Your bit striking
| offsets do not change.  Your CPU and memory are each cut in half.

That should be 4B numbers = 4B bits = 0.5B bytes,
and 2B numbers = 2B bits = 0.25B bytes.

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: Mark McIntyre <[EMAIL PROTECTED]>
Crossposted-To: 
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,gnu.gcc
Subject: Re: Can linux be trusted?
Date: Sat, 10 Mar 2001 11:37:29 +0000

On Fri, 09 Mar 2001 23:37:29 -0500, Willam Hughes <[EMAIL PROTECTED]>
wrote:

>Richard Tobin wrote:
>
>> In article <[EMAIL PROTECTED]>,  <[EMAIL PROTECTED]> wrote:
>>
>> >Remember that 3.0 isn't the same as 3 and (depending on how your floats are 
>encoded) might be
>> >2.99999999.
>>
>> If your floats are encoded in any way that is actually used, 3 will be
>> represented exactly.
>
>While it is true that the floating point constant 3.
>will probably be represented exactly, 

How ? Is it an exact binary number ? 

>there is no guarantee that a floating point expression
>that has a nominal value of 3 will evaluate to
>exactly 3.

absolutely. 


-- 
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>

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

From: "hushui" <[EMAIL PROTECTED]>
Subject: Is bootsect.s the code of MBR??
Date: Sat, 10 Mar 2001 21:28:31 +0800

I have seen some part of the source code of Linux,that is bootsect.S .
The code shows "lilo" when booting .
When bios start the computer ,then read the code of mbr ,then execute it .
Now I want to know the code in mbr (besides the partion infomation) is in
the file bootsect.S ???
Setup.S is including what ??
When booting ,the code after 0x10000 (real mode ) is head.S???
the code after 0x90200( which is 2k size ) is setup.S ??






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

Date: Sat, 10 Mar 2001 07:36:32 -0600
From: Robert Redelmeier <[EMAIL PROTECTED]>
Crossposted-To: 
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,gnu.gcc
Subject: Re: Can linux be trusted?

Mark McIntyre wrote:
> 
> On Fri, 09 Mar 2001 23:37:29 -0500, Willam Hughes <[EMAIL PROTECTED]>
> >While it is true that the floating point constant 3.
> >will probably be represented exactly,
> 
> How ? Is it an exact binary number ?

YES!  3d = 1.1b * 2^1b .

In general, all non-mantissa over[under?]flowing integers 
can be exactly representing by floats.

All fractions that are multiples of exact negative powers of 
two _can_ also be exactly represented.  0.25d = 1.0b * 2^-10b.

Unfortunately, multiples of other numbers to negative powers
[like the commonly use base 10] are repeaters.  

Worse, even when you try to decimally represent an exact 
binary fraction [like 0.25d], it may wind up inexact.
The compiler may do 25/100 rather than 1/4 .

-- Robert  "You have to play the hand you are dealt in Silicon."

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

From: "thomas a. anderson" <[EMAIL PROTECTED]>
Subject: Using old kernel modules under a new kernel
Date: Sat, 10 Mar 2001 22:25:18 +0800

Hi

I would like to know if it would be possible to use a kernel 'module'
compiled from a previous version of Linux and load it on system with a newer
kernel version.
Specifically, I have problems using the commercial DirecPC drivers supplied
by Helius software since those are built for RedHat 6.0 systems using kernel
version 2.2.5-*whatever... I'm currently running Slackware 7.0 with kernel
version 2.4.2 and I dislike the idea of stepping down my kernel just to use
those drivers. I am aware that one should find the sources of those modules,
rebuild, and link it to the current kernel tree to be able to use it under
the newer kernel. But that statement is next to impossible!
Any ideas, tricks on manipulating binary kernel modules so that it'll be
usable enough on my system?
Suggestions would be greatly appreciated.

Thanks in advance!

Thomas A. Anderson
bash# segmentation fault
           core dumped...
bash#




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

From: "J. E. Garrott Sr" <[EMAIL PROTECTED]>
Subject: Re: linux kernel #, linux release #, ???
Date: Sat, 10 Mar 2001 06:47:44 -0800

johng12 wrote:
> 
> i wanted to know more about
> 1  different linux distributions like red hat, suse, etc etc have their
> versions of linux OS. what is the difference between them
> 2  how to find, or what are the differences between variuos linux kernels eg
> kernel 2.0.34
>   if linux is an open source software , then its kernel is code is free...
> right ??
> 
> eg rehat calls its Linux release 5.1 as Manhattan. what are the differences
> between each release.
> Please point me to relevant docs.

Most distributions keep a ChangeLog file.  Go to
the distributions home page and look for it.  It 
may have a different name, but should be identifiable.

The kernel is free.  The home page is
    http://www.kernel.org/
and the download site is 
   http://www.kernel.org/pub/linux/kernel/

Happy reading,


John

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

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Re: Why is this process swapping?
Date: 10 Mar 2001 08:48:20 -0800

Erik de Castro Lopo <[EMAIL PROTECTED]> writes:

> Kaelin Colclasure wrote:
> > 
> > I recently dug up a prime number sieve that I wrote many moons ago and,
> > for grins, set it cranking on computing all the primes that will fit
> > in a 32-bit unsigned integer. [Yes, I'm well aware that there are
> > better ways to compute prime numbers. I'm doing it this way for personal
> > amusement. Please stop snickering.]
> > 
> > The program uses a bit-vector to hold the sieve, so it allocates just
> > under a half-gigabyte of memory during initialization and after that
> > does no more allocation. My machine has 512MB of RAM, and by all
> > indications this was sufficient that the program ran totally CPU bound
> > at first.  However, after racking up about an hour of CPU time, and
> > with nothing else running on the machine, suddenly the process appears
> > to be swapping. CPU utilization dropped from a constant 99%-ish busy
> > to just around 7%, and suddenly `kswapd' is jostling with `sieve' for
> > the high ground in `top'.
> 
> You have 512Meg of RAM of which the OS, the X server and whatever
> else is probebly using about 30-40 Meg.
> 
> Your program starts up and allocates 512Meg and then starts filling
> it. Linux does actually make all the space available until the app
> uses it.

But every-other bit in the sieve vector is touched during the programs
first pass... Hmmm, I suppose the machine might be swapping the whole
time, but the effect doesn't become noticable until the algorithm's
stride through the sieve starts to approach the 4K page size. Still, I
am somewhat surprised at how slowly things are running. I am wondering
if this isn't some sort of worst-case for Linux's swap algorithm?

> Your program starts using the allocated 512Meg at one end and when 
> it consumes all the pyhsical memory not used by the OS and X, it 
> starts swapping to disk.
> 
> Swapping to disk is a task that is I/O bound rather than CPU bound.

Yes, of course. Is there any place in /proc that can tell me how many
page faults have been generated on behalf of a specific process? That
might be helpful in determining if the program is actually hitting
swap the whole time it's running.

-- Kaelin

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

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Re: Why is this process swapping?
Date: 10 Mar 2001 09:03:58 -0800

[EMAIL PROTECTED] writes:

> On 09 Mar 2001 22:20:03 -0800 Kaelin Colclasure <[EMAIL PROTECTED]> wrote:
> 
> | I recently dug up a prime number sieve that I wrote many moons ago and,
> | for grins, set it cranking on computing all the primes that will fit
> | in a 32-bit unsigned integer. [Yes, I'm well aware that there are
> | better ways to compute prime numbers. I'm doing it this way for personal
> | amusement. Please stop snickering.]
> 
> I'll try to hold it in the best I can :-)
> 
> Actually I've done the very same thing myself, though I found a practical
> upper limit on sieve well below what you are trying.  But that was back when
> I was running a P75 on 32M.  But what I was doing was comparing the three
> algorithms I knew to see which was fastest.
> 
> 
> | The program uses a bit-vector to hold the sieve, so it allocates just
> | under a half-gigabyte of memory during initialization and after that
> | does no more allocation. My machine has 512MB of RAM, and by all
> | indications this was sufficient that the program ran totally CPU bound
> | at first.  However, after racking up about an hour of CPU time, and
> | with nothing else running on the machine, suddenly the process appears
> | to be swapping. CPU utilization dropped from a constant 99%-ish busy
> | to just around 7%, and suddenly `kswapd' is jostling with `sieve' for
> | the high ground in `top'.
> 
> I'm a bit curious how it got to be CPU bound, unless it simply took a
> long time to do that first strike of 3's.

It does take a long time, and the first strike is 2's. Yes, it's that bad.
The bitvector routines I wrote are not terribly efficient, and I made
them a lot worse when I switched to 64-bit ints for calculating the word
and bit offsets. Those routines are worth optimizing, as I use them in a
few other places. But in general, as I said, I am not trying to optimize
my sieve program -- just to see how long it takes to crank through it on
my latest Linux machines.

[...]

> Given the process size is 512M I'd say that 512M ram is not enough to
> keep the process totally resident.  Given what the sieve algorithm
> normally does, you are going to see it touch all that memory quite a
> lot.  Stick another 256M of ram in there if you can and see what
> happens.  Based on your top screen, it has 470M resident and there is
> some shared and some swapped.

That's a good point. I do have access to a machine with 1GB of RAM.
I'll see how the program behaves there.

> Or try changing the upper bound on the primes from 4294967296 to
> 3758096384.  That should change the bitmap from 512M to 448M.  It
> won't give you all possible primes that fit in U32 but it should
> show you what's going on with the process.
> 
> And finally, change your code so that instead of mapping every number
> to a bit (4B numbers = 0.5B bits) try mapping EVERY OTHER NUMBER to a
> bit (2B numbers = 0.25B).  Every 3rd bit is still the multiples of 3
> (but now represents 3,9,15,21,.... instead of 3,6,9,12,...) and every
> Nth bit (where N is not 2) is still multiples of N.  Your bit striking
> offsets do not change.  Your CPU and memory are each cut in half.

Well, again, I'm not really trying to optimize my sieve -- but this is
interesting. :-) I'll have to think this through, since I'm having
trouble visualizing how this would work. Maybe once I get a little
caffine into my system...

Thanks for the response.

-- Kaelin

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Is bootsect.s the code of MBR??
Reply-To: [EMAIL PROTECTED]
Date: Sat, 10 Mar 2001 17:15:11 GMT

On Sat, 10 Mar 2001 21:28:31 +0800, hushui <[EMAIL PROTECTED]> wrote:
>I have seen some part of the source code of Linux,that is bootsect.S .
>The code shows "lilo" when booting .

I don't think so. It's LILO's boot loader which shows this.

>When bios start the computer ,then read the code of mbr ,then execute it .
>Now I want to know the code in mbr (besides the partion infomation) is in
>the file bootsect.S ???
>Setup.S is including what ??

You are confusing the kernel and LILO. The kernel image has a boot
sector in the front so that you can dump your kernel to a device
(typically this is done for a floppy disk) and boot from that
device without using LILO. The simple boot loader at the start of
the kernel simply reads the remaining sectors sequentially.

LILO has its own boot sector. This is contained in the binary file
/boot/boot.b.  When you run lilo to install it, it copies from this
file to the boot sector of the target boot device. LILO's boot loader
works with sector lists, which allow the images to be located almost
anywhere on the disk, which means they can be ordinary files in the
filesystem.

If you want to see the kernel' boot sector in action, copy your
favorite vmlinuz image to a floppy disk and try booting it.

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

From: "tlin" <[EMAIL PROTECTED]>
Subject: Re: Using old kernel modules under a new kernel
Date: Sat, 10 Mar 2001 14:08:17 -0700

I guess not. Many structures change the definitions. So you need to upgrade
the interfaces before moving it to a higher version system.


thomas a. anderson <[EMAIL PROTECTED]> wrote in message
news:98ddi2$hbs$[EMAIL PROTECTED]...
> Hi
>
> I would like to know if it would be possible to use a kernel 'module'
> compiled from a previous version of Linux and load it on system with a
newer
> kernel version.
> Specifically, I have problems using the commercial DirecPC drivers
supplied
> by Helius software since those are built for RedHat 6.0 systems using
kernel
> version 2.2.5-*whatever... I'm currently running Slackware 7.0 with kernel
> version 2.4.2 and I dislike the idea of stepping down my kernel just to
use
> those drivers. I am aware that one should find the sources of those
modules,
> rebuild, and link it to the current kernel tree to be able to use it under
> the newer kernel. But that statement is next to impossible!
> Any ideas, tricks on manipulating binary kernel modules so that it'll be
> usable enough on my system?
> Suggestions would be greatly appreciated.
>
> Thanks in advance!
>
> Thomas A. Anderson
> bash# segmentation fault
>            core dumped...
> bash#
>
>
>



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

From: pete <[EMAIL PROTECTED]>
Crossposted-To: 
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,gnu.gcc
Subject: Re: Can linux be trusted?
Date: Sat, 10 Mar 2001 14:31:33 -0500
Reply-To: [EMAIL PROTECTED]

Robert Redelmeier wrote:
 
> All fractions that are multiples of exact negative powers of
> two _can_ also be exactly represented.  0.25d = 1.0b * 2^-10b.

I'm showing off my new function, Bits()
This is the second time I've posted it and I know it gets old fast,
so I won't post it again.

This is what the output looks like on my machine:

(float)-2.000000 = 11000000000000000000000000000000
(float)-1.500000 = 10111111110000000000000000000000
(float)-1.000000 = 10111111100000000000000000000000
(float)-0.500000 = 10111111000000000000000000000000
(float)0.000000 = 00000000000000000000000000000000
(float)0.500000 = 00111111000000000000000000000000
(float)1.000000 = 00111111100000000000000000000000
(float)1.500000 = 00111111110000000000000000000000
(float)2.000000 = 01000000000000000000000000000000
(float)2.600000 = 01000000001001100110011001100110

/* BEGIN, floatbits.c */

#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

char *Bits(void const *p, size_t bytes);

int main(void)
{
   float a;
   char b, *s = "(float)%f = %s\n";

   printf("\n");
   for(a = -2.0; a < 2.5; a += 0.5)
      printf(s, a, Bits(&a, sizeof a));
   a += 0.1;
   printf(s, a, Bits(&a, sizeof a));
   Bits(&b,0); /* parameter = 0, frees dynamic memory in Bits() */
   return 0;
}

char *Bits(void const *p, size_t bytes)
{
   static unsigned char *a;
   unsigned char *b, mask;

   if(!(a = realloc(a, CHAR_BIT * bytes + 1)))
      printf("realloc() failure in Bits()\n"), exit(EXIT_FAILURE);
   if(bytes){
      b = a;
      while(bytes--)
         for(mask = 1 << CHAR_BIT - 1; mask; mask >>= 1)
            *b++ = ((char*)p)[bytes] & mask? '1': '0';
      *b = '\0';
   }else
      free(a);
   return a;
}

/* END, floatbits.c */
-- 
 pete

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

From: Matt <[EMAIL PROTECTED]>
Subject: Where are inw and outw?
Date: Sat, 10 Mar 2001 19:33:38 GMT

I'm slowly writing a device driver for a DSP controller, and I have just
gotten around to the I/O port furtling. I'm trying to use the inw and
outw and my module compiles fine, but when I try and load it into my
kernel, I get:

nextmove.o: unresolved symbol inw
nextmove.o: unresolved symbol outw

As far as I know, I have a fully working 2.2.18 kernel, on an i386, with
nothing stripped out.

I've got *the* device drivers book, and have included asm/io.h, but has
it all changed since then?

Thanks

Matt


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

From: Erik Max Francis <[EMAIL PROTECTED]>
Crossposted-To: 
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,gnu.gcc
Subject: Re: Can linux be trusted?
Date: Sat, 10 Mar 2001 11:46:10 -0800

pete wrote:

> I'm showing off my new function, Bits()
> This is the second time I've posted it and I know it gets old fast,
> so I won't post it again.

It has a serious bug.  What happens when it's called with bytes == 0?

-- 
 Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ They have rights who dare defend them.
\__/ Roger Baldwin
    Official Omega page / http://www.alcyone.com/max/projects/omega/
 The official distribution page for the popular Roguelike, Omega.

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


** 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