2012/6/22 <kernelnewbies-request@xxxxxxxxxxxxxxxxx>
Send Kernelnewbies mailing list submissions to
kernelnewbies@xxxxxxxxxxxxxxxxx
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
or, via email, send a message with subject or body 'help' to
kernelnewbies-request@xxxxxxxxxxxxxxxxx
You can reach the person managing the list at
kernelnewbies-owner@xxxxxxxxxxxxxxxxx
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Kernelnewbies digest..."
Today's Topics:
1. Re: download the source code of some commands (Greg Freemyer)
2. could some current.h files be simplified? (Robert P. J. Day)
3. Re: download the source code of some commands (Wang Lei)
4. Re: download the source code of some commands (??)
5. Re: Kernel Memory (michi1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
----------------------------------------------------------------------
Message: 1
Date: Thu, 21 Jun 2012 10:42:12 -0400
From: Greg Freemyer <greg.freemyer@xxxxxxxxx>
Subject: Re: download the source code of some commands
To: ?? <wangzhe5004@xxxxxxxxx>
Cc: kernelnewbies <kernelnewbies@xxxxxxxxxxxxxxxxx>
Message-ID:
<CAGpXXZLM7s_=2xWcEDFtSrj_0-EjgP7aP7XNu1XEmZMEhXT53w@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset=UTF-8
On Thu, Jun 21, 2012 at 8:48 AM, ?? <wangzhe5004@xxxxxxxxx> wrote:
> ? Hi all:
> ? ? ?? I want to see some source code of some commands,for
> example,halt,reboot,uptime,and so on.
>
> but i don't kown where to download??? can you give me some advice?
>
> Thanks in advance!
You need to figure out how your distro of choice lets you query the
filelist for packages.
I use openSUSE primarily and it has the Yast tool that lets you do
that in the software management section.
uptime => coreutils
reboot => aaa_base
halt => aaa_base
Once you know the package your distro uses you can download the
corresponding source package for it.
You will have better luck learning the process you need to know by
asking on a distro specific mailing list.
Greg
hi,
you can use the download tool to get the sources code.
eg: apt-get source ssh (ubuntu)
you can get ssh source code.
but, not all !
------------------------------
Message: 2
Date: Thu, 21 Jun 2012 10:54:59 -0400 (EDT)
From: "Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx>
Subject: could some current.h files be simplified?
To: Kernel Newbies <kernelnewbies@xxxxxxxxxxxxxxxxx>
Message-ID: <alpine.DEB.2.02.1206211048240.22454@oneiric>
Content-Type: TEXT/PLAIN; charset=US-ASCII
it *seems* as if a number of current.h files from various
architectures could be simplified. here's <asm-generic/current.h>,
which gives any architecture a generic starting point in defining both
get_current() and current:
#ifndef __ASM_GENERIC_CURRENT_H
#define __ASM_GENERIC_CURRENT_H
#include <linux/thread_info.h>
#define get_current() (current_thread_info()->task)
#define current get_current()
#endif /* __ASM_GENERIC_CURRENT_H */
and if that's acceptable, any architecture is welcome to simply
include it as, for instance, mips does in <asm/current.h>:
#include <asm-generic/current.h>
but here's the current.h file for parisc:
#ifndef _PARISC_CURRENT_H
#define _PARISC_CURRENT_H
#include <linux/thread_info.h>
struct task_struct;
static inline struct task_struct * get_current(void)
{
return current_thread_info()->task;
}
#define current get_current()
#endif /* !(_PARISC_CURRENT_H) */
i'm not sure i see why the generic version wasn't adequate for
parisc (apart from the explicit pointer casting). same thing with the
cris architecture and, i'm sure, others.
is there any reason why some of those current.h files can't just
include the generic one?
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
------------------------------
Message: 3
Date: Thu, 21 Jun 2012 23:22:49 +0800
From: Wang Lei <f3d27b@xxxxxxxxx>
Subject: Re: download the source code of some commands
To: ?? <wangzhe5004@xxxxxxxxx>
Cc: kernelnewbies <kernelnewbies@xxxxxxxxxxxxxxxxx>
Message-ID: <4fe33c55.83da440a.4026.ffffc75b@xxxxxxxxxxxxx>
Content-Type: text/plain; charset=utf-8
If you use Debian or other distribution with apt package system.
You can use whereis to locate this command.
[~]$ whereis halt
halt: /sbin/halt /usr/share/man/man5/halt.5.gz /usr/share/man/man8/halt.8.gz
Then, use dpkg -S to show which package it's included. This one is: sysvinit.
[~]$ dpkg -S /sbin/halt
sysvinit: /sbin/halt
Now, you can download the source from Debian source, use:
[~]$ apt-get source sysvinit
Or if you want the original source, use aptitude (or apt-cache) find
it's homepage.
[~]$ aptitude show sysvinit
Package: sysvinit
......
Homepage: http://savannah.nongnu.org/projects/sysvinit
At last, get it from there. As for other package systems, I think there
should be a way too. Or you can google.
On 2012-06-21 20:48:48 +0800, ?? wrote:
> Hi all:
> I want to see some source code of some commands,for
> example,halt,reboot,uptime,and so on.
>
> but i don't kown where to download? can you give me some advice?
>
> Thanks in advance!
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
--
Regards,
Lei
------------------------------
Message: 4
Date: Thu, 21 Jun 2012 23:46:21 +0800
From: ?? <wangzhe5004@xxxxxxxxx>
Subject: Re: download the source code of some commands
To: Wang Lei <f3d27b@xxxxxxxxx>
Cc: kernelnewbies <kernelnewbies@xxxxxxxxxxxxxxxxx>
Message-ID:
<CAJrRU3XDpS620jOe+Q8W+siuGvR3CzzJOHZg3e+pWSSU5t0Tuw@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="gb2312"
2012/6/21 Wang Lei <f3d27b@xxxxxxxxx>
> If you use Debian or other distribution with apt package system.
>
> You can use whereis to locate this command.
> [~]$ whereis halt
> halt: /sbin/halt /usr/share/man/man5/halt.5.gz
> /usr/share/man/man8/halt.8.gz
>
> Then, use dpkg -S to show which package it's included. This one is:
> sysvinit.
> [~]$ dpkg -S /sbin/halt
> sysvinit: /sbin/halt
>
> Now, you can download the source from Debian source, use:
> [~]$ apt-get source sysvinit
>
> Or if you want the original source, use aptitude (or apt-cache) find
> it's homepage.
> [~]$ aptitude show sysvinit
> Package: sysvinit
> ......
> Homepage: http://savannah.nongnu.org/projects/sysvinit
>
> At last, get it from there. As for other package systems, I think there
> should be a way too. Or you can google.
>
Thank you very much ! i follow your steps, and download the source code
successfully.
On 2012-06-21 20:48:48 +0800, ?? wrote:
> Hi all:
> I want to see some source code of some commands,for
> example,halt,reboot,uptime,and so on.
>
> but i don't kown where to download? can you give me some advice?
>
> Thanks in advance!
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies@xxxxxxxxxxxxxxxxx
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> --
> Regards,
> Lei
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120621/6e586022/attachment-0001.html
------------------------------
Message: 5
Date: Thu, 21 Jun 2012 17:48:25 +0200
From: michi1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Kernel Memory
To: Vijay Chauhan <kernel.vijay@xxxxxxxxx>
Cc: kernelnewbies@xxxxxxxxxxxxxxxxx
Message-ID: <20120621154824.GA2280@grml>
Content-Type: text/plain; charset=us-ascii
Hi!
On 17:57 Thu 21 Jun , Vijay Chauhan wrote:
> Hello,
>
> I am newbie.
> It has been said "kernel memory is not pageable"
> What does it mean? There is no concept of kernel virtual address?
>
> Any simple explanation will help me to udnerstand.
The right term is actually "kernel memory is not swappable". Swapping means
writing inactive memory to disk and then using it for something else. Kernel
memory not being swappable is a design decicion made in the early linux days.
Operating systems which swap kernel memory need to isolate everything which
should not be swappd out (e.g. things needed for swap-in, realtime stuff,
security sensitive data, ...). This is quite a bit of work. I also guess it is
pretty pointless nowadays. Installed memory and is getting so huge that virtual
memory developers have a hard time trying to keep cpu-usage overhead for
swapping user space memory low.
> There is no concept of kernel virtual address?
Kernel memory uses virtual addresses as well. However, these the entire system
memory is continuously mapped somewhere in the virtual address space. The
drawback is that fragmentation turns allocation of large continuous memory
regions into a game of luck.
There is also an virtual address area (vmalloc) which is used to dynamically
map multiple scattered pages to a continuous region. But this is rather slow
and rarely used.
You might want to take a look at: http://lwn.net/Kernel/LDD3/
-Michi
--
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com
------------------------------
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
End of Kernelnewbies Digest, Vol 19, Issue 43
*********************************************
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies