Linux-Development-Sys Digest #304, Volume #8     Mon, 27 Nov 00 16:13:17 EST

Contents:
  Re: modify syscall readdir read (Kasper Dupont)
  synchronise the date ("Xavier Houppertz")
  Re: synchronise the date (Arne Driescher)
  Dynamic loading ? (Peter)
  Re: saving/restoring a process (Kasper Dupont)
  Re: Dynamic loading ? (Kasper Dupont)
  Help on booting linux ("Dirk")
  Re: Software RAID (Warren Young)
  Re: Dynamic loading ? (Josef Moellers)
  Re: synchronise the date (Michel Bardiaux)
  Re: synchronise the date (Villy Kruse)
  XTI o TLI ("Massimiliano Caovilla")
  Re: Dynamic loading ? (Kaz Kylheku)
  Re: linux software-interupt open file? (Josef Moellers)
  Re: XTI o TLI (Andi Kleen)
  TULIP driver problem with 2.2.17 (Paul Repacholi)
  Re: I admit it! ("Andreas Haberstroh")
  Re: rdtsc() timestamps synchronized between SMP CPU's? ("Norman Black")

----------------------------------------------------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: de.comp.os.unix.linux.misc,linux.dev.kernel,linux.sources.kernel
Subject: Re: modify syscall readdir read
Date: Mon, 27 Nov 2000 11:09:16 +0100

Thiemo Voigt wrote:
> 
> The code for the proc file system stuff is (this is Linux 2.4) in /fs/proc.
> I guess (but I am not sure) that you should be able to read current (process
> who made the call), get its pid, get the owner (uid) of the process
> (not sure about that but look it up) and compare to the other processes running
> 
> and their owners.
> 
> Thiemo

If you only want to change behavioure of the /proc filesystem
it is better to change only that filesystem instead of the
system calls.

If you want to change permitions for theese directories I
think you need only change the struct proc_dir_entry proc_pid
in fs/proc/base.c

S_IFDIR | S_IRUGO | S_IXUGO should be changed to
S_IFDIR | S_IRUSR | S_IXUSR

UGO is short for User+Group+Other
USR is short for User

-- 
Kasper Dupont

------------------------------

From: "Xavier Houppertz" <[EMAIL PROTECTED]>
Subject: synchronise the date
Date: Mon, 27 Nov 2000 12:27:05 +0100

hi there,

I run linux on different sites and would like to synchronise the date and
time with the master server automatically once a month (i will put the file
in cron.monthly).

How can i fo that ? By mean of ftp or telnet ???

thanks ,

Xavier



------------------------------

From: Arne Driescher <[EMAIL PROTECTED]>
Subject: Re: synchronise the date
Date: Mon, 27 Nov 2000 13:34:37 +0100

Xavier Houppertz wrote:
> 
> hi there,
> 
> I run linux on different sites and would like to synchronise the date and
> time with the master server automatically once a month (i will put the file
> in cron.monthly).
> 
> How can i fo that ? By mean of ftp or telnet ???
> 
> thanks ,
> 
> Xavier
Hi,

the network time protocol is your friend :-)
Look out for xntp, ntpd, ntp or what ever your system
uses.

-Arne

------------------------------

From: Peter <[EMAIL PROTECTED]>
Subject: Dynamic loading ?
Date: Mon, 27 Nov 2000 14:12:20 GMT

Hello all


I am little confused about the difference of dynamic and boot time
loading in kernel and also the difference between protected and  real
mode.

For example i don't know is ipchain or IP protocol is loaded in dynamic
mode or at boot time.

Or for example does IP or ipcahin working in real mode or protected mode
?
Is network driver works in real mode or protected mode ?

I have one more question, what is the difference between a module and a
packet in Linux ? is ipchain or IP protocol a module ?

Sorry if the questions sounds stupid, but i will be happy getting some
answer

Thanks in advance   Peter


------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: saving/restoring a process
Date: Mon, 27 Nov 2000 15:12:30 +0100

