亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
123下一頁
最近訪問板塊 發(fā)新帖
查看: 7222 | 回復(fù): 25
打印 上一主題 下一主題

求助,加載內(nèi)核出現(xiàn)0oops錯(cuò)誤~~苦啊~~~~ [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2008-11-20 16:26 |只看該作者 |倒序?yàn)g覽
錯(cuò)誤如下
  1. Unable to handle kernel NULL pointer dereference at virtual address 00000000
  2. pgd = c0a40000
  3. *pgd = 00000000, *pmd = 00000000
  4. Internal error: Oops: 0
  5. CPU: 0
  6. pc : [<c6cb00a4>]    lr : [<c001f0e4>]    Not tainted
  7. sp : c0a6de04  ip : c0a6de1c  fp : c0a6de44
  8. r10: c0223020  r9 : c0a6de48  r8 : c021ae7c
  9. r7 : c021afdc  r6 : 20000000  r5 : c6cb085c  r4 : c3561560
  10. r3 : c6cb0a28  r2 : 00000000  r1 : c6cb09fc  r0 : c6cb0678
  11. Flags: nzcv  IRQs off  FIQs on  Mode SVC_32  Segment user
  12. Control: C000317F  Table: 30A40000  DAC: 00000015
  13. Process insmod (pid: 67, stackpage=c0a6d000)
  14. Stack: (0xc0a6ddf4 to 0xc0a6e000)
  15. dde0:                                              c001f0e4 c6cb00a4 00000093
  16. de00: ffffffff c3561560 0000000b c0a6de44 c0a6de1c c001f0e4 c6cb0070 ea000000
  17. de20: c0a6de90 00000001 c001f258 60000013 ffffffff c6cb0794 c0a6deac c0a6de48
  18. de40: c001e4e0 c001f034 0000000b 00000001 080097c4 ea000000 c3561560 0000000b
  19. de60: 00000000 40000013 20000000 00000000 c6cb0794 c0a6deac c0a6de90 c0a6de90
  20. de80: c001f254 c001f258 60000013 ffffffff c3561560 00000000 0000000b c6cb0060
  21. dea0: c0a6ded8 c0a6deb0 c001f30c c001f198 c6cb09f0 00000000 c6cb0794 00000060
  22. dec0: ffffffea 0202dc58 c0a6c000 c0a6df04 c0a6dedc c6cb04a8 c001f274 00000000
  23. dee0: c004511c c0044638 c0a6df04 c6cb0000 00000000 c3497000 c0a6dfa4 c0a6df08
  24. df00: c002c450 c6cb038c c3497000 c0a6df1c c3499000 0000000b c35613e0 00000060
  25. df20: c6ca0000 c6cb0060 00000b30 00000000 00000000 00000000 00000000 00000000
  26. df40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  27. df60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 bfffd0f0
  28. df80: 0202a840 0202dc58 00000080 c001e9a4 c0a6c000 00000000 00000000 c0a6dfa8
  29. dfa0: c001e820 c002bd68 bfffd0f0 c0027dc8 0201f3b0 0202dc58 ffffffff fbad2084
  30. dfc0: bfffd0f0 0202a840 0202dc58 c6cb0000 00000b30 00000000 00000000 bfffd0c0
  31. dfe0: 4009eb40 bfffd0b0 02010064 4009eb4c 60000010 0201f3b0 00000000 00000000
  32. Backtrace:
  33. Function entered at [<c001f024>] from [<c001e4e0>]
  34. Function entered at [<c001f188>] from [<c001f30c>]
  35. r7 = C6CB0060  r6 = 0000000B  r5 = 00000000  r4 = C3561560
  36. Function entered at [<c001f264>] from [<c6cb04a8>]
  37. Function entered at [<c6cb037c>] from [<c002c450>]
  38. r6 = C3497000  r5 = 00000000  r4 = C6CB0000
  39. Function entered at [<c002bd58>] from [<c001e820>]
  40. Code: e59f305c e59f505c e5932000 e59f3058 (e5924000)
  41. Kernel panic: Aiee, killing interrupt handler!
  42. In interrupt handler - not syncing
復(fù)制代碼

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2008-11-20 16:30 |只看該作者
源代碼如下
  1. /* driver/char/adc0809.c
  2. *  this is a adc0809 char device driver.
  3. * Any problem pls contact [email]support@hhcn.com[/email]
  4. */
  5. #include <module.h>
  6. #include <linux/fs.h>
  7. #include <linux/iobuf.h>
  8. #include <linux/major.h>
  9. #include <linux/blkdev.h>
  10. #include <linux/capability.h>
  11. #include <linux/smp_lock.h>
  12. #include <asm/uaccess.h>
  13. #include <asm/hardware.h>
  14. #include <asm/arch/cpu_s3c2410.h>
  15. #include <asm/io.h>
  16. #include <linux/vmalloc.h>
  17. #include <linux/kernel.h>

  18. #include <linux/signal.h>
  19. #include <linux/sched.h>
  20. #include <linux/timer.h>
  21. #include <linux/interrupt.h>
  22. #include <asm/irq.h>
  23. #include <asm/arch/hardware.h>
  24. #include <asm/arch/irqs.h>

  25. #include <linux/init.h>
  26. #include <linux/timer.h>


  27. //#include "adc0809_ioctl.h"

  28. MODULE_LICENSE("GPL");

  29. #define ADC0809_MAJOR 231
  30. /*define the adc0809 major node is 231*/


  31. #define adc0809_sle (*(volatile unsigned long *)ADC_GPACON)
  32. #define adc0809_sle_data (*(volatile unsigned long *)ADC_GPADATA)


  33. unsigned long ADC_GPACON, ADC_GPADATA;
  34. static unsigned long ADC_1; //ADC_1, ADC_2, ADC_3, ADC_4, ADC_5, ADC_6, ADC_7;
  35. unsigned long ADC_DATA;
  36. static unsigned long r_TCFG0,r_TCFG1,r_TCNTB1,r_TCMPB1,r_TCON,r_GPCCON;

  37. unsigned long adc_write_addr;
  38. unsigned long adc_read_addr;
  39. //int * adc_read_addr,* adc_write_addr;


  40. devfs_handle_t devfs_adc;

  41. void adc0809_interrupt(int,void *,struct pt_regs *);

  42. int  adc0809_open(struct inode *, struct file *);
  43. int  adc0809_release(struct inode *, struct file *);
  44. //int  adc0809_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
  45. ssize_t adc0809_read(struct file *, char * , size_t , loff_t *);
  46. ssize_t adc0809_write(struct file *, const char *, size_t , loff_t *);

  47. static struct file_operations adc0809_fops = {
  48.        // ioctl:          adc0809_ioctl,   //根據(jù)參數(shù)確定讀取的引腳;
  49.         open:           adc0809_open,                //選中片選NGCS2(初始化ADC0809的管腳配置),初始化adc_read_addr;
  50.         read:           adc0809_read,
  51.         write:          adc0809_write,
  52.         release:        adc0809_release,
  53. };

  54. //struct timer_list timer_ForData;  // 定時(shí)器

  55. char data; //變量類型不同也會(huì)出錯(cuò),之前使用unsigned long所得是一連串八位數(shù)字要么是-1
  56. //unsigned long addr;

  57. int adc0809_sum=0;
  58. /*------------中斷處理函數(shù)------------------*/
  59. void adc0809_interrupt(int irq,void *d,struct pt_regs *regs)
  60. {
  61.         char adc0809_v=0,adc0809_u=0;
  62. /*clear interrupt register for INT_TIMER0*/
  63.         SRCPND &= (~0x00000800);    //bit11
  64.         INTPND = INTPND;
  65.         (*(volatile unsigned char *) ADC_1) = (char) 1;


  66.           data = (*(volatile unsigned long *) adc_read_addr);
  67.         if(data<200){adc0809_v=0;}
  68.                 else adc0809_v=1;
  69.         if(adc0809_v<adc0809_u){adc0809_sum=adc0809_sum+1;}
  70.                 else adc0809_sum=adc0809_sum;
  71.         adc0809_u=adc0809_v;
  72. printk("data:%d\n",data);
  73. printk("adc0809_u:%d\n",adc0809_u);
  74. printk("adc0809_v:%d\n",adc0809_v);
  75. printk("adc0809_sum:%d\n",adc0809_sum);
  76. }

  77. /*------- Open/close code for raw IO.-----*/
  78. int adc0809_open(struct inode *inode, struct file *filp)
  79. {
  80.           adc_read_addr = ADC_DATA;
  81.        
  82.         printk("open ok\n");
  83.           return 0;
  84. }
  85. /*------------read()----------------*/
  86. ssize_t adc0809_read(struct file *filp, char * buf,
  87.                  size_t size, loff_t *offp)
  88. {       
  89.         char key;
  90.        
  91.        
  92.         key =adc0809_sum;
  93.         printk("key_driver:%d\n",key);
  94.         copy_to_user(buf,&key,1);//put_user(key,buf);
  95.         //printk("adc0809_read:adc_read_addr=0x%x\n",adc_read_addr);
  96.         return 1;
  97. }
  98. /*------------------write()-------------------------------*/
  99. ssize_t adc0809_write(struct file *filp, const char *buf,
  100.                   size_t size, loff_t *offp)
  101. {
  102.    char key;
  103.    if (get_user(key, buf))
  104.                return -EFAULT;
  105.    printk("adc0809_write:adc_write_addr=0x%x; key = %c\n",adc_write_addr,key);

  106.         (*(volatile unsigned char *) adc_write_addr) = key;
  107.    //put_user(key,buf);
  108.    return 1;
  109. }

  110. /*----------------release()---------------------*/
  111. int adc0809_release(struct inode *inode, struct file *filp)
  112. {
  113.         printk("release ok\n");
  114.         return 0;
  115. }

  116. /*-------------------iormap()--地址影射函數(shù)---*/
  117. static int address_map(void)
  118. {
  119.            r_TCFG0 = ioremap(0x51000000,4); //定時(shí)器配置寄存器0
  120.             r_TCFG1 = ioremap(0x51000004,4); //定時(shí)器配置寄存器1
  121.             r_TCNTB1 = ioremap(0x51000018,4);
  122.            r_TCMPB1 = ioremap(0x5100001C,4);
  123.             r_TCON = ioremap(0x51000008,4);
  124.             r_GPCCON = ioremap(0x56000020,4);

  125.         ADC_GPACON = (unsigned int)ioremap(0x56000000,4);  //物理寄存器的影射,個(gè)人認(rèn)為這里都是指CPLD的物理寄存器
  126.           ADC_GPADATA = ioremap(0x56000004,4);
  127.           ADC_1 = ioremap(0x10002010,4);

  128.           /*---
  129.         ADC_0 = ioremap(0x10000010,4);
  130.        
  131.           ADC_2 = ioremap(0x10004010,4);
  132.           ADC_3 = ioremap(0x10006010,4);
  133.           ADC_4 = ioremap(0x10008010,4);
  134.           ADC_5 = ioremap(0x1000a010,4);
  135.           ADC_6 = ioremap(0x1000c010,4);
  136.           ADC_7 = ioremap(0x1000e010,4);  ----*/
  137.           ADC_DATA = ioremap(0x10000020,4);
  138.             return 0;

  139. }
  140. /*--------------------------------------------------------------------------*/
  141. int __init adc0809_init(void)
  142. {
  143.   static int result;
  144.   //unsigned long gpfup;
  145.   //volatile unsigned int bankcon2;       
  146.   address_map();
  147.   printk("*********************adc0809_init**************\n");


  148. // bankcon2=(volatile unsigned int)ioremap(0x4800000c,4);
  149. // *(volatile unsigned int*)bankcon2 |= 3<<13;  //
  150.   /* select NGCS2 */
  151.   adc0809_sle |= 0x2000;
  152.   adc0809_sle_data &= (~0x2000);

  153. printk("***********00000000000000000!!***********\n");
  154.        

  155. /*-----------初始化S3C2410的時(shí)鐘timer0--------------------------*/
  156.         (*(volatile unsigned int *)r_TCFG0) &= 0x11111100;//prescaler=0
  157.         (*(volatile unsigned int *)r_TCFG1) &= (~0x000000F0);//MUX1=1/2
  158. //        (*(volatile unsigned int *)r_TCFG1) &= (~0x000000D0);//MUX1=1/8  時(shí)間T=r_TCNTB1/625000(s)
  159.         (*(volatile unsigned int *)r_TCNTB1) = 25000;         //時(shí)間為10ms
  160.             (*(volatile unsigned int *)r_TCMPB1) = 0x00000000;
  161.             (*(volatile unsigned int *)r_TCON) |= 0x00000E00;
  162.            (*(volatile unsigned int *)r_TCON) &= (~0x00000200);
  163.            (*(volatile unsigned int *)r_TCON) |= 0x00000100;

  164.         disable_irq(IRQ_TIMER1);
  165.             enable_irq(IRQ_TIMER1);
  166. printk("***********11111111111111***********\n");
  167.         result=request_irq(IRQ_TIMER1,&adc0809_interrupt,SA_INTERRUPT,"adc0809",NULL);
  168. printk("***********222222222222222***********\n");
  169.         if (!result)
  170.         {
  171.                 printk("Get assigned irq %d,result=%d\n",IRQ_TIMER1,result);
  172. //                return result;
  173.         }
  174. /*--*/
  175. printk("***********Init ok!!***********\n");
  176.        

  177.         
  178.   devfs_adc =
  179.         devfs_register(NULL,"adc0809",DEVFS_FL_DEFAULT,
  180.                        ADC0809_MAJOR, 0,
  181.              S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
  182.                        &adc0809_fops,NULL);
  183.         return 0;

  184. //printk("*********************adc0809_init**************\n");
  185. }
  186. //int __init adc0809_exit(void)
  187. static void __exit adc0809_exit(void)
  188. {
  189.         (*(volatile unsigned int *)r_TCON) &= (~0x00000100);
  190.              disable_irq(IRQ_TIMER1);
  191.         free_irq(IRQ_TIMER1,NULL);
  192.              printk("exit ok\n");
  193. //free_irq(IRQ_EINT2, adc0809_interrupt);
  194.           devfs_unregister(devfs_adc);
  195. }

  196. module_init(adc0809_init);
  197. module_exit(adc0809_exit);

復(fù)制代碼

通過打印信息,發(fā)現(xiàn)加載時(shí)
是在初始化程序int __init adc0809_init(void)
中的result=request_irq(IRQ_TIMER1,&adc0809_interrupt,SA_INTERRUPT,"adc0809",NULL);
這一局過不去
實(shí)在找不到問題所在 郁悶死了

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2008-11-20 16:31 |只看該作者
不懂
幫頂
學(xué)習(xí)
有用

論壇徽章:
3
金牛座
日期:2014-06-14 22:04:062015年辭舊歲徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:49:45
4 [報(bào)告]
發(fā)表于 2008-11-20 16:54 |只看該作者

回復(fù) #3 Steiny 的帖子

我建議你用你第一天貼出來那個(gè)程序。
你這個(gè)程序錯(cuò)誤太多了。

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2008-11-20 16:58 |只看該作者
第一天貼的程序 沒有加時(shí)鐘中斷啊  deamice救救啊

[ 本帖最后由 ady2002 于 2008-11-20 17:00 編輯 ]

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2008-11-20 17:08 |只看該作者
原帖由 dreamice 于 2008-11-20 16:54 發(fā)表
我建議你用你第一天貼出來那個(gè)程序。
你這個(gè)程序錯(cuò)誤太多了。

希望 deamice能幫我指出錯(cuò)誤之處哦,我也可以得到提升
第一天的程序雖然可能,我這個(gè)程序其實(shí)也就是在那個(gè)程序上加了個(gè)時(shí)鐘中斷,
痛苦啊~~~~~~

