Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
first function from kernel
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
preetam m.n  
View profile  
 More options Oct 31 2011, 7:43 am
From: "preetam m.n" <preeta...@gmail.com>
Date: Mon, 31 Oct 2011 17:13:28 +0530
Local: Mon, Oct 31 2011 7:43 am
Subject: first function from kernel

Hi,

After kernel boots which is the first function in the android file system
called and how does kernel know to call the first function of android.

Regards,
Preetam

--
"The great pleasure in life is doing what people say you cannot do"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yue Zeng  
View profile  
 More options Oct 31 2011, 7:57 am
From: Yue Zeng <zenggon...@gmail.com>
Date: Mon, 31 Oct 2011 19:57:17 +0800
Local: Mon, Oct 31 2011 7:57 am
Subject: Re: [android-kernel] first function from kernel

u sould read the whole android system code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
preetam m.n  
View profile  
 More options Oct 31 2011, 8:07 am
From: "preetam m.n" <preeta...@gmail.com>
Date: Mon, 31 Oct 2011 17:37:32 +0530
Local: Mon, Oct 31 2011 8:07 am
Subject: Re: [android-kernel] first function from kernel

Thanks, I have started reading android system code.

I have seen through traces that when in the default boot, the android stack
entry is in the file system/core/init/init.c main() function.

I would like to know how does kernel know to call this main function?

Regards,
Preetam

--
"The great pleasure in life is doing what people say you cannot do"

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bird  
View profile  
 More options Oct 31 2011, 2:05 pm
From: Tim Bird <tim.b...@am.sony.com>
Date: Mon, 31 Oct 2011 11:05:56 -0700
Local: Mon, Oct 31 2011 2:05 pm
Subject: Re: [android-kernel] first function from kernel
On 10/31/2011 5:07 AM, preetam m.n wrote:

> Thanks, I have started reading android system code.

> I have seen through traces that when in the default boot, the android
> stack entry is in the file system/core/init/init.c main() function.

> I would like to know how does kernel know to call this main function?

Normally, the Linux kernel automatically starts a program called 'init', int
the /sbin directory.  So most legacy Linux systems have the starting
program placed there: /sbin/init.  However, the kernel accepts a command
line variable 'init=<value>' which can be used to specify the starting
program.
In the case of Android, this is set to '/init'  (so the full command line
argument is 'init=/init'. This is set by the bootloader.  Depending on which
bootloader you are using, you can set this either via the bootloader command
line, or have it read from nvram.

'init' and other kernel command line arguments are documented in the
file: Documentation/kernel_parameters.txt, in the kernel source directory.

The 'main()' function is called by the C initialization code, after the
kernel
starts execution at an address specified in the ELF header for the program.
This is part of the C standard, I believe, but in any case is rather outside
the scope of Android.
  -- Tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
preetam m.n  
View profile  
 More options Oct 31 2011, 2:35 pm
From: "preetam m.n" <preeta...@gmail.com>
Date: Tue, 1 Nov 2011 00:05:47 +0530
Local: Mon, Oct 31 2011 2:35 pm
Subject: Re: [android-kernel] first function from kernel

Thank you Tim.

Regards,
Preetam

--
"The great pleasure in life is doing what people say you cannot do"

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bird  
View profile  
 More options Oct 31 2011, 3:05 pm
From: Tim Bird <tim.b...@am.sony.com>
Date: Mon, 31 Oct 2011 12:05:04 -0700
Local: Mon, Oct 31 2011 3:05 pm
Subject: Re: [android-kernel] first function from kernel

On 10/31/2011 11:35 AM, preetam m.n wrote:

> Thank you Tim.

> On Mon, Oct 31, 2011 at 11:35 PM, Tim Bird <tim.b...@am.sony.com
> <mailto:tim.b...@am.sony.com>> wrote:

>     'init' and other kernel command line arguments are documented in the
>     file: Documentation/kernel_parameters.txt, in the kernel source
>     directory.

One other thing, just for information's sake...

The command line passed to the kernel is printed by
the kernel on startup, and is available in the kernel
log buffer (not to be confused with the Android
system log).  There are usually several other Android-specific
items in the kernel command line.

After a kernel has booted, you can see the kernel
command line, along with other kernel startup messages)
using 'dmesg'.  Here's a sample from my Sony Android
tablet S:

