A Simple Embedded Linux System
Author: inner elf (float) station: embedded Title: [test] simple embedded linux system time: Sat Nov 17 10:27:09 2001 ah recent embedded system is a very hot topic, a lot of people are asking how to start first step? In fact, there are many information on this area! But most of them are based on the data of English! For those who have English phobia, it is really very painful ^^. Okay! Not much nonsense, In fact, be a bootable small Linux system door, not high, the following will give a reference to the person who doesn't know how to start, because this is just a new hand that I don't know how to get started. Look ^^ ||) Workers must be good, and must first take care of them; the following is my work environment: CLE 1.0
128M
Celeron 500GCC-2.96-95 Requires Archives: Busybox0.60.1 Download Address: http://opensource.Lineo.com/software.html Since I only make a system that can boot and simple shell instructions, I don't need it. Login directly starts XTERM, so you only need to download busybox, so as so much of many interesting Embedded projects on the site, you can try it. Step 1: First divide one in your own hard drive
32M
Split area, for example: I created a working environment / Embedded_test (/ dev / hdb5) in my second hard disk (/ dev / hdb), and remember to format the split area (MKE2FS / DEV / HDB5). Step 2: Establish a system directory - Basic directory structure is as follows: / - | ---- / bin || ---- / boot || ---- / dev || ---- / etc || - --- / Home || ---- / lib --- / modules || ---- / mnt || ---- / proc || ---- / root || ---- / sbin || ---- / usr ----- | ---- / bin | || | ---- / lib | || | ---- / share || ---- / tmp || ---- / var Basically you can write the process of built a directory tree into script, so you don't need to be established every time. Step 3: Let us compile our busybox! First, put the busybox to decline. #tar zxvf busybox-0.60.1.tar.gz? Go to the busybox directory #CD busybox-0.60.1 Editing config.h file, this file can determine how we want to join the functions of BusyBox, such as: I To make Busybox with CP instructions, you must take the "//" annotation in front of the // # define bb_cp. Modify init.c, in order to make the system start moving without a login verification: "IF (get_enter == True) {" <---- approximately in the 528th line and "Getc (stdin); --542 lines and "}" <---- 543 lines take him with "//" to discover the other, you can modify the 124th line "#define init_script" / etc / rcs "/ * default sysinit script. * / "This is used to set up the power-up system initialization setting. The above is that I have changed him to find / etc / rcs. This file is to start compiling our busybox, the instructions are as follows: #make #make prefix = / Embedded_test install <----- Put Busybox to our work directory Step 4: Since I need a full-featured shell, I copied Bash in the system to / Embedded_test / bin directory (#CP) -AV / bin / bash / Embedded_test / bin then establishes a link (#CD / Embedded_test # ln -s bash sh) Step 5: Copy the related lib to the working directory, where we can use the LDD instruction to check what we need LIB, for example: #LDD busyboxlibc.so.6 => /lib/libc.so.6 (0x4002c
000) /LIB/ld-Linux.SO.2 => /Lib/ld-linux.so.2 (0x400000000) We can know that busybox needs libc.so.6 and ld-linux.so.2 this Two files (note that the above two actually link, also need to copy the corresponding lib past) According to this mode, the use of Bash needs to be used to copy to the working directory: Copy the past LIB can use Strip this instruction Weight Loss step six: copy device / dev will be used in our working directory: console hda7 hdc3 loop3 ptyp7 ram2 tty ttyp2 vcs1 vcsa3cua0 hdb hdc4 loop4 ptyp8 ram3 tty0 ttyp3 vcs2 vcsa4cua1 hdb1 hdd mem ptyp9 ram4 tty1 ttyp4 vcs3 vcsa5fb0 hdb2 hdd1 null ptypa ram5 tty2 ttyp5 vcs4 vcsa6fd0 hdb3 hdd2 psaux ptypb ram6 tty3 ttyp6 vcs5 vcsa7hda hdb4 hdd3 ptyp0 ptypc ramdisk @ tty4 ttyp7 vcs6 vcsa8hda1 hdb5 hdd4 ptyp1 ptypd sda tty5 ttyS0 vcs7 vcsa9hda2 hdb6 initctl | ptyp2 ptype sda1 tty6 ttyS1 vcs8 zerohda3 hdb7 log | ptyp3 ptypf sda2 tty7 ttyS2 vcs9hda4 hdc loop0 ptyp4 ram sda3 tty8 ttyS3 vcsahda5 hdc1 loop1 ptyp5 ram0 sda4 ttyp0 urandom vcsa1hda6 hdc2 loop2 ptyp6 ram1 systty ttyp1 vcs vcsa2 Note: the need for those devices please according to their own needs, above is just an example step 7: edit ~ embedded_test / etc / INITTAB :: Sysinit: / etc / rcs :: askfirst: / bin / sh Editing ~ Embedded_test / etc / rcsexport path = / bin: / sbin: / usr / bin: / usr / sbinexport home = / rootmount -a editing ~ Embedded_test / etc / fstabnone Proc Proc Defaults 0 0 Editing ~ Embedded_test / etc / passwdroot :: 0: 0: root: / root: / bin / shnobody :: 99: 99: NoBody: /: Edit ~ Embedded_test / etc / grouproot :: 0: Rootnobody :: Copy / Etc/ld.so.cache to ~ / Embedded_test / etc / under edit /etc/lilo.conf Because we are initially intended to boot using its system kernel ( Compiling Kernel to say too much) so add image = / boot / vmlinuz-2.2.17 in lilo.conf
-14Label = TestRead-Writeroot = / dev / hdb5 then executes LILO -V -V Step 8: Then reboot, choose the TEST option in the boot menu to see if you can enter the system! ^^. Um .... Originally Want to read the basic XTERM part, ㄜ .... Next time, you will write again - [1;
32M
※ [
33M
Shuocheng Linux Information Station [
37M
[m [1;
31M