| Next | Previous | Contents |
In embedded system, differently in general PC, general firmware
like CMOS does not exist.
So to boot embedded system for the first time, we have to make bootloader which
adjusted well to target board.
Bootloader plays a very important part in embedded system. We explain the roles of bootloader simply below.
First of all, extract tarball now that vivi source files are compressed with tarball. vivi tarball source is located at /linuette/target/box/boot directory.
| # cd /linuette/target/box/boot # tar jxvf vivi.tar.bz2 |
Now we will go to vivi directory created by extraction,
and compile vivi. The process is as following.
To set the set points, do ¡°make menuconfig¡± command. The results are reflected
on vivi binary finally. In here, we will not set all values, instead we will
load default-configuration-file which includes the set points adjusted to target
board well. Under vivi/arch/def-configs directory, there are default-configuration-files
for various target board.
If you use MIZI ToolBox that aiji system manufactures by the name of ¡°smdk2410¡±,
load ¡°arch/def-configs/smdk2410¡±. Otherwise you use MIZI ToolBox that Meritech manufactures
by the name of ¡°s3c2410-tk¡±, load ¡°arch/def-configs/s3c2410-tk¡±.
Then save the set points and compile vivi by ¡°make¡± command.
| # cd vivi # make menuconfig |
| Select ¡°Load on Alternate Configuration File¡± menu, then write ¡°arch/def-configs/smdk2410¡± or ¡°arch/def-configs/s3c2410-tk¡±. |
| Select ¡°Ok¡±, front page appears. Select ¡°Exit¡±, then to save the set points select ¡°Yes¡±. |
| # make |
If compiling vivi progresses well, vivi binary file is created under /linuette/target/box/boot/vivi directory.
In Next chaper, we will port vivi (bootloader), kernel image,
and filesystem to target board. To do this work more conveniently, it is good
collecting the compiled images to image directory.
Make image directory and copy the compiled images to image directory.
| # mkdir /image # cp vivi /image |
kernel sources are compressed by the name of ¡°linux-2.4.18-rmk7-pxa1-mz4.tar.bz2¡± under /linuette/target/box directory. Extract this then move to ¡°2.4.18-rmk7-pxa1-mz4¡± directory created by extraction.
| # cd /linuette/target/box # tar jxvf linux-2.4.18-rmk7-pxa1-mz4.tar.bz2 # cd 2.4.18-rmk7-pxa1-mz4 |
Alike vivi compiling, set values by doing ¡°make menuconfig¡±
command. In here also we don¡¯t select the set points one by one, instead we
load default-configuration-file that is composed with values optimized to target
board. In the case of kernel, default-configuration-files are located in ¡°2.4.18-rmk7-pxa1-mz4/arch/arm/def-configs¡±
directory.
MIZI ToolBox is two type of smdk2410 or s3c2410-tk, so if you use MIZI ToolBox named smdk2410,
load ¡°arch/arm/def-configs/smdk2410¡± file after select ¡°Load on Alternate Configuration File¡± menu.
Otherwise you use MIZI ToolBox named s3c2410-tk, load ¡°arch/arm/def-configs/s3c2410-tk¡± file.
| # make menuconfig |
| Select ¡°Load on Alternate Configuration File¡± menu, then write ¡°arch/arm/def-configs/smdk2410¡± or ¡°arch/arm/def-configs/s3c2410-tk¡±. |
| Select ¡°Ok¡±, front page appears. Select ¡°Exit¡±, then to save the set points select ¡°Yes¡±. |
Setting for compiling kernel is over. Compile embedded kernel as following.
| # make zImage # make modules # make modules_install |
If above steps are done without problems, kernel image
is created in 2.4.18-rmk7-pxa1-mz4/arch/arm/boot directory by the name of zImage.
¡°make modules¡± command compiles the parts selected for Module in kernel setting
menu. Modules mean the part undertaking independent function under big program
and before linking to the big program, modules can not do any work. According
to, there is advantage that we can reduce the size of kernel by modularity.
¡°make modules_install¡± command creates kernel, pcmcia directories under
/tmp/lib/modules/2.4.18-rmk7-pxa1 directory. build directory in there is not
related to module, it¡¯s just symbolic linked to /tmp/lib/modules/2.4.18-rmk7-pxa1-mz4
directory for easy work.
The created directories by above command will be included to root filesystem
image. We will deal with this process more detail the next page.
We just compress kernel, pcmcia directories to move root filesystem directory
at once.
| # tar cvf mod.tgz kernel pcmcia |
To port to target board easily, copy zImage(kernel image) to image directory.
| # cd 2.4.18-rmk7-pxa1-mz4/arch/arm/boot/ # cp zImage /image |
Root filesystem of MIZI-tool-box is composed by Cramfs(Compressed
ROM file system).
Cramfs is designed small and simple. The size is restricted to 256MB, but it
doesn¡¯t act on a defect in embedded system.
If you want to use Korean version of root filesystem, extract ¡°root_hangul.tar.bz2¡±
file.
| # cd /linuette/target/box/root_dir # tar jxvf root_hangul.tar.bz2 |
You can select and make English or Chinese root filesystem by your favorite.
In here, we will explain about how to include the modules created
during kernel compiling to root filesystem.
Extract mod.tgz that compresses the modules under root_hangul/usr/lib/modules/2.4.18-rmk7-pxa1
directory. kernel and pcmcia directory already exist in there.
| # cd root_hangul/usr/lib/modules/2.4.18-rmk7-pxa1 # rm-rf kernel/ pcmcia/ # tar xvf /tmp/lib/modules/2.4.18-rmk7-pxa1/mod.tgz -C . |
You can see mkcramfs binary under /linuette/target/box/root_dir directory.
It makes possible convert the sources to cram filesystem. The usage about mkcramfs
is written in ¡°run.sh¡± file.
Convert the contents under root_hangul directory to ¡°root_hangul.cramfs¡± by
using mkcramfs utility.
| # cd /linuette/target/box/root_dir # ./mkcramfs ./root_hangul ./root_hangul.cramfs |
To port easily, copy the root filesystem to image directory.
| # cp root_hangul.cramfs /image |
The all images(vivi, zImage, root_hangul.cramfs) are collected in image directory. In next chapter, we will learn about how to port the images to target board.
| Next | Previous | Contents |