Linux-Development-Sys Digest #393, Volume #8      Sat, 6 Jan 01 05:13:16 EST

Contents:
  Re: Kernel 2.4 (ratz)
  Re: getpwuid() (Jerry Peters)
  Re: Kernel Non-boot (Jerry Peters)
  Re: Kernel Non-boot ("mpierce")
  task switch trick? (lavender)
  Re: Extending /proc filesystem on Solaris 7/8? (Kaelin Colclasure)
  Modular Netfilter FTP protocol support in 2.4.0 broken. (Clifford Kite)
  Kernel2.4.0 - Unusual panic ("mpierce")
  Re: task switch trick? (Andi Kleen)
  Re: task switch trick? (lavender)
  Re: Kernel2.4.0 - Unusual panic (Nic)
  Re: ioperm() (Matan Ziv-Av)

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

From: ratz <[EMAIL PROTECTED]>
Subject: Re: Kernel 2.4
Date: Fri, 05 Jan 2001 13:01:37 +0100

This is a multi-part message in MIME format.
==============7B7A04E9012ECD4DB3C4A797
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 7bit

Hi David,

David Findlay wrote:
> 
> I just loaded Kernel 2.4. I thought I'd share these observations:

Good, hope you enjoy it.
 
> - loaded very nicely
> - system seems faster on boot and multitasking

Send money to Rik van Riel for his vm contribution ;)

> - grub doesn't like it - it produces CRC errors, so you need to use LILO
> - NVdriver can't be insmod'ed.

Try the attached patch.
 
> Has anyone got NVdriver to go, with any patching? Anyone interested in
> reverse engineering a open source Nvidia 3D driver?

Why, if it's open source you don't need to reverse engineer. ???

> David

Best regards,
Roberto Nibali, ratz

-- 
mailto: `echo [EMAIL PROTECTED] | sed 's/[NOSPAM]//g'`
==============7B7A04E9012ECD4DB3C4A797
Content-Type: text/plain; charset=iso-8859-15;
 name="patch-2.4.0-PR"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-2.4.0-PR"

diff -ruN NVIDIA_kernel-0.9-5/nv.c nvdriver/nv.c
--- NVIDIA_kernel-0.9-5/nv.c    Sat Aug 26 02:48:38 2000
+++ nvdriver/nv.c       Tue Jan  2 13:43:13 2001
@@ -49,6 +49,13 @@
 #include <linux/modversions.h>
 #endif
 
+#ifndef mem_map_dec_count
+  #define mem_map_dec_count(p) atomic_dec(&((p)->count));
+#endif
+#ifndef mem_map_inc_count
+  #define mem_map_inc_count(p) atomic_inc(&((p)->count));
+#endif
+
 #include <nv.h>                                // needs to precede other headers (SMP)
 
 #include <linux/stddef.h>
@@ -778,17 +785,6 @@
 }
 
 
-void nv_vma_release(struct vm_area_struct *vma)
-{
-    nv_state_t *nv;
-
-    nv = &nv_devices[NV_DEVICE_NUMBER(LINUX_VMA_DEV(vma))];
-    NV_DMSG(nv, "vma_release [0x%lx-0x%lx]", vma->vm_start, vma->vm_end);
-
-    MOD_DEC_USE_COUNT;
-}
-
-
 // assumes we are destroying entire map
 void nv_vma_unmap(
     struct vm_area_struct *vma,
@@ -833,6 +829,21 @@
     }
 }
 
