Linux-Development-Sys Digest #456, Volume #8 Wed, 31 Jan 01 16:13:15 EST
Contents:
Writing to rhe right PCI address? ([EMAIL PROTECTED])
Writing to correct PCI address? ([EMAIL PROTECTED])
Re: Writing to rhe right PCI address? (Kasper Dupont)
Re: 2.4.1pre and 2.4.0ac problem: __buggy_fxsr_alignment undefined (J�rgen Koslowski)
Re: The value of HZ ("Norm Dresner")
Re: PCI access from and app, ioremap (David Florez)
Re: The value of HZ (Kasper Dupont)
Suggestions for basic but very fast MP math machine... (Michael Hopkins)
problems with dlopen ("Aris Basic")
Re: can Linux be secure? ([EMAIL PROTECTED])
Re: can Linux be secure? (Toby Haynes)
Re: can Linux be secure? (Erik de Castro Lopo)
Semaphore use with C++ Linux driver code ("Ahmed, Suhail")
how to increase shared memory (Sudhakar Mani)
Re: how to increase shared memory (Sudhakar Mani)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED]
Subject: Writing to rhe right PCI address?
Date: Wed, 31 Jan 2001 11:44:51 GMT
Hi,
I need to develop a driver for a certain PCI card on a AMD K7 system.
lspci and setpci tell me that this card has two regions (0xd400,
0xd000).
The card has 4 registers, one following after another.
So I start writing to them (out of a kernel module - 2.2.17):
outb_p (0xd400, 0x12);
outb_p (0xd400, 0x34);
outb_p (0xd400, 0x56);
outb_p (0xd400, 0x78);
This has o effect at all. Nothing happens.
Am I writing to the right address? Is there some address-mapping which
I've missed? The card does not react at all although it should...
Thanks,
Stefan
Sent via Deja.com
http://www.deja.com/
------------------------------
From: [EMAIL PROTECTED]
Subject: Writing to correct PCI address?
Date: Wed, 31 Jan 2001 11:36:07 GMT
Hi,
I have severe problems writing a byte to a
register on a certain PCI card plugged into a AMD
K7 System
What I did:
I used "lspci" and "setpci" to find out Regions.
It returned me two Regions (0xd400, 0xd000).
I assume that theses are the addresses, where my
registers on the card are (There should be 4
registers following one after another).
So I started writing
outb_p (0xd400, 0x12);
outb_p (0xd401, 0x34);
outb_p (0xd402, 0x56);
outb_p (0xd403, 0x78);
This did not work as expected - even worse:
nothing happened...
Have I missed a memory mapping or some other
trick?
Thanks, Stefan
Sent via Deja.com
http://www.deja.com/
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Writing to rhe right PCI address?
Date: Wed, 31 Jan 2001 14:08:17 +0100
[EMAIL PROTECTED] wrote:
>
> Hi,
> I need to develop a driver for a certain PCI card on a AMD K7 system.
> lspci and setpci tell me that this card has two regions (0xd400,
> 0xd000).
> The card has 4 registers, one following after another.
>
> So I start writing to them (out of a kernel module - 2.2.17):
> outb_p (0xd400, 0x12);
> outb_p (0xd400, 0x34);
> outb_p (0xd400, 0x56);
> outb_p (0xd400, 0x78);
>
> This has o effect at all. Nothing happens.
> Am I writing to the right address? Is there some address-mapping which
> I've missed? The card does not react at all although it should...
>
> Thanks,
> Stefan
>
> Sent via Deja.com
> http://www.deja.com/
You have written the arguments to outb_p in
the wrong order. The correct code would be:
outb_p (0x12,0xd400);
outb_p (0x34,0xd400);
outb_p (0x56,0xd400);
outb_p (0x78,0xd400);
I think everybody experimenting with port
I/O have made that mistake.
--
Kasper Dupont
------------------------------
From: [EMAIL PROTECTED] (J�rgen Koslowski)
Subject: Re: 2.4.1pre and 2.4.0ac problem: __buggy_fxsr_alignment undefined
Date: 31 Jan 2001 13:51:11 GMT
Kasper Dupont ([EMAIL PROTECTED]) wrote:
: It sounds like something similar to the get_user and
: put_user macros.
: The get_user and put_user macros can only be called
: with elements of size 1, 2 or 4. In the macro there
: is a switch on sizeof applied to the argument. In
: the default case there is a reference to a
: nonexisting function. This reference is removed by
: the optimizer. This means that if you don't optimize
: or if there are invalid calls to the macro, the
: program cannot link.
: Search through the header files for the string
: __buggy_fxsr_alignment. If you don't find it it is
: probably made up by the ## preprocessor concatenate
: directive, then search for the words buggy, fxsr
: and alignment.
Well, so far I haven't found these words in any header files
besides linux/include/asm-i386/bugs.h. The relvant bits seem to be
* Pentium III FXSR, SSE support
* Gareth Hughes <[EMAIL PROTECTED]>, May 2000
and
/* Enable FXSR and company _before_ testing for FP problems. */
/*
* Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
*/
if (offsetof(struct task_struct, thread.i387.fxsave) & 15) {
extern void __buggy_fxsr_alignment(void);
__buggy_fxsr_alignment();
}
I have an ordinary old pentium 133 (pentium classic?) and I suspect
that this bit of code is built into the kernel before checking the
processor properly. Just strange that nobody else seems to see this
problem.
-- J�rgen
--
J�rgen Koslowski If I don't see you no more on this world
ITI, TU Braunschweig I'll meet you on the next one
[EMAIL PROTECTED] and don't be late!
http://www.iti.cs.tu-bs.de/~koslowj Jimi Hendrix (Voodoo Child, SR)
------------------------------
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: The value of HZ
Date: Wed, 31 Jan 2001 14:34:19 GMT
If you need finer resolution for event and task timing, consider using
Real-Time Linux which gives you "microsecond resolution" on timing.
http://www.rtlinux.org
Norm
Bharath Kumar K <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> The optimal value of HZ is found to be 1024 for alpha and 100 for x86.
> Too fast a clock would give a jerky response. Too slow would result in
> degradation of perf. Do not try to change the value of HZ ( You have to
> rebuild the kernel to bring the new value into effect.) - This has
> serious bearing on the working of the kernel.
>
> If interested in knowing more, grab a copy of "Linux Device drivers" by
> Alessandro Rubini.
------------------------------
From: David Florez <[EMAIL PROTECTED]>
Subject: Re: PCI access from and app, ioremap
Date: Wed, 31 Jan 2001 09:23:48 +0100
You can't use ioremap() from a user application. What you need is to
build a module (device driver). See these answer from a previous thread
named: PCI bus access.
David Florez.
In article <955ggk$7fa$[EMAIL PROTECTED]>, bjrosen wrote:
>Is there anyway to do this without a driver?
Not really.
>I'm trying to do the same
>thing for a hardware development diagnostic and I haven't been able to
>figure out which #includes and #defines are required to make ioremap
>work. I'm looking for the simplest way to get at PCI memory space.
Write a driver module. If all you want to do is implement
mmap() to allow user programs access to PCI memory space, it's
really pretty simple. The link below points to an example of
such a driver (I wrote it to enable user-mode diagnostic
programs to access a PCI prototype I was debugging).
ftp://ftp.visi.com/users/grante/stuff/demomm.tar.gz
Change the vendor/device IDs, tweak on the size of mapped
regions if they're not 4K, and Bob's your uncle.
--
Grant Edwards grante Yow! Now that I have
my
at "APPLE," I comprehend
COST
visi.com ACCOUNTING!!
bjrosen wrote:
>
> I need to access PCI memory space from a diagnostic application. Can I
> use ioremap from an application? and if so what are the required
> #includes and #defines? I've tried
>
> #include <linux/vmalloc.h>
>
> and that gave me a bunch of errors. I've also tried
>
> #define __KERNEL__
> #include <asm/io.h>
>
> and that was worse.
>
> Sent via Deja.com
> http://www.deja.com/
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: The value of HZ
Date: Wed, 31 Jan 2001 15:56:45 +0100
Bharath Kumar K wrote:
>
> The optimal value of HZ is found to be 1024 for alpha and 100 for x86.
> Too fast a clock would give a jerky response. Too slow would result in
> degradation of perf. Do not try to change the value of HZ ( You have to
> rebuild the kernel to bring the new value into effect.) - This has
> serious bearing on the working of the kernel.
>
> If interested in knowing more, grab a copy of "Linux Device drivers" by
> Alessandro Rubini.
The optimal valye of HZ depends very much on
what you want to do with the computer.
Faster timers vaste some of the CPU resources
but will share the rest better between
processes.
The optimal would be not to use an interval
timer at all. The optimal would be to have
hardware that can do two things: Meassure
time in some very small unit, eg. clockcycles.
And send an interrupt after a specified
amount of time. Specifying the a new amount
should simply cancel the first.
The rest can easilly be implemented in
software, it's just the matter of implementing
a priority queue of pending events.
Some of the needed hardware is already
available, I don't know if a TSC can be used
to send an interrupt at a given time.
--
Kasper Dupont
------------------------------
Date: Wed, 31 Jan 2001 16:11:14 +0000
From: Michael Hopkins <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.hardware
Subject: Suggestions for basic but very fast MP math machine...
Hi all
I am planning to build a very fast but basic machine that will just run
jobs sent by another UNIX/Linux machine - probably Mac OS X, which is
BSD underneath...
It will need to have a 100 or 1000 Mbit ethernet card, about 64-128Mb
fast RAM and some disk storage for the system & dev tools. I am not
planning to install X or even a video card - this is just for high-speed
maths computation at the moment.
Any suggestions on processors/motherboards? I'm assuming PIII or P4,
Athlon, Alpha or IA64 for processors - I don't know about motherboards
but I want multiple processors (probably), good support for the chosen
hard disk/ethernet card & >>>***EASY SETUP/RELIABILITY***<<<. :o)
How about the system? Red Hat, Debian, Open/FreeBSD, Mandrake, others?
Which kernel version is working RELIABLY & supporting fast ethernet &
multiple processors well?
Thanks in advance for any thoughts/experiences
Mike
P.S. Please CC replies to me.
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/_/_/ _/_/_/ _/_/_/ ACS Consultancy
_/ _/ _/ _/ _/
_/_/_/_/ _/ _/_/_/ Information Sciences for Industry
_/ _/ _/ _/
_/ _/ _/_/_/ _/_/_/ Telephone/Fax: 01732~463519 (UK)
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
`All models are wrong, but some are useful' - George Box
------------------------------
From: "Aris Basic" <[EMAIL PROTECTED]>
Subject: problems with dlopen
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Date: Wed, 31 Jan 2001 16:56:57 GMT
Hi
I have problem with dlopen function on unix (glibc2.1 and glibc2.2)
I used to succesifully load my shared objects with it but
when i changed loading of those moduels to other functions
my programs segfaults and according to gdb it happen in dl_map_object
function when my program calls dlopen.
I see that __init function of my modules gets executed but i have no clue
why it crashes afterwards
and also according to gdb it is the problem in sysdeps/i386/bits/string.h
line 462
what would be strncmp or strchr
has anyone an idea what can i do to fix that
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: can Linux be secure?
Date: Wed, 31 Jan 2001 18:50:18 -0000
On 30 Jan 2001 18:50:02 GMT Juha Laiho <[EMAIL PROTECTED]> wrote:
| Things that might be worth a look:
| - NSA has built some kind of secured Linux system
| - Trustix Secure Linux distribution looks rather nice
I didn't see any kernel changes in it. The biggest problems out there
seem to be all the userland programs, especially the daemons and suid
programs. I know about all that. I'm asking about the kernel, and
so many people are still doing the usenet practice of diverting the
question.
--
=================================================================
| Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/ |
=================================================================
------------------------------
From: Toby Haynes <[EMAIL PROTECTED]>
Subject: Re: can Linux be secure?
Date: 31 Jan 2001 13:39:08 -0500
On Tue, 30 Jan 2001, [EMAIL PROTECTED] wrote:
> On 30 Jan 2001 10:03:14 -0500 Toby Haynes <[EMAIL PROTECTED]> wrote:
>
>| If you are worried about exploits which attain root status and/or fiddle the
>| kernel by trick-loading kernel modules, then I suggest you take a look at
>| LIDS. http://www.lids.org/ details most of what you need to know. As a brief
>| (and incomplete) summary:
> There will be no users on the machine. Local exploits are not an
> issue. I guess I neglected to mention this. Sorry.
But you will have 'users' running services. Even 'nobody' is a user. Or are you
only ever running kernel-level services? Even embedded applications are likely
to have some user-level services.
>| - Harden your system utilities by making them immutable and then removing
>| the ability to remove the immutable flag (stops trojanned utilities). -
>| Lock your log files so they can only be appended to, not editted (stops
>| rootkits covering their tracks) - Harden the kernel so that after the
>| boot sequence completes, no more kernel modules can be inserted to
>| compromise the system.
>|
>| Administration of the system once LIDS is in place is done with the lidsadm
>| tool, which you should keep on a removable medium separate from the server
>| during normal operation. (i.e. stick it on a floppy and only mount it when
>| you need to rotate the logs, for example).
> Well, I guess this is ruled out since the machines will be in remote
> locations requiring most administration be done via remote SSH access.
Shouldn't be a problem. The lidsadm tool is signed to identify itself to the
locked system. You should be able to use it remotely without trouble - I merely
recommended that the lidsadm tool be kept off the secured system to remove any
chance of it being used. Even if it is kept on the base machine it is password
protected. The only time you can use lidsadm without the password is to seal
the system - this is done when you boot the system.
Here's a sample SSH config startup:
/sbin/lidsadm -A -s /usr/sbin/sshd -o /etc/shadow -j READ
/sbin/lidsadm -A -o /usr/local/etc/sshd_config -j DENY
/sbin/lidsadm -A -o /usr/local/etc/ssh_host_key -j DENY
/sbin/lidsadm -A -o /usr/local/etc/ssh_host_dsa_key -j DENY
/sbin/lidsadm -A -s /usr/local/sbin/sshd \
-o /usr/local/etc/sshd_config -j READ
/sbin/lidsadm -A -s /usr/local/sbin/sshd \
-o /usr/local/etc/ssh_host_key -j READ
/sbin/lidsadm -A -s /usr/local/sbin/sshd \
-o /usr/local/etc/ssh_host_dsa_key -j READ
/sbin/lidsadm -A -s /usr/local/sbin/sshd \
-t -o CAP_SETUID -j NO_INHERIT
/sbin/lidsadm -A -s /usr/local/sbin/sshd \
-t -o CAP_SETGID -j NO_INHERIT
/sbin/lidsadm -A -s /usr/local/sbin/sshd \
-t -o CAP_NET_BIND_SERVICE -j NO_INHERIT
/sbin/lidsadm -A -s /usr/local/sbin/sshd \
-o /var/log/wtmp -j WRITE
/sbin/lidsadm -A -s /usr/local/sbin/sshd \
-o /var/log/lastlog -j WRITE
Check the documentation for more details.
>| There are also libraries to harden the stack against buffer overflow
>| attacks, which will make life a lot harder for the average cracker.
> In the kernel?
Buffer overflow attacks in the kernel? What are you running - Ingo's TUX
webserver? I'm not aware of any kernel-level buffer overflow attacks - anyone
care to point at a CERT advisory to prove me wrong?
Anyway, take a look at this:
http://www.bell-labs.com/org/11356/libsafe.html
There are also kernel patches to make the stack non-executable, which should
cut most exploits off at the pass. Of course, if you actually handle buffers
properly and truncate the incoming data at your buffer boundary, buffer
overflow is not possible but they are often subtle and tricky to fully remove..
Cheers,
Toby Haynes
--
Toby Haynes
The views and opinions expressed in this message are my own, and do
not necessarily reflect those of IBM Canada.
------------------------------
From: Erik de Castro Lopo <[EMAIL PROTECTED]>
Subject: Re: can Linux be secure?
Date: Wed, 31 Jan 2001 19:42:51 GMT
[EMAIL PROTECTED] wrote:
>
> On 30 Jan 2001 18:50:02 GMT Juha Laiho <[EMAIL PROTECTED]> wrote:
>
> | Things that might be worth a look:
> | - NSA has built some kind of secured Linux system
> | - Trustix Secure Linux distribution looks rather nice
>
> I didn't see any kernel changes in it. The biggest problems out there
> seem to be all the userland programs, especially the daemons and suid
> programs. I know about all that. I'm asking about the kernel, and
> so many people are still doing the usenet practice of diverting the
> question.
I repeat there have been one or two local kernel exploits over the
last five or so year that I can remember. I do not remember seeing
ANY remote kernel exploits.
Erik
--
+----------------------------------------------------------+
Erik de Castro Lopo [EMAIL PROTECTED] (Yes its valid)
+----------------------------------------------------------+
"The Internet interprets censorship as damage, and routes around it."
-- John Gilmore
------------------------------
From: [EMAIL PROTECTED] ("Ahmed, Suhail")
Subject: Semaphore use with C++ Linux driver code
Date: 31 Jan 2001 21:31:05 +0100
Hi,
I have written an IP chains driver and that uses some C++ object-oriented
code. My linux kernel version is 2.2.12 and I have RedHat 6.0 installed. I
am using "struct semaphore" of type "MUTEX" for syncronization purposes. I
have moticed that some times the system locks up and forces me to re-boot.
When I comment out the use of semaphore I don't see any system hangs.
I have made the following declaration in my 'C' file:
struct semaphore MySem = MUTEX;
to use this in the C++ file I have to do the following:
extern struct semaphore MySem;
Is there any issues with use of the above semaphore (up() & down()) with the
C++ files??
Any pointers would be helpful,
Thanks
~Suhail
--
Posted from thalia.fm.intel.com [132.233.247.11]
via Mailgate.ORG Server - http://www.Mailgate.ORG
------------------------------
From: Sudhakar Mani <[EMAIL PROTECTED]>
Subject: how to increase shared memory
Date: Wed, 31 Jan 2001 15:52:04 -0500
Hi :
How to increase the shared memory and how much i can increase upto ?
Physical memory in the system is 104 MB. Currently shared memory is set to 9 MB.
I am oracle 8.0.5 and it needs more shared memory.
Thanks in advance for any help.
sudhakar mani
[EMAIL PROTECTED]
My environment :
================
Intel Pentium 75 MHz - PC running Redhat linux 6.0.
Total physical memory : 104 MB.
------------------------------
From: Sudhakar Mani <[EMAIL PROTECTED]>
Subject: Re: how to increase shared memory
Date: Wed, 31 Jan 2001 15:54:58 -0500
Sorry for the typo: I am running oracle 8.0.5.
sudhakar mani
[EMAIL PROTECTED]
Sudhakar Mani wrote:
>
> Hi :
>
> How to increase the shared memory and how much i can increase upto ?
> Physical memory in the system is 104 MB. Currently shared memory is set to 9 MB.
> I am oracle 8.0.5 and it needs more shared memory.
>
> Thanks in advance for any help.
>
> sudhakar mani
> [EMAIL PROTECTED]
>
> My environment :
> ----------------
> Intel Pentium 75 MHz - PC running Redhat linux 6.0.
> Total physical memory : 104 MB.
------------------------------
** 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
******************************