LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 04-01-2011, 03:38 PM   #1
gsinde
LQ Newbie
 
Registered: Jan 2011
Posts: 11

Rep: Reputation: 0
Linux bootargs parameter format question


I am working on an Atmel ARM9 port of Linux and currently, the system boots as follows:

Processor ROM Code
Bootstrap Code (Hardware Init)
U-Boot 1.3.x
Linux Kernel 2.6.36
Embedded Qt 4.7.1
My Qt Application

I have added enough code to my bootstrap application (which must stay less then 64KBytes) to handle the NAND, Ethernet, and all the functions need to boot and replace the kernel/rfs without needing U-Boot installed. The last piece of the puzzle are the format of the boot arguments on the special RAM space that the kernel looks at when it runs the first few instructions in assembly.

When an ARM9 boots, you jump to the zImage of the kernel (or uImage + 64 byte offset) and pass R0 = 0, R1 = MACH TYPE (2212 for AT91SAM9G45EKES), and R2 = Linux Formatted Boot Parameter Pointer. I have yet to find the format of these parameters documented. I can take apart U-Boot to find them but I thought I would ask the world.

Note: I have captured the hex values of this data and it does contain the text string of the bootargs in tact but it also has other data amongst the capture.

Thanks, Gary
 
Old 04-01-2011, 10:16 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,044
Blog Entries: 1

Rep: Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369
Moved: This thread is more suitable in <Linux - Embedded> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 04-03-2011, 11:25 AM   #3
gsinde
LQ Newbie
 
Registered: Jan 2011
Posts: 11

Original Poster
Rep: Reputation: 0
OK, so I found a file in u-boot that appears to document this.
It is in /include/asm-arm/setup.h or /include/asm/setup.h

There is a sequence of TAGS called ATAG_blahblah

These tags all appear to have unique structures and are sent in a sequence. There is an older method of passing parameters to the kernel on boot but it is no longer used since 2006.

Note: WATCH BIG vs. LITTLE ENDIAN as always

The AT91SAM9G45 appears to have 4 (or 5 depending on config) TAGS in U-Boot
TAG 1) Size 5 words, 0x54410001 (ATAG_CORE), flags = 0, page size = 0, root = 0
TAG 2) Size 4 words, 0x54410002 (ATAG_MEM), Phys Size = 0x10000000, Start = 0x70000000
TAG 3) Size bootargs_strlen in words + 2, 0x54410009 (ATAG_CMDLINE), text_str_of_bootargs
TAG 4) Optional if you specify an initrd which right now I do not have
TAG 5) Size = 0, 0x00000000 (ATAG_NONE)

You can also add tags for serial number, revision number, etc. for your embedded device.

Hope this helps someone else someday - Gary
 
Old 04-03-2011, 11:58 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,044
Blog Entries: 1

Rep: Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369
Hi,

Good. I was hoping Linux - Embedded members would have some feedback for you. Access to Linux - Embedded is not high. A few members do actively participate here.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bootargs is not getting update shariefbe Linux - Embedded & Single-board computer 0 01-11-2010 03:50 AM
Non Linux User Question: (closest to) Standard Video Format on Linux escherwisser Linux - Newbie 3 05-18-2009 09:41 AM
How can I access bootargs from inside the kernel? mintzyuval Linux - Newbie 13 04-03-2009 06:59 AM
linux bash - how to use a dynamic parameter in shell parameter expansion expression nickleus Linux - General 2 08-21-2006 04:54 AM
Linux OS and file format related question. tusher Linux - Newbie 13 03-15-2004 01:48 PM


All times are GMT -5. The time now is 07:30 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration