Linux-Development-Sys Digest #444, Volume #6      Tue, 2 Mar 99 04:14:06 EST

Contents:
  Pentium-III serial number patch for 2.2.1 ([EMAIL PROTECTED])
  Re: Real Programmers text editors (Daddy Roger)
  Re: Driver Programming (Timothy J. Lee)
  Re: SMP Support (David Fox)
  Re: SMP Support (Johan Kullstam)
  OpenGL question. (David T. Wang)
  3Dfx 2D register specs available (Gary Tarolli)
  Re: problem with creating ramdisk: kernel loads, but hangs when it tries to mount 
ramdisk ("Allan Jones")
  Re: How to understand Kernel Source code (Christopher Thompson)
  Re: Version 2.2.2 loses IP Masquerading ? (Christopher Thompson)
  Re: Linux Virtual Memory trick (Bryan Hackney)
  Re: SMP Support ("Robert B. Hamilton")
  OSS developer (Yiu Fan Samuel Yau)
  Re: SMP Support (Adam P. Jenkins)
  Re: SMP Support (Adam P. Jenkins)
  Re: How to understand Kernel Source code ("Quiney, Philip (EXCHANGE:HAL02:HM10)")

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

From: [EMAIL PROTECTED]
Subject: Pentium-III serial number patch for 2.2.1
Date: Tue, 02 Mar 1999 03:01:54 GMT

I've made a patch for 2.2.1 that retrieves the PIII serial number and stores
it in the cpuinfo_x86 struct, then disables the CPUID instruction that allows
the serial number to be read again.  Finally, the serial number is printed as
part of the contents of /proc/cpuinfo.  (Apologies if anybody sees multiple
copies of this; my regular newsfeed is broken, so I've been struggling with
dejanews.)

regards,
d.

diff -u -r linux-2.2.1-orig/arch/i386/kernel/head.S
linux/arch/i386/kernel/head.S
--- linux-2.2.1-orig/arch/i386/kernel/head.S    Thu Jan 14 22:57:25 1999
+++ linux/arch/i386/kernel/head.S       Fri Feb 26 19:39:40 1999
@@ -33,6 +33,7 @@
 #define X86_CPUID      CPU_PARAMS+8
 #define X86_CAPABILITY CPU_PARAMS+12
 #define X86_VENDOR_ID  CPU_PARAMS+16
+#define        X86_SERIAL_NUM  CPU_PARAMS+32

 /*
  * swapper_pg_dir is the main page directory, address 0x00101000
@@ -196,6 +197,22 @@
        andb $0x0f,%cl          # mask mask revision
        movb %cl,X86_MASK
        movl %edx,X86_CAPABILITY
+
+       movl X86_CPUID,%eax     # Check for CPUID level >= 3 ... P-III has serial info
+       cmpb $3,%al
+       jl is486
+       movl $1,%eax            # use CPUID(1) again to get "Processor Signature"
+       cpuid
+       movl %eax,X86_SERIAL_NUM
+       movl $3,%eax            # use CPUID(3) to get rest of serial number
+       cpuid
+       movl %edx,X86_SERIAL_NUM+4
+       movl %ecx,X86_SERIAL_NUM+8
+
+       movl $0x119,%ecx        # also disable processor signature reading.
+       rdmsr
+       or $0x00200000,%eax
+       wrmsr

 is486:
        movl %cr0,%eax          # 486 or better
diff -u -r linux-2.2.1-orig/arch/i386/kernel/setup.c
linux/arch/i386/kernel/setup.c
--- linux-2.2.1-orig/arch/i386/kernel/setup.c   Thu Jan 21 11:28:40 1999
+++ linux/arch/i386/kernel/setup.c      Fri Feb 26 20:02:53 1999
@@ -760,6 +760,13 @@
        if (c->x86_mask || c->cpuid_level>=0)
                printk(" stepping %02x", c->x86_mask);

+       if (c->cpuid_level >= 3) {
+               printk( " serial %04x-%04x-%04x-%04x-%04x-%04x",
+                               c->x86_serial_number[1], c->x86_serial_number[0],
+                               c->x86_serial_number[3], c->x86_serial_number[2],
+                               c->x86_serial_number[5], c->x86_serial_number[4] );
+       }
+
        if(c->x86_vendor == X86_VENDOR_CENTAUR)
        {
                u32 hv,lv;
@@ -811,6 +818,22 @@
                        p += sprintf(p, "stepping\t: %d\n", c->x86_mask);
                else
                        p += sprintf(p, "stepping\t: unknown\n");
+
+               if (c->cpuid_level >= 3) {
+                       int      current_cpuid = 0;
+                       p += sprintf( p, "serial\t\t: %04x-%04x-%04x-%04x-%04x-%04x",
+                                                 c->x86_serial_number[1], 
+c->x86_serial_number[0],
+                                                 c->x86_serial_number[3], 
+c->x86_serial_number[2],
+                                                 c->x86_serial_number[5], 
+c->x86_serial_number[4] );
+                       __asm__( "xorl %%eax,%%eax\ncpuid\nmovl %%eax,%0"
+                                        : "=m" (current_cpuid)
+                                        : /* no inputs */
+                                        : "eax", "ebx", "ecx", "edx" );
+                       p += sprintf( p, ((current_cpuid >= 3)
+                                                         ? " (currently enabled)\n"
+                                                         : " (currently disabled)\n") 
+);
+               } else
+                       p += sprintf( p, "serial\t\t: unknown\n" );

                if (c->x86_capability & X86_FEATURE_TSC) {
                        p += sprintf(p, "cpu MHz\t\t: %lu.%06lu\n",
diff -u -r linux-2.2.1-orig/fs/proc/array.c linux/fs/proc/array.c
--- linux-2.2.1-orig/fs/proc/array.c    Thu Jan 28 10:08:53 1999
+++ linux/fs/proc/array.c       Fri Feb 26 19:41:58 1999
@@ -5,6 +5,8 @@
  *  based on ideas by Darren Senn
  *
  * Fixes:
+ * dave madden: added P3 serial number to cpuinfo
+ *
  * Michael. K. Johnson: stat,statm extensions.
  *                      <[EMAIL PROTECTED]>
  *
diff -u -r linux-2.2.1-orig/include/asm-i386/processor.h
linux/include/asm-i386/processor.h
--- linux-2.2.1-orig/include/asm-i386/processor.h       Thu Jan 28 12:41:18 1999
+++ linux/include/asm-i386/processor.h  Fri Feb 26 19:37:52 1999
@@ -30,6 +30,7 @@
        int     cpuid_level;    /* Maximum supported CPUID level, -1=no CPUID */
        __u32   x86_capability;
        char    x86_vendor_id[16];
+       __u16   x86_serial_number[8];   /* only 6 __u16s; pad 2 to keep aligned. */
        char    x86_model_id[64];
        int     x86_cache_size;  /* in KB - valid for CPUS which support this
                                    call  */

============= Posted via Deja News, The Discussion Network ============
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

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

From: Daddy Roger <[EMAIL PROTECTED]>
Crossposted-To: comp.sys.mac.misc,comp.sys.amiga.hardware
Subject: Re: Real Programmers text editors
Date: Mon, 01 Mar 1999 23:09:03 GMT

Real programers know when they are cross-posting, you are such a person

Per Olsson wrote:
> 
> Great! I didn't know the original source of my sig. I would be happy if you
> posted the file here or sent me a copy to mailto:[EMAIL PROTECTED]
> 
> /Per Olsson
> 
> --
> Real programmers dont use WYSIWYG editors. They use YAFIYGI editors like
> edlin. (You Asked For It You Got It)
> 
> Dave wrote in message ...
> >In article <7bc7ma$499$[EMAIL PROTECTED]>, "Per Olsson"
> ><[EMAIL PROTECTED]> wrote:
> >
> >
> >> --
> >> Real programmers dont use WYSIWYG editors. They use YAFIYGI editors like
> >> edlin. (You Asked For It You Got It)
> >
> ><chuckle>
> >
> >I have a *very* old text file that was one of my very first BBS downloads
> >in 1982 or so.  It has a line very similar to this.
> 
> [snip]
> 
> >The document is called "Real Programmers don't use Pascal".   It extolls
> >the virtues of mainframe FORTRAN.  It's actually quite funny, and is also
> >quite a "time capsule", as it appears to have been written in 1982 or so.
> >
> >I can upload it here if anyone is interested.

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

Crossposted-To: comp.os.linux.questions
From: [EMAIL PROTECTED] (Timothy J. Lee)
Subject: Re: Driver Programming
Reply-To: see-signature-for-email-address---junk-not-welcome
Date: Tue, 2 Mar 1999 00:22:19 GMT

"snurf" <[EMAIL PROTECTED]> writes:
|Hello all.
|I need to develop a driver for an industrial card but I don't know how do
|it.
|I'm looking for news, example, docs about drivers programming under linux
|S.U.S.E.
|If you know how do it, please share your knowledge.

Rubini's _Linux_Device_Drivers_ (published by O'Reilly)?
-- 
========================================================================
Timothy J. Lee                                                   timlee@
Unsolicited bulk or commercial email is not welcome.             netcom.com
No warranty of any kind is provided with this message.

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

From: d s f o x @ c o g s c i . u c s d . e d u (David Fox)
Subject: Re: SMP Support
Date: 01 Mar 1999 21:00:51 -0800

[EMAIL PROTECTED] (Adam P. Jenkins) writes:

> as the disk.  On a two processor system I found that running make -j 2
> nearly halved kernel compile-time, but increasing it beyond that
> didn't help at all.

How much did it hurt it?
-- 
David Fox           http://hci.ucsd.edu/dsf             xoF divaD
UCSD HCI Lab                                         baL ICH DSCU

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

Subject: Re: SMP Support
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 02 Mar 1999 00:04:08 -0500

[EMAIL PROTECTED] (Adam P. Jenkins) writes:

> There is no point in running more parallel make processes than the
> number of processors you have, so unless you really have 8 processors,
> you'd actually be better off running less.  It actually slows things
> down to have so many processes contending for access to resources such
> as the disk.  On a two processor system I found that running make -j 2
> nearly halved kernel compile-time, but increasing it beyond that
> didn't help at all.

and i found that make -j 3 shaved about 1/3 of the time of compiles on
my uniprocessor.  go figure.

-- 
                                           J o h a n  K u l l s t a m
                                           [[EMAIL PROTECTED]]
                                              Don't Fear the Penguin!

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

From: [EMAIL PROTECTED]@Glue.umd.edu (David T. Wang)
Subject: OpenGL question.
Date: 2 Mar 1999 04:17:03 GMT

I just looked in linux.announce, and apparently there is some talk about OpenGL
in the upcoming LinuxWorld.  However, since I won't be attending it, is there a
good source which summarizes the current state of development of OpenGL with 
Linux?  I'd like to use OpenGL for my next project, but everywhere I turn, if
I should mention "inexpensive" or "PC", the answer I get back is "Windows".
Mesa is very nice, but I'd like a hardware supported solution, the program
I am thinking of would most definitely be too slow for a software based 
solution.  Any ideas or pointers? TIA.

                                                        David

--
No SPAM or email wholly without substance please
[EMAIL PROTECTED],not.spam
All statements are personal opinions
Not speaking for NTT or University of Maryland
Kyoto, Japan.

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

From: Gary Tarolli <[EMAIL PROTECTED]>
Subject: 3Dfx 2D register specs available
Date: Mon, 01 Mar 1999 20:17:41 -0500

For those who haven't seen the press release:
        http://biz.yahoo.com/prnews/990301/ca_3dfx_in_1.html
check out our Web site at www.3dfx.com and you can download
a PDF file that contains the 2D register specs for Banshee.

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

From: "Allan Jones" <[EMAIL PROTECTED]>
Subject: Re: problem with creating ramdisk: kernel loads, but hangs when it tries to 
mount ramdisk
Date: Mon, 1 Mar 1999 23:11:30 -0600


Villy Kruse wrote in message
<7b5p72$ui0$[EMAIL PROTECTED]>...
>In article <C6tB2.2875$[EMAIL PROTECTED]>,
>Oscar Stiffelman <[EMAIL PROTECTED]> wrote:
>>Hi,
>>
>>I built a ramdisk root partition for redhat 5.2, but it seems to crash as
>>soon as the kernel jumps to the ramdisk.
>>The last message I see is:
>>    VFS: Mounted root (ext2 fileseystem).
>>
>>I built the ramdisk according to the instructions in docs/bootdisks
>>(followed it precisely)
>>
>>I then unmounted /mnt and copied the contents of /dev/ram to a file with a
>>dd if=/dev/ram of=rootfs bs=1k
>>It said there was a read/write error at this step.  Not sure what caused
the
>>error.


I can make 4Meg RamDisk images; anything larger, and I get the same type of
problem where the system hangs at boot.




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

From: [EMAIL PROTECTED] (Christopher Thompson)
Subject: Re: How to understand Kernel Source code
Date: 2 Mar 1999 01:24:32 GMT

Dan Williams ([EMAIL PROTECTED]) wrote:
: I want to be able to understand the kernel source code.  I have an
: intermediate background in C++, Perl, and Java.  Are there any books or
: online references that can get me started with the advanced C code of the
: kernel.

The textbook that we use is called Linux Kernel Internals (Second Edition)
published by Addison-Wesley.  It's more a sort of general overview of
the kernel but probably gives you more than enough to get started.

--

                   -=Christopher Thompson=-
CMPUT 201 (C/C++) TA and general PITA to my students
All email is spam-filtered:  http://www.internz.com/SpamBeGone/

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

From: [EMAIL PROTECTED] (Christopher Thompson)
Subject: Re: Version 2.2.2 loses IP Masquerading ?
Date: 2 Mar 1999 01:25:38 GMT

Replaced with ip-chaining, I think.

Zefram Cochrane ([EMAIL PROTECTED]) wrote:
: Just upped my kernel from 2.0.36 -> 2.2.2. The five or six IP masquerading
: modules loaded OK.
: However, my various commands for configuring ip forwarding (ipfwadm -F ...)
: are failing with some "unknown device" error. ON investigating, I found that
: /proc/net/ip_forward et al are missing.

: Have these files been replaced by another, or is there some other
: reason for their disappearance ?

: Richard [in PE12]



--

                   -=Christopher Thompson=-
CMPUT 201 (C/C++) TA and general PITA to my students
All email is spam-filtered:  http://www.internz.com/SpamBeGone/

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

From: Bryan Hackney <[EMAIL PROTECTED]>
Subject: Re: Linux Virtual Memory trick
Date: Tue, 02 Mar 1999 06:15:13 +0000
Reply-To: [EMAIL PROTECTED]



This is a little strange, but I won't question your motives.

You'll need a very simple driver that implements mmap(). On every
nopage(), just return the same phys_addr.

I think this should work, but no guarantees.



[EMAIL PROTECTED] wrote:
> 
> Is there a way to map two virtual memory addresses to the same physical
> memory under linux?  I'd like to make it so two consequtive pages actually
> write to the same memory locations...  Anyone know how I might accomplish
> this?  I'm assuming it would have to do with using mmap, but how to I get a
> fd that points to an existing memory location?
> 
> Brett
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

-- 
Bryan Hackney / BHC / bhackneyatexpress-news.net
*

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

From: "Robert B. Hamilton" <[EMAIL PROTECTED]>
Subject: Re: SMP Support
Date: Tue, 2 Mar 1999 00:00:56 -0600



> and i found that make -j 3 shaved about 1/3 of the time of compiles on
> my uniprocessor.  go figure.

Best time on my UP for a kernel compile is "make -j4".  
I always figured it was because of fast cpu + slow disk,
though there are probably other factors as well....




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

From: Yiu Fan Samuel Yau <[EMAIL PROTECTED]>
Subject: OSS developer
Date: Tue, 02 Mar 1999 07:04:05 GMT

hi, i am a high school student and currently working on open source
software project which needs to contact and retrieve infromation from
some open source software developers.  So, if any one is able to provide
some background information and nature of their work on OSS project or
similar, i really appreicate it.  Please e-mail me at [EMAIL PROTECTED]

Samuel Yau
Ontario, Canada
[EMAIL PROTECTED]


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

Subject: Re: SMP Support
From: [EMAIL PROTECTED] (Adam P. Jenkins)
Date: 02 Mar 1999 02:59:40 -0500

d s f o x @ c o g s c i . u c s d . e d u (David Fox) writes:
> [EMAIL PROTECTED] (Adam P. Jenkins) writes:
> 
> > as the disk.  On a two processor system I found that running make -j 2
> > nearly halved kernel compile-time, but increasing it beyond that
> > didn't help at all.
> 
> How much did it hurt it?

Unfortunately I don't have access to that machine anymore because I
don't work there anymore.  Anyone with a dual-processor Pentium want
to try it and let us know the results?  That is, try compiling your
kernel with "make -j 2", and then try it with some other numbers
higher than 2 to see how the compile times compare.  I do seem to
remember that "make -j 2 dep zImage modules" took about 2 1/2 minutes
to compile.  Or maybe it was just "make -j 2 zImage modules".  That
was with dual PII 200s and 256 megs RAM.

-- 
Adam P. Jenkins 
[EMAIL PROTECTED]

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

Subject: Re: SMP Support
From: [EMAIL PROTECTED] (Adam P. Jenkins)
Date: 02 Mar 1999 03:02:20 -0500

Johan Kullstam <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] (Adam P. Jenkins) writes:
> 
> > There is no point in running more parallel make processes than the
> > number of processors you have, so unless you really have 8 processors,
> > you'd actually be better off running less.  It actually slows things
> > down to have so many processes contending for access to resources such
> > as the disk.  On a two processor system I found that running make -j 2
> > nearly halved kernel compile-time, but increasing it beyond that
> > didn't help at all.
> 
> and i found that make -j 3 shaved about 1/3 of the time of compiles on
> my uniprocessor.  go figure.

