实验一 LINUX配置和移植实验

2019-07-13 04:02发布

一、 实验目的   学会嵌入式LINUX裁剪、移植,根据目标系统要求配置LINUX 二、实验内容 本次实验使用Redhat linux 9.0 操作系统环境安装arm linux 的开发库及编译器。学习LINUX内核的配置和编译,以及ARM 开发板的使用和开发环境的设置。下载已经编译好的内核文件到嵌入式控制器中。 三、预备知识 C 语言的基础知识、程序调试的基础知识和方法,LINUX 的基本操作。 四、实验设备及工具(包括软件调试工具) 硬件:SZ7207G ARM 嵌入式开发板、PC Pentumn500 以上, 硬盘10G 以上。 软件:PC 机操作系统redhat linux 9.0 linux 开发环境 五、实验步骤 1.开发环境的建立 在我们的资料光盘(ARM7编译环境)中有五个文件将是这里建立交叉编译环境所需要的,它们必须被安装到 /home目录下。它们是: HLDK_Root.tar.gz HLDK_x86.tar.gz HLDK _App.tar.gz HLDK_Kernel_7202_2.4.18-rmk3.tar.gz arm-linux-toolchains.tar.gz 还有三个编译好的二进制代码文件是运行嵌入式Linux 所必需的, 它们是: LDBoot.bin(启动代码) vmlinux.bin(内核代码) rootfs.img.gz(根文件) 因此将上述文件复制到/home目录下。 首先以ROOT用户登陆主机LINUX,进入linux操作系统,点鼠标右键,新建终端,进入[root@localhost root]# [root@localhost root]#mount /dev/cdrom   //挂接光盘 [root@localhost envi ]#cd /mnt/cdrom/ linux/ envi /  //进入光盘目录  [root@localhost linuxenv ]# cp LDBoot.bin /home [root@localhost linuxenv ]# cp vmlinux.bin /home [root@localhost linuxenv ]# cp rootfs.img.gz /home  [root@localhost linuxenv ]#tar xvfz arm-linux-toolchains.tgz –C / [root@localhost linuxenv ]#tar xvfz HLDK_Root.tar.gz /home [root@localhost linuxenv ]# tar xvfz HLDK_x86.tar.gz /home [root@localhost linuxenv ]# tar xvfz HLDK_App.tar.gz /home [root@localhost linuxenv ]# tar xvfz HLDK_Kernel _7202_2.4.18-rmk3.tar.gz /home 2.进入LINUX开发环境 [root@localhost linuxenv ]#chroot /home/HLDK /x86/sbin/login localhost login: hms720 passwd: linux1 输入正确的密码后会出现下面的提示: Welcome to HMS720 ARM7 Linux Development Kit Hynix Semiconductor Inc. hms720[1]# 这时, 当前路径已经被改到/home/hms720 表示已进入开发系统 3.进入目录/home/hms720/LinuxHEI720/linux     hms720#下输入: hms720[1]# cd /home/hms720/LinuxHEI720/linux 4.配置LINUX内核 hms720[1]#下输入: hms720[0]# make menuconfig     系统将运行LINUX内核配置脚本,并出现内核配置菜单,各配置选项如下: 说明: 代码成熟度选项 Code maturity level options ---> [*] Prompt for deveLopment and/or incompLete code/drivers [*] Prompt for obsolete code/drivers 可装载模块选项 Loadable module support ---> [*] EnaLbLe LoadabLe moduLe Support [ ] Set verSion information on aLL SymboLS for moduLeS [*] KerneL moduLe Loader 系统类型 System Type ---> (H7202) ARM system type Archimedes/A5000 Implementations ---> Footbridge Implementations ---> SA11x0 Implementations ---> CLPS711X/EP721X Implementations ---> --- Processor Type [ ] Support Thumb instructions (experimental) [ ] Matrix Keyboard Support [ ] ANGEL Support [ ] Discontiguous memory(16MBx2) 普通配置 General setup ---> [ ] Support hot-pluggable devices [*] Networking Support [*] SyStem V IPC [ ] BSD ProceSS Accounting [*] SysctL Support --- At least one math emulation must be selected <*> NWFPE math emulation < > FastFPE math emulation (experimental) (ELF) Kernel core (/proc/kcore) format < > Kernel support for a.out binaries <*> Kernel support for ELF binaries < > Kernel support for MISC binaries [ ] Power Management support (experimental) < > RISC OS personality [*] Kernel-mode alignment trap handler 内存设备 Memory Technology Devices (MTD) ---> <*> Memory Technology Device (MTD) support [*] Debugging   //空格键选择 (0) Debugging verbosity (0 = quiet 3 = noisy) <*> MTD partitioning support < > MTD concatenating support <*> ArMon partition table parsing < > RedBoot partition table parsing < > Compaq bootldr partition table parsing < > ARM Firmware Suite partition parsing --- User Modules And Translation Layers <*> Direct char device access to MTD devices <*> Caching block device access to MTD devices < > FTL (Flash Translation Layer) support < > NFTL (NAND Flash Translation Layer) support RAM/ROM/FLASH 芯片选项 RAM/ROM/Flash chip drivers ---> <*> Detect flash chips by Common Flash Interface (CFI) probe < > Detect JEDEC JESD21c compatible flash chips [*] Flash chip driver advanced configuration options (NO) Flash cmd/query data swapping [ ] Specific CFI Flash geometry selection <*> Support for Intel/Sharp flash chips < > Support for AMD/Fujitsu flash chips < > Support for RAM chips in bus mapping < > Support for ROM chips in bus mapping < > Support for absent chips in bus mapping [ ] Older (theoretically obsoleted now) drivers for non-CFI chips Mapping drivers for chip access ---> < > CFI Flash device in physical memory map < > CFI Flash device mapped on Nora <*> CFI Flash device mapped on H7202 < > CFI Flash device mapped on ARM Integrator/P720T < > CFI Flash device mapped on the XScale IQ80310 board < > CFI Flash device mapped on the FortuNet board Self-contained MTD device drivers ---> NAND Flash Device Drivers ---> < >Plug and play support---> Block devices ---> < > Normal PC floppy disk support < > XT hard disk support (NULL) SMC/MMC Card support < > Loopback device support < > Network block device support <*> RAM disk support (32768) Default RAM disk size [*] Initial RAM disk (initrd) support Multi-device support (RAID and LVM) ---> Networking options ---> < > Packet Socket < > Netlink device emulation [ ] Network packet filtering (replaces ipchains) [ ] Socket FiLtering <*> Unix domain SocketS [*] TCP/IP networking [*] IP: muLticaSting [ ] IP: advanced router    [ ] IP: kerneL LeveL autoconfiguration < > IP: tunneLing < > IP: GRE tunneLS over IP [ ] IP: multicast routing [ ] IP: ARP daemon Support (EXPERIMENTAL) [ ] IP: TCP Explicit Congestion Notification support [ ] IP: TCP syncookie support (disabled per default) < > The IPv6 protocol (EXPERIMENTAL) < > Kernel httpd acceleration (EXPERIMENTAL) [ ] Asynchronous Transfer Mode (ATM) (EXPERIMENTAL) < > 802.1Q VLAN Support (EXPERIMENTAL) --- < > The IPX protocol < > Appletalk protocol support < > DECnet Support < > 802.1d Ethernet Bridging < > CCITT X.25 Packer Layer (EXPERIMENTAL) < > LAPB Data Link Driver (EXPERIMENTAL) [ ] 802.2 LLC (EXPERIMENTAL) [ ] Frame Diverter (EXPERIMENTAL) < > Acorn Econet/AUN protocols (EXPERIMENTAL) < > WAN router [ ] Fast Switching (read help!) [ ] Forwarding between high Speed interfaceS QoS and/or fair sueing ---> Network device support ---> [*] Network device support? ARCnet devices ---> < > Dummy net driver support < > Bonding driver support < > EQL (serial line load balancing) support < > Universal TUN/TAP device driver support < > Ethertap network tap (OBSOLETE) Ethernet (10 or 100Mbit) ---> [*] Ethernet (10 or 100Mbit) [ ] 3COM cards < > AMD LANCE and PCnet (AT1500 and NE2100) support [ ] Western Digital/SMC cards [ ] Racal-Interlan (Micom) NI cards < > AT1700/1720 support (EXPERIMENTAL) < > DEPCA DE10x DE200 DE201 DE202 DE422 support < > HP 10/100VG PCLAN (ISA EISA PCI) support  [ ] Other ISA cards [*] EISA VLB PCI and on board controllers < > Ansel Communications EISA 3200 support (EXPERIMENTAL) < > Apricot Xen-II on board Ethernet <*> CS89x0 support [ ] Zenith Z-Note support (EXPERIMENTAL) [ ] Pocket and portable adapters Amateur Radio support  --->   IrDA (infrared) support  --->     ATA/IDE/MFM/RLL support  --->    SCSI support  --->   I2O device support  --->   ISDN subsystem  --->     Input core support  --->  Character devices ---> [*] VirtuaL terminaL [*] Support for conSoLe on virtuaL terminaL < > Standard/generic (8250/16550 and compatible UARTs) serial support [ ] Non-standard serial port support Serial drivers ---> [*] H7202 serial port support [*] Console on H7202 serial port < > 8250/16550 and compatible serial support (EXPERIMENTAL) <*> H7202 touchscreen support [*] Unix98 PTY Support (256) Maximum number of Unix98 PTYS in uSe (0-2048) I2C support ---> L3 serial bus support ---> Mice ---> Joysticks ---> < > QIC-02 tape Support Watchdog Cards ---> < > /dev/nvram support < > Enhanced Real Time Clock Support < > Double Talk PC internal speech card support < > Siemens R3964 line discipline < > Applicom intelligent fieldbus card support Ftape the floppy tape device driver ---> < > /dev/agpgart (AGP Support) [ ] Direct Rendering Manager (XFree86 DRI support) Multimedia devices  ---> File systems ---> [ ] Quota Support < > KerneL automounter Support < > KerneL automounter version 4 support (also supports v3) < > Reiserfs support < > ADFS filesystem support (read only) (EXPERIMENTAL) < > Amiga FFS fiLeSyStem Support < > AppLe MacintoSh fiLeSyStem Support (EXPERIMENTAL) < > BFS file system support (EXPERIMENTAL) < > Ext3 journalling file system support (EXPERIMENTAL) < > DOS FAT fS Support < > EFS file system support (read only) (EXPERIMENTAL) < > Journalling Flash File System (JFFS) support <*> Journalling Flash File System v2 (JFFS2) support (1) JFFS2 debugging verbosity (0 = quiet 2 = noisy) < > Compressed ROM file system support [ ] Virtual memory file system support (former shm fs) < > Simple RAM-based file system support < > ISO9660 cdrom fiLeSyStem Support < > Minix fS Support < > FreeVxFS file system support(VERITAS VxFS(TM) compatible) < > NTFS fiLeSyStem Support (read onLy) < > OS/2 HPFS file system support [*] /proc fiLeSyStem Support [ ] /dev file system support (EXPERIMENTAL) [*] /dev/pts fiLeSyStem for Unix98 PTYS < > QNX4 fiLeSyStem Support (read only) (EXPERIMENTAL) < > ROM fiLeSyStem Support <*> Second extended fS Support < > SyStem V and Coherent fiLeSyStem Support < > UDF file system support (read only) < > UFS fiLeSyStem Support (read only) Network FiLe SyStemS ---> < > Coda file system support (advanced network fs) < > InterMezzo file system support (experimental replicating fs) <*> NFS file system support [*] Provide NFSv3 client support < > NFS server support < > SMB file system support (to mount Windows shares etc.) < > NCP file system support (to mount NetWare volumes) Partition TypeS ---> [*] Advanced partition selection                                [ ]   Acorn partition support                                   [ ]   Alpha OSF partition support                               [ ]   Amiga partition table support                             [ ]   Atari partition table support                             [ ]   Macintosh partition map support                           [ ]   PC BIOS (MSDOS partition tables) support                  [ ]   Windows Logical Disk Manager (Dynamic Disk) support       [ ]   SGI partition support                                     [ ]   Ultrix partition table support                           [ ]   Sun partition tables support Console drivers ---> [ ] VGA text console Frame-buffer support ---> [*] Support for frame buffer devices (EXPERIMENTAL) [*] H7202 LCD support (TFT) LCD support < > Virtual Frame Buffer support (ONLY FOR TESTING!) [*] Advanced low level driver options/ < > Monochrome support < > 2 bpp packed pixels support < > 4 bpp packed pixels support < > 8 bpp packed pixels support <*> 16 bpp packed pixels support < > 24 bpp packed pixels support < > 32 bpp packed pixels support < >     Amiga bitplanes support                                < >     Amiga interleaved bitplanes support                    < >     Atari interleaved bitplanes (2 planes) support        < >     Atari interleaved bitplanes (4 planes) support         < >     Atari interleaved bitplanes (8 planes) support        < >     Mac variable bpp packed pixels support                 < >     VGA 16-color planar support                            < >     VGA characters/attributes support                    < >     HGA monochrome support (EXPERIMENTAL)                  [ ]   Support only 8 pixels wide fonts [ ]   Select compiled-in fonts         Sound ---> <*> Sound card Support < > BT878 audio dma < > Crystal SoundFusion (CS4280/461x) < > Crystal Sound CS4281 < > ESS Technology Solo1 < > ESS Maestro Maestro2 Maestro2E driver < > S3 SonicVibes < > Trident 4DWave DX/NX SiS 7018 or ALi 5451 PCI Audio Core < > Support for Turtle Beach MultiSound Classic Tahiti Monterey < > Support for Turtle Beach MultiSound Pinnacle Fiji <*> H7201/H7202 Audio Support < > H7202 I2S Audio Support < > OSS sound modules Multimedia Capabilities Port drivers  --->             USB support  --->                                        Bluetooth support  ---> Kernel hacking ---> [ ] Compile kernel without frame pointer [*] Verbose user fault messages [ ] Include debugging information in kernel binary [ ] Kernel debugging 4.按以上要求配置好各选项,保存并退出配置菜单 5.编译内核    hms720下依次输入: hms720[0]# make dep hms720[0]# make 系统将自动用arm-linux-gcc交叉编译器编译LINUX内核,如果上面的操作没有什么错误, 那么你可以在~/LinuxHMS720/linux/ 下看到 vmlinux.bin 5.下载内核至目标板并观察其运行结果 六、实验思考     在系统不同时,各选项应如何配置?1、怎样改变RAMDISK的大小,RAMDISK对系统资源的影响。2、怎样  修改显示器 {MOD}彩位数。3、怎样使系统支持LAN