Building LinuxBIOS: Difference between revisions
JordanCrouse (talk | contribs) m (typo) |
m (Reverted edits by Rizwan1218 (Talk) to last revision by JordanCrouse) |
||
(17 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{Translations}}</noinclude> |
|||
{{deprecated}} |
|||
== Warnings and Disclaimers == |
== Warnings and Disclaimers == |
||
Line 7: | Line 10: | ||
During boot, LinuxBIOS loads a small payload that consists of a minimal kernel and an initramfs image. We refer to this payload as the "ROM image". |
During boot, LinuxBIOS loads a small payload that consists of a minimal kernel and an initramfs image. We refer to this payload as the "ROM image". |
||
The ROM image is responsible for bringing up the system enough to try to load a full kernel from the NAND flash, a USB mass storage device, or the network. |
The ROM image is responsible for bringing up the system enough to try to load a full kernel from the NAND flash, a USB mass storage device, or the network. |
||
Buildrom is a small set of build scripts that facilitiates building the ROM image |
Buildrom is a small set of build scripts that facilitiates building the bootloader and ROM image (including the kernel and all the different utilities and scripts that make |
||
up the initramfs image. If you understand buildroot (from the uclibc team), then buildrom will look familiar - it is based on the same concept. |
up the initramfs image). If you understand buildroot (from the uclibc team), then buildrom will look familiar - it is based on the same concept. |
||
Buildrom is a GNU Make based build system. Using a series of configuration files, the makefile will determine what packages need to be built. Each package is |
Buildrom is a GNU Make based build system. Using a series of configuration files, the makefile will determine what packages need to be built. Each package is |
||
obtained from an upstream repository with wget and built locally on your machine. When all the packages have been built, the script pulls together all the binaries |
obtained from an upstream repository with wget and built locally on your machine. When all the packages have been built, the script pulls together all the binaries |
||
for the ROM image, and combines them into a .ELF file which |
for the ROM image, and combines them into a .ELF file which is then used as the payload to build a LinuxBIOS ROM. |
||
'''Update''' - buildrom now builds ROM images for the SPI flash by default. You don't need to change anything from the default configuration. |
|||
=== Getting buildrom === |
=== Getting buildrom === |
||
Buildrom is available from the OLPC GIT repository on [http://dev.laptop.org http://dev.laptop.org]. |
Buildrom is available from the OLPC GIT repository on [http://dev.laptop.org http://dev.laptop.org]. After installing git, run: |
||
tree location: |
|||
git://dev.laptop.org/users/jcrouse/buildrom |
$ git clone git://dev.laptop.org/users/jcrouse/buildrom |
||
From time to time, you will want to make sure you are synced with the |
This will make a copy of the tree in a folder called 'buildrom'. From time to time, you will want to make sure you are synced with the tree: |
||
$ cd buildrom; git pull |
$ cd buildrom; git pull |
||
Line 31: | Line 35: | ||
* make |
* make |
||
* gcc |
* gcc |
||
* svn |
|||
* wget |
* wget |
||
* quilt |
* quilt |
||
Line 43: | Line 48: | ||
$ export http_proxy=<proxyurl>:<proxyport> |
$ export http_proxy=<proxyurl>:<proxyport> |
||
Note that there is also one package (LinuxBIOS) that will be pulled down with SVN. If you have proxy worries, make sure your local SVN environment is correctly setup. |
|||
Buildrom already sets all the important flags and other settings to build the tools and libraries so they can be included into the ROM. |
Buildrom already sets all the important flags and other settings to build the tools and libraries so they can be included into the ROM. |
||
Line 55: | Line 62: | ||
* olpc-payload.elf - ELF file that includes both the bzImage and the initrd. This is the payload that LinuxBIOS uses. |
* olpc-payload.elf - ELF file that includes both the bzImage and the initrd. This is the payload that LinuxBIOS uses. |
||
The most important deliverable is the 1MB ROM image: |
|||
== LinuxBIOS == |
|||
* linuxbios.rom |
|||
⚫ | |||
You'll want to review everything at the excellent [http://www.linuxbios.org/index.php/Main_Page LinuxBIOS wiki] before continuing. I'm only going to address the OLPC specific points here. |
|||
* [[Flashing LinuxBIOS]] |
|||
First, download a recent copy of the LinuxBIOS code (read this: http://www.linuxbios.org/index.php/Download_LinuxBIOS). |
|||
* [[Recipes for buildrom and LinuxBIOS]] |
|||
Next, you'll need to tell LinuxBIOS where to find your payload. You can either do this in one of two ways: |
|||
* [[ROM Emulators for OLPC]] |
|||
# Edit targets/olpc/rev_a/Config.1M.lb and change the line that says ''payload /tmp/olpcpayload.elf'' to ''<your buildrom directory>/deploy/olpc-payload.elf'' |
|||
# Copy olpc-payload.elf from your buildrom directory to ''/tmp/olpcpayload.elf''. |
|||
Now, configure a build for the 1MB ROM on the OLPC board: |
|||
$ cd targets/ |
|||
$ ./buildtarget olpc/rev_a/Config.1M.lb |
|||
This will create a directory called ''targets/olpc/rev_a/rev_a_1M''. |
|||
Make sure you have the latest payload built (see above). Then build your ROM: |
|||
$ cd targets/olpc/rev_a/rev_a_1M/ |
|||
$ make |
|||
This will create a file called ''linuxbios.rom'' in your local directory. Note that this is the LinuxBIOs portion plus the payload built in the previous section. |
|||
===Getting the VSA=== |
|||
The other part of the ROM you'll need is the binary VSA: http://dev.laptop.org/~jcrouse/olpc_vsa.64k.bin |
|||
===Putting it all together=== |
|||
To build the final ROM image, you'll need to combine the VSA and the linuxbios.rom: |
|||
$ cat olpc_vsa.64k.bin linuxbios.rom > olpc.rom |
|||
You should now have a file called olpc.rom that is exactly 1048576 (0x100000) bytes large. This is your 1MB ROM. |
|||
⚫ | |||
* [[Building an SPI image for olpcflash]] |
|||
Currently there isn't any sane way to flash the ROM to the serial flash on the OLPC board without running a huge risk of bricking it. The only way to try out |
|||
the ROM image right now is to write the image to a PLCC ROM chip and use that in the PLCC socket on the Rev A boards. |
|||
* [[Maintainer Notes]] |
|||
You will want to use 8Mbit ROM chips, like |
|||
[https://www.em.avnet.com/pns/home/0,5533,CID%253D0%2526CCD%253DUSA%2526SID%253D0%2526DID%253DDF2%2526LID%253D0%2526BID%253DDF2%2526CTP%253DPNS,00.html?ref=https://emwcs.avnet.com/webapp/wcs/stores/servlet/RemoteAdvancedSearchView?langId=-1&storeId=500201&catalogId=500201&manufacturerPartNum=SST49LF008A-33-4C-NH these]. |
|||
[[Category:Hardware]] |
|||
Flash the image with your favorite method. The LinuxBIOS FAQ has much to say on the issue: http://linuxbios.org/index.php/FAQ. |
|||
[[Category:Developers]] |
Latest revision as of 20:32, 25 July 2013
Warnings and DisclaimersThese instructions are new and subject to change. No assurance is made that this won't permanently harm your hardware. If you don't understand any of these steps, please stop and ask for clarification on the mailing lists or in IRC. You have now been officially warned. BuildromDuring boot, LinuxBIOS loads a small payload that consists of a minimal kernel and an initramfs image. We refer to this payload as the "ROM image". The ROM image is responsible for bringing up the system enough to try to load a full kernel from the NAND flash, a USB mass storage device, or the network. Buildrom is a small set of build scripts that facilitiates building the bootloader and ROM image (including the kernel and all the different utilities and scripts that make up the initramfs image). If you understand buildroot (from the uclibc team), then buildrom will look familiar - it is based on the same concept. Buildrom is a GNU Make based build system. Using a series of configuration files, the makefile will determine what packages need to be built. Each package is obtained from an upstream repository with wget and built locally on your machine. When all the packages have been built, the script pulls together all the binaries for the ROM image, and combines them into a .ELF file which is then used as the payload to build a LinuxBIOS ROM. Update - buildrom now builds ROM images for the SPI flash by default. You don't need to change anything from the default configuration. Getting buildromBuildrom is available from the OLPC GIT repository on http://dev.laptop.org. After installing git, run: $ git clone git://dev.laptop.org/users/jcrouse/buildrom This will make a copy of the tree in a folder called 'buildrom'. From time to time, you will want to make sure you are synced with the tree: $ cd buildrom; git pull Building the imageBuildrom requires the following tools on your development system to run:
To build the default image, just type $ make You will notice that the system will start downloading packages from the web with wget, and compiling them. If you are behind a proxy, don't forget to set http_proxy before starting. $ export http_proxy=<proxyurl>:<proxyport> Note that there is also one package (LinuxBIOS) that will be pulled down with SVN. If you have proxy worries, make sure your local SVN environment is correctly setup. Buildrom already sets all the important flags and other settings to build the tools and libraries so they can be included into the ROM. There are several configuration options you can play with once you are more familar with the system. Check Config.mk and read the comments. Using the ImageWhen the system is done building, you will have three files in the deploy/ directory:
The most important deliverable is the 1MB ROM image:
What Next? |