Linux-Development-Sys Digest #387, Volume #8      Wed, 3 Jan 01 06:13:10 EST

Contents:
  Re: Hayes compatiple modem driver (Shane)
  Re: How to send a signal (Stefan Taferner)
  device driver programming (Red Hat 7.0) (aminudin)
  Re: Equivalent of DebugBreak? (Josef Moellers)
  Re: Kernel Memory Sizeing (Josef Moellers)
  Re: device driver programming (Red Hat 7.0) (Josef Moellers)
  Re: device driver programming (Red Hat 7.0) (aminudin)
  Re: Kernel Memory Sizeing (Paul Sackun)
  Library dependencies ("Fruitbat")
  Re: Before I go bald... Socket problem! (Jem)
  Re: Before I go bald... Socket problem! (Jem)
  Re: cpu count (Kasper Dupont)
  Re: Reading Linux file system from a Win 95 App. (Kasper Dupont)
  Re: Equivalent of DebugBreak? (Andi Kleen)
  Re: Before I go bald... Socket problem! [BIG APOLOGY] (ratz)
  Re: SHARE THE STACK (Kasper Dupont)
  Re: SHARE THE STACK (Kasper Dupont)
  Re: How to add a kernel system call ?? (Kasper Dupont)

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

From: Shane <[EMAIL PROTECTED]>
Subject: Re: Hayes compatiple modem driver
Date: Wed, 03 Jan 2001 07:30:05 -0000


Glitch wrote:
> 
> a real modem doesn't neeed a driver.  if your modem isnt' a winmodem u
> dont need a driver, just plug it in and tell linux what Com it's using.
> 
> Brian Liedtke wrote:
> > 
> > I've been looking for a driver for a Hayes compatable V.34 modem.
> > 
> > Anybody here have any ideas?
> > 
> > Brian Liedtke

 NOT TRUE.. I havea Hayes extreranal 56k Accura.. and have not been able to
get linux mandrake to work with it.. (7.2) it works fine with my 33.6 USR
Sportster EXT.. but Hayes it bombs....  

                [EMAIL PROTECTED]


--
Posted via CNET Help.com
http://www.help.com/

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

Subject: Re: How to send a signal
From: Stefan Taferner <[EMAIL PROTECTED]>
Date: 03 Jan 2001 08:59:43 +0100

Guo zhenfeng <[EMAIL PROTECTED]> writes:

> How can I send a special signal in my process to a sepcified process
> ,which function could do this work ?

man 2 kill

-- Stefan

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

From: aminudin <[EMAIL PROTECTED]>
Subject: device driver programming (Red Hat 7.0)
Date: Wed, 03 Jan 2001 16:06:37 +0800
Reply-To: [EMAIL PROTECTED]

Hello guys ;
I'm still learning how to develop device driver for Linux.
I use Red Hat 7.0 .

My module program can't work properly .

I compiled and tried to load the module into the kernel but it gave "
Kernel version mismatched " error .

The kernel version is 2.2.16  but the module program was compiled for
the 2.4 .
If we check the  <linux/version.h> file  ,   kernel_version =
2.4.0-0.26 .

What is the real problem here ? Is it the kernel library ?

Following  are my codes .

#include <linux/module.h> //comment this part , it will work  but i
dunno why
#include <linux/kernel.h>

//char kernel_version[] = "2.2.16-22";  // uncomment  and this part it
will work

#ifndef MODULE
#  define MODULE
#endif

#ifndef __KERNEL__
#  define __KERNEL__
#endif

#ifdef MODULE

int init_module(void)
{
  printk("Hello , world \n");
  return 0;
}

void cleanup_module(void)
{
  printk("Goodbye \n");
}

#endif




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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Equivalent of DebugBreak?
Date: Wed, 03 Jan 2001 09:18:21 +0100

"A. Schr=F6der" wrote:
> =

> Hi,
> =

> Thaddeus L Olczyk wrote:
> =

> > Is there a command that is the equivalent of DebugBreak()?
> =

> If you develop on a PC (i.e. Intel) you might simply insert
> a
> =

>  __asm__ ( "int3" );
> =

> into your code (of course you may beautify this using a macro, for inst=
ance)
> and you will get the same results as with DebugBreak.
> Beware that this is machine specific, and thus non-portable to other
> architectures.

Nope, on my system (SuSE 6.3 w/ a 2.2.13 kernel) this will result in a
"Trace/breakpoint trap" and any code following the int3 will not be
executed.

The only suggestion I can make to the OP's question is to write some
kind of function which checks for an external variable:

int DebuggerRunning =3D 0;
void
DebugBreak()
{
    if (DebuggerRunning)
        __asm__ ( "int3" );
}
Then, when you start the debugger on the process, you need to set this
variable to !=3D 0 to have the process stop.

-- =

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

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Kernel Memory Sizeing
Date: Wed, 03 Jan 2001 09:22:34 +0100

Nathan Dyer wrote:
> =

> Does anyone have any information on how the linux kernel finds out how =
much
> physical RAM is installed in the computer?

At least for PC style systems, it uses the BIOS supplied values
optionally overridden by what the user says in the "mem=3D" kernel
parameter.

-- =

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

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: device driver programming (Red Hat 7.0)
Date: Wed, 03 Jan 2001 09:24:49 +0100

aminudin wrote:
> =

> Hello guys ;
> I'm still learning how to develop device driver for Linux.
> I use Red Hat 7.0 .
> =

> My module program can't work properly .
> =

> I compiled and tried to load the module into the kernel but it gave "
> Kernel version mismatched " error .
> =

> The kernel version is 2.2.16  but the module program was compiled for
> the 2.4 .
> If we check the  <linux/version.h> file  ,   kernel_version =3D
> 2.4.0-0.26 .
> =

> What is the real problem here ? Is it the kernel library ?

There is no such thing as a "kernel library". It seems that you have a
2.2.16 kernel running but a 2.4 kernel source tree installed.
Look into /usr/src/linux/Makefile. The first 3 lines tell you the kernel
version.

-- =

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

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

From: aminudin <[EMAIL PROTECTED]>
Subject: Re: device driver programming (Red Hat 7.0)
Date: Wed, 03 Jan 2001 16:36:31 +0800
Reply-To: [EMAIL PROTECTED]

Hi ,

Nope , the kernel souce tree version is 2.2.16.
But the compiler compile the  source code for the 2.4 kernel because of the
<linux/version.h> .

I think the problem here is the header file (version.h>.

Anyone can explain on this ?

Thanx in advance .


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

From: [EMAIL PROTECTED] (Paul Sackun)
Subject: Re: Kernel Memory Sizeing
Reply-To: [EMAIL PROTECTED]
Date: Wed, 03 Jan 2001 09:01:13 GMT

In article <3a52983e$0$[EMAIL PROTECTED]>, Nathan Dyer wrote:
>Does anyone have any information on how the linux kernel finds out how much
>physical RAM is installed in the computer?

I don't know about Linux in *particular* but many Operating Systems try
reading from increasing addresses until the memory controller throws an
interrupt indicating that the kernel is trying to read an invalid address.

-- 
HOW YOU CAN TELL THAT IT'S GOING TO BE A ROTTEN DAY:

        #32: You call your answering service and they've never heard of
             you.

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

From: "Fruitbat" <[EMAIL PROTECTED]>
Subject: Library dependencies
Date: Wed, 03 Jan 2001 10:07:55 GMT

Does anyone know of a script or program that can be used to identify what
programs use a particular library?

I know ldd can be used on an executable file / library to list the
dependencies for that file / library, but what I need is something when
given a library name would list what uses the library.

I realise this could probably done with a shell script, using ldd and grep
and the like. Has someone developed such a script or program? I cant develop
it myself if one doesn't exist as I am not a programmer or script writer,
just a humble user interested in his system.

--

Regards Geoff :)
==================
[EMAIL PROTECTED]



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

From: Jem <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux.redhat,comp.os.linux.development.apps,comp.os.linux.networking,linux.dev.apps,linux.dev.net,linux.redhat.devel
Subject: Re: Before I go bald... Socket problem!
Date: Wed, 3 Jan 2001 10:15:35 -0000

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Jem wrote:
> > 
> > PLEASE PLEASE COULD YOU CC ANY REPLIES TO MY MAIL ADDRESS!!! Too many
> > groups and I'm not 100% sure where I should best post this question...
> 
> Don't crosspost! The chance of getting a response doesn't necessarily
> rise. You rather piss off people. Ok, let's see what your problem is:

Well when they announce comp.os.linux.redhat.socket.programming.c I'll 
make sure I post there! Note the list of groups ALL are relevant to the 
problem, hence the chance of getting an answer should be higher. Now if 
I'd cross-posted to alt.im.a.troll or 
alt.binaries.arent.girlies.wonderful then I could see your point.

>  
> > Argh argh argh!
> 
> whatever.
>  
> > OK, before I lose loads of hair.. I am trying desperately to get the MAC
> > address of the PC that my program (C++) is running on. I have some
> 
> Now this is really funky. Either you're running your program locally or
> you assume that your programm does some network stuff. If your program
> is running on a remote node and f.e. just does a printf("hello world\n");
> You will never be able to find a tool that will print you the MAC addr
> of that node since how could the tool find out on what machine you're 
> running your ``hello world'' on. I just can't get the relation between
> you program and the MAC of your NIC and especially not what the C++ info
> has to do with it. Why don't you tell us what you really like to do. You
> can get the MAC with: /sbin/ifconfig | grep HWaddr
> With this command line you get at least the station address. However if you
> like to get the node address or the oem station address you need to do some
> ioctl's or have a look into the nettools from http://www.scyld.com

Try reading the line first. "MAC address of the PC that my program (C++) 
is running on"... i.e. "the MAC address of the (a) NIC in the PC that 
the program is running on". How to make this simpler... um, "NOT the MAC 
address of any other PC that I may be connecting to?" or "NOT the MAC 
address of any other PC on the network" BUT "the MAC address of the PC 
that the program is running on". I don't know how to say that simpler... 
oh "what about the MAC address of the host PC"? does that help.

And the C++ bit? Well that was so I didn't get crazy answers like 
"/sbin/ifconfig | grep HWaddr" since that is not written in C++ (or C) 
but is a console command that I already KNOW about.

What I'd really like to do is exactly what I said I'd really like to do. 
I will have a look at scyld.com but after searching it for "nettools" it 
just seems to bring up lots of links to posted questions & answers 
rather than a download / faq / documentation page anywhere...  Would 
this be the same "Net Tools" as listed by freshmeat at:
        http://freshmeat.net/appindex/1998/09/02/904770843.html
which is classified as "console/networking" and, may I hazard a guess, 
is not a C++ library?

> 
> > source code for it that I found from several locations on the web but I
> > can't get it to compile because the constants that it uses don't seem to
> > be defined, specifically:
> >         AF_ROUTE
> >         AF_LINK
> >         NET_RT_IFLIST
> >         RTM_IFINFO
> >         ETHER_ADDR_LEN
> 
> What kind of source code is this? For what kind of system?

Argh! This is not source code, it's a list of constants referenced in a 
bit of source code. It's from a C source... as above I am talking about 
a C++ application (please don't start getting C / C++ pedantic!). And 
it's written for a ZX81... oh no, sorry, it's a Unix box ;-).

>  
> > Now I've done searches on this and, as far as I can determine, BSD
> > Sockets.h should have these constants in #define statements. I have the
> > FreeBSD version of socket.h
> 
> Is the tool written for BSD systems?

Err, yes

>  
> > (http://minnie.cs.adfa.edu.au/FreeBSD-srctree/newsrc/sys/socket.h.html)
> > 
> > and it has just about everything I need neatly laid out - or at least
> > some of the constants anyway and I'm hoping other related files will
> > have the rest of them.
> 
> :) 
>  
> > Now I don't understand this. I am running RedHat 6.2 and the Socket.h
> 
> Where did you find Socket.h? I know of /usr/src/linux/include/linux/socket.h.
> 

Yeah, I was working from /usr/include/socket.h which includes 
/usr/include/bits/socket.h which DOES have AF_ROUTE defined. So saying 
NONE was incorrect, it does have this ONE constant defined. The problem 
remains though as I don't have AF_LINK or NET_RT_IFLIST or RTM_IFINFO or 
ETHER_ADDR_LEN (which is required later in the code).

> > file has NONE of this stuff defined. I have done a search on my system
> > for any ".h" files with ANY of these constants defined and there is
> > nothing, zilch. Should the FreeBSD and Linux versions of Socket.h not be
> > extremely similar??
> 
> zar:~ # find /usr/src/linux/include/ -exec egrep \
> "AF_ROUTE|AF_LINK|NET_RT_IFLIST|RTM_IFINFO|ETHER_ADDR_LEN" \
> /dev/null {} \; 2>/dev/null
> 
> /usr/src/linux/include/linux/socket.h:#define AF_ROUTE        AF_NETLINK /* Alias to
> emulate 4.4BSD */
> /usr/src/linux/include/linux/socket.h:#define PF_ROUTE        AF_ROUTE
> zar:~ # find /usr/include/ -exec egrep \
> "AF_ROUTE|AF_LINK|NET_RT_IFLIST|RTM_IFINFO|ETHER_ADDR_LEN" \
> /dev/null {} \; 2>/dev/null
> 
> /usr/include/net/ethernet.h:#define   ETHER_ADDR_LEN  ETH_ALEN                 /*
> size of ethernet addr */
> /usr/include/libnet/libnet-headers.h:#ifndef ETHER_ADDR_LEN
> /usr/include/libnet/libnet-headers.h:#define ETHER_ADDR_LEN 6
> /usr/include/libnet/libnet-headers.h:    u_char  ether_dhost[ETHER_ADDR_LEN];   
> /* destination ethernet address */
> /usr/include/libnet/libnet-headers.h:    u_char  ether_shost[ETHER_ADDR_LEN];   
> /* source ethernet address */
> /usr/include/bits/socket.h:#define    AF_ROUTE        PF_ROUTE
> zar:~ # 
> 
> hmm, my system does have at least AF_ROUTE and ETHER_ADDR_LEN, which you
> actually 
> don't need for your problem.

Yes, it does have AF_ROUTE as per my previous apology but it only has 
ETHER_ADDR_LEN in libnet which is an additional package. and no 
reference to the other required constants.

>  
> > Has anyone ANY ideas where these constants could possibly be defined or
> > why my Socket.h seems to be missing these definitions?
> 
> Nope, me not, I'm sorry.

Me neither.

>  
> > Alternatively, has anyone got a bit of C source for MAC determination
> > that does compile under RedHat?
> 
> Nope but some hint:
> 
> char *interface;
> int fd;
> struct ifreq req;
> fd = socket(AF_INET, SOCK_DGRAM, 0);
> strcpy(req.ifr_name, interface);
> ioctl(fd, SIOCGIFHWADDR, &req);
> close(fd);
> 
> This is it basically I hope. I haven't tried it but I will because I need such a
> tool
> too.

Cheers that's what I needed... Shame we couldn't have got there without 
you shooting down everything I said. Oh how I bow to your massive 
knowledge... and wish that any one of the four Linux programming books I 
have actually made mention of how to use SIOCGIFHWADDR ;-). I had found 
a hint referring to this ioctl but hadn't found reference to struct 
ifreq and how to use it so ioctl was constantly returning -1.

> 
> HTH, regards,
> Roberto Nibali, ratz




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

From: Jem <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux.redhat,comp.os.linux.development.apps,comp.os.linux.networking,linux.dev.apps,linux.dev.net,linux.redhat.devel
Subject: Re: Before I go bald... Socket problem!
Date: Wed, 3 Jan 2001 10:17:46 -0000

Yeah thanks, as in my reply to ratz, I noticed AF_ROUTE DOES exist but 
none of the others do. I had searched... strangely though although I had 
found this using find, the KDE2 Find Files utility doesn't locate the 
file... Ah well, that's for another discussion, don't actually care much 
about that!

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> In article <[EMAIL PROTECTED]>,
> Jem  <[EMAIL PROTECTED]> wrote:
> 
> >OK, before I lose loads of hair.. I am trying desperately to get the MAC 
> >address of the PC that my program (C++) is running on. I have some 
> >source code for it that I found from several locations on the web but I 
> >can't get it to compile because the constants that it uses don't seem to 
> >be defined, specifically:
> >     AF_ROUTE
> >     AF_LINK
> >     NET_RT_IFLIST
> >     RTM_IFINFO
> >     ETHER_ADDR_LEN
> >
> >Now I've done searches on this and, as far as I can determine, BSD 
> >Sockets.h should have these constants in #define statements. I have the 
> >FreeBSD version of socket.h 
> 
> Did you try searching through the .h files on your system?  I found
> AF_ROUTE right away.  Try including <sys/socket.h>.
> 
> --
> http://www.spinics.net/linux
> 

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: cpu count
Date: Wed, 03 Jan 2001 10:18:52 +0000

Robert Redelmeier wrote:
> 
> Oleg Levin wrote:
> > May be somebody knows how can I determine the number of CPU,
> > without parsing /proc/stat or /proc/cpuinfo files ?
> 
> This is the easiest way.  The Linux kernel may export the
> number of CPUs in some other way.
> 
> You can have a look at the code Intel suggests for starting-up
> APs (secondary processors) in an SMP system in the IA32 Systems
> Programming Manual.  IIRC, you've got to set up the APIC, and
> issue an IPI from the ICR.  Lots of fun.
> 
> -- Robert

I would only expect that piece of code to work from
kernel mode. From usermode the standard way of doing
this kind of things is through /proc.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Reading Linux file system from a Win 95 App.
Date: Wed, 03 Jan 2001 10:28:03 +0000

[EMAIL PROTECTED] wrote:
> 
> In The Name of GOD
> 
> Hi, I want to write windows application which should read a floppy
> formatted with Linux file system and copy a file from floppy to hard
> disk formatted with FAT File System
> 
> I don't know whether i can access the floppy disk formatted with
> another file system using Win32 API or i need Lower level of access
> (e.g, VXD access), If so, From where i should start?
> 
> Many thanks
> 
> Mostafa Kalantar
> 
> Sent via Deja.com
> http://www.deja.com/

First you need to find Windows equivalence
of /dev/fd0, second you need to understand
the data structures used in ext2.

-- 
Kasper Dupont

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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: Equivalent of DebugBreak?
Date: 03 Jan 2001 11:14:14 +0100

Josef Moellers <[EMAIL PROTECTED]> writes:

> "A. Schr�der" wrote:
> > 
> > Hi,
> > 
> > Thaddeus L Olczyk wrote:
> > 
> > > Is there a command that is the equivalent of DebugBreak()?
> > 
> > If you develop on a PC (i.e. Intel) you might simply insert
> > a
> > 
> >  __asm__ ( "int3" );
> > 
> > into your code (of course you may beautify this using a macro, for instance)
> > and you will get the same results as with DebugBreak.
> > Beware that this is machine specific, and thus non-portable to other
> > architectures.
> 
> Nope, on my system (SuSE 6.3 w/ a 2.2.13 kernel) this will result in a
> "Trace/breakpoint trap" and any code following the int3 will not be
> executed.

Try signal(SIGTRAP,SIG_IGN);  before. The debugger will catch it anyways.
When you want a terminal trap you can also use abort(), this would normally
give you a coredump when the debugger is not running.


-Andi

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

From: ratz <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux.redhat,comp.os.linux.development.apps,comp.os.linux.networking,linux.dev.apps,linux.dev.net,linux.redhat.devel
Subject: Re: Before I go bald... Socket problem! [BIG APOLOGY]
Date: Wed, 03 Jan 2001 11:32:11 +0100

Jem,

I sincerely apologize to you for being so prude and stupid. I really had
a bad day and thought that this would not reflect my posts. Unfortunately
it did. Sorry for that.

> Try reading the line first. "MAC address of the PC that my program (C++)
> is running on"... i.e. "the MAC address of the (a) NIC in the PC that
> the program is running on". How to make this simpler... um, "NOT the MAC
> address of any other PC that I may be connecting to?" or "NOT the MAC
> address of any other PC on the network" BUT "the MAC address of the PC
> that the program is running on". I don't know how to say that simpler...
> oh "what about the MAC address of the host PC"? does that help.

Not really but you have to understand that my native language is definitely
not english.
 
> What I'd really like to do is exactly what I said I'd really like to do.
> I will have a look at scyld.com but after searching it for "nettools" it
> just seems to bring up lots of links to posted questions & answers
> rather than a download / faq / documentation page anywhere...  Would
> this be the same "Net Tools" as listed by freshmeat at:
>         http://freshmeat.net/appindex/1998/09/02/904770843.html
> which is classified as "console/networking" and, may I hazard a guess,
> is not a C++ library?

I'm sorry have a look at the various c-sources at ftp://ftp.scyld.com/pub/diag/
especially ftp://ftp.scyld.com/pub/diag/mii-diag.c helped me a lot to understand
the basic principle of getting parameters out of the eeprom of a NIC.
Unfortunately
there is now source there which wouldn't rely on dozens of other sources so you
need quite some time grepping for the correct ioctl calls for what you want.

> > Nope but some hint:
> >
> > char *interface;
> > int fd;
> > struct ifreq req;
> > fd = socket(AF_INET, SOCK_DGRAM, 0);
> > strcpy(req.ifr_name, interface);
> > ioctl(fd, SIOCGIFHWADDR, &req);
> > close(fd);
> >
> > This is it basically I hope. I haven't tried it but I will because I need such a
> > tool
> > too.
> 
> Cheers that's what I needed... Shame we couldn't have got there without
> you shooting down everything I said. Oh how I bow to your massive
> knowledge... and wish that any one of the four Linux programming books I
> have actually made mention of how to use SIOCGIFHWADDR ;-). I had found
> a hint referring to this ioctl but hadn't found reference to struct
> ifreq and how to use it so ioctl was constantly returning -1.

Ok, cool I'm happy that I finally found the correct way to give you a hint.
Again,
apologies for all this crap I wrote before.

Yours sincerely,
Roberto Nibali, ratz

-- 
mailto: `echo [EMAIL PROTECTED] | sed 's/[NOSPAM]//g'`

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Re: SHARE THE STACK
Date: Wed, 03 Jan 2001 10:33:56 +0000

David wrote:
> 
> Hi, I want share program stack. I create file (ftruncate ...) and copy
> stack to that file. Then I try to make mmap (with al permisions ...),
> and I obtain "cant allocate memory". I cant make it with code and data
> segments.
> 
> Why cannot I mmap the stack ?
> Any idea to share my program stack ?
> 
> thanks in advance,
> DTM

Don't expect that to work, the stack will most likely
have changed between the time you save it and the
time you map it again. If you really want to do
something like this you need to use an alternate
stack while doing the trick. But then you would still
loose the stacks ability to grow when needed. You
might consider the option of mmaping an alternate
stack and only use the primary for startup. In both
cases you need to know how much stack space you are
going to use.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Re: SHARE THE STACK
Date: Wed, 03 Jan 2001 10:33:56 +0000

David wrote:
> 
> Hi, I want share program stack. I create file (ftruncate ...) and copy
> stack to that file. Then I try to make mmap (with al permisions ...),
> and I obtain "cant allocate memory". I cant make it with code and data
> segments.
> 
> Why cannot I mmap the stack ?
> Any idea to share my program stack ?
> 
> thanks in advance,
> DTM

Don't expect that to work, the stack will most likely
have changed between the time you save it and the
time you map it again. If you really want to do
something like this you need to use an alternate
stack while doing the trick. But then you would still
loose the stacks ability to grow when needed. You
might consider the option of mmaping an alternate
stack and only use the primary for startup. In both
cases you need to know how much stack space you are
going to use.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: How to add a kernel system call ??
Date: Wed, 03 Jan 2001 10:40:34 +0000

William Huang wrote:
> 
>         I am learning linux kernel programming recently, and want to add system
> call in my kernel. But I don't how to start it. Any body can give me some
> related example code ??
> 
>                                                         thanks :)

Adding a systemcall can be quite complicated,
and might cause all sorts of problems. In many
cases it is better to use a /proc interface
or a character device with an ioctl. Adding
a misc device is not that complicated.

If you still want to add a systemcall you could
look at monte which adds parameters to the
reboot syscall. Source can be downloaded from:

<URL:http://www.scyld.com/>

-- 
Kasper Dupont

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


** 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 by posting to the
comp.os.linux.development.system newsgroup.

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