免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3492 | 回复: 3
打印 上一主题 下一主题

程序进程意外结束跳出,大家帮我看看咋回事 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-03-08 17:14 |只看该作者 |倒序浏览
代码在附件中。

现象: timer函数初始化完毕后,过了1秒不到, app就会自动结束跳出, 伴随一条"Real-time signal 1”的信息。

对于signal的使用不是很熟,也不清楚问题出在哪里。

/home/app $ ./TmrTest
open SIGRT4_FILEENTRY successfully! //驱动打开
timer init over!   // 定时器初始化完毕
Real-time signal 1    // 这个消息应该是kernel发出的,大约在此程序启动后不到1秒发出。
/home/app $     //程序自动终止


我的环境: VirtualBox, Ubuntu10, Kernel 2.6.30, 超级终端 115200-8-n-1

这几天查了一下,Real-time siganl 1貌似是SIGHUP信号

我查了一下资料,按照此信号的介绍,"SIGHUP: 如果终端接口检测到一个连接断开,则将此信号发送给与该终端相关的控制进程(会话首进程). 见图9-11, 此信号被送给session结构中的s_leader字段所指向的进程。仅当终端的CLOCAL标志没有设置时,在上诉条件下才产生此信号。(如果所连接的终端是本地的,则设置该终端的CLOCAL标志。它告诉终端驱动程序忽略所有调制解调器的状态行。)"                 

我现在的想法是,试着屏蔽掉这个SIGHUP信号。按照上面的描述,需要将CLOCAL标志位置1。请问CLOCAL标志位应该在哪里设置?


Timer Test.rar (10.35 KB, 下载次数: 27)

论坛徽章:
0
2 [报告]
发表于 2011-03-09 16:03 |只看该作者
本帖最后由 fifodct 于 2011-03-09 16:32 编辑

如果要修改控制台串口ttyS0的参数c_cflag,比如波特率,比如这个CLOCAL flag, 是否应该在busybox的/init/init.c 里改? 这几天好郁闷,没有指路人的话,自己调真难有进展阿。。。

论坛徽章:
0
3 [报告]
发表于 2011-03-10 09:42 |只看该作者
这是启动信息~~

U-Boot 1.3.4 (Jan 28 2010 - 11:36:04)

DRAM:  64 MB
NAND:  128 MiB
*** Warning - bad CRC or NAND, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   macb0
macb0: Starting autonegotiation...
macb0: Autonegotiation complete
macb0: link up, 100Mbps full-duplex (lpa: 0x45e1)
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0xa0000, size 0x200000
2097152 bytes read: OK
## Booting kernel from Legacy Image at 22000000 ...
   Image Name:   Linux-2.6.30
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1528380 Bytes =  1.5 MB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.............................................................
...................................... done, booting the kernel.
Linux version 2.6.30 (calvin@ubuntu104) (gcc version 3.4.5) #1 Mon Feb 28 11:49:
17 CST 2011
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9G20-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 396 MHz, master 132 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS0,115200 root=/dev/mtdblock5 mtdparts=atmel_nan
d:128k(bootstrap)ro,256k(uboot)ro,128k(env1)ro,128k(env2)ro,2M(linux),-(root) rw
rootfstype=yaffs2
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttyS0] 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: 61700KB available (2796K code, 234K data, 128K init, 0K highmem)
Calibrating delay loop... 197.83 BogoMIPS (lpj=989184)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 296 bytes
NET: Registered protocol family 16
AT91: Power Management
AT91: Starting after user reset
bio: create slab <bio-0> at 0
SCSI subsystem initialized
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 204
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
yaffs Feb 28 2011 11:47:49 Installing.
msgmni has been set to 120
io scheduler noop registered
io scheduler anticipatory registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = is a ATMEL_SERIAL
atmel_usart.4: ttyS4 at MMIO 0xfffd0000 (irq = 23) is a ATMEL_SERIAL
atmel_usart.5: ttyS5 at MMIO 0xfffd4000 (irq = 24) is a ATMEL_SERIAL
atmel_usart.6: ttyS6 at MMIO 0xfffd8000 (irq = 25) is a ATMEL_SERIAL
brd: module loaded
loop: module loaded
ssc ssc.0: Atmel SSC device at 0xc4848000 (irq 14)
Driver 'sd' needs updating - please use bus_type methods
scsi0 : pata_at91
ata1: PATA max PIO4 mmio cmd 0x50c00000 ctl 0x50e00000 irq 88
dm9000 Ethernet Driver, V1.31
dm9000 dm9000.0: eth%d: Invalid ethernet MAC address. Please set using ifconfig
eth0 (dm9000): not using net_device_ops yet
eth0: dm9000e at c4826000,c482e004 IRQ 89 MAC: 00:00:00:00:00:00 (chip)
MACB_mii_bus: probed
eth1: Atmel MACB at 0xfffc4000 irq 21 (00:04:9f:ef:01:01)
eth1: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:00, irq=-1)
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bi
t)
AT91 NAND: 8-bit, Software ECC
Scanning device for bad blocks
6 cmdlinepart partitions found on MTD device atmel_nand
Creating 6 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "bootstrap"
0x000000020000-0x000000060000 : "uboot"
0x000000060000-0x000000080000 : "env1"
0x000000080000-0x0000000a0000 : "env2"
0x0000000a0000-0x0000002a0000 : "linux"
0x0000002a0000-0x000008000000 : "root"
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
mice: PS/2 mouse device common for all mice
rtc-at91sam9 at91_rtt.0: rtc core: registered at91_rtt as rtc0
IRQ 1/rtc0: IRQF_DISABLED is not guaranteed on shared IRQs
rtc-at91sam9 at91_rtt.0: rtc0: SET TIME!
i2c /dev entries driver
at24 0-0050: 256 byte 24c02 EEPROM (writable)
i2c-gpio i2c-gpio: using pins 55 (SDA) and 56 (SCL)
Registered led device: ds1
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
rtc-at91sam9 at91_rtt.0: hctosys: unable to read the hardware clock
yaffs: dev is 32505861 name is "mtdblock5"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.5, "mtdblock5"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs2 filesystem) on device 31:5.
Freeing init memory: 128K
running /etc/init.d/rcS
starting udevd...
cannot open /dev/null
dm9000 dm9000.0: WARNING: no IRQ resource flags set.
eth0: link down
SIGRT4 generator $Revision: calvin-1.0 - 2.6.12$ initializing
/opt/apache/bin/apachectl start: httpd (pid 456) already running

Please press Enter to activate this console. eth1: link up (100/Full)

running /etc/profile
~ $

论坛徽章:
0
4 [报告]
发表于 2011-03-10 10:24 |只看该作者
回复 2# fifodct


    两种方法修改你的tty参数,

   1. 直接修改/linux/linux/.config文件CONFIG_CMDLINE=就可以了,
   2.另外就是同过make menuconfig来修改,配置内核的menuconfig中的Machine Selection里面有Defaut Kernel command string: 不同的平台可能会不一样的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP