Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Quick guide for porting linux to ALTERA DE2 70

Platform and tools:  Ubuntu 9.04
Step 1,   Download the nios linux tallbal
wget http://www.niosftp.com/pub/linux/nios2-linux-20090929.tar
or use xunlei to fix it.
Step2,
tar xvf  nios2-linux-20090929.tar
cd nios2-linux
./checkout
Step 3,   Generate the fpga.h file
First, a nios processor should be constructed.
Use any one of examples in the DE2 cd.  For instance, use  E:\fpga\de2_70\DE2_70_demonstrations\DE2_70_NIOS_HOST_MOUSE_VGA
Then add a mmu as pics bellow.   Remember to click the Auto-Assign Base Addresses, or it will sthick on the booting stage.
Click Generate, this takes a while.
Alfter above steps, we can get fpga.h file now.Open Nios II Command Shell,   cd to this DE2...vga DIR,  and key in the following commond
sopc-create-header-files --single fpga.h
start complication
copy ***VGA.sof to c:/
then copy the fpga.h file to /softs/nios2-linux/linux-2.6/arch/nios2/include/asm
Step 4     Building the linux kernel
 
Add "PATH=$PATH:~/nios2-linux/toolchain-mmu/x86-linux2/bin" to ~/.bashrc file
cd /softs/nios2-linux/uClinux-dist
make menuconfig        
#Enable the dma9000 and mtd drivers
make
cd images
copy linux.initramfs.gz  to windows xp  c:/
Step 5   Flash Linux kelnel to DE2-70
 
Open Nios II Command Shell,   cd to this DE2...vga DIR,  and key in the
following commonds
 
nios2-configure-sof  ***.sof
nios2-download -g linux.initramfs.gz
nios2-terminal
 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[NiosII EDS]$ nios2-terminal
nios2-terminal: connected to hardware target using JTAG UART on cable
nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)
Linux


Ïà¹ØÎĵµ£º

LinuxÄÚºËÅäÖÃÎĵµ(make menuconfig)

Ò»¡¢ÒýÑÔ£º
    ±¾ÎĵµµÄÄÚÈݴ󲿷ÝÄÚÈݶ¼ÊÇ´ÓÍøÉÏÊÕ¼¯¶øÀ´£¬È»ºóÅäºÏһЩеĽØͼ£¨Äں˰汾£ºV2.4.19£©¡£ÔÚÿһÅäÖÃÏîºó»áÓÐÒ»¸öÑ¡ÔñÖ¸ÄϵIJ¿·Ý£¬ÓÃÀ´Ö¸µ¼´ó¼ÒÔõôÑù¸ù¾Ý×Ô¼ºµÄÇé¿öÀ´×öÏàÓ¦µÄÑ¡Ôñ£»»¹ÓÐÔÚÿһ¸ö´óÏîºÍÎĵµµÄ×îºó»áÓÐÒ»¸ö¾­Ñé̸£¬ËüÊÇһЩ¸ßÊÖÃÇÔÚÓ¦¶ÔÎÊÌâºÍ´¦ÀíÌØÓÐÓ²¼þʱµÄһЩ¾­Ñ飨Õâ¸ö»¹µ ......

linux socket Ïê½â

Í·Îļþ£ºsys/socket.h
Ïà¹Ø½á¹¹Ì壺
struct sockaddr
{
    unsigned short sa_family;   //µØÖ·×å
    char sa_data[14];   //14×Ö½ÚЭÒéµØÖ·
};
struct sockaddr_in
{
    short int sin_family;   //µØÖ·×å
    u ......

Linux shell

Linux ²é¿´ËùÓл·¾³±äÁ¿ÃüÁexpoert ºÍ  env ¡£
               Ö¸¶¨»·¾³±äÁ¿£ºecho $XXX,(XXX´ú±í»·¾³±äÁ¿Ãû)
¸ü¸Ä»·¾³±äÁ¿Öµ·½·¨£º
1.ÐÞ¸Ä/etc/profileÎļþ
Àý£ºÔÚprofileÎļþĩβ¼ÓÈ룺
JAVA_HOME=/usr/share/jdk1.5.0_05
P ......

linux shellÖÖÀà

LinuxÖеÄshellÓжàÖÖÀàÐÍ£¬ÆäÖÐ×î³£Óõļ¸ÖÖÊÇBourne   shell£¨sh£©¡¢C   shell£¨csh£©ºÍKorn   shell£¨ksh£©¡£ÈýÖÖshell¸÷ÓÐÓÅȱµã¡£Bourne   shellÊÇUNIX×î³õʹÓõÄshell£¬²¢ÇÒÔÚÿÖÖUNIXÉ϶¼¿ÉÒÔʹÓá£Bourne   shellÔÚshell±à³Ì·½ÃæÏ൱ÓÅÐ㣬µ«ÔÚ´¦ÀíÓëÓû§µÄ½»»¥ ......

linux ,·Ôںη½£¿

 
ѧlinuxÒ²ÓÐÒ»¶Îʱ¼äÁË£¬´ÓÒ»¸ö²ËÄñ³É³¤ÎªõçõÇ×ß·µÄ³ûÄñ£¬Ò»Â·×ßÀ´£¬ÄÑÃâÓÐЩ¿Ä¿ÄÅöÅö¡£¶ÔlinuxµÄÈÏʶҲ´ÓÌý˵ºÜÇ¿´ó£¬µ½Ç××ÔÌåÑéËüµÄ¿ªÔ´¡¢°²
È«¡¢ÒÔ¼°ÓÅÔ½µÄÐÔÄÜ£¬²»¹ýÒ²³Ô¾¡ÁË¿àÍ·£¬ÕæµÄÊÇÎåζ¾ãÈ«¡£
    
¶¼Ëµlinux¹¦ÄÜÇ¿´ó£¬×Ô´ÓÎÒ½Ó´¥ÁËlinux¾Í¸Ð¾õµ½ÁËËüµÄÇ¿´ó¡£Ç¿´óµÄ°²È«ÐÔÄÜ£¬ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