📄 basic_session.html
字号:
<br> [user@DebugPC
tftpboot]$ cmp readfromflash reference.file
<br>
<h3>Creating a jffs2 file system</h3>
//Create a
directory where to mount the file system
<br> [root@AT91RM9200DK
/]$cd /mnt
<br> [root@AT91RM9200DK
/mnt]$mkdir AT45DB642
<p> //Mount
the file system
<br> [root@AT91RM9200DK
/mnt]$mount -t jffs2 /dev/mtdblock/0 AT45DB642
<p> //Copy
some files...
<br> [root@AT91RM9200DK
/mnt]$cp -a /bin /AT45DB642
<p> //Unmount
the file system
<br> [root@AT91RM9200DK
/mnt]$umount AT45DB642
<br>
<p> //Try some
file operations
<br> [root@AT91RM9200DK
/mnt]$ls AT45DB642/bin
<br>
[root@AT91RM9200DK mnt]$ls AT45DB642/bin
<br>
ae dd
cp df
du ln
ls
<br>
mv ps
rm sh
su vi
cat
<br>
pwd sed
tar tee
bash date
edit
<br>
head grep
gzip kill
more nice
ping
<br>
sort stty
sync true
uniq zcat
deluser
<br>
chgrp chmod
chown dmesg
egrep false
login
<br>
mkdir mknod
mount rmdir
sleep uname
hostname
<br>
delgroup POSIXness editor netstat
gunzip addgroup adduser
<br>
tinylogin umount usleep
busybox
<br>
[root@AT91RM9200DK /mnt]$AT45DB642/bin/date
<br>
Thu Jan 1 00:02:33 /usr/local/arm 1970
<br>
[root@AT91RM9200DK /mnt]$echo "test successfully passed" > AT45DB642/message
<br>
[root@AT91RM9200DK /mnt]$cat AT45DB642/message
<br>
Test successfully passed
<br>
<h3>Benchmarking the file system</h3>
//Reboot the board
<br>
//Mount the file system
<br>
[root@AT91RM9200DK /mnt]$mount -t jffs2 /dev/mtdblock/0 AT45DB642
<p>
//Launch the benchmark program (Bonnie)
<br>
[root@AT91RM9200DK /mnt]$Bonnie -d AT45DB642 -s 1
<p>
//Unmount the file system
<br>
[root@AT91RM9200DK /mnt]$umount AT45DB642
<br>
<br>
<h2><a NAME="Nand Flash"></a>Nand Flash</h2>
<p>This test performs read and write operations on the Nand Flash. Before
carrying on you need to make sure that you have a 32 MegaByte SmartMedia card
and two important binaries; "<font color="green">mkfs.jffs2</font>" and
"<font color="green">eraseall</font>". Make sure after board reboot that device files
have been created for nand flash (plugged); /dev/mtd/2 (char device) and /dev/mtdblock/2
(block device) . The test goes like this :
<br><br>
<dl>
<dd>// Create a jffs2 filesystem from a directory, we choose /usr/adm</dd>
<dd>[root@AT91RM9200DK /root]$mkfs.jffs2 -p 131072 -e /usr/adm -o /tmp/jffs.image</dd>
<br><br>
<dd>//Erase nand flash</dd>
<dd>[root@AT91RM9200DK /root]eraseall /dev/mtd/2</dd>
<br><br>
<dd>//Copy the filesystem in nand flash</dd>
<dd>[root@AT91RM9200DK /root]$cp /tm jffs.image /dev/mtd/2</dd>
<br><br>
<dd>// mount the the nand flash (block device) in a directory</dd>
<dd>[root@AT91RM9200DK /root]mount -t jffs2 /dev/mtdblock/2 /mnt/mtd</dd>
<dd>[root@AT91RM9200DK /root]ls /mnt/mtd</dd>
</dl>
<h2><a NAME="Disk-On-Key"></a>How to use your Disk On Key</h2>
<p>The kernel source provided in this release supports a USB Disk-On-Key. All you have to do is plug your key and type the following
commands :
<dl>
<dd>// mount key's device file on a directory
<dd>[root@AT91RM9200DK /root]$mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt</dd>
<br><br>
<dd>// you can browse your key </dd>
<dd>[root@AT91RM9200DK /root]$ ls /mnt</dd>
<br><br>
<dd>// copy files</dd>
<dd>[root@AT91RM9200DK /root]$ cp files /mn</dd>
<dd>[root@AT91RM9200DK /root]$ cp /mnt/files files</dd>
<br><br>
<dd>// umount your key </dd>
<dd>[root@AT91RM9200DK /root]$ umount /mnt</dd>
</dl>
<h2><a NAME="RTC"></a>How to set the system Clock</H2>
<p>A RTC driver runs the RTC peripheral in the chip which allows the user to set the system clock and the RTC itself. RTC peripheral is a 32-bit wide
counter that counts the elapsed seconds since January, 1st 1970. Linux has two programs that allow to set and/or read both system clock and hardware clock
(RTC) <font color="green">"date"</font> and <font color="green">"clock"</font>. Notice that the RTC device file is created in <font color="green">/dev/misc</font> whereas <font color="green">"date"</font> and <font color="green">"clock"</font> assume that it is located in <font color="green">/dev/</font>. A little trick can be used to work around this tiny problem. You can create a symbolic link to <font color="green">/dev/misc/rtc</font> in <font color="green">/dev/</font>.
<dl>
<dd>// Create the symbolic link. Notice that you don't need to create this symbolic link if you are using the ramdisk shipped in this release.
<dd>[root@AT91RM9200DK /root]$ ln -s /dev/misc/rtc /dev/rtc</dd>
<br><br>
<dd>// Main commands, clock setting</dd>
<dd>// Initialize the system clock from hardware clock (RTC)</dd>
<dd>[root@AT91RM9200DK /root]$ clock -s</dd>
<br>
<dd>// Set the system clock to current date</dd>
<dd>[root@AT91RM9200DK /root]$ date -s "MMDDhhmmYYYY.ss"</dd>
<dd>Wed Jul 9 14:50:00 /usr/local/arm 2003</dd>
<br><br>
<dd>// Display system clock</dd>
<dd>[root@AT91RM9200DK /root]$ date</dd>
<dd>Wed Jul 9 14:52:07 /usr/local/arm 2003</dd>
<br><br>
<dd>// Set the hardware clock from the system clock</dd>
<dd>[root@AT91RM9200DK /root]$ clock -w</dd>
<dd>[root@AT91RM9200DK /root]$ clock -a</dd>
</dl>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -