主题 : 系统跑起来了,但是不能用终端下载文件。 复制链接 | 浏览器收藏 | 打印
误人子弟!
级别: 新手上路
UID: 799
精华: 0
发帖: 40
金钱: 355 两
威望: 130 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2008-06-01
最后登录: 2013-09-03
楼主  发表于: 2008-08-02 21:09

 系统跑起来了,但是不能用终端下载文件。

##### FriendlyARM BIOS for 2440 #####
[x] bon part 0 320k 2368k
[v] Download vivi
[k] Download linux kernel
[y] Download root_yaffs image
[c] Download root_cramfs image
[n] Download Nboot
[e] Download Eboot
Download WinCE NK.nb0
[w] Download WinCE NK.bin
[d] Download & Run
[f] Format the nand flash
[p] Partition for Linux
Boot the system
[s] Set the boot parameters
[t] Print the TOC struct of wince
[q] Goto shell of vivi
Enter your selection: b
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 362
NOW, Booting Linux......
Uncompressing Linux.................................................................................
.................... done, booting the kernel.
Linux version 2.6.25 (studyboy@localhost.localdomain) (gcc version 3.4.1) #1 Wed Jun 25 13:49:04 EDT 20
08
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
irq: clearing pending ext status 00000200
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00000000, tcnt a4ca, tcfg 00000200,00000000, usec 00001e57
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61568KB available (2884K code, 291K data, 128K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 152 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
S3C244X: Clock Support, DVS off
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.30
Uniform Multi-Platform E-IDE driver
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=1, 9ns Twrph0=4 39ns, Twrph1=1 9ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00030000 : "bootloader"
0x00050000-0x00250000 : "kernel"
0x00250000-0x03ffc000 : "root"
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
mice: PS/2 mouse device common for all mice
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
TCP cubic registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 128K
hwclock: Could not access RTC: No such file or directory
mount proc tmp var FS.
FS Done.

Please press Enter to activate this console.
-sh: can't access tty; job control turned off
[root@(none) /]#
[root@(none) /]#
[root@(none) /]#
[root@(none) /]# ls
bin      dev      etc_bk  lib      mnt      root    sys      usr
boot    etc      home    linuxrc  proc    sbin    tmp      var
[root@(none) /]# ls dev/
console  null
[root@(none) /]# ls proc/
1              783            driver        kpageflags    slabinfo
2              788            execdomains    loadavg        stat
3              96            fb            locks          swaps
4              97            filesystems    meminfo        sys
5              98            fs            misc          sysrq-trigger
59            99            ide            modules        sysvipc
6              buddyinfo      interrupts    mounts        timer_list
64            bus            iomem          mtd            tty
70            cmdline        ioports        net            uptime
73            cpu            irq            pagetypeinfo  version
734            cpuinfo        kallsyms      partitions    vmstat
758            devices        kmsg          sched_debug    zoneinfo
765            diskstats      kpagecount    self
[root@(none) /]#

我的文件系统(cramfs)。只是将默认的文件系统更改一下rcS而制作成的。
#! /bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:
runlevel=S
prevlevel=N
umask 022
export PATH runlevel prevlevel

#
#      Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
#
trap ":" INT QUIT TSTP
/sbin/hwclock -s

#SCSI modules

#Input modules
#/sbin/insmod /lib/input.o
#/sbin/insmod /lib/keybdev.o
#/sbin/insmod /lib/mousedev.o
#/sbin/insmod /lib/evdev.o

#Charactor modules
#/bin/mknod /dev/pts/0 c 136 0
#/bin/ln -s /dev/v4l/video0 /dev/video0
#/bin/ln -s /dev/fb/0 /dev/fb0
#/bin/ln -s /dev/vc/0 /dev/tty1
#/bin/ln -s /dev/sound/dsp /dev/dsp
#/bin/ln -s /dev/sound/mixer /dev/mixer
#/bin/ln -s /dev/scsi/host0/bus0/target0/lun0/part1 /dev/sda1

echo "mount proc tmp var FS."
/bin/mount -t proc none /proc
/bin/mount -t tmpfs none /tmp
/bin/mount -t tmpfs none /var

/bin/mkdir -p /var/lib
/bin/mkdir -p /var/run
/bin/mkdir -p /var/log


#/etc/rc.d/init.d/netd start
#echo "                        " > /dev/vc/0
#echo "Starting networking..." > /dev/vc/0
#usleep 300000
#/etc/rc.d/init.d/httpd start
#echo "                        " > /dev/vc/0
#echo "Starting web server..." > /dev/vc/0
#usleep 300000
#/etc/rc.d/init.d/leds start
#echo "                        " > /dev/vc/0
#echo "Starting leds service..." > /dev/vc/0
#echo "                        "
#usleep 300000
#/sbin/ifconfig lo 127.0.0.1
#/sbin/ifconfig eth0 192.168.1.230 up
#
#/sbin/madplay /shanghaitan.mp3 &
#
#/bin/hostname -F /etc/sysconfig/HOSTNAME

echo "FS Done."

系统能跑起来,但是用终端不能下载文件。是哪方面的原因呢?是kernel or 根文件系统呢?
有谁遇到过这种问题的?谢谢先了。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2008-08-02 21:29
这里有两个问题你需要注意的:
1. 2.6.25的内核里不包含devfs, 所以/dev目录下只有你预先手动创建的console和null节点,这对于启动文件系统是足够了,但要通过终端(串口)下载文件,你至少需要创建串口设备的节点。可以手动创建,也可以用udev这样的工具完全取代devfs
2. cramfs格式的文件系统是只读的,你只能把文件下载到可写的目录下(/tmp ???)
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
误人子弟!
级别: 新手上路
UID: 799
精华: 0
发帖: 40
金钱: 355 两
威望: 130 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2008-06-01
最后登录: 2013-09-03
2楼  发表于: 2008-08-03 00:01
thanks.

1. 2.6.25的内核里不包含devfs, 所以/dev目录下只有你预先手动创建的console和null节点,这对于启动文件系统是足够了,但要通过终端(串口)下载文件,你至少需要创建串口设备的节点。可以手动创建,也可以用udev这样的工具完全取代devfs

对于第一点,确实不能在/dev 手动创建。有点不明白,在默认的文件系统上,我只是修改了rcS启动脚本(其实注释掉一些语句而已),为什么不能自动创建串口设备的节点。那么默认的文件系统又如何创建这些节点的呢?

2. cramfs格式的文件系统是只读的,你只能把文件下载到可写的目录下(/tmp ???)
对于这点,我表示不认同。 因为/tmp是mount 到 none 应该是在内存上的(术语不知道如何说,就好像proc sys)。 我在/tmp下创建文件是可以的。

[root@(none) /tmp]# ls
[root@(none) /tmp]# df
Filesystem          1k-blocks      Used Available Use% Mounted on
none                    30864        0    30864  0% /tmp
none                    30864        0    30864  0% /var
[root@(none) /tmp]# mkdir test
[root@(none) /tmp]# ls
test
[root@(none) /tmp]# cd test/
[root@(none) test]# ls
[root@(none) test]# touch asdf
[root@(none) test]# ls
asdf
[root@(none) test]# pwd
/tmp/test
[root@(none) test]#
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2008-08-03 08:37
1.默认的文件系统从来都没有自动创建设备节点,只不过搭配2.6.13的内核时,内核的devfs做了这些事情。而很不幸的是,2.6.25的内核里早就已经没有devfs了。你必须自己想办法做这些事情。

2. 我不知道你对什么表示不认同,我要说明的是你只能把文件下载到可写的目录下,/tmp如果是可写的,那就没问题。

另外,澄清一个基本常识,/tmp不是mount到none上的,tmp才是挂载点(mount point), /tmp之所以可写,是因为
mount -t tmpfs none /tmp
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
误人子弟!
级别: 新手上路
UID: 799
精华: 0
发帖: 40
金钱: 355 两
威望: 130 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2008-06-01
最后登录: 2013-09-03
4楼  发表于: 2008-08-03 10:16
好 谢谢。 我去试试看。