Michael Pujos wrote:
> 
> I have the following problem:
> 
> i have a simple process that does no disk or other I/O and mainly
> heavy computations. i want to stop it and save its context and memory
> to a file and to be able to restart it in the same state later.
> 
> Is it possible without too much hassle and does a library exist for
> this purpose ?

It is possible to do, but it will require some work.
I don't know if there exist any library for doing this.

You need to look through the memory mapings of the
process and save all data not stored in any files.

Read only mapings from files like the executable will
be available for restoring asuming the file has not
been changed or deleted. Read write mapings will be
written back to files, you can force write back with
some system call.

You can either read /proc/self/maps to find the look
of the mapings or do your own maping so you always
knows what it looks like. Reimplementing malloc,
calloc, realloc and free to use a mmaped file would
make a lot of things easier.

At the time of saving and restoring you must ensure
that all registers containing important information
have been pushed onto the stack, you can do that with
some assembler code.

The last tricky part is to save the stack pointer and
where the save/restore code should operate.

You also have to decide what should trigger the save
operation, perhaps some signal like SIGUSR1 would be
appropriate.

On the other hand it might be easier to use some
adhoc code to store whatever datastructures your
program operates on.

Hope this helps.

-- 
Kasper Dupont

------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Dynamic loading ?
Date: Mon, 27 Nov 2000 15:31:43 +0100

Peter wrote:
> 
> Hello all
> 
> I am little confused about the difference of dynamic and boot time
> loading in kernel and also the difference between protected and  real
> mode.
> 
> For example i don't know is ipchain or IP protocol is loaded in dynamic
> mode or at boot time.
> 
> Or for example does IP or ipcahin working in real mode or protected mode
> ?
> Is network driver works in real mode or protected mode ?
> 
> I have one more question, what is the difference between a module and a
> packet in Linux ? is ipchain or IP protocol a module ?
> 
> Sorry if the questions sounds stupid, but i will be happy getting some
> answer
> 
> Thanks in advance   Peter

Protected mode is used for all new programs
written for the x86 architecture.

Real mode and virtual 86 mode only exist to be
backward compatible with the old 16-bit cpus.

Most runing Linux systems uses only protected
mode. (APM and some emulator programs can use
real/virtual 86 mode.)

On bootup the CPU will be in real mode, the
API for calling BIOS functions operate in real
mode, but the BIOS needs to do some of its
work in protected mode so during bootup there
will be a lot of mode switching.

When control is finally transfered to the
Linux kernel the CPU stays in protected mode.
(Unless it has to do something very special.)

Both the kernel and kernel modules work in
protected mode and have all priveleges.

Many of the kernel features can be either
compiled into the kernel or available as a
module. Some central features can only be
in the kernel.

The kernel is loaded and decompressed at
boot time and is not changed at any time.
A module is loaded from a file and may be
unloaded if not in use. When the code is
runing there is no difference between the
kernel and a module.

The IP, TCP, UDP and some more protocols
is normally compiled as part of the kernel.
I don't know if they can be loaded from a
module. The drivers for network interfaces
are normally loaded from modules, but can be
compiled into the kernel as well.

-- 
Kasper Dupont

------------------------------

From: "Dirk" <[EMAIL PROTECTED]>
Subject: Help on booting linux
Date: Mon, 27 Nov 2000 16:09:42 +0100

Hello,

I have got a problem understanding the boot process of Linux.
The files bootsect.S and setup.S are in binary file format. The Kernel
vmlinux is in ELF format. The kernel vmlinux will be loaded to address
0x1000 or 0x100000. How can setup.S jump to this address when there is the
ELF header of the file vmlinux.

Please tell me what my mistake is.

Thanks.

Dirk



------------------------------

Date: Mon, 27 Nov 2000 08:46:53 -0700
From: Warren Young <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,alt.linux,comp.os.linux.misc
Subject: Re: Software RAID

John Nelson wrote:
> 
> > Tut tut.  No, it doesn't slow it appreciably, provided the disk writes
> > are on two separate controllers (ide).  Yes, two commands will be
> 
> This is the only "right" way to do RAID1 on IDE/ATA disk drives. Otherwise, if you 
>put
> both drives on the same channel and the master dies, the array dies. Rather defeats 
>the
> purpose.

...Not to mention that RAID 1 with two drives on a single controller
will make your write speed N/2, instead of merely the same as a lone
drive (N).  And read performance will be N at best, and probably a
little less.  Properly set up RAID 1 gives you 2N read speed and N write
speed, even with IDE disks.
-- 
= Warren -- ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

------------------------------

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Dynamic loading ?
Date: Mon, 27 Nov 2000 17:19:12 +0100

Peter wrote:
> =

> Hello all
> =

> I am little confused about the difference of dynamic and boot time
> loading in kernel and also the difference between protected and  real
> mode.

"dynamic vs. boot-time loading":
The linux kernel consists of a "true" kernel (containing e.g. process
schelduing and memory management) and device drivers and assorted
support-code. The "true" kernel has to be loaded always while not all
device drivers and/or support-code need to be loaded. So the "true"
kernel has a feature which allows to add code fragments at any time,
thereby enhanciong the functionality of the running system. These code
fragments, "modules", can also be removed when they are no longer
needed.
Since this sometimes causes minor overhead and may pose a security risk,
you can also compile your "true" kernel to include these code-fragments.
When the kernel is loaded, so will these code-frgaments.

"real mode vs. protected mode":
The early members of the x86 family, e.g. the 8086, had a very crude
memory management unit which constructed a physical address from a
segment part and an offset part (the segment part was multiplied by 16
and the offset part was added in). No protection was implemented, every
program running was able to access all of the memory and all I/O ports.
This mode was called "real mode".
With the 80286, the memory management unit was modified and a new mode
was added: "protected mode". In it, the segment part was not multiplied
by 16 but it was used to select a "segment descriptor" which contained
the base address of the segment (which was added to an offset to get a
physical address), the size of a segment and some protection
information. When the processor was running in this mode (for
compatibility reasons, even Pentium 4s will be able to run in real
mode), it could switch into a user state where a program running could
not modify these segment descriptors, providing some protection between
running programs. Also access to I/O ports was no longer possible to
every program.

> For example i don't know is ipchain or IP protocol is loaded in dynamic=

> mode or at boot time.

Although in theory it would be possible to implement networking
protocols as modules, it is rarely done and I don't know if it possible
to do so in current Linux iomplementations.

> Or for example does IP or ipcahin working in real mode or protected mod=
e
> ?
> Is network driver works in real mode or protected mode ?

When the Linux kernel boots, it switches to protected mode very early
and won't leave it.

> I have one more question, what is the difference between a module and a=

> packet in Linux ? is ipchain or IP protocol a module ?

A module is a piece of code providing some additional functionality
(e.g. a device driver) which can be loaded into memory while the system
is running and it will be part of the kernel. The concept of a "packet"
does not exist, however there are "packages" which are entire subsystems
containing kernel modules (if necessary), executable programs, data
files etc. They, too, can be added to a running system ("installed") and
removed if no longer needed, but they are at a much higher level.

> Sorry if the questions sounds stupid, but i will be happy getting some
> answer

We all started at one time or the other,
-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

------------------------------

From: Michel Bardiaux <[EMAIL PROTECTED]>
Subject: Re: synchronise the date
Date: Mon, 27 Nov 2000 16:21:16 GMT

Arne Driescher wrote:
> 
> Xavier Houppertz wrote:
> >
> > hi there,
> >
> > I run linux on different sites and would like to synchronise the date and
> > time with the master server automatically once a month (i will put the file
> > in cron.monthly).
> >
> > How can i fo that ? By mean of ftp or telnet ???
> >
> > thanks ,
> >
> > Xavier
> Hi,
> 
> the network time protocol is your friend :-)
> Look out for xntp, ntpd, ntp or what ever your system
> uses.
> 
> -Arne

And synchronize more than once a month. On its own, a PC can drift up to
*several minutes* every day - enough to seriously screw up any
remote-file-access protocol.

-- 
Michel Bardiaux

------------------------------

From: [EMAIL PROTECTED] (Villy Kruse)
Subject: Re: synchronise the date
Date: 27 Nov 2000 16:51:25 GMT

On Mon, 27 Nov 2000 16:21:16 GMT, Michel Bardiaux <[EMAIL PROTECTED]> wrote:
>Arne Driescher wrote:
>> 
>> 
>> the network time protocol is your friend :-)
>> Look out for xntp, ntpd, ntp or what ever your system
>> uses.
>> 
>> -Arne
>
>And synchronize more than once a month. On its own, a PC can drift up to
>*several minutes* every day - enough to seriously screw up any
>remote-file-access protocol.
>




Note: that ntp synchronizes continuously, so a PC won't be alowed to drift
at all.  



Villy

------------------------------

From: "Massimiliano Caovilla" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: XTI o TLI
Date: Mon, 27 Nov 2000 17:55:47 +0100

    Hi
The question is simple this time:
XTI: where do I find them???
I'm porting a BIG project that make heavy use of them from solaris,
please, please, please don't tell me they are not available for linux!
Please, tell me I'm stupid enought not to find them while I have them in
front of my face...

 Ciao



------------------------------

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Dynamic loading ?
Reply-To: [EMAIL PROTECTED]
Date: Mon, 27 Nov 2000 17:22:34 GMT

On Mon, 27 Nov 2000 14:12:20 GMT, Peter <[EMAIL PROTECTED]> wrote:
>Hello all
>
>
>I am little confused about the difference of dynamic and boot time
>loading in kernel and also the difference between protected and  real
>mode.
>
>For example i don't know is ipchain or IP protocol is loaded in dynamic
>mode or at boot time.
>
>Or for example does IP or ipcahin working in real mode or protected mode
>?
>Is network driver works in real mode or protected mode ?

Consider that Linux runs on all kinds of hardware besides Intel 80x86.  The
``real mode'' versus ``protected mode'' terminology is specific to Intel x86.
On this architecture, Linux runs purely in protected mode.  There is some
assembly language startup code to set up the segment descriptor tables and page
tables, switch to protected mode and then run the kernel.  

This has nothing to do with dynamic loading. Certain parts of the kernel, like
most device drivers, can be statically linked to the kernel, or compiled as
dynamically loaded modules.  Whether or not the code is statically linked or
dynamically linked, it runs in the same mode.

>I have one more question, what is the difference between a module and a
>packet in Linux ? is ipchain or IP protocol a module ?

Are you serious?  A module is a unit of program code. A packet is a unit of
network data.

------------------------------

From: Josef Moellers <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.asm.x86
Subject: Re: linux software-interupt open file?
Date: Mon, 27 Nov 2000 17:52:56 -0000


Kaz Kylheku wrote:
> =

> On Fri, 24 Nov 2000 19:26:00 -0000, Daniel Schroeter <[EMAIL PROTECTED]=
e> wrote:
> >
> >hi,
> >does anybody know a software interupt where i can open a file under
> >LINUX. is there somewhere a (sorted) list with interupts?
> >THNX
> =

> Doh what? I think you are looking for the open() system call!
> =

> There is a corresponding interrupt, and there is a list of them.  but y=
ou
> should use the high level interface through the system library.
> =

> On Linux, these interrupts are an interface for the library developers,=

> not for application developers.

One could argue that section 2 of the manual describes what other "OS"es
call "interrupts".

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)
 


------------------------------

From: Andi Kleen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: XTI o TLI
Date: 27 Nov 2000 19:04:33 +0100

"Massimiliano Caovilla" <[EMAIL PROTECTED]> writes:

>     Hi
> The question is simple this time:
> XTI: where do I find them???
> I'm porting a BIG project that make heavy use of them from solaris,
> please, please, please don't tell me they are not available for linux!
> Please, tell me I'm stupid enought not to find them while I have them in
> front of my face...

The kernel does not support XTI/TLI, but there are various emulation
libraries for it. One of them is included in the Linux TIRPC port 
at ftp.inr.ac.ru:/TIRPC

If your application uses STREAMS directly it'll get a bit more
difficult.


-Andi

------------------------------

Subject: TULIP driver problem with 2.2.17
From: Paul Repacholi <[EMAIL PROTECTED]>
Date: 28 Nov 2000 02:16:32 +0800


I have a out of the box Debian 2.2, with
the distro kernel still in place.

The tulip driver now can't track or find the
media conection on DE450s or SMC cards. Also
the dropped counts in ifconfig are insanely
high and increment at 100k/sec!

If I unload tulip, load DE4x5, ping,
unload de4x5, load tulip, then it
works... So far.

Also, the driver states that the media
can be changed with ifconfig or modutils.
But what is the correct stuff to these?
Can it PLEASE be documented.

tnx

~paul

------------------------------

Reply-To: "Andreas Haberstroh" <[EMAIL PROTECTED]>
From: "Andreas Haberstroh" <[EMAIL PROTECTED]>
Subject: Re: I admit it!
Date: Mon, 27 Nov 2000 20:21:40 GMT

IMHO, all code can be made "non-trivial".
I'm a firm believer in divide and conquer.

But, since I'm new to linux, and am having a difficult time stumbling thru
all the documentation, I'd much rather kill the bug in an environment where
I can see everything on the screen, without having to constantly list stuff
and write it down.

The only time I'm willing to do that kind of debugging is in SoftICE.
Granted, it's probably as difficult as gdb, but, atleast the documentation
is clear. Where as, gdb has several web pages of stuff which for ME is
difficult to read through.



"Kaz Kylheku" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Sun, 26 Nov 2000 22:40:39 GMT, Andreas Haberstroh <[EMAIL PROTECTED]>
wrote:
> >Okay, I admit it.
> >I'm spoiled. I have grown to love the VC IDE debugger. Makes life SOOOOO
> >simple.
>
> You must not be working on any non-trivial code to sound so optimistic
about a
> debugger GUI. If your life is so simple, maybe the bugs aren't that hard?
:)
>
> >Is there something like this in linux?
> >Not the gdb, but, something with a GUI.
>
> There are GUI front ends to gdb, like xxgdb or ddd. In ddd you can plot
views
> of variables on a graph-like thing. Can't speak from experience; I looked
over
> the shoulder of someone who was odoing it. ;)



------------------------------

From: "Norman Black" <[EMAIL PROTECTED]>
Subject: Re: rdtsc() timestamps synchronized between SMP CPU's?
Date: Mon, 27 Nov 2000 13:03:22 -0800
Reply-To: "Norman Black" <[EMAIL PROTECTED]>

The definition of the Multi processor BIOS has an entry stating if rdtsc
instruction can be relied upon. All Multi CPU Intel BIOS that I know of
follow this standard since the shrink wrapped HAL in NT/2k has always
required that this BIOS standard exists. NT/2k uses this BIOS entry to
determine if it can use the rdtsc instruction to implement its
QueryPerformanceCounter API. I do not know if the Linux kernel checks this
entry. I do not see why not since the BIOS standard has been around for
years.

--
Norman Black
Stony Brook Software
the reply, fubar => ix.netcom

"Kaelin Colclasure" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Are the 64-bit timestamps (well, clock cycle counts) that are accessed
> via rdtsc() synchronized between CPU's on an SMP Linux system? That
> is, supposing it were somehow possible to execute a rdtsc instruction
> on each CPU in the system at the exact same instant, would they all
> have the same value?
>
> If not, would they be close enough to allow reasonably meaningful
> comparisons between values from two different CPU's?
>
> -- Kaelin


------------------------------


** 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
******************************

Reply via email to