Linux-Development-Sys Digest #805, Volume #7 Wed, 26 Apr 00 21:13:14 EDT
Contents:
Re: Time for the MS-rats to desert ("Chad Myers")
Question about CDROM_DRIVE_STATUS to get tray info ([EMAIL PROTECTED])
Re: cli() & sti()... (Bill Waddington)
Re: How legal is it??? ("Stephen Howe")
Re: How legal is it??? ("Tim Laursen")
GCC Install (was Glibc2 install) ([EMAIL PROTECTED])
Gimp Install ([EMAIL PROTECTED])
Re: Gimp Install ([EMAIL PROTECTED])
unresolved symbols ("Aurelie Fonteny")
Re: Allocating memory at a specific physical locaation (Brett Johnson)
FTP question (jvirzi)
Re: cli() & sti()... (Bill Waddington)
Re: install problems (Aquiles Cohen)
Re: install problems (Aquiles Cohen)
----------------------------------------------------------------------------
From: "Chad Myers" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.advocacy,comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy,comp.os.linux.networking,comp.os.linux.security,comp.os.ms-windows.networking.tcp-ip,alt.conspiracy.area51
Subject: Re: Time for the MS-rats to desert
Date: Wed, 26 Apr 2000 13:15:06 -0500
"John Unekis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]...
[SNIP: Hateful ignorant blathering]
Is this what anti-MS people think? No real logical foundation, it's just
"hip" to hate MS because they're a big bad corporation? They're the
big-bad-corporation-to-hate-d'jour?
Man, you should go back on the medicine, you really have a problem.
> Remember all you Microserfs, the ones who bail first will get all the good
jobs
> down in Silicon valley, the stragglers will end up fetching them coffee....
Drats, now all those multi-millionaires are just millionaires!
If you don't think MS's stock will be back 10 fold in 5 years, you are sorely
mistaken. Seen AT&T and all the bells lately? What about Exxon or other oil
companies?
-Chad
------------------------------
From: [EMAIL PROTECTED]
Subject: Question about CDROM_DRIVE_STATUS to get tray info
Date: Wed, 26 Apr 2000 18:50:26 GMT
I'm working on a project where I need to know the status of the
CD-ROM drive tray (opened or closed). When I try using the
CDROM_DRIVE_STATUS ioctl (kernel 2.3.41 and 2.3.99) I get back 2
(CDS_TRAY_OPEN) both if the tray is open and if it is closed but empty.
It returns 4 (CDS_DISC_OK) if there is a CD in the tray.
Is there a way I can tell the difference between the tray being open
and it being closed but empty?
Thanks,
Nathan
[EMAIL PROTECTED]
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Bill Waddington <[EMAIL PROTECTED]>
Subject: Re: cli() & sti()...
Date: Wed, 26 Apr 2000 19:13:14 GMT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> On Wed, 26 Apr 2000 16:50:21 GMT, Bill Waddington
> <[EMAIL PROTECTED]> wrote:
> >In article <[EMAIL PROTECTED]>,
> > [EMAIL PROTECTED] wrote:
> >> On Wed, 26 Apr 2000 14:15:34 GMT, Bill Waddington
> >> <[EMAIL PROTECTED]> wrote:
> >> >
> >> >
> >> >> The point I'm trying to get to is that cli() and sti() are
> >obsolete,
> >> >legacy
> >> >> operations---do not use them! Use spinlocks. The operations
> >> >spin_lock_irqsave()
> >> >> and spin_unlock_irqrestore() work correclty under SMP and on a
uP
> >> >kernel they
> >> >> collapse into save_flags(); cli() and restore_flags().
> >> >
> >> >Hello,
> >> >
> >> >When using the above, does one place similar spinlocks in the
> >interrupt
> >> >code?
> >>
> >> Yes.
> >>
> >> --
> >> #exclude <windows.h>
> >>
> >
> >Thanks,
> >
> >Sorry to be such a blockhead ... are the lock and unlock ops used in
the
> >interrupt code spin_lock_irqsave()and spin_unlock_irqrestore() or
> >some related lock and unlock ops? (& if so, what are they, please)
>
> No, you spin_lock_irqsave() in interrupt code as well. Here
> are some rules of thumb: if you know that you are running in a context
> that has interrupts enabled you can use spin_lock_irq() and
> spin_unlock_irq(). These functions don't bother saving and restoring
> flags. If you don't know whether interrupts are masked or unmasked
> on the local processor, then use spin_lock_irqsave() and
> spin_unlock_irqrestore().
>
> In other words, in places where you would use cli() and sti() on 2.0
or older
> kernels, you can use spin_lock_irq() and spin_unlock_irq(). In places
where
> you would have used save_flags(flags); cli(); and restore_flags(), you
now use
> spin_lock_irqsave() and spin_unlock_irqrestore().
>
> Avoid using spin_lock and spin_unlock since they don't do anything
with
> interrupts. They can't protect processes from ISR's. What they can
> do is protect critical regions against concurrent access by processes,
> as long as those region is not executed by interrupt code.
>
> You must not reschedule while holding a spin lock, otherwise some
process will
> come along and try to acquire the lock which is held by the suspended
process.
> By doing so, it hog the CPU and prevent the suspended process from
releasing
> the lock. If you need long locks among processes, use semaphores.
>
> >Do I understand correctly from the previous discussion that
cli()/sti()
> >still function on SMP hardware, but at the expense of locking out
> >interrupts across all processors?
>
> Sort of. It's pretty bletcherous; to understand it fully, you have to
> follow the source code, of course. There are some concessions made;
> it's not a full lockout just a reasonable lockout.
>
> --
> #exclude <windows.h>
>
Thanks,
That helps a lot.
Bill
--
Bill Waddington
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: "Stephen Howe" <[EMAIL PROTECTED]>
Crossposted-To:
alt.comp.lang.learn.c-c++,comp.lang.asm.x86,comp.lang.c++,comp.os.linux.development.apps,microsoft.public.windowsnt.protocol.tcpip,microsoft.public.win32.programmer.tools
Subject: Re: How legal is it???
Date: Wed, 26 Apr 2000 21:55:15 GMT
Reply-To: "Stephen Howe" <[EMAIL PROTECTED]>
_Steven Chang <[EMAIL PROTECTED]> wrote in message
news:8e37a3$gen$[EMAIL PROTECTED]...
> Hi there,
>
> I'm thinking of creating a stealth application that will automatically
> launch itself when the OS starts. I would like the application to
> record the keystrokes made by users, and possibly the mouse movements as
> well. Then, probably buffer these data and have them sent to a server
> over the internet periodically.
>
> Assuming that the user has provided consent for having this program
> installed on one's computer, how legal will it be for such program to be
> running under
>
> a) Linux?
> b) Windows 98/NT/2000?
I would have thought that varied from country to country.
Stephen Howe
------------------------------
From: "Tim Laursen" <[EMAIL PROTECTED]>
Crossposted-To:
alt.comp.lang.learn.c-c++,comp.lang.asm.x86,comp.lang.c++,comp.os.linux.development.apps,microsoft.public.windowsnt.protocol.tcpip,microsoft.public.win32.programmer.tools
Subject: Re: How legal is it???
Date: Wed, 26 Apr 2000 21:55:22 GMT
"_Steven Chang" <[EMAIL PROTECTED]> wrote
> Hi there,
>
> I'm thinking of creating a stealth application that will automatically
> launch itself when the OS starts. I would like the application to
> record the keystrokes made by users, and possibly the mouse movements as
> well. Then, probably buffer these data and have them sent to a server
> over the internet periodically.
>
> Assuming that the user has provided consent for having this program
> installed on one's computer, how legal will it be for such program to be
> running under
>
> a) Linux?
> b) Windows 98/NT/2000?
>
> I would expect this not such a big deal with LINUX, but what about the
> privacy issue?
>
> Any help or referral is appreciated.
Well, apparently it is quite legal (at least in the countries where the
other replies are coming from), but what you should really ask yourself is
"How smart is it???"
Sending that kind of data over a network is to a hacker like blood to a
shark. Make sure that the data at least is sent in an encrypted way.
Another thing is that I don't personally like the idea at all. Frankly I am
amazed that it is at all legal.
- Tim -
------------------------------
From: [EMAIL PROTECTED]
Subject: GCC Install (was Glibc2 install)
Date: 26 Apr 2000 22:31:48 GMT
Okay, I punted and just upgraded my whole system to Slackware 7.0, which
comes stock with glibc-2.1.2.
But it comes with egcs-2.91.66.
Should I (attempt to) install gcc-2.95.2 again, or just leave it be?
--J
------------------------------
From: [EMAIL PROTECTED]
Subject: Gimp Install
Date: 26 Apr 2000 22:40:40 GMT
More on libs...
I'm installing gimp-1.0.4 (the end target here is to compile
ethereal-0.8.7, which requires these libs).
Gimp is huge, and isn't linking dynamically, so /usr/lib/gimp/1.0/plug-ins
is winding up > 210MB!
'ldd -v' gives version 1.9.9. 'ld -v' gives 2.9.1 (BFD 2.9.1.0.25).
Doing a './configure --enable-shared' still doesn't work, since it reports
that my ld isn't capable of dynamic linking, which is strange because when
I ran configure for glib it liked it just fine.
Ideas?
--J
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Gimp Install
Date: 26 Apr 2000 22:45:06 GMT
I may have found my own problem. 'configure' reports that my linker is
/usr/i586-pc-linux-gnulibc1/bin/ld. There's no directory there.
I symlinked i386-slackware-linux-gnulibc1 to i586-pc-linux-gnulibc1 and it
now reports that my linker supports shared libraries. Will this break
things (or make lots of things work right)?
--J
[EMAIL PROTECTED] wrote:
: More on libs...
: I'm installing gimp-1.0.4 (the end target here is to compile
: ethereal-0.8.7, which requires these libs).
: Gimp is huge, and isn't linking dynamically, so /usr/lib/gimp/1.0/plug-ins
: is winding up > 210MB!
: 'ldd -v' gives version 1.9.9. 'ld -v' gives 2.9.1 (BFD 2.9.1.0.25).
: Doing a './configure --enable-shared' still doesn't work, since it reports
: that my ld isn't capable of dynamic linking, which is strange because when
: I ran configure for glib it liked it just fine.
: Ideas?
: --J
------------------------------
From: "Aurelie Fonteny" <[EMAIL PROTECTED]>
Subject: unresolved symbols
Date: Wed, 26 Apr 2000 18:41:29 -0500
Hi,
I'm triing to load a module that I've just written.
I compiled it with -D__KERNEL__ -DMODULE -O Wall ..., and installed it by
just doing install - c new_mod.o /lib/modules/$(VER)/net
Now, when I'm loading it I can't get rid of the unresolved symbols :
unresolved symbol htonl
unresolved symbol htons
unresolved symbol memmove
unresolved symbol __constant_memcpy
unresolved symbol __memcpy
....
Does someone know why?
Thanks.
Aurelie
------------------------------
From: Brett Johnson <[EMAIL PROTECTED]>
Subject: Re: Allocating memory at a specific physical locaation
Date: Wed, 26 Apr 2000 18:13:04 -0600
Reply-To: [EMAIL PROTECTED]
Timur Tabi wrote:
>
> I'm writing a device driver that needs to be able to allocate a chunk
> (about 4-8KB) of physical memory. That is, I know the true physical
> address of this memory block, and I need the kernel to give it to me.
Do you really have to map a specific address? Or do you just need some
physical memory allocated (for DMA buffers or some such)? If you just
need some physical memory, you can allocate it fairly easily with
__get_free_pages, then use mem_map_reserve, to reserve the memory so
that the kernel won't use it for VM & such.
[...]
> In addition, I need to be able to alter the "cacheability" of the memory
> block. For these blocks, caching needs to be disabled, and
> write-combining needs to be turned on.
I assume you're talking about the x86 architecture here. If so, the way
to do this is with mtr registers (look up "mtrr" in an Intel manual).
Linux provides some code to do this (mtrr_add and mtrr_del), but it's
not a trivial thing. There are some rather arcane rules about mtrr
allocation that you'll have to follow (for example, an mtrr can only map
a region of memory that is _both_ a power of two in size, _and_ aligned
on the same power of two. Also, write-combined memory cannot overlap any
other kind of memory [so you're going to have to re-map all the rest of
your memory back to write-back cacheable following the same rules]). On
top of that, there are only 8 mtrrs! So, if you have 1gig of memory, for
example, you will use 6 mtrrs just to map a single 32M chunk of memory
write-combined! i.e. to map all of your memory, you would need the
following mtrr arrangement:
mtrr0: 32M write-combined
mtrr1: 32M write-back
mtrr2: 64M write-back
mtrr3: 128M write-back
mtrr4: 256M write-back
mtrr5: 512M write-back
> I would very much appreciate any help in this matter. I'm overwhelmed
> by the amount of information I need to digest in order to answer this
> question myself, so I need some help in order to focus my research.
You're tackling a pretty tough problem for someone "new to Linux kernel
programming". Good luck...
Cheers!
--
Brett Johnson <[EMAIL PROTECTED]>
HP Technical Solutions Laboratory
- i n v e n t -
------------------------------
From: jvirzi <[EMAIL PROTECTED]>
Subject: FTP question
Date: Wed, 26 Apr 2000 17:11:33 -0700
I just installed RedHat 6.1 on a system; I've normally used 5.x and 6.0.
Having accepted all the defaults for the "automatic" FTP daemon
installation, it takes up to 5 minutes to log on to the FTP daemon. The
connection acknowledge from the daemon is immediate. It takes about 5
mins to execute the login script.
-Joe
------------------------------
From: Bill Waddington <[EMAIL PROTECTED]>
Subject: Re: cli() & sti()...
Date: Thu, 27 Apr 2000 00:44:07 GMT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> On Wed, 26 Apr 2000 16:50:21 GMT, Bill Waddington
> <[EMAIL PROTECTED]> wrote:
> >In article <[EMAIL PROTECTED]>,
> > [EMAIL PROTECTED] wrote:
> >> On Wed, 26 Apr 2000 14:15:34 GMT, Bill Waddington
> >> <[EMAIL PROTECTED]> wrote:
> >> >
> >> >
> >> >> The point I'm trying to get to is that cli() and sti() are
> >obsolete,
> >> >legacy
> >> >> operations---do not use them! Use spinlocks. The operations
> >> >spin_lock_irqsave()
> >> >> and spin_unlock_irqrestore() work correclty under SMP and on a
uP
> >> >kernel they
> >> >> collapse into save_flags(); cli() and restore_flags().
> >> >
> >> >Hello,
> >> >
> >> >When using the above, does one place similar spinlocks in the
> >interrupt
> >> >code?
> >>
> >> Yes.
> >>
> >> --
> >> #exclude <windows.h>
> >>
> >
> >Thanks,
> >
> >Sorry to be such a blockhead ... are the lock and unlock ops used in
the
> >interrupt code spin_lock_irqsave()and spin_unlock_irqrestore() or
> >some related lock and unlock ops? (& if so, what are they, please)
>
> No, you spin_lock_irqsave() in interrupt code as well. Here
> are some rules of thumb: if you know that you are running in a context
> that has interrupts enabled you can use spin_lock_irq() and
> spin_unlock_irq(). These functions don't bother saving and restoring
> flags. If you don't know whether interrupts are masked or unmasked
> on the local processor, then use spin_lock_irqsave() and
> spin_unlock_irqrestore().
>
> In other words, in places where you would use cli() and sti() on 2.0
or older
> kernels, you can use spin_lock_irq() and spin_unlock_irq(). In places
where
> you would have used save_flags(flags); cli(); and restore_flags(), you
now use
> spin_lock_irqsave() and spin_unlock_irqrestore().
>
> Avoid using spin_lock and spin_unlock since they don't do anything
with
> interrupts. They can't protect processes from ISR's. What they can
> do is protect critical regions against concurrent access by processes,
> as long as those region is not executed by interrupt code.
>
> You must not reschedule while holding a spin lock, otherwise some
process will
> come along and try to acquire the lock which is held by the suspended
process.
> By doing so, it hog the CPU and prevent the suspended process from
releasing
> the lock. If you need long locks among processes, use semaphores.
>
> >Do I understand correctly from the previous discussion that
cli()/sti()
> >still function on SMP hardware, but at the expense of locking out
> >interrupts across all processors?
>
> Sort of. It's pretty bletcherous; to understand it fully, you have to
> follow the source code, of course. There are some concessions made;
> it's not a full lockout just a reasonable lockout.
>
> --
> #exclude <windows.h>
>
Hello again,
May we chase this a bit farther? I replaced my save flags/cli/restore
flags code with spin_lock_irqsave and spin_unlock_irqrestore. Things
seem to work just fine (on a uniprocessor PC).
Now I wonder if it should be working at all.
What is going on in the strategy routine is:
spin_lock_irqsave()
launch a DMA xfer
interruptible_sleep_on_timeout()
spin_unlock_irqrestore()
the interrupt handler does:
spin_lock_irqsave()
if it is our int, set a flag
spin_unlock_irqrestore()
if(flag) wake_up_interruptible()
What puzzles me is how am I getting through the interrupt code if I am
still holding the spinlock? Is something really magic happening in
interruptible_sleep_on_timeout()? I imagine it calls schedule, which
doesn't sound like a good idea. Perhaps it really does just collapse
into cli/sti on a uniprocessor PC - but does it then ignore the spinlock
entirely? If that is what is going on, it isn't likely to fly on a SMP
machine. Is there a version of interruptible_sleep_on_timeout that
incorporates the spinlock? I will try to ferret this out of the source
code, but I would appreciate any additional help you can offer.
This must be a common problem in a device driver (I know that it is in
mine). How is this handled by the big boys?
Thanks again for your time,
Bill
--
Bill Waddington
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Aquiles Cohen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux
Subject: Re: install problems
Date: Thu, 27 Apr 2000 00:47:45 GMT
The problem is that linux redhat 6.1 has several ways to begin.
if you chose enter, then you are chosing the graphics mode. In this
mode linux begins making a hardware check if the system can't support
the autoconfiguration the screen goes white.
You need to chose when linux begin text mode and before you must to
configure X-windows if you want it.
When you finish the install take off the cd if you don`t want reinstall
it.
Aquiles Cohen
ICQ:69962080
Magdalena University.
When I am trying to install linux redhat 6.1 off of a single cd from
> > cheapbytes.com, the install program boots off of the cd and begins
the
> > hardware check. After this though the screen goes completley white,
> > and freezes. Can someone please help me with this problem.
>
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> hmmm, this is hard to say what exactly is the prob. Why dont u try
making
> a boot disk and boot it from drive a: instead? depends on the distros,
> some come with setup utility that guide u thro the installation
process. i
> know RH does have.
>
> go back to dos/windozz and look at the content of the RH cd. i believe
> there is a directory something like 'dosutils'. in there u can find
dos
> utilities to make the bootdisk.
>
> customer wrote:
>
> > When I am trying to install linux redhat 6.1 off of a single cd from
> > cheapbytes.com, the install program boots off of the cd and begins
the
> > hardware check. After this though the screen goes completley white,
> > and freezes. Can someone please help me with this problem.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Aquiles Cohen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux
Subject: Re: install problems
Date: Thu, 27 Apr 2000 00:45:44 GMT
The problem is that linux redhat 6.1 has several ways to begin.
if you chose enter, then you are chosing the graphics mode. In this
mode linux begins making a hardware check if the system can't support
the autoconfiguration the screen goes white.
You need to chose when linux begin text mode and before you must to
configure X-windows if you want it.
Aquiles Cohen
ICQ:69962080
Magdalena University.
When I am trying to install linux redhat 6.1 off of a single cd from
> > cheapbytes.com, the install program boots off of the cd and begins
the
> > hardware check. After this though the screen goes completley white,
> > and freezes. Can someone please help me with this problem.
>
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> hmmm, this is hard to say what exactly is the prob. Why dont u try
making
> a boot disk and boot it from drive a: instead? depends on the distros,
> some come with setup utility that guide u thro the installation
process. i
> know RH does have.
>
> go back to dos/windozz and look at the content of the RH cd. i believe
> there is a directory something like 'dosutils'. in there u can find
dos
> utilities to make the bootdisk.
>
> customer wrote:
>
> > When I am trying to install linux redhat 6.1 off of a single cd from
> > cheapbytes.com, the install program boots off of the cd and begins
the
> > hardware check. After this though the screen goes completley white,
> > and freezes. Can someone please help me with this problem.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
** 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
******************************