Linux-Development-Sys Digest #814, Volume #7 Sun, 30 Apr 00 18:13:15 EDT
Contents:
Re: Two really easy (I'm sure) questions (Kaz Kylheku)
Query: CPU Cache Management (Tom Roberts)
Re: Two really easy (I'm sure) questions ("Mark Graybill")
Re: Two really easy (I'm sure) questions (Kaz Kylheku)
Re: Two really easy (I'm sure) questions ("Mark Graybill")
Have new parallel port - but it's PCI!! (Chris Rankin)
Recompiling the Kernel kills my sound module (Stephen Biggs)
2.3.99-pre6: can't compile bootsect.S (Giampaolo Tomassoni)
Re: 2.3.99-pre6: can't compile bootsect.S (Robert Schiele)
I need information about Raw Socket ("Ruben")
(yet another newbie question) (Pipegeek)
Re: where can i find a kernel debugger? (Jean-Paul Chemaly)
Locking user space buffers. (liran)
Re: GCC Install (was Glibc2 install) (J.H.M. Dassen (Ray))
Re: converting htond (host to netwrok double) (Frank Pilhofer)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: Two really easy (I'm sure) questions
Reply-To: [EMAIL PROTECTED]
Date: Sun, 30 Apr 2000 05:26:16 GMT
On Sun, 30 Apr 2000 03:28:51 GMT, Mark Graybill <[EMAIL PROTECTED]> wrote:
>
>
>>
>>Second question: How can I direct the compiler's output (the error
>>messages) to a file? I've tried gcc hello.cc > testfile and testfile is
>>created but not written to. So how can I do this? Thanks in advance
>>for any help!
>>
>
>try:
>
>gcc hello.cc 2<&1 | tee make.out
Should be 2>&1 :)
>tee should be in usr/bin.
>
>If not the following basic program should work:
>
>#include <stdio.h>
>
>main(void)
>{
> FILE *oFile;
> char buff[512];
> int cnt;
>
> if((oFile=fopen("MAKE.OUT","w"))!=NULL)
> {
> do
> {
> cnt=fread(buff,1,1,stdin);
> printf(buff);
Oops; buff is not null terminated. Also, it could contain
something that looks like a printf conversion specifier.
> fwrite(buff,1,1,oFile);
>
> }while(cnt && !feof(stdin));
>
> fclose(oFile);
> }
>}
>
>
>-Mark
>
>
--
#exclude <windows.h>
------------------------------
Date: Sun, 30 Apr 2000 00:24:50 -0500
From: Tom Roberts <[EMAIL PROTECTED]>
Subject: Query: CPU Cache Management
I heave read several books on writing Linux device drivers and on the
Linux Kernel, but none of them discuss managing the CPU cache at all.
How does Linux manage the cache for memory-mapped I/O devices? What
functions are there to invalidate, store, and flush portions of the
CPU's cache?
I assume that using ioremap() will obtain an uncached map to physical
memory, while any memory from kmalloc() and get_free_pages() will be
cached. But the books never mention this at all -- is this true?
Note users should never need to understand the cache structure of
the CPU, but kernel hackers MUST. Especially in multiple-CPU
systems (not SMP -- for that snooping hardware solves the problem;
I have non-snoopable hardware for which any CPU can access any
other CPU's memory -- each CPU runs its own kernel).
And also: how can I get the physical address of the first page from
get_free_pages() so I can use ioremap to reference THE SAME physical
memory? -- Yes I know accessing memory both cached and uncached
requires programming care, but I think such an approach is
appropriate for what I am doing:
I expect to allocate an inter-CPU buffer with get_free_pages(),
and put a set of buffer control fields at the start of it. I want
cached access for the buffer itself, but uncached access to the
control fields (via different virtual addresses, of course). This
requires manual management of the CPU cache for such buffers. I'll
put a 16-byte flag at the start of the buffer-control fields so
the other CPU can find it by simply scanning the start of each page
of the other CPU's memory. If this double-access turns out to be
impossible, I'll simply put each field into its own cache line,
but that entails a performance penalty (and wastes an insignificant
few bytes of memory).
I am investigating using Linux on an existing mulriple-PowerPC PCI
board without any ethernet interface, so I will need to develop a
pair of "backplane IP" drivers. My best guess of how to do this is
to implement a serial char device which uses an on-board memory
buffer and then layer SLIP on it. I'll probably implement two such
devices, one for the Linux console and the other for SLIP and NFS.
While developing a proprietary real-time OS, CPU cache management
turned out to be the largest single source of problems. In a
multi-processor system this can be a complex subject full of
1-in-a-million errors (:-(). I am very surprised that NONE of the
books I have mention CPU caches at all, nor does any HOWTO seem to
discuss this.
Tom Roberts [EMAIL PROTECTED]
------------------------------
Reply-To: "Mark Graybill" <[EMAIL PROTECTED]>
From: "Mark Graybill" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: Two really easy (I'm sure) questions
Date: Sun, 30 Apr 2000 05:44:36 GMT
You can do it that way also. Whatever way you choose would only be for
rhetorical reasons anyway - flip a coin.
2<&1 - heads
2>&1 - tails
The both work; try it.
Kaz Kylheku wrote in message ...
>>gcc hello.cc 2<&1 | tee make.out
>
>Should be 2>&1 :)
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: Two really easy (I'm sure) questions
Reply-To: [EMAIL PROTECTED]
Date: Sun, 30 Apr 2000 05:55:26 GMT
On Sun, 30 Apr 2000 05:44:36 GMT, Mark Graybill <[EMAIL PROTECTED]> wrote:
>You can do it that way also. Whatever way you choose would only be for
>rhetorical reasons anyway - flip a coin.
>
>2<&1 - heads
>2>&1 - tails
The first duplicates an input descriptor. The second duplicates an output
descriptor. It's sort of an academic difference since the dup2 system call is
used underneath. Still, if you are working with output descriptors, it's
probably best to use the output descriptor duplicating form.
--
#exclude <windows.h>
------------------------------
Reply-To: "Mark Graybill" <[EMAIL PROTECTED]>
From: "Mark Graybill" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: Two really easy (I'm sure) questions
Date: Sun, 30 Apr 2000 07:00:08 GMT
Kaz Kylheku wrote in message ...
>The first duplicates an input descriptor. The second duplicates an output
>descriptor. It's sort of an academic difference since the dup2 system call
is
>used underneath. Still, if you are working with output descriptors, it's
>probably best to use the output descriptor duplicating form.
Deja vu... Didn't we have a similar trivial discussion about void main()?
:)
Since the underlying code is a shell, I wouldn't think it would be calling
system calls for such things. Although I have participated in other OS
development projects, I am new to Linux and have no experience with command
shells.
Again, I hear best practice or best to use, but not why (as a scientist, I
always ask why.) :)
Best,
Mark
------------------------------
From: Chris Rankin <au.zipworld.com@{no.spam}rankinc>
Crossposted-To: comp.os.linux.hardware
Subject: Have new parallel port - but it's PCI!!
Date: Sun, 30 Apr 2000 18:35:25 +1000
Hi,
(Firstly, sorry if this message shows up twice: my ISP's news server is
playing up)
I have just installed a new parallel port into my PC, but am having
trouble configuring it. The fact that's it's PCI doesn't help matters, I
think, but anyway:
This is the output from lspci:
00:0e.0 Class 0783: Syba Tech Ltd Multi-IO Card (rev 92) (prog-if 15)
Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 9
Region 0: I/O ports at f800
I have tried to configure this port as LPT2 by setting the IRQ to 9 and
the IO to 0x278 in modules.conf. I then loaded the parport driver and
got this:
/proc/parport/1/autoprobe:
MODEL:Unknown device;
MANUFACTURER:Unknown vendor;
/proc/parport/1/devices:
/proc/parport/1/hardware:
base: 0x278
irq: 9
dma: none
modes: SPP,PS2
/proc/parport/1/irq:
9
This seemed OK, but I then plugged my Zip100 drive into the port
(shutdown first, of course) and got "zip" !! I also saw the following
lines in /var/log/kernel:
Apr 29 23:39:23 WellHouse kernel: 0x278: CTR: wrote 0x0c, read 0xff
Apr 29 23:39:23 WellHouse kernel: 0x278: DATA: wrote 0xaa, read 0xff
which come from this piece of code in parport_pc.c:
if (user_specified)
/* That didn't work, but the user thinks there's a
* port here. */
printk (KERN_DEBUG "0x%lx: CTR: wrote 0x%02x, read 0x%02x\n",
pb->base, w, r);
So does this mean that my spiffy PCI card requires some kind of manual
configuration so that it knows which port to use? And presumably
something similar to switch it between SPP, ECP and EEP? Well, I was
kind of expecting the latter...
It looks like I'm going to have to modify the parport driver to do
this... unless "setpci" can come to my rescue??? (somehow???)
I have tried using 0xf800 as the parallel port address too, to no avail.
Can anyone give me a jump-start here, please?
Cheers,
Chris.
PS: The card, port and ZIP drive work fine under That Other OS. There is
also a 68K VB tool which does some manual configuration. Does anyone
know of a good disassembler for Linux so that I can pull this thing
apart, if necessary?
------------------------------
Crossposted-To: comp.os.linux.setup,linux.dev.kernel
Subject: Recompiling the Kernel kills my sound module
From: [EMAIL PROTECTED] (Stephen Biggs)
Date: Sun, 30 Apr 2000 09:34:01 GMT
Very disturbing...
Redhat 6.2 installed from ISO downloaded and burned into CD rom. No problems
until I used 'make xconfig' to add NTFS module support. I did everything that
the Redhat reference guide said to do (make mrproper, etc...) and in the right
order.
The new kernel boots but during the boot I get this (from /var/log/boot.log):
Apr 30 01:29:29 localhost depmod: depmod:
Apr 30 01:29:29 localhost depmod: *** Unresolved symbols in
/lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o
Apr 30 01:29:29 localhost rc.sysinit: Finding module dependencies succeeded
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol remap_page_range
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol __wake_up
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol kmalloc
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol boot_cpu_data
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol interruptible_sleep_on
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol __pollwait
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol kfree
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol __verify_write
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol best_copy_to_user
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol best_copy_from_user
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol mem_map
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
unresolved symbol printk
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
insmod /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o failed
Apr 30 01:29:30 localhost modprobe: /lib/modules/2.2.14-5.0ntfs/misc/emu10k1.o:
insmod emu10k1 failed
Apr 30 01:29:30 localhost rc.sysinit: Loading sound module (emu10k1) failed
The kernel continues booting and my NTFS works, but, of course, I have no
sound. The original kernel DID work with sound.
This module is somehow not dynamically linking to the kernel exports. Is this
some sort of munging problem on the symbols?
Any ideas what I am doing wrong? Did I not copy something right into the /boot
directory?
Any help would be most appreciated.
Thanks.
------------------------------
From: Giampaolo Tomassoni <[EMAIL PROTECTED]>
Subject: 2.3.99-pre6: can't compile bootsect.S
Date: Sun, 30 Apr 2000 12:45:07 GMT
Dears,
I'm getting an error in compiling linux-2.3.99-pre6 on my i686 (PII)
platform.
Make bzlilo works mostly fine, but when is the time to compile the boot
module arch/i386/boot/bootsect.S my compiler complaints with the
following error:
make[1]: Entering directory `/usr/src/linux-2.3.99-pre6/arch/i386/boot'
gcc -E -D__KERNEL__ -I/usr/src/linux-2.3.99-pre6/include
-D__BIG_KERNEL__ -traditional -DSVGA_MODE=NORMAL_VGA bootsect.S -o
bbootsect.s
as -o bbootsect.o bbootsect.s
bbootsect.s: Assembler messages:
bbootsect.s:1040: Error: base/index register must be 32 bit register
bbootsect.s:1047: Error: base/index register must be 32 bit register
bbootsect.s:1048: Error: base/index register must be 32 bit register
bbootsect.s:1049: Error: base/index register must be 32 bit register
bbootsect.s:1302: Error: base/index register must be 32 bit register
make[1]: *** [bbootsect.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.3.99-pre6/arch/i386/boot'
make: *** [bzlilo] Error 2
The problem seems to be caused by lines like this:
ldsw %fs:(%bx), %si
and is probably due to the fact that my version of gas (v.2.9.1, the
latest) woun't understand that the source is speaking about 16 bits
code, not 32 bits one ...
I found this kind of problem also trying to install version 2.3.99-pre5.
Is there any way to circumvent the empasse?
Thanks,
------------------------------
From: Robert Schiele <[EMAIL PROTECTED]>
Subject: Re: 2.3.99-pre6: can't compile bootsect.S
Date: Sun, 30 Apr 2000 15:11:16 +0200
Giampaolo Tomassoni wrote:
> and is probably due to the fact that my version of gas (v.2.9.1, the
> latest) woun't understand that the source is speaking about 16 bits
> code, not 32 bits one ...
v.2.9.1 is not the latest.
Which patchlevel of binutils do you have?
According to Documentation/Changes you need at least 2.9.1.0.7.
I am using 2.9.5.0.24 and everything works just fine for me.
Robert
--
Robert Schiele mailto:[EMAIL PROTECTED]
Tel./Fax: +49-621-10059 http://webrum.uni-mannheim.de/math/rschiele/
------------------------------
From: "Ruben" <[EMAIL PROTECTED]>
Subject: I need information about Raw Socket
Date: Sat, 29 Apr 2000 00:36:35 +0200
if someone has information about Raw Socket he will can tell me it.
Thanks you.
------------------------------
From: [EMAIL PROTECTED] (Pipegeek)
Subject: (yet another newbie question)
Date: 30 Apr 2000 16:22:11 GMT
Is there a version of Quicktime (or some sort of clone) for Linux? This is
(oddly enough) one of the major factors in whether or not I switch OSs.
PTR
======================
"I love California. I practically grew up in Phoenix." -Dan Quayle
Protect privacy, boycott Intel: http://www.bigbrotherinside.org
========================================
[EMAIL PROTECTED]
ICQ: 53338265
==============
------------------------------
Date: Sun, 30 Apr 2000 19:24:40 +0200
From: Jean-Paul Chemaly <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: where can i find a kernel debugger?
James Cownie wrote:
>
> Zoran Cutura wrote:
> >
> > There is no such thing like a kernel debugger. You can remote debug
> > the kernel with gdb, which is very complicated, and I never managed to
> > do so.
>
> You could try the supposedly packaged version of that
> "kGDB (Remote kernel debugger)"
> at
> http://www.oss.sgi.com/projects/kgdb/
>
> (I haven't tried it myself...)
>
> -- Jim
Best and safest way is to use printk for debugging. Just one thing to
add: everything you print out gets out on the console, so if you're
running X, you probably won't see anything (I had the problem myself).
If you use the latter, open a terminal window and launch the command
dmesg which out the kernel ouput.
J.p.
------------------------------
From: liran <[EMAIL PROTECTED]>
Subject: Locking user space buffers.
Date: Sun, 30 Apr 2000 09:53:26 -0700
Hi,
I need to lock user space buffer in the kernel to avoid
double buffering.
is it possible?
where can I read about it.
Thanks Liran.
* Sent from AltaVista http://www.altavista.com Where you can also find related Web
Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
------------------------------
From: [EMAIL PROTECTED] (J.H.M. Dassen (Ray))
Subject: Re: GCC Install (was Glibc2 install)
Date: Sun, 30 Apr 2000 16:41:02 +0200
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>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?
The most notable improvements between these versions are in C++, so if you
develop or compile modern C++ code, you should consider upgrading.
If you're interested in keeping your system up to date in general, you may
want to consider switching to a distribution that has proper package
management and that can be incrementally updated, like Debian or Red Hat.
HTH,
--
Ray Dassen <[EMAIL PROTECTED]>
------------------------------
From: [EMAIL PROTECTED] (Frank Pilhofer)
Crossposted-To: comp.unix.programmer,comp.programming,comp.os.linux.networking
Subject: Re: converting htond (host to netwrok double)
Reply-To: [EMAIL PROTECTED]
Date: 30 Apr 2000 23:45:08 +0200
Sudhindra Suresh Bengeri <[EMAIL PROTECTED]> wrote:
>
> I want to implement host to netwrok double, here is how I was trying to
> do it
>
There is no such thing as a "network double", you need to take your
machine's floating point format into account and agree on a common for-
mat for transfer. Frequently, the sanest thing to do is to encode them
as strings. Another common representation is the IEEE floating point
format:
Bit:
Byte: 7 6 5 4 3 2 1 0
0 sign e10 e9 e8 e7 e6 e5 e4
1 e3 e2 e1 e0 f51 f50 f49 f48
2..7 f47 ... ... f0
i.e. 11 bits exponent and 52 bit mantissa, with the final value being
value = -1^(sign) * 2^(exponent - 1023) * (1 + mantissa).
This is the big-endian representation, for little-endian, the bytes are
reversed.
Hope this helps,
Frank
--
+ Frank Pilhofer [EMAIL PROTECTED] +
| http://www.uni-frankfurt.de/~fp/ |
+---- Life would be a very great deal less weird without you. - DA ----+
------------------------------
** 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
******************************