Kernel command line: nvmem=64M@448M mem=1024M@0M vmalloc=192M
video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1
lp0_vec=8192@0x1c404000 odmdata=0x300c0040
androidboot.bootloader=0x00000008 tegraboot=sdmc gpt

(Hmmm.  I just noticed that on this device, it doesn't use the 'init=/init'
argument.  I think it might just symlink /sbin/init to /init, or maybe
they've
modified the kernel to default to /init instead of /sbin/init.
You can find the code in the kernel that does the start of the first
program in <kernel_src>/init/main.c in the routine init_post().

Some of the items that you might see in the kernel command line
(specifically some of the items prefixed with 'android')
are not actually parameters to the kernel.

Some of them are set by the bootloader, but used by Android user-space
programs.  If the kernel does not recognize a parameter, it just
ignores it.  The Android system uses this to pass items from the
bootloader to other parts of the system.  The kernel command line
shows up in user space in /proc/cmdline, and some other
android programs look there to find parameters that are used to
control various runtime features.  For example, init looks there
to find out if it should do data collection for bootchart.

This system is a different use for the kernel command line than
I've seen before, and is pretty interesting.
  -- Tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam King  
View profile  
 More options Oct 31 2011, 11:05 am
From: Sam King <kin...@gmail.com>
Date: Mon, 31 Oct 2011 08:05:49 -0700 (PDT)
Local: Mon, Oct 31 2011 11:05 am
Subject: Re: first function from kernel
Look for a comment that says "Kernel startup entry point" in head.S

--Sam

On Oct 31, 7:07 am, "preetam m.n" <preeta...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
George Patton  
View profile  
 More options Oct 31 2011, 8:09 am
From: George Patton <patton7...@gmail.com>
Date: Mon, 31 Oct 2011 05:09:52 -0700
Local: Mon, Oct 31 2011 8:09 am
Subject: Re: [android-kernel] first function from kernel

I know right
On Oct 31, 2011 5:07 AM, "preetam m.n" <preeta...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
preetam m.n  
View profile  
 More options Nov 1 2011, 1:16 am
From: "preetam m.n" <preeta...@gmail.com>
Date: Tue, 1 Nov 2011 10:46:30 +0530
Local: Tues, Nov 1 2011 1:16 am
Subject: Re: [android-kernel] first function from kernel

So for instance if i have to boot into recovery in the startup I have to
pass recovery path in cmd line of the kernel right?

--
"The great pleasure in life is doing what people say you cannot do"

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bird  
View profile  
 More options Nov 2 2011, 11:46 am
From: Tim Bird <tim.b...@am.sony.com>
Date: Wed, 2 Nov 2011 08:46:13 -0700
Local: Wed, Nov 2 2011 11:46 am
Subject: Re: [android-kernel] Re: first function from kernel
On 10/31/2011 8:05 AM, Sam King wrote:
> Look for a comment that says "Kernel startup entry point" in head.S

That's the startup entry point for the kernel, not the first
instruction of user-space.
   -- Tim

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam King  
View profile   Translate to Translated (View Original)
 More options Nov 2 2011, 1:39 pm
From: Sam King <kin...@gmail.com>
Date: Wed, 2 Nov 2011 10:39:05 -0700 (PDT)
Local: Wed, Nov 2 2011 1:39 pm
Subject: Re: first function from kernel
Yeah, I know, I misread the question :)  I didn't bother following it
up because your posts were right.

--Sam

On Nov 2, 10:46 am, Tim Bird <tim.b...@am.sony.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »