Linux-Development-Sys Digest #36, Volume #7 Tue, 10 Aug 99 06:14:03 EDT
Contents:
Re: Linux assembly, etc (Kaz Kylheku)
Re: Cross-compiling kernel ->PowerPC (Michael Meissner)
RH 6.0 modprobe for lo (Robin Becker)
RH 6.0 Crappy boot stuff (Robin Becker)
Re: GCC byte alignment flag for structures (Michael Meissner)
Re: Linux assembly, etc (Johan Kullstam)
Re: Help: Shared Memory!! (Kaz Kylheku)
Help: Shared Memory!! (Kenny Zhu Qili)
Re: g++ (Chris Butler)
Re: Linux assembly, etc (Alexander Viro)
Re: "Domain validation" for reading tape archive??? (Andreas Dilger)
Re: Device Driver (Josef =?iso-8859-1?Q?M=F6llers?=)
Re: Device Driver (Mogens Dybaek Christensen)
Re: Help: Shared Memory!! ([EMAIL PROTECTED])
nanosleep() (Mogens Dybaek Christensen)
Re: the way that users can't move to high directory... (Karl Heyes)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Linux assembly, etc
Date: Tue, 10 Aug 1999 03:10:40 GMT
On 09 Aug 1999 19:08:18 -0400, Johan Kullstam <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] (Alexander Viro) writes:
>
>> In article <[EMAIL PROTECTED]>,
>> Johan Kullstam <[EMAIL PROTECTED]> wrote:
>> >system calls in linux are C function calls. you could look at the
>> >kernel as a low-level shared library. the linker/loader will set up
>> >the appropriate hooks.
>>
>> Oh, puh-lease! We don't share that idiocy with OS/2. System calls
>> do not use call gates and they are *not* affected by dynamical linker.
>> Libc *is* a library and it contains the wrappers for system calls, but
>> syscalls themselves are done via the single vector. Interface to the kernel
>> is not a shared lib one.
>
>of course it's not *really* a shared library. however, on the surface
>it shares a couple of attributes:
>
>1) system calls are done by a C subroutine call mechanism. in x86 you
> push args onto the stack and use a `call' instruction.
Linux system calls are done by executing traps. On x86, this would be the int
instruction. The C functions in libc are just wrappers, that set up the
arguments, hit the trap and then fix up the result into a return value and
errno.
>2) the kernel is always in memory and all applications share it.
But you can't see it because it's inaccessible.
------------------------------
Subject: Re: Cross-compiling kernel ->PowerPC
From: Michael Meissner <[EMAIL PROTECTED]>
Date: 09 Aug 1999 23:17:44 -0400
Robin Smith <[EMAIL PROTECTED]> writes:
> BRIOLE <[EMAIL PROTECTED]> writes:
>
> > Hello all,
> >
> > I would like to use Linux on IBM rs6k model 250 workstations
> > (power pc 601 based), but I need to cross-compile Linux
> > for these workstations from a 80x86 based Linux PC.
> > How can I do this? (I'm a new in cross-compiling)
> >
> > I thank you in advance,
> >
> > Sylvain.
> >
> > --
> > Sylvain Briole (aka Eclice sur IRC / supaero)
> > Lille - Nord - France
> > EMail InterNet : [EMAIL PROTECTED] / [EMAIL PROTECTED]
>
> I did this sort of thing many years ago when I wanted to compile Atari
> ST programs on Suns when Suns were based on the 68000 series of chips.
>
> The simple solution is to get the C compiler for your target platform
> ( Power PC ) and compile this on the 80x86 platform. The
> compiler/assembler only produces files of numbers. I'm not sure if you
> will have big-endian/little-endian problems but give this a try.
Another way is to start with either LinuxPPC or Yellowdog releases that contain
prebuilt linuxes (assuming they support they IBM platform -- I suspect you can
use the COFF kernel for those boxes).
If you still need to build a cross compiler, you need to get an appropriate
egcs compiler release and a binutils release. You use an --prefix= switch to
specify where to install the compiler and tools and a --target=powerpc-linux
switch to configure the cross compiler. You probably need to copy over the
libraries and include files and use the --with-includes= and --with-libs=
switches (the normal cross compilers I build use the Cygnus one tree mechanisim
and are targeted to embedded platforms, so I'm blanking on all of the steps
needed to make a cross compiler with the egcs tools).
The only cross endian bug I'm aware was fixed some time ago (if you compiled
code that used floating point constants that fit a certain pattern and used the
-msoft-float, and if the target endian was different from the host endian as it
is in this case, it would generate the wrong constant).
--
Michael Meissner, Cygnus Solutions
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886
email: [EMAIL PROTECTED] phone: 978-486-9304 fax: 978-692-4482
------------------------------
From: Robin Becker <[EMAIL PROTECTED]>
Subject: RH 6.0 modprobe for lo
Date: Tue, 10 Aug 1999 03:33:35 +0100
I'm getting some spurious boot messages about modprobe being unable to
find the lo device. I have inserted an 'alias lo off' line in
/etc/conf.modules and certainly attempts made after the boot to modprobe
for lo certainly don't cause errors. I have most of the net stuff in
modules, but can't figure this nonsense out.
--
Robin Becker
------------------------------
From: Robin Becker <[EMAIL PROTECTED]>
Subject: RH 6.0 Crappy boot stuff
Date: Tue, 10 Aug 1999 03:29:21 +0100
I see there are some nonsense things in the rc.sysinit. The there are
some attempts made to link
System.map-version, modules-info-version and vmlinuz-version in /boot at
a time when the /boot volume is not linked. I'm not very clear whether
this is vital and would like to know how and what the modules-info file
is about/produced?
--
Robin Becker
------------------------------
Crossposted-To: comp.os.linux.development.apps
Subject: Re: GCC byte alignment flag for structures
From: Michael Meissner <[EMAIL PROTECTED]>
Date: 09 Aug 1999 23:23:43 -0400
Matthew Carl Schumaker <[EMAIL PROTECTED]> writes:
> I wish I could except that we have about a dozen apps using this structure
> distributed to about 600 clients (this problem is server side obviously)
>
> recompiling all the apps and distributing them is an absolute last resort
It is still broken to assume a given endian and alignment outside of a given
system. You really need to think about doing this portably, or your code will
break for instance when you move it to a 64-bit Merced.
--
Michael Meissner, Cygnus Solutions
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886
email: [EMAIL PROTECTED] phone: 978-486-9304 fax: 978-692-4482
------------------------------
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Linux assembly, etc
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 09 Aug 1999 22:48:04 -0400
[EMAIL PROTECTED] (Alexander Viro) writes:
> In article <[EMAIL PROTECTED]>,
> Johan Kullstam <[EMAIL PROTECTED]> wrote:
> >of course it's not *really* a shared library. however, on the surface
> >it shares a couple of attributes:
> >
> >1) system calls are done by a C subroutine call mechanism. in x86 you
> > push args onto the stack and use a `call' instruction.
>
> Check the facts, please. It's done by putting the values into registers
> followed by int 0x80. No trace of call. We are *not* using the call
> gate - it's a trap gate and nothing is copied from the caller's stack.
> Check arch/i386/kernel/{trap.c,entry.S} for details. Or just do the following:
> al@bird:/tmp$ ar x /usr/lib/libc.a write.o
> al@bird:/tmp$ objdump --disassemble write.o |less
>
> write.o: file format elf32-i386
>
> Disassembly of section .text:
>
> 00000000 <__libc_write>:
> 0: 53 pushl %ebx
> 1: 8b 54 24 10 movl 0x10(%esp,1),%edx
> 5: 8b 4c 24 0c movl 0xc(%esp,1),%ecx
> 9: 8b 5c 24 08 movl 0x8(%esp,1),%ebx
> d: b8 04 00 00 00 movl $0x4,%eax
> 12: cd 80 int $0x80
> 14: 5b popl %ebx
> 15: 3d 01 f0 ff ff cmpl $0xfffff001,%eax
> 1a: 0f 83 fc ff ff jae 1c <__libc_write+0x1c>
> 1f: ff
> 20: c3 ret
>
> No calls. write(fd,buf,len) is %eax=4; %ebx=fd; %ecx=buf; %edx=len; int 0x80;
> followed by error handling (return value is in %eax, if it's between -0x1000
> and 0 - jump to the standard routine that sets errno and returns -1). 4 here
> is the number of syscall. Using call gates takes more cycles and clutters
> GDT. None of Unices on x86 does it.
thanks. i stand corrected.
i was naively using gcc -S on a short C program using `open'.
--
J o h a n K u l l s t a m
[[EMAIL PROTECTED]]
Don't Fear the Penguin!
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Help: Shared Memory!!
Date: Tue, 10 Aug 1999 03:56:56 GMT
On 10 Aug 1999 03:10:47 GMT, Kenny Zhu Qili <[EMAIL PROTECTED]> wrote:
>I'm writing a client/server application in C++. I need to dynamically
>allocate space for objects from a pool of shared memory defined earlier.
>I'm new to IPC and all I know is to use shmat() to attach a piece of
You should use shmget() to create the segment first.
>memory to an address, but that doesn't help me much.
You need to create a mapping that has the same address in each process.
Otherwise the objects can't contain any pointers to other objects. Also any
hidden pointers generated by the C++ implementation will have to be correct. If
class Foo has a vtable at address 0x1234567A in one process, then that address
had better refer to a Foo vtable in every other process that uses the object,
or else! The vtable address depends on what modules are present in the
executable and what order they are linked in. So unless all of the processes
have identical executables, or you otherwise ensure that the vtables are at the
same address in each process, you can't have polymorphic objects in shared
space. It might be safer to stick to using only structs, or non-polymorphic
class objects (no virtual functions).
>Predefined shared
>memory is fixed sized. Could some one give me an example in C++? Another
>question is since shmat() returns char*, does that mean I have to do a
>cast from my object class type to char*? Please email me back if
No, you have to cast from char * to your object type, as you would
with malloc.
------------------------------
From: Kenny Zhu Qili <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Help: Shared Memory!!
Date: 10 Aug 1999 03:10:47 GMT
I'm writing a client/server application in C++. I need to dynamically
allocate space for objects from a pool of shared memory defined earlier.
I'm new to IPC and all I know is to use shmat() to attach a piece of
memory to an address, but that doesn't help me much. Predefined shared
memory is fixed sized. Could some one give me an example in C++? Another
question is since shmat() returns char*, does that mean I have to do a
cast from my object class type to char*? Please email me back if
possible. Thanks in advance.
Kenny Zhu
------------------------------
From: [EMAIL PROTECTED] (Chris Butler)
Subject: Re: g++
Date: 9 Aug 1999 23:27:09 +0100
[comp.os.linux.development.system - 4 Aug 1999 02:45:50 GMT] * Horst von wrote *
>>>You should NEVER put . in your path.
> [...]
>>>If you happen to visit my directory and type 'ls',
>>>then you're screwed.. I could also put my 'ls' in
>>>/tmp, and if you 'cd /tmp' and 'ls', you're doomed.
>>PATH=$PATH:. ... . ought to be the last entry, then
>>you can type ls until the cows come home 8)
> But you'd type 'sl' once in a while... dystypia can be deadly.
Of course, the easy solution to this one:
/dev/hdb10 on /tmp type ext2 (rw,noexec,nosuid,nodev)
--
Chris Butler
<[EMAIL PROTECTED]>
------------------------------
From: [EMAIL PROTECTED] (Alexander Viro)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Linux assembly, etc
Date: 10 Aug 1999 00:58:52 -0400
In article <[EMAIL PROTECTED]>,
Johan Kullstam <[EMAIL PROTECTED]> wrote:
>thanks. i stand corrected.
>
>i was naively using gcc -S on a short C program using `open'.
Right. It calls open(). Which is a normal function in libc. Now, if you will
look at the body of that function you'll see the same code as in write(),
except that syscall number is 5. Indeed we have wrappers with the normal
C calling conventions, but they are outside of the kernel. If you prefer
to use the inlined versions you can have them - see example in this
thread (syscall.h and friends).
--
There *is* something on port 23 but it ain't TELNET...
Zack Weinberg in Scary Devil Monastery.
------------------------------
From: [EMAIL PROTECTED] (Andreas Dilger)
Subject: Re: "Domain validation" for reading tape archive???
Date: 10 Aug 1999 05:43:28 GMT
In article <6iur3.1925$[EMAIL PROTECTED]>,
Josh Stern <[EMAIL PROTECTED]> wrote:
>However, for directories that
>are not nfs mounted I piped the output of tar
>running on the Linux machine to rsh "dd of=/dev/tape"
>on the Sun box.
>
>I find messages like this:
>
>Aug 10 00:34:32 Atlas kernel: (scsi0:0:5:0) Performing Domain validation.
Try adding a block size parameter to the dd statement, maybe "bs=64k" so
that it writes fixed-size blocks to the tape. Otherwise it will be slow
reading variable sized records.
Cheers, Andreas
--
Andreas Dilger University of Calgary \"If a man ate a pound of pasta and
Micronet Research Group \ a pound of antipasto, would they
Dept of Electrical & Computer Engineering \ cancel out, leaving him still
http://www-mddsp.enel.ucalgary.ca/People/adilger/ hungry?" -- Dogbert
------------------------------
From: Josef =?iso-8859-1?Q?M=F6llers?= <[EMAIL PROTECTED]>
Subject: Re: Device Driver
Date: Tue, 10 Aug 1999 07:57:23 +0200
Adam Meyerowitz wrote:
> =
> Hello,
> =
> I am kind of new to linux. I need to grab an interrupt and somehow
> notify the application that the interrupt has occurred. Am I correct
> in thinking that this must be a device driver. How would the device
> driver communicate with the ring3 app. Under Win 95/98/NT I can
> use events are asynchronous procedure calls. Are these things possible=
> in linux. Any help or direction would be appreciated.
As always: it depends.
Of course, a driver is the one and only place to deal with hardware.
If you can wait for an interrupt, you can use an ioctl to enter the
driver and return when the interrupt has occurred, returning all
necessary information in a user supplied buffer, e.g.
ioctl(fd, WAITINT, &info);
If you can't wait for an interrupt, i.e. if it occurs asynchronously and
must be delivered as such, you need a two-part approach:
1. notify the driver that the current process is the one, this might be
implicitly done just by opening the driver.
2. send a notification to the application process. This is naturally
done by using signals. Of course, you must choose the signal wisely not
to interfere with other signal sources. You might even use an ioctl to
tell the driver which signal to send when the interrupt occurs.
My 2cts,
Josef
-- =
PS Die hier dargestellte Meinung ist die persoenliche Meinung des
Autors!
PS This article reflects the autor=B4s personal views only!
------------------------------
From: Mogens Dybaek Christensen <[EMAIL PROTECTED]>
Subject: Re: Device Driver
Date: Tue, 10 Aug 1999 10:14:57 +0200
Take a look at "Linux Kernel Module Programming Guide" available at LDP
(sunsite and mirrors). It has good examples.
See also "Linux I/O port programming mini-HOWTO".
Adam Meyerowitz wrote:
>
> Hello,
>
> I am kind of new to linux. I need to grab an interrupt and somehow
> notify the application that the interrupt has occurred. Am I correct
> in thinking that this must be a device driver. How would the device
> driver communicate with the ring3 app. Under Win 95/98/NT I can
> use events are asynchronous procedure calls. Are these things possible
> in linux. Any help or direction would be appreciated.
>
> Is it benefical to use like rtlinux or something like that????
>
--
Mogens Dybaek Christensen | http://www.adtranz-signal.dk
ABB Daimler-Benz Transportation Signal A/S | mailto:[EMAIL PROTECTED]
Stamholmen 193, DK-2650 Hvidovre, Denmark | Phone: +45 3639 0267
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Help: Shared Memory!!
Crossposted-To: comp.os.linux.development.apps
Date: 10 Aug 1999 08:57:08 GMT
In comp.os.linux.development.system Kenny Zhu Qili <[EMAIL PROTECTED]> wrote:
: I'm writing a client/server application in C++. I need to dynamically
: allocate space for objects from a pool of shared memory defined earlier.
: I'm new to IPC and all I know is to use shmat() to attach a piece of
: memory to an address, but that doesn't help me much. Predefined shared
: memory is fixed sized. Could some one give me an example in C++? Another
: question is since shmat() returns char*, does that mean I have to do a
: cast from my object class type to char*? Please email me back if
: possible. Thanks in advance.
The SysV IPC shm* functions are a bugger to use.
I wrote a set of patches for mmalloc a while back
that let you do this in a much more natural way.
Basically, all your applications share a persistent
shared file, and can use malloc/free-like semantics
to allocate and deallocate blocks of mmapped
memory from this file. When the applications go
away (and even when the machine is turned off)
the shared memory/file stays around. Mail me
directly and I'll dig up the code for you.
Rich.
--
[EMAIL PROTECTED] | Free email for life at: http://www.postmaster.co.uk/
BiblioTech Ltd, Unit 2 Piper Centre, 50 Carnwath Road, London, SW6 3EG.
+44 171 384 6917 | Click here to play XRacer: http://xracer.annexia.org/
--- Original message content Copyright � 1999 Richard Jones ---
------------------------------
From: Mogens Dybaek Christensen <[EMAIL PROTECTED]>
Subject: nanosleep()
Date: Tue, 10 Aug 1999 10:45:05 +0200
Hi,
I am experimenting with nanosleep(), but I cannot compile the module
referencing it.
According to the man page I should just include <time.h>, but the
structure timespec, which is the parameter(s) of nanosleep(), is
undefined.
It seems it should come from <linux/time.h> which in turn is picked up
via <sys/time.h> from <time.h>.
Can anyone give a hint? Is nanosleep outdated by another function?
gcc is version 2.7.2.3, the whole kit is Slackware 4.0 with kernel
2.2.6.
--
Mogens Dybaek Christensen | http://www.adtranz-signal.dk
ABB Daimler-Benz Transportation Signal A/S | mailto:[EMAIL PROTECTED]
Stamholmen 193, DK-2650 Hvidovre, Denmark | Phone: +45 3639 0267
------------------------------
From: Karl Heyes <[EMAIL PROTECTED]>
Subject: Re: the way that users can't move to high directory...
Date: Mon, 09 Aug 1999 17:43:21 +0100
"����ȫ" wrote:
> I want to know the way that the users can't move to the high
> directory....Like Proftp..
>
> It is very hard to know ...like me....beginner.
>
> I use Redhat Linux 5.1 and 6.0.
> and webhosting server.
sounds like chroot
karl
------------------------------
** 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
******************************