Re: Several unrelated beginner questions.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Konstantin,

On Thu, Mar 7, 2013 at 4:49 AM, Konstantin Kowalski <kostya-kow@xxxxxxx> wrote:
> Hello everyone,
>
> I am interested in Linux kernel programming (and OS kernels and
> general), and I am currently reading several books about Linux kernel. I
> have a few questions about it:
>
>
> 1.) Currently, I am reading 2 books about Linux kernel: Linux Device
> Drivers (3rd edition) and Linux Kernel Development (3rd edition).
>
> I like both books and I am learning a lot from them.
>
> I heard that both of this books are outdated, but so far all the
> information in this books seems valid and applicable. Is there better
> books you would recommend?
>
I think you go ahead with above books only.

> 2.) In Linux Device Drivers, it states that module_exit(function) is
> discarded if module is built directly into kernel or if kernel is
> compiled with option to disallow loadable modules. But what if the
> module still has to do something during shutdown? Releasing memory is
> unimportant since it does not persist over reboot, but what if the
> module has to write something to a disk file, or do some other action?
>
Linux is OS, If not that way there are alternatives, what you can do is
use register_reboot_notifier() call, which arranges to call code blocks
when sys_reboot() is called.

> 3.) What's the deal with different kernel versions? I heard back in the
> 2.x days, even kernels were stable and odd versions were experimental,
> but with 2.6 it changed.
>
'different kernel versions'  means after each release of Linux it has version.
 like as you mentioned 2.6 above. Currently the naming convention is as
follows the number was composed as "A.B.C", where the number A denoted
the kernel version, the number B denoted the major revision of the kernel, and
the number C indicated the minor revision of the kernel.

> So with 3.x kernels, are all of them experimental in the beginning and
> stable in the end? Also, with 3.x new versions seem to be released more
> often than in 2.1-2.5 days. Did the release cycle get smaller or is it
> just my imagination? Also, what does rc number mean?
>
Stable kernel release depends on Linus/Greg etc.. Which involves lots
of work for them :). No The release cycle is 2-3 months.

> 4.) Currently, I am running linux-next, and it works great. Am I correct
> to assume that linux-next is supposed to have newest, shiniest and most
> unstable features? `uname -a` says that I am still running 3.8-next, but
> there is already 3.9 out. So which version is more experimental and
> least stable? Which one is the newest?
>
The linux-next tree to serve as a place where patches aimed to be merged
during the next development cycle are gathered. The newest one is 3.9.rc1
which is the release candidate. The release candidate usually have patches for
bug fixes no new feature or drivers add up here.

> 5.) How exactly does make/.config work? When I run `make oldconfig`,
> does it use the everything from the previous .config and only ask how to
> configure new features? And when I run `make` does it re-use old object
> files if nothing was changed in the specific file, or does it re-compile
> everything from scratch?
>
when you do `make oldconfig' 'It reads the existing .config file and prompts
the user for options in the current kernel source that are not found
in the file.
This is useful when taking an existing configuration and moving it to
a new kernel.

make program is an intelligent utility and works based on the changes you do
in your source files. If you have four files main.cpp, hello.cpp,
factorial.cpp and functions.h.
Here all the remaining files are dependent on functions.h and main.cpp
is dependent on
hello.cpp and factorial.cpp. So if you make any change in functions.h
then make will
recompile all the source files to generate new object files. But if
you make any change main.cpp,
as this is not dependent of any other fil, then in this case only
main.cpp file will be recompiled
and hellp.cpp and factorial.cpp will not be recompiled.

While compiling a file, make checks its object file and compare the
time staps, if source file
has newer time stamp than object file then it will generate new object
file assuming that
source file has been changed.

Regards,
--Prabhakar Lad
http://in.linkedin.com/pub/prabhakar-lad/19/92b/955

> Thank you,
>
> Kostyantyn Kovalskyy (Konstantin Kowalski)
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux