Ask about source code and main function of the defaut build of buildroot-at91

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

thanhtrung
Posts: 2
Joined: Mon Nov 25, 2019 11:25 am

Ask about source code and main function of the defaut build of buildroot-at91

Mon Nov 25, 2019 11:44 am

Hi all.

I'm a fresher of AT91SAM9G25. I follow the instruction of this link: https://www.linux4sam.org/bin/view/Linux4SAM/BuildRoot

This link is very useful. I already build it after 2 command:

make at91sam9x5ek_defconfig
make

But I don't know that where the source code is that it build, where the main function is.

It's the first time that I build a firmware through make file.

Can anyone help me about where is the source code after I run the "make" command in buildrootat-91 folder?

Thank you so much!!!
blue_z
Location: USA
Posts: 2005
Joined: Thu Apr 19, 2007 10:15 pm

Re: Ask about source code and main function of the defaut build of buildroot-at91

Tue Nov 26, 2019 1:53 am

thanhtrung wrote: I already build it after 2 command
...
It's the first time that I build a firmware through make file.
Buildroot is a collection of makefiles to produce numerous programs, a kernel, and a root filesysem.
To simply refer to all that output as just "it" or "firmware" obscures the components involved.

thanhtrung wrote: But I don't know that where the source code is that it build, where the main function is.

It's the first time that I build a firmware through make file.
What you simplistically call "firmware" is composed of numerous software packages or projects.
You are not building a single program that has a "main" procedure.
Packages for boot programs and userspace programs will each have a "main" procedure.
Libraries and the Linux kernel do not have a "main" procedure (because they are not programs).

thanhtrung wrote: Can anyone help me about where is the source code after I run the "make" command in buildrootat-91 folder?
You need to read the README file in the top-level directory.
That file is going to point you to the docs/ directory, where you can find the answer to your question in docs/manual/quickstart.txt.

Regards
thanhtrung
Posts: 2
Joined: Mon Nov 25, 2019 11:25 am

Re: Ask about source code and main function of the defaut build of buildroot-at91

Tue Nov 26, 2019 4:45 am

blue_z wrote:
Tue Nov 26, 2019 1:53 am
thanhtrung wrote: I already build it after 2 command
...
It's the first time that I build a firmware through make file.
Buildroot is a collection of makefiles to produce numerous programs, a kernel, and a root filesysem.
To simply refer to all that output as just "it" or "firmware" obscures the components involved.

thanhtrung wrote: But I don't know that where the source code is that it build, where the main function is.

It's the first time that I build a firmware through make file.
What you simplistically call "firmware" is composed of numerous software packages or projects.
You are not building a single program that has a "main" procedure.
Packages for boot programs and userspace programs will each have a "main" procedure.
Libraries and the Linux kernel do not have a "main" procedure (because they are not programs).

thanhtrung wrote: Can anyone help me about where is the source code after I run the "make" command in buildrootat-91 folder?
You need to read the README file in the top-level directory.
That file is going to point you to the docs/ directory, where you can find the answer to your question in docs/manual/quickstart.txt.

Regards
Thank you so much for your reply. This is the first time that I build a linux embedded program.

After I read the manual in your link, I still can not find the direction of the boot program and userspace program. Can you point that for me?

And if I just want to build a program that blinks leds, what of the steps should I follow? (my chip is AT91SAM9G25). Where can I add my code to blink leds and build it?
blue_z
Location: USA
Posts: 2005
Joined: Thu Apr 19, 2007 10:15 pm

Re: Ask about source code and main function of the defaut build of buildroot-at91

Wed Nov 27, 2019 1:20 am

thanhtrung wrote: After I read the manual in your link, I still can not find the direction of the boot program and userspace program.
You need to learn/use proper terminology/jargon.
I did not provide a "link", but a "path".
Rather than "direction", you did not find the "location".
As I already mentioned, there is not just a single "userspace program"; Buildroot can/will build a plethora of programs to populate the root filesystem.
thanhtrung wrote: Can you point that for me?
What did you look for?
Where have you looked already?
Did you actually inspect any of the directories that were mentioned?

thanhtrung wrote: And if I just want to build a program that blinks leds, what of the steps should I follow? (my chip is AT91SAM9G25). Where can I add my code to blink leds and build it?
That's an ambiguous request that can actually have several involved answers (e.g. the kernel/board configuration is a dependency).
It's also another topic apart from the current one. Post a separate question.

But maybe you first need to get acquainted with Buildroot (and Linux)?
Have you used the Buildroot menu configuration?
Have you installed and booted what you have built?
Have you written & compiled any Linux programs?


Regards

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: No registered users and 2 guests