+
+void nv_vma_release(struct vm_area_struct *vma)
+{
+    nv_state_t *nv;
+
+    nv = &nv_devices[NV_DEVICE_NUMBER(LINUX_VMA_DEV(vma))];
+    NV_DMSG(nv, "vma_release [0x%lx-0x%lx]", vma->vm_start, vma->vm_end);
+
+    /*  2.4.0 PR fix/hack  */
+    nv_vma_unmap(vma, vma->vm_start, vma->vm_end - vma->vm_start);
+
+    MOD_DEC_USE_COUNT;
+}
+
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
 struct vm_operations_struct nv_vm_ops = {
     nv_vma_open,
@@ -850,7 +861,8 @@
 struct vm_operations_struct nv_vm_ops = {
     open:     nv_vma_open,
     close:    nv_vma_release,
-    unmap:    nv_vma_unmap,  
+/*  2.4.0 PR hack/fix       */
+/*  unmap:    nv_vma_unmap, */
 };
 #endif
 
diff -ruN NVIDIA_kernel-0.9-5/nv.h nvdriver/nv.h
--- NVIDIA_kernel-0.9-5/nv.h    Sat Aug 26 02:48:38 2000
+++ nvdriver/nv.h       Tue Jan  2 13:43:41 2001
@@ -128,7 +128,7 @@
   #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
     #define KERNEL_2_2
   #else
-    #warning This driver is not officially supported on post-2.2 kernels
+/*  #warning This driver is not officially supported on post-2.2 kernels */
     #define KERNEL_2_3
   #endif  // < 2.3
 #endif  // < 2.2
diff -ruN NVIDIA_kernel-0.9-5/os-interface.c nvdriver/os-interface.c
--- NVIDIA_kernel-0.9-5/os-interface.c  Fri Sep  1 04:19:17 2000
+++ nvdriver/os-interface.c     Tue Jan  2 13:41:14 2001
@@ -1331,6 +1331,11 @@
     char *parmp;
     char ch;
 
+    spinlock_t unload_lock = SPIN_LOCK_UNLOCKED;
+    struct module *mp = THIS_MODULE;
+    struct module_symbol *sym;
+    int i;
+
     if ((strlen(regParmStr) + NV_SYM_PREFIX_LENGTH) > NV_MAX_SYM_NAME)
         goto done;
 
@@ -1351,11 +1356,18 @@
 
     *symp = '\0';
 
-    symbol_value = get_module_symbol(NV_MODULE_NAME, symbol_name);
-    
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
-    put_module_symbol(symbol_value);
-#endif
+    spin_lock(&unload_lock);
+    if (MOD_CAN_QUERY(mp) && (mp->nsyms > 0)) {
+        for (i = mp->nsyms, sym = mp->syms;
+             i > 0; --i, ++sym) {
+
+            if (strcmp(sym->name, symbol_name) == 0) {
+                symbol_value = sym->value;
+                break;
+            }
+        }
+    }
+    spin_unlock(&unload_lock);
 
  done:
     return (void *) symbol_value;

==============7B7A04E9012ECD4DB3C4A797==


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

From: Jerry Peters <[EMAIL PROTECTED]>
Subject: Re: getpwuid()
Date: Fri, 05 Jan 2001 23:38:41 GMT

mike harris <[EMAIL PROTECTED]> wrote:
> i know it cant read the usename.
> but, the passwd file has one entry:  "root::0:0:root:/:/bin/bash"
> i have wtmp and utmp files.
> i have hosts, host.conf, ld.so.conf,  nsswitch.conf,  pwdb.conf, AND i've properly
> configured pam.

> no password has been set for root...
> is this a possible problem?

> i know getpwuid() is getting passed an 0
> as it should be for the superuser....

> anybody? please?

Do you have /etc/shadow? IIRC RH uses shadow passwords.

        Jerry


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

From: Jerry Peters <[EMAIL PROTECTED]>
Subject: Re: Kernel Non-boot
Date: Fri, 05 Jan 2001 23:42:08 GMT

mpierce <[EMAIL PROTECTED]> wrote:
> Mandrake 7.2, kernel 2.2.17-21

> Compiled new kernel-2.4.0-test12
> Compiled & install modules - no runs, no drips, no errors.
> Mv bzImage to vmlinuz-2.4.0-test12 to make a boot disk
> Kernel size is in the middle of two kernels that boot (cannot use
> vmlinuz-2.4.0-0.31mdk as I cannot get PCMCIA module to work)
> -rw-r--r--    1 root     root       665029 Oct  5 22:24 vmlinuz-2.2.17-21mdk
> -rw-r--r--    1 root     root       768494 Oct 10 21:56 vmlinuz-2.4.0-0.31mdk
> -rw-r--r--    1 root     root       702409 Jan  5 01:01 vmlinuz-2.4.0-test12

> When I try to boot vmlinuz-2.4.0-test12, it starts as normal and then...
>       Uncompressing linux ... OK, booting the kernel
> System freezes at this point.
> I've rebuilt it and tried everything w/o success.
> Can anyone help?
> Marvin

What type of cpu does your system have? What type is the new kernel
configured for? If you have it configured for a "higher" processor
type than you have, this is about where it would hang.

        Jerry

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

From: "mpierce" <[EMAIL PROTECTED]>
Subject: Re: Kernel Non-boot
Date: Sat, 06 Jan 2001 00:54:34 GMT

I have a 400Mhz Pentium II.
I'll get the new 2.4.0 kernel and also check CPU setting in xconfig.
Marvin


In article <kZs56.19987$[EMAIL PROTECTED]>,
"Jerry Peters" <[EMAIL PROTECTED]> wrote:

> mpierce <[EMAIL PROTECTED]> wrote:
>> Mandrake 7.2, kernel 2.2.17-21
> 
>> Compiled new kernel-2.4.0-test12 Compiled & install modules - no runs,
>> no drips, no errors. Mv bzImage to vmlinuz-2.4.0-test12 to make a boot
>> disk Kernel size is in the middle of two kernels that boot (cannot use
>> vmlinuz-2.4.0-0.31mdk as I cannot get PCMCIA module to work)
>> -rw-r--r--    1 root     root       665029 Oct  5 22:24
>> vmlinuz-2.2.17-21mdk
>> -rw-r--r--    1 root     root       768494 Oct 10 21:56
>> vmlinuz-2.4.0-0.31mdk
>> -rw-r--r--    1 root     root       702409 Jan  5 01:01
>> vmlinuz-2.4.0-test12
> 
>> When I try to boot vmlinuz-2.4.0-test12, it starts as normal and
>> then...
>>      Uncompressing linux ... OK, booting the kernel
>> System freezes at this point. I've rebuilt it and tried everything w/o
>> success. Can anyone help? Marvin
> 
> What type of cpu does your system have? What type is the new kernel
> configured for? If you have it configured for a "higher" processor type
> than you have, this is about where it would hang.
> 
>       Jerry

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

From: lavender <[EMAIL PROTECTED]>
Subject: task switch trick?
Date: Sat, 06 Jan 2001 10:34:45 +0800

�o�O MIME �榡���h���q�l��C
==============52EB40016441D2842167E55C
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: 7bit

hello:
when I am in __switch_to() function, I have some trouble
in the old time, we use ltr to dispatch new task
then in 2.2, we step-by-step to dispatch it
but in 2.4.0-test12, the way to reload esp0... in source looks like this

I don't know why it's possible to reload all of them...
we just changed esp0 pointer in TSS....
but in intel manual, it doesn't say that change TSS will cause
esp0,ldt,pbdr to be changed....
can someone help me?
thanks a lot...:)

        /*
         * Reload esp0, LDT and the page table pointer:
         */
        tss->esp0 = next->esp0;


==============52EB40016441D2842167E55C
Content-Type: text/x-vcard; charset=big5;
 name="lavender.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for lavender
Content-Disposition: attachment;
 filename="lavender.vcf"

begin:vcard 
n:Wu;lavender
x-mozilla-html:FALSE
org:embsol;
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
title:software engineer
x-mozilla-cpt:;0
fn:lavender Wu
end:vcard

==============52EB40016441D2842167E55C==


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

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.solaris
Subject: Re: Extending /proc filesystem on Solaris 7/8?
Date: 05 Jan 2001 18:40:39 -0800

[EMAIL PROTECTED] (Casper H.S. Dik - Network Security Engineer) writes:

> Kaelin Colclasure <[EMAIL PROTECTED]> writes:
> 
> >I've developed a kernel module under Linux that I'd like to port to Solaris.
> >Unfortunately, it looks like Solaris' /proc filesystem is not extensible
> >the way Linux's is... At least, I could find no mention of how to extend
> >it in Sun's "Writing Device Drivers" book for Solaris 8.
> 
> The Solaris /proc filesystem is not a dumping ground for non-process
> related information.
> 
> Is your kernel module adding information to each process?
> 
> If not, the information has no business in /proc.

Ah, I see. Well, for better or for worse, the /proc filesystem on Linux
*is* a bit of "a dumping ground". :-)