I suppose it depends on how your disk performs.  If your disk I/O is
really slow, then maybe it really helps if one process can be
compiling while another is writing to disk, whereas if your disk I/O
were really fast then this wouldn't make as much of a difference.
Just guessing though....

-- 
Adam P. Jenkins 
[EMAIL PROTECTED]

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

From: "Quiney, Philip (EXCHANGE:HAL02:HM10)" <[EMAIL PROTECTED]>
Subject: Re: How to understand Kernel Source code
Date: Tue, 02 Mar 1999 08:00:10 +0000

Christopher Thompson wrote:
> 
> Dan Williams ([EMAIL PROTECTED]) wrote:
> : I want to be able to understand the kernel source code.  I have an
> : intermediate background in C++, Perl, and Java.  Are there any books or
> : online references that can get me started with the advanced C code of the
> : kernel.
> 
> The textbook that we use is called Linux Kernel Internals (Second Edition)
> published by Addison-Wesley.  It's more a sort of general overview of
> the kernel but probably gives you more than enough to get started.
> 

Also try the Linux Source Navigator at
http://metalab.unc.edu/linux-source/

Regards

Phil Q

-- 

Phil Quiney                             Digital PowerLine,
[EMAIL PROTECTED]              Nortel Networks,
Telephone: +44 (1279) 402363            London Rd, Harlow,
Fax:       +44 (1279) 402885            Essex CM17 9NA,
                                        United Kingdom.

"This message may contain information proprietary to Northern 
Telecom so any unauthorised disclosure, copying or distribution
of its contents is strictly prohibited."

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


** 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 (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

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