这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » FPGA » [原创]altera杯nios设计大赛源码奉献 (三)

共2条 1/1 1 跳转至

[原创]altera杯nios设计大赛源码奉献 (三)

工程师
2007-04-25 23:02:22     打赏

buildroot to build toolchain on Linux

This post is moved to Nios Wiki,
I don't recommend the buildroot approach to newbie now.
Please go to the nios wiki, http://nioswiki.jot.com/WikiHome/Operating...ms/%C2%B5Clinux
try out the prebuilt zImge if you have altera nios dev board,
install binary toolchain, and follow the uClinux-dist to build kernel and apps.


--Please note, this thread is getting too long, please post your question/discussion as a new topic over the uClinux forum. It will be easier to follow.

This is a guide to nios2 uClinux. We build tools, compile kernel and port applications for nios2 uclinux on a Linux platform.
Why build the tools when you have the IDE on Windows?
The IDE on Windows are not good for kernel/apps development. The IDE's compiler default to newlib, while we would use uClibc in uClinux.
The tools run much faster and less trouble on Linux. You will feel IDE moves like turtle after you use Linux.
If you want uClinux, you should work on Linux and learn Linux. You can learn a lot when working on Linux, and the "Linux know-how" is the key to success on nios2 uClinux.
You can find links to major linux distributions,
http://distrowatch.com/dwres.php?resource=major

Just add a PC to run Linux. You can use quartusII and nios2 on Windows to design hardware, then build sofware on Linux. You DON'T have to run quartusII on Linux. You can setup a samba server or client on Linux, so that they can share files. Always update your tools to the latest ones, ie, quartusII v6.0, niosII v6.0, ddr 3.4.0 at this moment.

If you are new to uClinux, it is very helpful to read the FAQ on the www.ucdot.org.
You should start with a mininal system with only nios2 cpu core,sdram,full featured timer,jtag/serial console and a cfi flash, (cfi flash can be dummy and removed later). Note, the interrupt vector (ie, execption vector) should be in uClinux program memory, ie sdram.
Note in Linux, irq 0 used to be auto-detected and that is not supported in Nios II, so you should not use irq 0 for your devices. Only timer_0 may use irq 0.

There is no MMU on current nios2, so no virtual memory,no shared objs/libs, no fork, and stack size is fixed.
The app exec format on uClinux is not ELF, but binary flat format, FLT.

We will use initramfs (which is quite new to uClinux), instead of romfs. The initramfs is compressed. The rootfs (initrd) image can be linked into the kernel, and make the booting easier. You don't need other devices, such as MTD,CF/IDE,NFS for rootfs to start up your nios2 uClinux. As they may be not available for a new custom board. You can mount other devices or filesystem later,eg jffs2, in user space.

Let's start it step by step.
You should use gcc3 to build this cross-compiler. the gcc4 has problem on binutils-2.15.
If you use Fedora core 5, you should select development packages during installation, and run "yum update" after installation. (redhat 9 is too old, that make failed)
There is compat-gcc-32 package.

CODEsu -   # your root passwd
yum install compat-gcc-32
cd /usr/bin
mv gcc gcc4
ln -s gcc32 gcc
exit



If you have a working buildroot toolchain, there is no need to rebuild all each time. You should edit the build script and update only what is needed. During the build, if you fail (or too slow) when downloading (wget) some files, you can use your browser to search and download them from other sites into ~/download dir. Then you can edit the build script, and restart from the middle.
If you have old builds, and you want a fresh build from begin, you must remove all old build dirs. uncomment line1 of the build script, which will remove all old build dirs.
(Please NOTE, the latest buildroot/uClibc/busybox snapshot may still have problems on nios2, so we will download -20060320, the last known good shot, and save them as -snapshot instead in the build script.)

During the build, you can cut the command lines in this guide with your brower, and paste in the shell console or save to a script. So that you can save some typing and errors.

1. login with a user account, eg, jack. do not use root account.
your home dir will be /home/jack, or in short ~/

2. download microtronix's port of nios2 linux from the forum into the ~/download dir,
http://forum.niosforum.com/downloads/1_4/nios2linux-1.4.zip

3. download http://hungryhippo.jot.com/WikiHome/build.zip , into dir ~/download

CODEcd ~/download
unzip build.zip
./build



The build script will download (using wget) the 20060320 snapshot ,untar, patch and make.
(The configs are binutils-2.15,gcc-3.4.6,uClibc-0.9.29-pre,busybox-1.1.1-pre0 and kernel header 2.6.11.)
The c++ and libstdc++ will be built, too. (but they still have problems to run)
The ~/rootfs dir will be created. The kenel will use this dir and ~/download/rootfs_list file to generate initramfs image.
You may edit the ~/download/rootfs_list file, to add or remove dev nodes.
There is a minimal .config file.
The uClinux-dist will be prepared in ~/uClinux-dist.
The apps ported by microtronix will be in ~/apps .
And the 2.6.11-uc0 kernel will be in ~/linux-2.6.x , with zImage, EPCS MTD,avalon watchdog drivers added.

4. You should include this PATH to use the cross gcc after it is built

CODEPATH=$PATH:~/buildroot/build_nios2/staging_dir/bin


Or you can update the path of the cross gcc in file ~/.bash_profile

CODEPATH=$PATH:$HOME/bin:$HOME/buildroot/build_nios2/staging_dir/bin


so that it will be in the PATH when you login Linux.

Run this to verify that you have it in your command search path,

CODEnios2-linux-uclibc-gcc -v



Run this to verify that you have the proper busybox in FLT format,

CODEnios2-linux-uclibc-flthdr ~/rootfs/bin/busybox


it should display the FLT header like this,

CODE/home/jack/rootfs/bin/busybox
   Magic:        bFLT
   Rev:          4
   Build Date:   Mon Mar 27 13:55:05 2006
   Entry:        0x40
   Data Start:   0x632c8
   Data End:     0x7bb80
   BSS End:      0x96750
   Stack Size:   0x3e80
   Reloc Start:  0x7bb80
   Reloc Count:  0x344d
   Flags:        0x1 ( Load-to-Ram )




5. Then config and compile kernel.

CODEcd ~/linux-2.6.x
# generate nios2_system.h from ptf
make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- hwselect SYSPTF=your_system.ptf


If you use Altera CycloneII NIOS dev board with 2C35, the ptf file is altera/kits/nios2/examples/verilog/niosII_cycloneII_2c35/standard/ std_2C35.ptf,
and the sof is standard.sof . The ptf must match your board.
Here is the hwselect of std_2C35.ptf,

QUOTE--- Please select which CPU you wish to build the kernel against:
(1) cpu - Class: altera_nios2 Type: s Version: 5.11
Selection: 1
--- Please select a device to upload the kernel to:
(1) ext_flash
        Class: altera_avalon_cfi_flash
        Size: 16777216 bytes
Selection: 1
--- Please select a device to execute kernel from:
(1) ext_ssram
        Class: altera_avalon_cy7c1380_ssram
        Size: 2097152 bytes
(2) ddr_sdram
        Class: ddr_sdram_component
        Size: 33554432 bytes
(3) epcs_controller
        Class: altera_avalon_epcs_flash_controller
        Size: 2048 bytes
Selection: 2


CODE# config the kernel
make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- menuconfig


In menuconfig, you should select your serial or jtag console in menu,

QUOTEDevice Drivers  ---> Character devices  --->  Serial drivers  --->


If your user id and group id on Linux are not 500, change these to your id instead,

QUOTEGeneral setup -->  (for new kernels)
OR
Device Drivers  -->  Block devices -->  (for 2.6.11-uc0)
    (500) User ID to map to 0 (user root)
    (500) Group ID to map to 0 (group root)


If you use DEII with 8M sdram, change the link address of the uncompress loader,

QUOTEProcessor type and features-->(0x00500000) Link address offset for booting


Then <exit> and save configuration.

CODE# compile the kernel
make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- zImage


Whenever you update the ~/rootfs, you have to compile the kernel and update the initramfs.

QUOTE  CHK     usr/initramfs_list
  CPIO    usr/initramfs_data.cpio
  GZIP    usr/initramfs_data.cpio.gz
  AS      usr/initramfs_data.o
  LD      usr/built-in.o


If you didn't see the "CPIO" and "GZIP" in compile message, the initramfs is not updated. You will have to remove the file usr/initramfs_list in kernel dir, and compile again to force the update of initramfs.


6. Now the compressed kernel image is ready, arch/nios2nommu/boot/zImage .
you can run it on windows,
First, download the sof of your hardware to your board with quartusII programmer,
Then open a nios2 sdk shell,

Note the drives mapping in nios2 sdk shell,
drive c: is /cygdrive/c/
if you map your linux home to h: on windows with samba server,
then drive h: is /cygdrive/h/
so the image file is
/cygdrive/h/linux-2.6.x/arch/nios2nommu/boot/zImage

CODEcd /cygdrive/h/linux-2.6.x/arch/nios2nommu/boot
nios2-download -g zImage
nios2-terminal


Here is the boot message on my custom board,

QUOTEUncompressing Linux... Ok, booting the kernel.
Linux version 2.6.16 (jack@localhost) (gcc version 3.4.6) #1 PREEMPT Wed Mar 22 11:48:33 CST 2006
uClinux/Nios II
Altera Nios II support © 2004 Microtronix Datacom Ltd.
Built 1 zonelists
Kernel command line:
PID hash table entries: 512 (order: 9, 8192 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory available: 63616k/65536k RAM, 0k/0k ROM (733k kernel code, 546k data)
Mount-cache hash table entries: 512
io scheduler noop registered
io scheduler deadline registered (default)
NIOS serial driver version 0.0
ttyS0 (irq = 1) is a builtin NIOS UART
Freeing unused kernel memory: 468k freed (0xc0000 - 0x134000)
init started:  BusyBox v1.1.1-pre0 (2006.03.20-07:53+0000) multi-call binary
BusyBox v1.1.1-pre0 (2006.03.20-07:53+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
#


(Note, don't use jtag uart in production, it will not run without a nios2-terminal connection)

7. After you have tested the uClinux from sdram, you may want to program the flash.

If you use EPCS flash, find out and change the sof path and epcs base below.
on nios2 sdk shell,

CODEcd arch/nios2nommu/boot
# Creating .flash file for the FPGA configuration
sof2flash --epcs --input=$SOPC_KIT_NIOS2/examples/verilog/niosII_cycloneII_2c35/standard/standard.sof --output=standard.flash
# Programming flash with the FPGA configuration
nios2-flash-programmer --epcs --base=0x02200000 standard.flash
# Creating .flash file for the project
elf2flash --epcs --after=standard.flash --input=zImage --output=epcs_controller.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec
# Programming flash with the project
nios2-flash-programmer --epcs --base=0x02200000 epcs_controller.flash



Or if you use cfi flash,

CODEcd arch/nios2nommu/boot
# Creating .flash file for the FPGA configuration
sof2flash --offset=0xC00000 --input=$SOPC_KIT_NIOS2/examples/verilog/niosII_cycloneII_2c35/standard/standard.sof --output=standard.flash
# Programming flash with the FPGA configuration
nios2-flash-programmer --base=0x00000000 standard.flash
# Creating .flash file for the project
elf2flash --base=0x00000000 --end=0xffffff --reset=0x0 --input=zImage --output=ext_flash.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_cfi.srec
# Programming flash with the project
nios2-flash-programmer --base=0x00000000 ext_flash.flash



8. If you use EPCS, you can use jffs2 to provide a nonvolatile filesystem.
Check the very nice guide from Jdhar,
http://via.dynalias.org/svn/uclinux/doc/trunk/epcs-ug.pdf
In kernel menuconfig

QUOTEMemory Technology Devices (MTD) -->
<*> Memory Technology Device (MTD) support
  [*]   MTD partitioning support
    <*>   Direct char device access to MTD devices
    <*>   Caching block device access to MTD devices
  RAM/ROM/Flash chip drivers -->
    <*> Support for Altera EPCS Device
  Mapping drivers for chip access -->
    <*> Maps for Altera EPCS Configuration Device
File systems  -->
  Miscellaneous filesystems -->
    <*> Journalling Flash File System v2 (JFFS2) support



Or if you use cfi flash, in kernel menuconfig,

QUOTEMemory Technology Devices (MTD) -->
<*> Memory Technology Device (MTD) support
  [*]   MTD partitioning support
    <*>   Direct char device access to MTD devices
    <*>   Caching block device access to MTD devices
  RAM/ROM/Flash chip drivers -->
    [*] Detect flash chips by Common Flash Interface (CFI) probe
    [*] Detect non-CFI AMD/JEDEC-compatible flash chips
    [*] Support for AMD/Fujitsu flash chips
       (3)   Retry failed commands (erase/program)
  Mapping drivers for chip access -->
    [*] Maps for Altera Nios Development Kit
File systems  -->
  Miscellaneous filesystems -->
    <*> Journalling Flash File System v2 (JFFS2) support


Then rebuild the kernel, and boot nios2 uclinux.
It should display jffs2 support and detect mtd partitions.

CODEmount –t jffs2 /dev/mtdblock0 /mnt


here, /mnt is your mount dir. You can access files under the mount dir.
After you finish the access,

CODEumount /mnt



Note, you may have to erase the mtd part or preload jffs2 image with nios2-flash-programmer. You may have to customize the map file for different flash size and part size, in drivers/mtd/maps/
either epcs_map.c or altera.c .

9. To enable network support, eg if you use the Altera dev board with SMC91111,

QUOTENetworking -->
  [*] Networking support
    Networking options  --->  
      <*> Packet socket
      <*> Unix domain sockets  
      [*] TCP/IP networking
Device Drivers -->
Network device support ─>
  [*] Network device support
    [*] Ethernet (10 or 100Mbit)
    <*> SMC 91111 support


Then rebuild the kernel, and boot nios2 uclinux.
It should detect the SCM 91111 device as eth0.
Then config the ip address and router.

CODEifconfig eth0 192.168.1.10
route add default gw 192.168.1.254


You may add these setup for "eth0" to ~/rootfs/etc/inittab, follow the setup for "lo" .
So that eth0 will be configed by init.

10. If you will write driver, try out the hello world module example in the (must have) book "Linux Device Driver 3rd ed.".
In your kernel dir,
save the file to drivers/misc/hello.c

CODE#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
   printk(KERN_ALERT "Hello, world\n");
   return 0;
}
static void hello_exit(void)
{
   printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);


Add these lines to drivers/misc/Kconfig, before the "endmenu" line.

CODEconfig HELLO
   tristate "example hello module"
   help
        Enable example hello module.


Add the line to drivers/misc/Makefile

CODEobj-$(CONFIG_HELLO) += hello.o



Enable module support in menuconfig, then build the hello.ko module.

QUOTELoadable module support -->  
  [*] Enable loadable module support
Device Drivers -->  
  Misc devices  --->  
    <M> example hello module


CODE# config the kernel, enable module support
make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- menuconfig
# compile the kernel module
make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc-
# copy module files to rootfs and generate modules.dep
make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- INSTALL_MOD_PATH=~/rootfs modules_install
# rebuild image for initramfs
make ARCH=nios2nommu CROSS_COMPILE=nios2-linux-uclibc- zImage


Boot nios2 uClinux, and load module

CODEmodprobe hello




11. To compile a simple program, just add -elf2flt to link flag

CODEnios2-linux-uclibc-gcc hello.c -o hello -elf2flt
cp hello ~/rootfs/bin


Rebuild the kernel image for initramfs, boot nios2 uClinux, and run

CODEhello


The default stack size of application is 4KB, you can change it with -elf2flt="-s <new stack size>" option, eg ,

CODEnios2-linux-uclibc-gcc hello.c -o hello -elf2flt="-s 16000"


will have stack size as 16KiB.

12. There are many applications built into busybox, enter 'help" to find out and read doc of busybox to learn them (eg udhcp server and client). You may config busybox, for more apps or to reduce size.

CODEcd ~/buildroot
# remove old busybox apps and links
make -C build_nios2/busybox clean
# select busybox apps
make -C build_nios2/busybox menuconfig
# build busybox again
make
# rebuild rootfs
rm -rf ~/rootfs
cp -a ~/buildroot/build_nios2/root ~/rootfs
cd ~/rootfs
# remove include and lib to save space
# the dev nodes are generated via ~/download/rootfs_list
rm -rf dev usr/include usr/lib
# you may use this instead of the one from buildroot
cp ~/download/inittab etc
# check busybox header
nios2-linux-uclibc-flthdr ~/rootfs/bin/busybox


Rebuild the kernel image for initramfs.( I have removed old ~/rootfs for simplicity in the example, you may have to reinstall others, such as kernel modules, apps, configs)

If you want to add or port apps to uClinux, you should think of adding it to busybox first. Because there are no shared objs, add apps to busybox will save some memory usage.

13. to use the apps ported by Microtronix. I have patched the Makefile of inetd,ftpd and boa using ~/download/mx140apps.diff . You can look at the patches and update other apps yourself. Note you have to prepare proper config files to run these apps.

To run boa web server,

CODEcd ~/apps/boa/src
make
make install
mkdir ~/rootfs/etc/config
cp ~/download/boa.conf ~/rootfs/etc/config
cp ~/download/mime.types ~/rootfs/etc
mkdir ~/rootfs/home/httpd


put your index.html and other content into ~/rootfs/home/httpd .
Then rebuild zImage for initramfs, boot nios2 uclinux, and run,

CODEboa&


If you want cgi, check ~/uClinux-dist-test/user/cgi_generic , in next step.

To run inetd and ftpd,

CODEcd ~/apps/inetd
make
make install
cd ~/apps/ftpd
make
make install
echo "ftp  stream tcp nowait root /bin/ftpd" >>~/rootfs/etc/inetd.conf


to use anonymous ftp user,
add "ftp:x:14:50:FTP User:/home/ftp:" to etc/passwd
add "ftp:x:50:" to etc/group
make dir home/ftp
add ftp contents to home/ftp
rebuild zImage for initramfs, boot nios uclinux, and run,

CODEinetd&
netstat -a


inetd will invoke ftpd.

14. to use user apps ported to uClinux from uClinux-dist.

CODEcd ~/uClinux-dist
make menuconfig


In menuconfig, select
Kernel/Library/Defaults Selection ---> [*] Customize Vendor/User Settings (NEW)
Then <exit>,<exit>,<yes>.
It will enter user apps select, make your selection.
It has pre-selected dhcpd and net-snmp for testing.

To compile

CODEmake subdirs


copy apps to ~/rootfs

CODEmake romfs
cd romfs
cp -a bin usr var ~/rootfs


Note, you have to setup config files to ~/rootfs/etc for apps (eg dhcpd.conf), check doc for each of them. You should also check ~/uClinux-dist-test/romfs/etc for other config files.
~/uClinux-dist-test/user/dhcpd/samples/dhcpd.conf

Then rebuild zImage for initramfs.
(note, the boa port in uClinux-dist has problems on nios2)

To use telnetd, you have to enable pty in kernel config,

CODEDevice Drivers --> Character devices -->
[*] Legacy (BSD) PTY support
(10) Maximum number of legacy PTY in use


Select telnetd in uClinux-dist-test menuconfig,

CODE[*] telnetd
    [*]   telnetd does not use openpty() (NEW)  


add "telnet stream tcp nowait root /bin/telnetd" to ~/rootfs/etc/inetd.conf .
The password files are etc/passwd,etc/group,etc/shadow .
Use "addgroup","adduser","passwd" to create password on nios2 uClinux.
Then update the password files in ~/rootfs.
Add ptyp0-9 to , or remove the file etc/securetty, if you want root login on telnetd.


15. If you want to port apps, look in ~/buildroot/build_nios2/busybox, ~/apps, and ~/uClinux-dist-test/user first. There may be ported apps already.
Read the file INSTALL of it. If it need "./configure", you should check it with "./configure -help" and add options. You may have to update the file config.sub, check ~/download/uClinux-dist.diff on how to add $basic_machine, eg wget

CODEIndex: user/wget/config.sub
===================================================================
--- user/wget/config.sub (revision 1)
+++ user/wget/config.sub (revision 3)
@@ -274,6 +274,11 @@
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;

+ nios2 | nios2-* | nios2 | nios2-*)
+  basic_machine=nios2-altera
+  os=-linux
+;;
+
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.


Then run "./configure --host=nios2-linux-uclibc --disable-shared ...." ,a Makefile will be generated.
You may have to modify the Makefile or Rules.mak.
The stdinc dir and stdlib dir are default to uClibc.
So you don't need the "-nostdinc" and "-nostdlib" stuf.
You should add something like this to link flags to generate FLT obj,

CODELDFLAGS += -Wl,-elf2flt="-s 16000" -Wl,-v -Wl,-d


Remove unused items, or that is for PC host.
You can setup the install path to your rootfs.
Then,"make","make install".
Remeber to update the kernel image for initramfs.
A sample patch, mtools-Makefile.diff, to mtools-3.9.10 Makefile is included in the attached build.zip.

16. to use CF drive on the dev board, download the example design,
http://forum.niosforum.com/downloads/cflash/cf5_0.zip
Run generate in SOPC and compile again with the latest quartusII and niosII.
Use the new sof and ptf, do hwselect and menuconfig for the kernel, select altera cf, and we want FAT support in this example,

CODEDevice Drivers -->  ATA/ATAPI/MFM/RLL support  --->
[*] ATA/ATAPI/MFM/RLL support
[*]   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
[*]     Include IDE/ATA-2 DISK support
[*]     Use multi-mode by default
[*]     generic/default IDE chipset support
[*]     Other IDE chipset support
[*]       Altera CF (IDE mode) interface (Avalon bus) support
File systems -->  
DOS/FAT/NT Filesystems  --->
   [*] MSDOS fs support
   [*] VFAT (Windows-95) fs support
   (437) Default codepage for FAT
   (iso8859-1) Default iocharset for FAT
Native Language Support -->
   (iso8859-1) Default NLS Option
   [*]   Codepage 437 (United States, Canada)
   [*]   NLS ISO 8859-1  (Latin 1; Western European Languages)


Rebuild the kernel image for initramfs, boot nios2 uClinux, and it should detected the cf drive. assume part1 on the CF, /dev/hda1, is preformated FAT,

CODEmount -t vfat /dev/hda1 /mnt


Or if the windows formats the CF without part,

CODEmount -t vfat /dev/hda /mnt


after you finish the access, umount to flush the disk cache,

CODEumount /mnt



17. to use altera pci host bridge, check the hardware design example,
http://forum.niosforum.com/forum/index.php?showtopic=3059
dev0 is sdram,
dev1 is your pci device1, using irqn_0 to irqn_3 for inta..intd
dev2 is your pci device2, using irqn_4 to irqn_7 for inta..intd
(update the number of irqn in the example design to 8)

The PCI driver is in the altpci.zip, attached at the end of this post.
download to ~/download dir.

CODEcd ~/download
unzip altpci.zip
cd ~/linux-2.6.x
patch -p0 <~/download/altpci.diff


You have to update arch/nios2nommu/drivers/pci/altpci.c to fix up pci slots and irqs mapping for your board, seach for "FIX ME".
Then kernel menuconfig,
Bus options (PCI, PCMCIA, EISA, MCA, ISA)
[*] PCI support
[*] Altera PCI host bridge
And enable support for your pci devices.

18. STRONGLY RECOMMANDED, You should use subversion to help tracking your works, including both hardware and software.
Try "svn help", if you don't have it, install it with "yum install subversion". (for fedora core)

a. create the svn store, and check your original as rev1.

CODEcd ~
mkdir mysvn
svnadmin create mysvn/webs
tar xzvf webs218.tar.gz
svn import ws031202 file:///home/alex/mysvn/webs/ws031202 -m="initial"
rm -rf ws031202
svn co file:///home/alex/mysvn/webs/ws031202



b. make your change to Makefile, misc.c ....
build and test....

c. after you finished, or when you want to save your change to store, as rev2

CODEcd ws031202
svn commit -m="update for nios2 uclinux"
svn diff -r1:2 >webs.diff


Then you can send webs.diff to others

d. when other get your diff file, he can apply the patch and get the same update from yours.

CODEtar xzvf webs218.tar.gz
cd ws031202
patch -p0 <webs.diff



The subversion is very helpful. You can find more usages from the subversion guide on their web.

(PS..)
Marc sent the nios2 port of buildroot to busybox.net, and I did some patches, too. Vapier, one of the developers of busybox/uClibc/buildroot, helps to clean up the codes and incoporate into the "trunk". And he forwarded the elf2flt patches to uClinux dev team, too. All these works bring this project, simple and easy to use tools to build uClinux for the Nios2. Best thanks to marc, jdhar, and vapier.

Links:
marc's site for nios2, with buildroot
http://scorpius.homelinux.org/~marc/nios2.html
web site, docs and bug report for busybox/uClibc/buildroot/udhcp
http://busybox.net/
uclinux-dist, with a lots of apps ported to uclinux
http://www.uclinux.org/pub/uClinux/dist/
More information about Initramfs can be found on LWN, "Initramfs arrives" and
"Patch: Documentation for ramfs, rootfs, initramfs."

kernel tree and svn, including many drivers, (including epcs,mmc and i2c...) ported by Jdhar
http://via.dynalias.org/svn/uclinux/linux-2.6.11/trunk/

how to run the uClinux in NIOS2 in chinese by Alex.liu.
http://www.icwin.net/ShowArtitle.ASP?art_id=8313&cat_id=52[COLOR=red][COLOR=red]

Attached File(s)
  altpci.zip ( 14.85k ) Number of downloads: 55
  kernel2.zip ( 337.57k ) Number of downloads: 79
  isp1362.zip ( 59.35k ) Number of downloads: 65
  zimage.zip ( 4.8k ) Number of downloads: 48
  build0411.zip ( 52.42k ) Number of downloads: 175


[em07][em07][em07][em07][em07][em07][em07] [align=right][color=#000066][此贴子已经被作者于2007-4-25 15:18:02编辑过][/color][/align]



关键词: 原创     altera     设计     大赛     源码     奉献     bui    

院士
2007-04-27 07:00:00     打赏
2楼

统一了吧~~

加精~~


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]