Hi Viet,

On 08/08/11 16:24, Viet Nguyen wrote:
Thanks for your answer.
However, my question is reading a boot parameter directly from my
module because i need to know which device is selected for the
console.
For example if I pass "console=ttyS0,115200" and I want to get
"ttyS0,115200" in my module.

The system works fine, in boot process, config_BSP is called with
u-boot argument. I just wonder that I can get value of a kernel
parameter so that i don't need to define my own one in my module.

Ok, I see. I haven't wanted to do that before, so I don't
know off hand how you would do that.

Most arches keep the command line as a string (the thing you see
when you do "cat /proc/cmdline"). So you could access that and
parse it again looking for strings you want.

Regards
Greg



On Mon, Aug 8, 2011 at 12:24 PM, Greg Ungerer<g...@snapgear.com>  wrote:
Hi Viet,

On 02/08/11 19:34, Viet Nguyen wrote:

I need to get the value of parameter "console" passed by u-boot in arch
initialization stage.
I think I need to touch config_BSP function.

Do you mean the kernel code you are using doesn't currently get the
command line at all from uboot? áYou would only need to do some work
in the config_BSP if there is no code to support geting the uboot
command line at all.


However, if I write a kernel module, how to get value of this parameter
from my module?

Use module_param() and friends in your driver.

Regards
Greg


------------------------------------------------------------------------
Greg Ungerer á-- áPrincipal Engineer á á á áEMAIL: á á g...@snapgear.com
SnapGear Group, McAfee á á á á á á á á á á áPHONE: á á á +61 7 
3435 2888
8 Gardner Close á á á á á á á á á á á á á á FAX: á á á á +61 
7 3217 5323
Milton, QLD, 4064, Australia á á á á á á á áWEB: http://www.SnapGear.com






--
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     g...@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to