OpenCores
URL https://opencores.org/ocsvn/amber/amber/trunk

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [vmlinux/] [README.txt] - Diff between revs 45 and 48

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 45 Rev 48
Line 8... Line 8...
vmlinux.dis.bz2             Kernel disassembly file, bzip2 compressed
vmlinux.dis.bz2             Kernel disassembly file, bzip2 compressed
vmlinux.mem.bz2             Kernel .mem file for Verilog simulations, bzip2 compressed
vmlinux.mem.bz2             Kernel .mem file for Verilog simulations, bzip2 compressed
                            If you build the kernal from source these 2 files
                            If you build the kernal from source these 2 files
                            get replaced.
                            get replaced.
 
 
 
 
# +++++++++++++++++++++++++++++++++++++++++++
# +++++++++++++++++++++++++++++++++++++++++++
# How to run Amber Linux kernel on a development board
# How to run Amber Linux kernel on a development board
# +++++++++++++++++++++++++++++++++++++++++++
# +++++++++++++++++++++++++++++++++++++++++++
1. Download the bitfile to configure the FPGA using Impact ir Chipscope
1. Download the bitfile to configure the FPGA using Impact or Chipscope
2. Connect HyperTerminal to the serial port on the FPGA to connect to the boot loader
2. Connect HyperTerminal to the serial port on the FPGA to connect to the boot loader
3. Download the disk image
3. Download the disk image
> b 800000
> b 800000
Then select the file $AMBER_BASE/sw/vmlinux/initrd to transfer
Then select one of the provided disk image files to transfer, e.g.
 
   $AMBER_BASE/sw/vmlinux/initrd-200k-hello-world
 
 
4. Download the kernel image
4. Download the kernel image
> l
> l
Then select the file $AMBER_BASE/sw/vmlinux/vmlinux to transfer
Then select the file $AMBER_BASE/sw/vmlinux/vmlinux to transfer
 
 
5. Execute th ekernel
5. Execute th ekernel
> j
> j 80000
 
 
 
 
# +++++++++++++++++++++++++++++++++++++++++++
# +++++++++++++++++++++++++++++++++++++++++++
# How to build Amber Linux kernel from source
# How to build Amber Linux kernel from source
# +++++++++++++++++++++++++++++++++++++++++++
# +++++++++++++++++++++++++++++++++++++++++++
Line 64... Line 68...
 
 
cp vmlinux vmlinux_unstripped
cp vmlinux vmlinux_unstripped
${AMBER_CROSSTOOL}-objcopy -R .comment -R .note vmlinux
${AMBER_CROSSTOOL}-objcopy -R .comment -R .note vmlinux
${AMBER_CROSSTOOL}-objcopy --change-addresses -0x02000000 vmlinux
${AMBER_CROSSTOOL}-objcopy --change-addresses -0x02000000 vmlinux
$AMBER_BASE/sw/tools/amber-elfsplitter vmlinux > vmlinux.mem
$AMBER_BASE/sw/tools/amber-elfsplitter vmlinux > vmlinux.mem
 
 
# Add the ram disk image to the .mem file
# Add the ram disk image to the .mem file
$AMBER_BASE/sw/tools/amber-bin2mem ${AMBER_BASE}/sw/vmlinux/initrd 800000 >> vmlinux.mem
# You can use one of the provided disk images or generate your own (see below)
 
$AMBER_BASE/sw/tools/amber-bin2mem ${AMBER_BASE}/sw/vmlinux/initrd-200k-hello-world 800000 >> vmlinux.mem
${AMBER_CROSSTOOL}-objdump -C -S -EL vmlinux_unstripped > vmlinux.dis
${AMBER_CROSSTOOL}-objdump -C -S -EL vmlinux_unstripped > vmlinux.dis
cp vmlinux.mem $AMBER_BASE/sw/vmlinux/vmlinux.mem
cp vmlinux.mem $AMBER_BASE/sw/vmlinux/vmlinux.mem
cp vmlinux.dis $AMBER_BASE/sw/vmlinux/vmlinux.dis
cp vmlinux.dis $AMBER_BASE/sw/vmlinux/vmlinux.dis
 
 
# Run the Linux simulation to verify that you have a good kernel image
# Run the Linux simulation to verify that you have a good kernel image
Line 89... Line 95...
 
 
# Pick a directory on your system where you want to build Linux
# Pick a directory on your system where you want to build Linux
export LINUX_WORK_DIR=/proj/amber2-linux
export LINUX_WORK_DIR=/proj/amber2-linux
 
 
 
 
 
# Create the Linux build directory
 
test -e ${LINUX_WORK_DIR} || mkdir ${LINUX_WORK_DIR}
cd ${LINUX_WORK_DIR}
cd ${LINUX_WORK_DIR}
 
 
# Need root permissions to mount disks
# Need root permissions to mount disks
su root
su root
dd if=/dev/zero of=initrd bs=200k count=1
dd if=/dev/zero of=initrd bs=200k count=1
mke2fs -F -m0 -b 1024 initrd
mke2fs -F -m0 -b 1024 initrd
 
 
Line 113... Line 122...
mknod ${LINUX_WORK_DIR}/mnt/dev/null c 1 3
mknod ${LINUX_WORK_DIR}/mnt/dev/null c 1 3
mknod ${LINUX_WORK_DIR}/mnt/dev/loop0 b 7 0
mknod ${LINUX_WORK_DIR}/mnt/dev/loop0 b 7 0
chmod 600 ${LINUX_WORK_DIR}/mnt/dev/*
chmod 600 ${LINUX_WORK_DIR}/mnt/dev/*
 
 
cp $AMBER_BASE/sw/hello-world/hello-world.flt ${LINUX_WORK_DIR}/mnt/sbin/init
cp $AMBER_BASE/sw/hello-world/hello-world.flt ${LINUX_WORK_DIR}/mnt/sbin/init
 
#cp $AMBER_BASE/sw/dhry/dhry.flt ${LINUX_WORK_DIR}/mnt/sbin/init
chmod +x ${LINUX_WORK_DIR}/mnt/sbin/init
chmod +x ${LINUX_WORK_DIR}/mnt/sbin/init
 
 
# Check
# Check
df ${LINUX_WORK_DIR}/mnt
df ${LINUX_WORK_DIR}/mnt
 
 
# Unmount
# Unmount
umount ${LINUX_WORK_DIR}/mnt
umount ${LINUX_WORK_DIR}/mnt
rm -rf ${LINUX_WORK_DIR}/mnt
rm -rf ${LINUX_WORK_DIR}/mnt
exit
exit # from being root
 
 
 
cp initrd $AMBER_BASE/sw/vmlinux/initrd-
 
 
 
---
 
 
 
If 200k is not large enough, you can change the size as follows.
 
You'll need to change a couple of values in the ATAG data structure defined in the
 
boot loader. Specifically the ATAG_RAMDISK_SIZE parameter and the ATAG_INITRD_SIZE
 
parameter in file $AMBER_BASE/sw/boot-loader/start.S. Then create an initrd image
 
with a different bs number, for example;
 
dd if=/dev/zero of=initrd bs=400k count=1
 
 
 
The initrd image size gets picked up automatically by the kernel, as long as the
 
ram disk defined in the ATAG data is large enough to contain it.
 
 
cp initrd $AMBER_BASE/sw/vmlinux
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.