> >Is there another place I should be looking? I unfortunately don't (yet)
> >have the Solaris 8 source code.
> 
> What do you need to do with your presumed /proc entry?

My module creates the following tree of /proc entries on Linux:

* New /proc file entries:
  - /proc/tnf    root of OpenTNF's proc filesystem entries
  -  +/status    cat for status of kernel subsystem [incomplete]
  -  +/trace     write interface to kernel subsystem [incomplete]
  -  +/0         trace data directories (0 .. TNF_MAXTRACES)
  -    +/cpu0    trace event buffer(s) (one for each CPU)
  -    +/probes  buffers all probes registered during trace

My decision to use /proc vs. /dev on Linux was largely driven by my desire
that the module be self-configuring when dynamically loaded. E.g. you
load the kernel module and the /proc/tnf tree springs into existance,
configured exactly to match the module's compile-time configuration. And
when you unload the module from the Linux kernel, the /proc entries go
away leaving no dangling special file entries in the host file system.

There was also the factor that the /dev directory is (traditionally) a
flat namespace, while the entries I need to place in the file system
have a natural hierarchy. E.g. each trace resource requires 1 + ncpus
filesystem entries.

I believe that the new devfs work ongoing in the latest Linux kernels
may address the former point. I'm not sure about the latter... I'm
crossposting this article to c.o.l.d.s so maybe someone will enlighten
me. But for the moment it's a moot point since I need to work with
2.2.x kernels...

I take it, Casper, that your recommendation would be to stick with the
traditional /dev entries on Solaris? Forgive my ignorance -- I just got
my Solaris reference material from Fatbrain yesterday -- but is there
a way to dynamically create /dev entries at module load time on Solaris?
Short of augmenting the load process with a script?

-- Kaelin

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

From: Clifford Kite <[EMAIL PROTECTED]>
Subject: Modular Netfilter FTP protocol support in 2.4.0 broken.
Date: Fri, 5 Jan 2001 22:09:09 -0600

Configuring modular FTP protocol support in Networking options -> IP:
Netfilter Configuration (with "make menuconfig) resulted in the failure
described below.

Doing "make modules," generated many stderr assembler warning messages
of the form

{standard input}:8: Warning: Ignoring changed section attributes for .modinfo

on stderr - probably not significant - but then:

ip_nat_ftp.c: In function `help':
ip_nat_ftp.c:315: structure has no member named `nat'
{standard input}: Assembler messages:
{standard input}:8: Warning: Ignoring changed section attributes for .modinfo
make[2]: *** [ip_nat_ftp.o] Error 1
make[1]: *** [_modsubdir_ipv4/netfilter] Error 2
make: *** [_mod_net] Error 2

-- 
Clifford Kite <kite@inet%port.com>                  Not a guru. (tm)
/* For every credibility gap, there is a gullibility fill.
                -- R. Clopton */

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

From: "mpierce" <[EMAIL PROTECTED]>
Subject: Kernel2.4.0 - Unusual panic
Date: Sat, 06 Jan 2001 05:12:46 GMT

System is LM7.2 - fresh install; kernel 2.2.17-21mdk
Downloaded and compiled new 2.4.0 release w/o any runs, drips or errors.
Have not had any luck getting a 2.4.0 to boot on my Mandrake system and
need this kernel for USB.

Unusual kernel panic problem:
        request_module[block-major -3] root fs not mounted
        VFS: Cannot open root device "hda1" or 03:01
        Please append a correct "root=" boot option
        Kernel panic: VFS: Unable to mount root fs on 03:01
                - Computer freezes at this point -

I tried using both grub and lilo. My lilo.conf setup is:

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
vga=normal
default=linux
keytable=/boot/us.klt
lba32
prompt
timeout=300
message=/boot/message
menu-scheme=wb:bw:wb:bw
image=/boot/vmlinuz
    label=linux
    root=/dev/hda1
    append=" ide1=autotune ide0=autotune"
    vga=788
    read-only
image=/boot/bzImage
    label=linux-new
    root=/dev/hda1
    #append=" ide1=autotune ide0=autotune"
    #vga=788
    read-only
image=/boot/vmlinuz
    label=linux-nonfb
    root=/dev/hda1
    append=" ide1=autotune ide0=autotune"
    read-only
image=/boot/vmlinuz
    label=failsafe
    root=/dev/hda1
    append=" ide1=autotune ide0=autotune failsafe"
    read-only
other=/dev/fd0
    label=floppy
    unsafe
 
My grub setup is:
timeout 10
color black/cyan yellow/cyan
i18n (hd0,0)/boot/grub/messages
keytable (hd0,0)/boot/us.klt
altconfigfile (hd0,0)/boot/grub/menu.once
default 0
 
title linux
kernel (hd0,0)/boot/vmlinuz root=/dev/hda1  ide1=autotune ide0=autotune vga=788
 
title linux-2.4.0
kernel (hd0,0)/boot/bzImage root=/dev/hda1
 
title linux-nonfb
kernel (hd0,0)/boot/vmlinuz root=/dev/hda1  ide1=autotune ide0=autotune
 
title failsafe
kernel (hd0,0)/boot/vmlinuz root=/dev/hda1  ide1=autotune ide0=autotune failsafe 
title floppy
root (fd0)
chainloader +1 

Does anyone have a clue as to why 2.4.0 refuses to boot on a newly
installed Mandrake 7.2 with the kernel panic error?

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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: task switch trick?
Date: 06 Jan 2001 06:19:08 +0100

lavender <[EMAIL PROTECTED]> writes:

> I don't know why it's possible to reload all of them...
> we just changed esp0 pointer in TSS....
> but in intel manual, it doesn't say that change TSS will cause
> esp0,ldt,pbdr to be changed....

esp0,ldt,etc. do only exist in the TSS, so a ltr implicitely
changes them.
With a single TSS/CPU like Linux 2.2+ is using they need to be rewriten
though.


-Andi 

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

From: lavender <[EMAIL PROTECTED]>
Subject: Re: task switch trick?
Date: Sat, 06 Jan 2001 16:00:17 +0800

�o�O MIME �榡���h���q�l��C
==============F900DB98D0710F60DB344FE5
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: 8bit

Andi Kleen �g�D�G

> lavender <[EMAIL PROTECTED]> writes:
>
> > I don't know why it's possible to reload all of them...
> > we just changed esp0 pointer in TSS....
> > but in intel manual, it doesn't say that change TSS will cause
> > esp0,ldt,pbdr to be changed....
>
> esp0,ldt,etc. do only exist in the TSS, so a ltr implicitely
> changes them.

but in 2.4.0, it doesn't use ltr to do context switch....the comment told
me that...

>
> With a single TSS/CPU like Linux 2.2+ is using they need to be rewriten
> though.
>
> -Andi

sorry for it, but I still can't understand why ...:~~
yes, we have one TSS for every CPU all the time
in the meantime, we have one TSS for all processes running
now(pseudo-concurrent in UP)
TR points to the TSS now it's running
the only one time we load TR directly is in cpu_init()...I find no place
else...

but the question is here-- HOW to context switch?
in __switch_to() function, the only code about changing PBDR, LDT is
include in one COMMNET line...
and all action I can see under this comment is changing to new process's
kernel stack esp0...

of course, changing kernel stack meaning context switch
but PBDR,LDTR...are not changed (manually)...
if they did, where were they changed??
or changing kernel stack will cause processor to do these change?
or any other trick inside __switch_to()??

sorry for my bothering....

--lavender

==============F900DB98D0710F60DB344FE5
Content-Type: text/x-vcard; charset=big5;
 name="lavender.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for lavender
Content-Disposition: attachment;
 filename="lavender.vcf"

begin:vcard 
n:Wu;lavender
x-mozilla-html:FALSE
org:embsol;
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
title:software engineer
x-mozilla-cpt:;0
fn:lavender Wu
end:vcard

==============F900DB98D0710F60DB344FE5==


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

From: Nic <[EMAIL PROTECTED]>
Subject: Re: Kernel2.4.0 - Unusual panic
Date: Sat, 06 Jan 2001 22:05:59 +1300

mpierce wrote:
> 
> System is LM7.2 - fresh install; kernel 2.2.17-21mdk
> Downloaded and compiled new 2.4.0 release w/o any runs, drips or errors.
> Have not had any luck getting a 2.4.0 to boot on my Mandrake system and
> need this kernel for USB.
> 
> Unusual kernel panic problem:
>         request_module[block-major -3] root fs not mounted
>         VFS: Cannot open root device "hda1" or 03:01

Make sure whatever you're using for a root filesystem (ext2, reiser,
whatever) is compiled into the kernel, not as a module, or the
chicken-and-egg rule applies.