論壇徽章:
3
金牛座
日期:2014-06-14 22:04:062015年辭舊歲徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:49:45
7 [報(bào)告]
發(fā)表于 2008-11-20 17:12 |只看該作者
原帖由 ady2002 于 2008-11-20 17:08 發(fā)表

希望 deamice能幫我指出錯(cuò)誤之處哦,我也可以得到提升
第一天的程序雖然可能,我這個(gè)程序其實(shí)也就是在那個(gè)程序上加了個(gè)時(shí)鐘中斷,
痛苦啊~~~~~~


我給你提的問題都很基本,但你還是沒明白如何寫一個(gè)中斷處理程序。所以,你得時(shí)鐘中斷在這里就錯(cuò)得很離奇。

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2008-11-20 17:29 |只看該作者
原帖由 dreamice 于 2008-11-20 17:12 發(fā)表


我給你提的問題都很基本,但你還是沒明白如何寫一個(gè)中斷處理程序。所以,你得時(shí)鐘中斷在這里就錯(cuò)得很離奇。

中斷處理程序 不是 就是 中斷函數(shù)  申請中斷  注冊 以及注銷中斷處理程序嗎?
ldd2上看的

論壇徽章:
3
金牛座
日期:2014-06-14 22:04:062015年辭舊歲徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:49:45
9 [報(bào)告]
發(fā)表于 2008-11-20 17:50 |只看該作者

回復(fù) #8 ady2002 的帖子

就按你說的這些基本要素,你好好檢查一下你的程序是不是符合一個(gè)驅(qū)動(dòng)程序的基本要求。

論壇徽章:
0
10 [報(bào)告]
發(fā)表于 2008-11-20 17:54 |只看該作者
這也不是一眼就看出來的啊。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP