Linux-Development-Sys Digest #143, Volume #8 Wed, 13 Sep 00 07:13:11 EDT
Contents:
printk() ([EMAIL PROTECTED])
where to get info about smp implementation ("Anil Prasad")
Re: Curious: compiling test8 series: "warning... token" (Kasper Dupont)
current->timeout in 2.4.x (Wolfram Faul)
Re: Zip 100 Parallel Port Drive (Kasper Dupont)
Re: current->timeout in 2.4.x (Mathias Waack)
Re: creating a bootable redhat install CD (Kasper Dupont)
diverting IP packets in Linux ("Anton")
Spin_lock_irq help ("[EMAIL PROTECTED]")
Re: scheduling under Linux not suitable for interactive work? (Szabolcs Csetey)
Re: printk() (Kasper Dupont)
Re: Zip 100 Parallel Port Drive ("Peter T. Breuer")
Re: printk() (Kaz Kylheku)
Re: Zip 100 Parallel Port Drive (Kasper Dupont)
Problem in RedHat 6.2 installation (Nuclear)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED]
Subject: printk()
Date: Wed, 13 Sep 2000 17:35:39 +1000
Greetings,
I have modified the elf binary format loader in binfmt_elf.c to do some
stuff and I want to print out some information whenever an ELF file
executes. At the moment I can print it out (using printk()) and it will
showup all-through boot-up as ELF files are executed. However as soon as
X starts and I start a terminal session and run an ELF executable I
cannot get the debugging information to show up.
I think it *may* have something to do with run-levels but I'm not sure.
If it is this, I would appreciate it if anyone could give me the format
of the printk() to use so that my debug messages show up no matter
where/under what runlevel I am executing the ELF binary.
Thanks in Advance
dan.
------------------------------
From: "Anil Prasad" <[EMAIL PROTECTED]>
Subject: where to get info about smp implementation
Date: 13 Sep 2000 08:15:39 GMT
can anyone tell where to get info about smp implementation in linux kernel
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Curious: compiling test8 series: "warning... token"
Date: Wed, 13 Sep 2000 10:38:34 +0200
bill davidsen wrote:
>
[...]
>
> There may be some gcc extention to ## functionality I'm missing, but
> what I said works on AIX (IBM compiler) and whatever is on an old UNISYS
> lying about as well, so I'm not too far off.
>
It is a gcc extension. To avoid anymore confusion
here is that page from the manual:
File: gcc.info, Node: Macro Varargs, Next: Subscripting, Prev:
Variable Length, Up: C Extensions
Macros with Variable Numbers of Arguments
=========================================
In GNU C, a macro can accept a variable number of arguments, much as
a function can. The syntax for defining the macro looks much like that
used for a function. Here is an example:
#define eprintf(format, args...) \
fprintf (stderr, format , ## args)
Here `args' is a "rest argument": it takes in zero or more
arguments, as many as the call contains. All of them plus the commas
between them form the value of `args', which is substituted into the
macro body where `args' is used. Thus, we have this expansion:
eprintf ("%s:%d: ", input_file_name, line_number)
==>
fprintf (stderr, "%s:%d: " , input_file_name, line_number)
Note that the comma after the string constant comes from the definition
of `eprintf', whereas the last comma comes from the value of `args'.
The reason for using `##' is to handle the case when `args' matches
no arguments at all. In this case, `args' has an empty value. In this
case, the second comma in the definition becomes an embarrassment: if
it got through to the expansion of the macro, we would get something
like this:
fprintf (stderr, "success!\n" , )
which is invalid C syntax. `##' gets rid of the comma, so we get the
following instead:
fprintf (stderr, "success!\n")
This is a special feature of the GNU C preprocessor: `##' before a
rest argument that is empty discards the preceding sequence of
non-whitespace characters from the macro definition. (If another macro
argument precedes, none of it is discarded.)
It might be better to discard the last preprocessor token instead of
the last preceding sequence of non-whitespace characters; in fact, we
may someday change this feature to do so. We advise you to write the
macro definition so that the preceding sequence of non-whitespace
characters is just a single token, so that the meaning will not change
if we change the definition of this feature.
--zz-Info: (gcc.info.gz)Macro Varargs, 50 lines
--All---------------------------
--
Kasper Dupont
------------------------------
From: Wolfram Faul <[EMAIL PROTECTED]>
Subject: current->timeout in 2.4.x
Date: Wed, 13 Sep 2000 10:48:30 +0200
Hallo ,
i am writing a devicedriver for 2.4.0-test1. In Alessandro Rubinis book
'device driver' there is a possibility shown to wait a bit.
current->timeout = jiffies + x;
current->state = TASK_INTERRUPTIBLE;
schedule();
current->timeout = 0; /* reset timeout */
If i realized it correctly this is no longer possible in 2.4.x.
Any idea how to replace this piece of code.
Thank you
Wolfram
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.misc
Subject: Re: Zip 100 Parallel Port Drive
Date: Wed, 13 Sep 2000 10:44:22 +0200
Wouter Verhelst wrote:
>
> In article <[EMAIL PROTECTED]>,
> Kasper Dupont <[EMAIL PROTECTED]> writes:
> > The speed for reading is as far as i remember:
> >
> > SPP: less than 200 kb/sec
> > ECP under DOS: 300 kb/sec
> > EPP under DOS: 400 kb/sec
> > EPP under Linux: 500 kb/sec
> >
> > For some reasons many new computers come with the BIOS default
> > set to SPP, does anyone have a very good explanation for that?
>
> I'm not sure about this, but perhaps because SPP is the oldest (is
> it?) so the 'default' that is supported by all OSses, also broken
> ones?
> Wouldn't make sense, but ya never know ;-)
Could make sense, but all software I have seen using
SPP works fine even with the bios set to EPP. And I
also think it would be a very strange choice to
configure new computers for old broken software
instead of configuring them for the new and more
effective ones.
--
Kasper Dupont
------------------------------
From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Re: current->timeout in 2.4.x
Date: 13 Sep 2000 10:40:29 +0200
Hi Wolfram,
Wolfram Faul <[EMAIL PROTECTED]> writes:
> Hallo , i am writing a devicedriver for 2.4.0-test1. In Alessandro
> Rubinis book 'device driver' there is a possibility shown to wait a
> bit.
...
> Any idea how to replace this piece of code.
On http://www.valpo.de/colds/ exists a short list of some common
pitfalls and tricks for Linux device driver writers. Maybe it helps you...
Mathias
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: creating a bootable redhat install CD
Date: Wed, 13 Sep 2000 10:57:56 +0200
[EMAIL PROTECTED] wrote:
>
> Please CC my email with any reply... [EMAIL PROTECTED]
>
> I usually purchase a redhat package, and I like having the bootable CD.
>
> One time however, it was late, and I need the latest release and
> couldn't wait for next day delivery.
>
> I downloaded the distribution and burned it to CD but the install would
> fail somewhere during the boot process.
>
> It has been a while since I did this, but I remember that a mount
> command showed my burned CD as being mounted "read only"
>
> When I mount an official Redhat CD, the perms show "owner rw" perms on
> the root and all files.
>
> It makes sense to me that the boot CD needs to fool the system into
> believing the filesystem is read/write, when actually it is read only,
> for the limited use that the installation requires.
>
> I looked at the mkisofs src and the cdrecord src and I cannot see where
> I could possibly force the perms on the CD to be anything but read only.
>
> Does anyone know what the trick is? Or am I way off base?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
First of all downloading the eltorito ISO file and burning that
should eliminate all possibilities for you do something wrong
with the permitions.
If you have made the ISO file yourself with mkisofs you can do
something with the permitions. I don't think the install program
depends on any permitions, but I could be wrong.
Permitions for files on a CD only exist in the Rock Ridge
extension, mkisofs has two different options for creating a
Rock Ridge extension:
-R will set owner, group and permitions like on the original.
-r will set owner and group to 0, permitions will be set to
readable for everyone if it was originally readable to
anyone. The same for executable. All other permitions
including write will be cleared.
The values on the CD can be overriden when mounting the CD,
but you probably didn't change that part of the install
program.
If you make the iso file yourself you must however remember
the eltorito options if you want to boot from the CD.
The process of burning the ISO file to the CD should cannot
affect the boot process or the permitions, unless there are
physical errors on the media.
--
Kasper Dupont
------------------------------
From: "Anton" <[EMAIL PROTECTED]>
Subject: diverting IP packets in Linux
Date: Wed, 13 Sep 2000 13:09:34 +0400
Hi!
Is it possible to divert all IP traffic from kernel to my userland program
for accounting, filtering etc, and then put it back into kernel for further
procesing? I mean that in FreeBSD I can issue:
ipfw divert 10 ip from any to any
to forward all IP traffic to divert port 10, and then in my C program:
ds.sin_family = AF_INET; ds.sin_addr.s_addr = INADDR_ANY; ds.sin_port =
htons(10);
socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT);
bind(socketid, (struct sockaddr *)&ds, sizeof(ds));
while (1) {
recvfrom(socketid, packet, 0xffff, 0, (struct sockaddr *)&ds, &size_ds);
// some processing here
sendto(socketid, packet, len, 0, (struct sockaddr *)&ds, size_ds);
}
I need a special kernel support in FreeBSD kernel, "options IPDIVERT"
And, what about Linux? Can I do the same thing?
Yours,
--
Anton Vinokurov, ALV9-RIPE
[EMAIL PROTECTED] ICQ:29041781
------------------------------
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: Spin_lock_irq help
Date: Wed, 13 Sep 2000 11:17:41 +0200
Hi,
In the request block of a device driver I saw the following,
spin_lock_irq(&io_req_lock);
and spin_inlock_irq(&io_req_lock);
What does this do ?
and when must I use it.
Thanks,
Richard.
------------------------------
From: Szabolcs Csetey <[EMAIL PROTECTED]>
Subject: Re: scheduling under Linux not suitable for interactive work?
Date: Wed, 13 Sep 2000 09:09:32 GMT
[EMAIL PROTECTED] wrote:
> On 13 Sep 2000 09:36:57 +0000, [EMAIL PROTECTED]
> >I have recently experienced, not for the first time, a complete
> >choking of the system (Linux 2.2.14) when I ran an editting session
> >(emacs) at the same time as some compute intensive tasks. I did not
> >play with priorities or nice values. I was practically unable to
> >edit, it took tens of seconds for characters to appear, or mouse
> >pointer to move. On another occasion, I was editting a big file
> >(~2Mb) and I ran a text replacement command on the whole buffer. The
> >system froze and I couldn't do anything until the replacement command
> >finished (after couple of minutes).
> There is something wrong with your system. I haven't seen behavior
> like that since using Linux 0.99 on a 386 with 4 megs of RAM with
> multiple users logged in, compiling their projects.
I can see when "heavier" disk IO occures, e.g. get or delete email,
netscape trashes its disk cache dir, etc :( 128 MB RAM, disk tuned (16
MB/sec, UDMA), ext2 block size 4 KB, kernel 2.2.17. Usually I can
reproduce it by a simple while(read(in,...)) write(out,...) using bigger
buffer sizes. Sometimes it hangs the system only for a few seconds,
other times 10-20 seconds and only 2-4 times I had to hit the reset
button because I didn't want to wait more than 2-5 minutes - yes,
virtual memory was far enough and no any kernel message as
do_try_to_free_pages, etc. Something seems very broken ... A typical
vmstat output,
procs memory swap io system cpu
r b w swpd free buff cache si so bi bo in cs us sy id
1 0 0 58828 2556 19932 41104 0 0 0 0 132 624 1 2 97
0 0 0 58828 2560 19932 41104 0 0 8 15 155 626 3 2 95
1 0 0 58828 2556 19932 41104 0 0 0 0 123 549 1 3 96
1 0 0 58828 2556 19932 41104 0 0 0 0 124 558 1 2 97
0 0 0 58828 2560 19932 41104 0 0 0 0 115 488 1 4 95
0 0 0 58828 2556 19932 41104 0 0 0 0 275 862 2 4 94
1 0 0 58828 2556 19932 41104 0 0 0 14 218 677 2 2 96
2 0 0 58828 2524 19452 41488 0 0 809 2 302 871 6 5 89
1 1 1 58828 2708 18012 42816 0 0 2535 1871 741 1900 7 21 72
1 0 0 58828 2128 16328 45012 0 0 993 1132 700 1725 4 11 85
1 1 1 58828 1036 15760 46684 0 0 800 1002 737 1825 3 8 90
2 0 2 58828 1204 15772 46568 0 0 483 501 637 1649 4 6 90
2 0 0 58828 2192 15296 46000 0 0 175 0 665 1473 6 6 88
0 1 1 58828 3132 15764 44668 0 0 1821 1843 684 1726 3 15 83
1 11 1 70996 56144 3300 16512 1704 12464 3298 5555 5287 3710 0 10 89
1 14 0 70920 54200 3816 17868 432 0 361 0 307 143 0 2 98
1 12 0 70820 52568 4268 18940 248 0 294 0 259 157 0 2 98
0 14 0 70760 50652 4732 20332 268 0 368 441 317 346 0 2 98
0 13 0 70696 48936 5140 21580 344 0 333 0 259 299 0 3 97
0 12 0 70660 47196 5588 22824 252 0 322 0 357 323 1 4 95
1 10 0 70560 45316 6048 24152 380 0 359 0 274 346 1 2 97
0 8 0 70524 42784 6944 25708 216 0 402 0 310 153 1 1 98
0 5 0 70376 40380 7608 27256 488 0 431 500 321 152 1 4 95
0 6 0 70312 36856 8696 29640 668 0 612 0 194 152 1 3 96
0 7 0 70284 32680 9848 32628 532 0 758 0 301 240 1 3 96
0 5 1 70256 29232 10764 35124 188 0 631 153 323 178 1 2 97
0 5 1 70128 27444 10768 36784 680 0 448 0 294 337 1 2 97
0 5 1 69884 25056 10784 38880 1524 0 589 16 374 400 5 0 95
0 5 1 69708 23004 10884 40656 944 0 488 387 526 1043 5 5 90
0 4 0 69688 21088 11456 41964 160 0 332 0 453 664 3 4 93
0 2 0 69628 17472 12872 44068 296 0 545 0 518 1432 3 6 91
0 3 0 69612 11496 15708 47124 4 0 779 500 609 1178 3 6 91
0 1 0 69560 5496 18312 50512 332 0 865 500 432 1087 2 8 90
0 0 1 69376 4508 18336 51288 680 0 246 0 301 1452 5 2 93
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: printk()
Date: Wed, 13 Sep 2000 11:10:47 +0200
[EMAIL PROTECTED] wrote:
>
> Greetings,
>
> I have modified the elf binary format loader in binfmt_elf.c to do some
> stuff and I want to print out some information whenever an ELF file
> executes. At the moment I can print it out (using printk()) and it will
> showup all-through boot-up as ELF files are executed. However as soon as
> X starts and I start a terminal session and run an ELF executable I
> cannot get the debugging information to show up.
>
> I think it *may* have something to do with run-levels but I'm not sure.
> If it is this, I would appreciate it if anyone could give me the format
> of the printk() to use so that my debug messages show up no matter
> where/under what runlevel I am executing the ELF binary.
>
> Thanks in Advance
>
> dan.
The messages from the kernel shows up on the current virtual
console, but only if it is in text mode. If your system is
properly configured the messages will be written into a file
as well. Try "xterm -e tail -f /var/log/messages", you need
to be root to do that.
--
Kasper Dupont
------------------------------
From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.misc
Subject: Re: Zip 100 Parallel Port Drive
Date: 13 Sep 2000 09:28:15 GMT
In comp.os.linux.misc Kasper Dupont <[EMAIL PROTECTED]> wrote:
: Could make sense, but all software I have seen using
: SPP works fine even with the bios set to EPP. And I
: also think it would be a very strange choice to
: configure new computers for old broken software
: instead of configuring them for the new and more
: effective ones.
Then you would be very very very wrong. As well as gullible. May I sell
you a new improved glass of water? ;-)
(this is one of the things that mswin sometimes does right btw; its
settings by default are very conservative).
Peter
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: printk()
Reply-To: [EMAIL PROTECTED]
Date: Wed, 13 Sep 2000 09:52:37 GMT
On Wed, 13 Sep 2000 17:35:39 +1000, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>Greetings,
>
>I have modified the elf binary format loader in binfmt_elf.c to do some
>stuff and I want to print out some information whenever an ELF file
>executes.
This is the sort of thing that process accounting is for.
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.misc
Subject: Re: Zip 100 Parallel Port Drive
Date: Wed, 13 Sep 2000 11:51:14 +0200
Peter T. Breuer wrote:
>
> In comp.os.linux.misc Kasper Dupont <[EMAIL PROTECTED]> wrote:
> : Could make sense, but all software I have seen using
> : SPP works fine even with the bios set to EPP. And I
> : also think it would be a very strange choice to
> : configure new computers for old broken software
> : instead of configuring them for the new and more
> : effective ones.
>
> Then you would be very very very wrong. As well as gullible. May I sell
> you a new improved glass of water? ;-)
>
> (this is one of the things that mswin sometimes does right btw; its
> settings by default are very conservative).
>
> Peter
There is quite a difference. Many people wants
to use ancient software on a new OS. But hardly
no one wants to use an ancient OS on a new
computer.
--
Kasper Dupont
------------------------------
From: Nuclear <[EMAIL PROTECTED]>
Subject: Problem in RedHat 6.2 installation
Date: Wed, 13 Sep 2000 10:47:11 GMT
Hi there,
I'm a Linux newbie. I was trying to install Redhat 6.2 at my friend's
place. He has got a 20 GB seagate Hard disk with four partitions as 4.8
GB, 5 GB, 4.8 GB .... and so on.
The problem i faced is that when the installation came to disk
partitioning it gave me an error message saying that the boot partition
i.e. "C:\" - the first 4.8 GB partition is too big.....
Then it refused to make any new partitions in the empty space.
Pls. Help me get around this problem.
Thank you.
Can contact me at [EMAIL PROTECTED] or [EMAIL PROTECTED]
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
******************************