Regards,
        Nic.

-- 
Nic Bellamy's non-official mailbox: < sky at wibble dot net >
IT Consultant, Asterisk Limited - http://www.asterisk.co.nz/

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

From: [EMAIL PROTECTED] (Matan Ziv-Av)
Subject: Re: ioperm()
Reply-To: [EMAIL PROTECTED]
Date: Sat, 06 Jan 2001 09:54:12 GMT

> >     [EMAIL PROTECTED] writes:

> >> I'm trying to develop a little program to manage the serial port and a
> >> digital I/O module but I get a SIGSEGV error message. The I/O module is
> >> located at the addresses 200H-203H, and the code of the program is:
> >> 
> >>    #include <sys/io.h>
> >> 
> >>    main(){
> >>            int i = ioperm(0x200,4,1);
> >>            outb(0x202,0x36);
> >>    }
> >> 
> >> Could anybody tell me what is happening? Thanks in advance.


> Jonathan Buzzard <[EMAIL PROTECTED]> wrote:
> >Why on earth are you using ioperm and direct port access? Take a look


Kaz Kylheku <[EMAIL PROTECTED]> wrote:
 
> Why, to ensure that the code only runs on an Intel PC with a 16550A
> UART, of course, and that when it does run, it requires root privs!
> Silly question.  ;)


If you tried to read the question and be helpful, instead of trying to 
seem so smart, you'd notice that 0x200 is no way the Serial port address. 
I guess that the I/O module is an additional expansion card that is addressed
at address 0x200-0x203. In that case you must access the hardware directly 
(or write a kernel drive to do it for you). ioperm and outb work on many 
platforms not on x86, so that is not an issue as well.

The problem with the original program is that the parameters to outb are in 
reversed order, so the program should probably read outb(0x36, 0x202);


-- 
Matan Ziv-Av.                         [EMAIL PROTECTED]

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


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