Linux-Development-Sys Digest #822, Volume #7 Thu, 4 May 00 13:13:15 EDT
Contents:
Re: serial/parallel port programming... (Anders Larsen)
Message from kernel -> user space? (Lindanne Metley)
termbits.h file (eddiej)
need intellimouse protocol spec ([EMAIL PROTECTED])
Re: termbits.h file (Josef Moellers)
Re: Hacking on mkdep.c (Sverker Wiberg)
Re: get_user and bottom half help (Alan Donovan)
Re: Message from kernel -> user space? (Alan Donovan)
In/Output buffer race conditions (Arnaud Westenberg)
Re: Code transfert from machine to another (Nicolas Boulay)
Re: ?Linux RS/6000 ? (David Weis)
Re: getcwd() newbie question (Davi de Castro Reis)
File System & Block Device Driver (Development System Linux OS)
Re: test_and_set_bit () (Kaz Kylheku)
Linux memory management changes from 2.0.x -> 2.2.x ("Niels")
----------------------------------------------------------------------------
From: Anders Larsen <[EMAIL PROTECTED]>
Subject: Re: serial/parallel port programming...
Date: Thu, 04 May 2000 09:28:33 +0200
Jonathan Buzzard wrote:
>
> In article <8elie1$[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Richard Puchmayer) writes:
> > In article <NH8O4.32153$[EMAIL PROTECTED]>,
> > Mark Graybill <[EMAIL PROTECTED]> wrote:
> > -I have used serial port hardware handshaking lines in the past (CTS, DSR,
> > -DCD, RI) because of how easy it was
> >
> > Did you use any existing device driver/API or did you use outb/inb
> > to acheive your goal.
> >
> > I'm trying to control the DTR line on a serial port that is ALSO
> > being used fro serial comms. Ie. there are two device connected
> > to the same port.
> >
> > Can you help, or give pointers.
> >
>
> Hum, you can get and set the status pins using ioctl's on the port (i.e.
> /dev/ttyS0 etc.). Something like
>
> i = TIOCM_DTR;
> ioctl(fd, TIOCMSET, &i);
>
> would set the DTR line high. You can read the status with TIOCMGET, in
> which case i on return holds the bitwise and of the various flags.
> Search the ioctl headers to find out the possible settings.
Beware!
i = TIOCM_DTR;
ioctl(fd, TIOCMSET, &i);
forces *all* control bits other than DTR to the off-state!
Your example would f.i. *clear* RTS as a side-effect, and, depending on
your kernel version and serial driver, might even shut off OUT2, thereby
disabling interrupts from this serial device!
i = TIOCM_DTR;
ioctl(fd, TIOCMBIS, &i);
sets the DTR line high *without* changing any other line, and
i = TIOCM_DTR;
ioctl(fd, TIOCMBIC, &i);
clears the DTR line (only).
Using TIOCMSET (without pre-setting i by using TIOCMGET) is really
non-portable, since you don't know which lines are affected - a prominent
example is the parse clock drivers of the NTP package
(see http://www.eecis.udel.edu/~ntp/), some of which attempts to power an
external clock device by turning DTR on and RTS off (or vice versa) using
one ioctl( ..., TIOCMSET, ...) call.
This worked perfectly well on all 2.0.x kernels, but broke by disabling
serial interrupts on 2.2.x (and 2.3.x) if the device is controlled by the
standard serial driver!
--
cheers
Anders Larsen
e-mail: alarsen AT baumerident DOT com
Q: What does the CE in Windows CE stand for?
A: Caveat Emptor
------------------------------
From: [EMAIL PROTECTED] (Lindanne Metley)
Subject: Message from kernel -> user space?
Date: Thu, 04 May 2000 02:03:54 -0800
Are there/what are some good ways to send a message from a kernel module
to user space? I'm just starting in this area, and I'm looking for
something similar to ipc message queues among user processes.
--
CACS: Collective Against Consensual Sanity v0.123
Now a text site map! http://www.angelfire.com/ca3/cacs/
pretty? http://www.geocities.com/SoHo/Studios/5079/
:)-free zone. Don't speak Latin in front of the books!
------------------------------
From: eddiej <[EMAIL PROTECTED]>
Subject: termbits.h file
Date: Wed, 03 May 2000 22:40:03 -0400
Reply-To: [EMAIL PROTECTED]
Does anyone know where to find the bits/termbits.h file?
--
Foundation
Open
Reaching
Course
Eternely
[EMAIL PROTECTED]
http://www.ccs.neu.edu/home/eddiej
and other info when up...
------------------------------
From: [EMAIL PROTECTED]
Subject: need intellimouse protocol spec
Date: Thu, 04 May 2000 10:41:29 GMT
hi guys ,
i am developing a new driver for MS-intellimouse(2 buttons +1
wheel+1 button under wheel).i could not get a proper protocol specifi
(4 byte protocol).man 4 mouse command tells very little.i will be glad
if anyone explains atleast the 3byte protocol given in that command.
should i worry about xf86 versions while developing driver?.
pleeeeease help me.
p.s: will be highly obliged if your reply is cc to [EMAIL PROTECTED]
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: termbits.h file
Date: Thu, 04 May 2000 12:56:27 +0200
eddiej wrote:
> =
> Does anyone know where to find the bits/termbits.h file?
josef@tuks:~ > locate termbits.h
/usr/src/linux-2.2.13.SuSE/include/asm-alpha/termbits.h
/usr/src/linux-2.2.13.SuSE/include/asm-arm/termbits.h
/usr/src/linux-2.2.13.SuSE/include/asm-i386/termbits.h
/usr/src/linux-2.2.13.SuSE/include/asm-m68k/termbits.h
/usr/src/linux-2.2.13.SuSE/include/asm-mips/termbits.h
/usr/src/linux-2.2.13.SuSE/include/asm-ppc/termbits.h
/usr/src/linux-2.2.13.SuSE/include/asm-sparc/termbits.h
/usr/src/linux-2.2.13.SuSE/include/asm-sparc64/termbits.h
Take your pick.
-- =
Josef M=F6llers
Fujitsu Siemens Computers
SHV Server DS 1
------------------------------
From: Sverker Wiberg <[EMAIL PROTECTED]>
Subject: Re: Hacking on mkdep.c
Date: Thu, 04 May 2000 13:30:08 +0200
bill davidsen wrote:
> Sverker Wiberg <[EMAIL PROTECTED]> wrote:
> | I'm experimenting with mkdep.c from Linux 2.3.99 for an internal project
> | here at Ericsson Utvecklings AB. To make it more useful here, I have
> | made some modifications (flags to skip system headers, support for
> | Erlang) -- which I now want to fold back into the official distribution.
> |
> | So: Who is in charge of mkdep.c?
> |
> | (Btw, I was impressed by its mmap() trick.)
>
> Any help in the "Maintainers" file? Other than that I can't find a
> good way to identify anyone who will accept patches for some particular
> bit.
This was the best match I got in Maintainers...I'll ask him.
CONFIGURE, MENUCONFIG, XCONFIG
P: Michael Elizabeth Chastain
M: [EMAIL PROTECTED]
L: [EMAIL PROTECTED]
S: Maintained
/Sverker
------------------------------
From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: get_user and bottom half help
Date: Thu, 04 May 2000 13:52:05 +0100
Eric Taylor wrote:
> Run a realtime process that does a 10ms usleep. I.E.
>
> for(;;) usleep(10000);
>
> When that sleep time is exhausted, shouldn't
> it (r.t. proc) get control? Or does it wait for the
> current process to exhaust its quantum?
> At the next clock tick (10ms) won't the
> system look to see if any higher priority r.t.
> processes are ready to run? (which should be mine).
>
> Assuming it pre-empts anything going on
> only to go back to sleep, it should effect
> a reschedule of my target process. Is this correct?
Yes, that sounds right, but it might not be exactly 10ms.
> Anyway, if a reschedule occurs between my 2 procs, I figure
> i can write a BH that should get in control with my target
> process context in place (thru current).
Remember the BH is not in process context, so you will need to store the
correct value of "current" for the target process.
> current pc and also a few levels of the stack frames. It's
> the stack frame that is the toughy but its real handy to
> see that dynamically at run time. Especially when a program
> is in a near inf loop.
There might be issues with the tgt process' stack pages being swapped
out to disk, but I guess this is what you want the page probe for.
> BTW, if I get a profiler running, I will post it's source
> code. I've written a profiler like this on a few systems,
> most recently VxWorks
I look forward to it.
> [snip]
>
> Other profiler designs require
> you time the entire run, which won't normally tell you
> what's happening during those critical times when
> the program goes into think mode. In our case, there
> is heavy processing each simulation hour that can run
> for 5 minutes or so. (we normally run 1-1 simulation
> time to real time).
Most profilers I've seen you can profile subsets of a program's code, by
indicating which functions are to be instrumented and at which function
in the code profiling is to begin (then you explicitly call that
function when ready). Do prof & gprof not support that? Look at man 3
profil as well.
alan
--
========================================================================
Alan Donovan [EMAIL PROTECTED] http://www.imerge.co.uk
Imerge Ltd. +44 1223 875265
------------------------------
From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: Message from kernel -> user space?
Date: Thu, 04 May 2000 13:58:58 +0100
Lindanne Metley wrote:
>
> Are there/what are some good ways to send a message from a kernel module
> to user space? I'm just starting in this area, and I'm looking for
> something similar to ipc message queues among user processes.
When you need callbacks from kernel -> user, the canonical method is to
use a usermode helper process. Start a usermode thread which blocks on
an ioctl. To make the callback, simply unblock the thread in the driver.
When the usermode thread has handled the callback (or passed it on by
IPC or similar), it blocks again on the ioctl.
HTH
alan
--
========================================================================
Alan Donovan [EMAIL PROTECTED] http://www.imerge.co.uk
Imerge Ltd. +44 1223 875265
------------------------------
Date: Thu, 04 May 2000 13:17:35 +0200
From: Arnaud Westenberg <[EMAIL PROTECTED]>
Subject: In/Output buffer race conditions
Hi all,
I wan't to implement In/Output (circular) buffers in my driver but I'm a
bit confused.
My hardware generates an interrupt after reception of new data and after
succesful transmission.
So for the input buffer I would have to write one short interrupt driven
process (get_data) wich puts the data in the input buffer, wakes the
read call and goes back to sleep again waiting for new data.
But what if I receive another interrupt while read is getting its data
from the buffer? I would have to protect the read call from being
interrupted but then I might lose the new data being send.
Must the get_data routine be a part of the interrupt handler, must it be
declared with start_bh_atomic, or something else?
Thanks in advance for your information.
Regards Arnaud
------------------------------
From: Nicolas Boulay <[EMAIL PROTECTED]>
Subject: Re: Code transfert from machine to another
Date: Thu, 04 May 2000 15:05:33 +0200
Chetan Ahuja wrote:
>
> Nicolas Boulay <[EMAIL PROTECTED]> spoke thusly:
> > Hi,
>
> > Is it possible to run code by a machine throught a network from an other
> > machine without using the file system ? More precisely, is it possible
> > to make a programme that can execute some of this function by differents
> > machines ? Those machines will not have any dedicated server for this
> > program.
>
> > nicO
>
> It will help if you can describe what you want to do exactly. There
> are various radically different methods ( eg. ranging from those which would
> require specially hacked kernel or libc to those which could be done
> in a very high level language like java without even knowing which
> platform you're running on) for doing this sort of stuff
> depending on what your constraints are.
>
> Chetan
>
>
The idea, which is not really precise is to create a moving program
which do is job on a machine and move.(we can could that an agent or a
virus if you want). The constraint will be no specific kernel nor libc,
if it possible.
In the other hand, i would run a simple program like an image
calculating program but i can't modify the kernel nor the libc of the
machine. Hier i would distribute the work throught a list of machine,
which i'm not the root.
I think that pvm need a specific server.
nicO
------------------------------
From: David Weis <[EMAIL PROTECTED]>
Subject: Re: ?Linux RS/6000 ?
Date: Thu, 4 May 2000 09:51:15 -0500
On 3 May 2000, bill davidsen wrote:
> In article <[EMAIL PROTECTED]>,
> Edcoy <[EMAIL PROTECTED]> wrote:
> | If Linux supports the PowerPC.
> | And Linux supports Microchannel.
> | Why doesn't support a Microchannel PowerPC (RS/6000)?
> | Would it be a simple task to produce a capable kernel?
Not a simple task, but doable. I'm actually in the process of testing out
a boot disk that will (the tension mounts!!) write 3 digits to the LED
display.
> Hard to tell how hard it would be, gcc certainly has the right modes
> to do the compile or cross compile, I think the hard parts would be the
> drivers. I can't see bothering with ports to stuff like R20's, etc,
> since they are dog slow as well as large, power hungry, and several
> other bad things. But I'd love to see a port for R5-'s, I have a fair
> bunch of them which would be a lot more fun as Linux machines.
The drivers aren't even that bad. The serial ports are normal, etc. The
MCA bus controller on the machines is pretty complicated. Booting is
tricky too.
If you have a 7011-250 that you would like to get rid of, let me know. The
box I was using got sold and the other one I use occasionally is two hours
away.
> I'm moderately sure that the early power ports didn't do SMP, but I
> have no idea where the project is now. There was a native port and a
> mklinux port as I recall.
There's the meager beginning of a page at
http://www.sjdjweis.com/linux/rs6k/
dave
--
David Weis | 10520 New York Ave, Des Moines, IA 50322
[EMAIL PROTECTED] | Voice 515-278-0133 Ext 231
| http://www.perfectionlearning.com/
When they took the Fourth Amendment, I was quiet because I didn't deal drugs.
When they took the Fifth Amendment, I was quiet because I was innocent.
When they took the Second Amendment, I was quiet because I didn't own a gun.
Now they've taken the First Amendment and I can't say anything.
------------------------------
From: Davi de Castro Reis <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: getcwd() newbie question
Date: Wed, 3 May 2000 12:41:35 -0300
On Wed, 3 May 2000, Nicola Attico wrote:
>=20
>=20
> Hello Linux developers!
>=20
>=20
> I'm trying to understand system calls and I've
> this problem (maybe stupid).
> I'm running Red Hat Linux 6.1 and I would like
> to understand how the getcwd() call (only one among the
> others!) to obtain the
> current working directory of a process works.
> I've installed the version 2 of glibc as showed by
> rpm:
>=20
> [nicola@c1p8 nicola]$ rpm -q glibc
> glibc-2.1.2-11
>=20
> In the GNU libc reference manual (available at
> http://www.gnu.org, p. 181) the following prototype
> of getcwd() is declared:
>=20
> char *getcwd(char *buffer,size_t size)
>=20
> where buffer is the string where you want to store the
> current working directory and size is the number of
> bytes you want to use for that (size_t is just the same
> that unsigned int).
>=20
> Now I wrote the following stupid (but maybe wrong) C code
> to implement it:
>=20
> #include <unistd.h>
> int main()
> {
> char buffer[10];
> getcwd(buffer, 10);
> printf("%s\n",buffer);
> }
>=20
Well, the most visible error is that you didn't include stdio, where
printf is. Besides, you must also check the return of getcwd. Surely that
caused that stranges characteres in the execution.
The following code is more appropriate:
#include <stdio.h>
#include <unistd.h>
int main()
{
char buffer[100];
if(getcwd(buffer, 100)){
printf("%s\n",buffer);
}else{
fprintf(stderr,"Shit! Not enough space");
}
}
And try to compile with
gcc -Wall -ansi -pedantic=20
(actually this code above that's work with this, but fuck off)
[]s
Davi
> I compile with gcc:
>=20
> {
> Incidentally I've the following version:=20
> [nicola@c1p8 nicola]$ rpm -q egcs =20
> egcs-1.1.2-24
> }
>=20
> using:=20
>=20
> [nicola@c1p8 nicola]$ gcc getcwd.c=20
>=20
> and all seems work fine, but when I run:
>=20
> [nicola@c1p8 nicola]$ ./a.out
> x=FC=FF=BF=EB@
>=20
> ...I obtain only garbage!
> So, why that? I've not great experience in C programming,
> so maybe I'm doing some very trivial error!
>=20
> Any suggestion will be greatly appreciated,
>=20
> Thanks,
>=20
> # Nicola
>=20
>=20
>=20
------------------------------
From: Development System Linux OS <[EMAIL PROTECTED]>
Subject: File System & Block Device Driver
Date: Wed, 03 May 2000 18:00:42 -0700
Hi,
We are about to start a project using a mag-stripe sized disk
stick(newly invented) on a card made by a company called UltraCard, Inc
(www.ultracard.com). The card is an RAM disk storage medium(5MB)
accessed by a card reader via USB or RS232 interface. We would like to
use Linux for this project to try with the idea to write a driver
ourselves, I have gone through O'Reilly "Linux Device Drivers" &
Addison-Wesley "Linux Kernel Internals". Before we actually jump into a
new driver development, we have been trying to look into the file
system registration & installation on a existing block driver first,
for instance, the init.c which call regiser_filesystem() in super.c at
Linux boot up, still, I cann't get a step by step clear picture in
doing this(e.g, how to register, install and mount a file system on a
existing block device in order to create a new file system?), although
I am willing to take a good challenge, still, it's a bit hard, so, can
anyone please point me to some file system creation samples for me to
hands on a file system first and then move to driver development?
Thanks,
Wade Jeng
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: test_and_set_bit ()
Reply-To: [EMAIL PROTECTED]
Date: Thu, 04 May 2000 16:21:11 GMT
On Thu, 04 May 2000 12:19:59 +0530, nilesh patel <[EMAIL PROTECTED]> wrote:
>
>Is test_and_set_bit () guarenteed to be atomic on SMP architecture ?
It's atomic but it's not guaranteed. GNU software doesn't come with warranty
protection, unless you specifically arrange it with a vendor.
--
#exclude <windows.h>
------------------------------
From: "Niels" <[EMAIL PROTECTED]>
Subject: Linux memory management changes from 2.0.x -> 2.2.x
Date: Thu, 4 May 2000 18:41:15 +0200
Hi
I have to write a paper on Linux' memory management, including a description
of the 'aging' mechanism used by the page replacement policy. However, while
digging through the 2.2.x sources and comparing them to the 2.0.x sources,
it seems to me that aging is no longer used in 2.2. Is this correct, or am I
missing something?
I'd really appreciate it if someone could clear this up.
Thanks,
Niels
------------------------------
** 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
******************************