freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

關(guān)于linux操作系統(tǒng)設(shè)計(jì)研究畢業(yè)論文-在線瀏覽

2024-08-02 03:50本頁面
  

【正文】 Linux內(nèi)核對(duì)file_operations的ioctl()函數(shù)的cmd參數(shù)有特殊的定義:如圖61。 ⑹ Ioctl函數(shù)模板static long rtc_dev_ioctl(struct file *file,unsigned int cmd, unsigned long arg){... switch (cmd) { case RTC_EPOCH_SET:...Break。 case RTC_IRQP_SET: ... break。... }圖62 字符設(shè)備驅(qū)動(dòng) 第7章 RTC驅(qū)動(dòng)實(shí)現(xiàn) 設(shè)計(jì)思路Linux設(shè)備驅(qū)動(dòng)屬于內(nèi)核的一部分,Linux內(nèi)核的驅(qū)動(dòng)模塊可以用兩種不同的方式加載和編譯: ⑴ 通過內(nèi)核裁剪,隨同Linux的啟動(dòng)直接加載編譯進(jìn)Linux內(nèi)核; ⑵ 把驅(qū)動(dòng)程序編譯成一個(gè)可加載和刪除的動(dòng)態(tài)模塊,可以在需要時(shí)隨時(shí)使用insmod命令加載,rmmod命令刪除。這次的RTC驅(qū)動(dòng)就采用動(dòng)態(tài)模塊加載的方式,將程序主體分成3個(gè)部分。rtc_timesec。min。hour。mday。mon。year。wday。yday。isdst。這個(gè)結(jié)構(gòu)體代表了硬件時(shí)間與日期,從RTC芯片讀取的時(shí)間和日期就分開保存在這個(gè)結(jié)構(gòu)體中 模塊初始化函數(shù): init_rtcintinit_rtc(void){ rtc_classclass_create(THIS_MODULE,int err。rtc_devt, 0, RTC_DEV_MAX, rtc)。rtc_sysfs_init(rtc_class)。if (err 0) printk(KERN_ERR %s: failed to allocate char dev region\n, __FILE__)。return }類本身就是一個(gè)高度面向?qū)ο蟮漠a(chǎn)物,而用戶空間就可以在不知道如何實(shí)現(xiàn)的情況下直接得到結(jié)果,驅(qū)動(dòng)程序也不用直接處理,只要調(diào)用就行了。 填充了file_operations結(jié)構(gòu)rtc_foperations,以及這些操作函數(shù)的具體實(shí)現(xiàn)。staticstruct rtc_foperations{.owner ===== = release,.fasyncfasync,}。 函數(shù)聲明 中rtc_ioctl相應(yīng)的命令,其中RTC_RD_TIME與RTC_SET_TIME兩個(gè)命令需要特別注意,這是RTC最基本的功能函數(shù)——獲取時(shí)間和設(shè)置時(shí)間。圖71 編寫用戶層測(cè)試程序,并編譯成可執(zhí)行程序qq。創(chuàng)建設(shè)備節(jié)點(diǎn): mknod /dev/rtc c 250 0修改執(zhí)行程序權(quán)限: chmod 777 qq執(zhí)行測(cè)試程序。在本文中嵌入式系統(tǒng)選擇的是Linux系統(tǒng),它具有占有內(nèi)存小和運(yùn)行速率高的優(yōu)點(diǎn)。本文將字符設(shè)備分為了設(shè)備注冊(cè)、函數(shù)功能實(shí)現(xiàn)以及調(diào)用接口,并對(duì)程序進(jìn)行了應(yīng)用層的實(shí)例驗(yàn)證。在以后對(duì)驅(qū)動(dòng)的學(xué)習(xí)中,希望能夠不斷完善RTC芯片的功能實(shí)現(xiàn),并在在嵌入式Linux操作系統(tǒng)的建立中,以內(nèi)核剪裁的方式將驅(qū)動(dòng)程序移植到Linux內(nèi)核中去,努力做出更為精簡(jiǎn)穩(wěn)定的內(nèi)核系統(tǒng)。在整個(gè)畢業(yè)設(shè)計(jì)指導(dǎo)活動(dòng)中,老師的豐富經(jīng)驗(yàn)和對(duì)整個(gè)行業(yè)脈絡(luò)的把握,都是年輕的我難以望其項(xiàng)背的,并在整個(gè)課題的完成過程中起到了至關(guān)重要的作用。
同時(shí)也要感謝培訓(xùn)班的所有同學(xué),在臨近畢業(yè)的培訓(xùn)過程中,對(duì)我的關(guān)心和幫助。感謝我的親人,在這四年里是他們給我無數(shù)的鼓勵(lì)、支持和幫助,正因?yàn)橛兴麄兾也拍芨吲d順利的完成大學(xué)學(xué)業(yè),并學(xué)到了很多專業(yè),以及很多人生道路上的寶貴財(cái)富。
參 考 文 獻(xiàn)[1] [D]西安:西北工業(yè)大學(xué)機(jī)械電子工程學(xué)院,2007.[2] 戴明華,李長(zhǎng)云,曾志浩,崔海燕. 嵌入式Linux驅(qū)動(dòng)程序框架研究綜述[J]. 長(zhǎng)沙大學(xué)學(xué)報(bào),2012,02:5253.[3] [D]北京:北京郵電大學(xué)計(jì)算機(jī)科學(xué)與技術(shù)學(xué)院,2011.[4] [D].成都:中國(guó)西南電子技術(shù)研究所,2012.[5] [D].西安:西安電子科技大學(xué),2011.[6] 董文軍. Linux驅(qū)動(dòng)程序兼容性的相關(guān)問題[J].單片機(jī)與嵌入式系統(tǒng)應(yīng)用,2010,03:1618.[7] [D],北京:北京郵電大學(xué),2009.[8] 周立功,陳明計(jì),陳渝.ARM嵌入式Linux系統(tǒng)構(gòu)建與驅(qū)動(dòng)開發(fā)范例[M].北京:北京航空航天大學(xué)出版社,2006.[9] 王淑貞.UBoot在S3C2410上的移植[J].微計(jì)算機(jī)應(yīng)用,2008,29(4):9597.[10] LTIB user manual Linux Target Image Builder,Freescale,2006.[11] [D].成都:電子科技大學(xué),2011.[12] MPC8536 datasheet MPC8536E PowerQUICC III tm Integrated Processor Product Brief ,2009.附錄A RTC驅(qū)動(dòng)程序include linux/include linux/include linux/include linux/include linux/include linux/include static DEFINE_IDR(rtc_idr)。struct class *rtc_class。 mutex_lock(amp。 idr_remove(amp。 mutex_unlock(amp。 kfree(rtc)。amp。static int rtc_suspend(struct device *dev, pm_message_t mesg){ struct rtc_device *rtc = to_rtc_device(dev)。 struct timespec delta, delta_delta。rtcdev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) return 0。 delta_delta = timespec_sub(delta, old_delta)。 } else { old_system = timespec_sub(old_system, delta_delta)。}static int rtc_resume(struct device *dev){ struct rtc_device *rtc = to_rtc_device(dev)。 struct timespec new_system, new_rtc。 if (strcmp(dev_name(amp。 getnstimeofday(amp。 rtc_read_time(rtc, amp。 if (rtc_valid_tm(amp。rtcdev))。 } rtc_tm_to_time(amp。)。 if ( ) { pr_debug(%s: time travel!\n, dev_name(amp。 return 0。 sleep_time = timespec_sub(sleep_time, timespec_sub(new_system, old_system))。sleep_time)。}elsedefine rtc_suspend NULLdefine rtc_resume NULLendifstruct rtc_device *rtc_device_register(const char *name, struct device *dev,const struct rtc_class_ops *ops, struct module *owner){ struct rtc_device *rtc。 int id, err。rtc_idr, GFP_KERNEL) == 0) { err = ENOMEM。 } mutex_lock(amp。 err = idr_get_new(amp。id)。idr_lock)。 id = id amp。 rtc = kzalloc(sizeof(struct rtc_device), GFP_KERNEL)。 goto exit_idr。 rtcops = ops。 rtcirq_freq = 1。 rtc = dev。 rtc = rtc_device_release。rtcops_lock)。rtcirq_lock)。rtcirq_task_lock)。rtcirq_queue)。rtctimerqueue)。rtcirqwork, rtc_timer_do_work)。rtcaie_timer, rtc_aie_update_irq, (void *)rtc)。rtcuie_rtctimer, rtc_uie_update_irq, (void *)rtc)。rtcpie_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL)。 rtcpie_enabled = 0。alrm)。amp。)) rtc_initialize_alarm(rtc, amp。 strlcpy(rtcname, name, RTC_DEVICE_NAME_SIZE)。rtcdev, rtc%d, id)。 err = device_register(amp。 if (err) { put_device(amp。 goto exit_kfree。 rtc_sysfs_add_device(rtc)。 dev_info(dev, rtc core: registered %s as %s\n, rtcname, dev_name(amp。 return rtc。exit_idr: mutex_lock(amp。 idr_remove(amp。 mutex_unlock(amp。exit: dev_err(dev, rtc core: unable to register %s, err = %d\n, name, err)。}EXPORT_SYMBOL_GPL(rtc_device_register)。rtcdev) != NULL) { mutex_lock(amp。 rtc_sysfs_del_device(rtc)。 rtc_proc_del_device(rtc)。rtcdev)。 mutex_unlock(amp。 put_device(amp。 }}EXPORT_SYMBOL_GPL(rtc_device_unregister)。 if (IS_ERR(rtc_class)) { printk(KERN_ERR %s: couldn39。 return PTR_ERR(rtc_class)。 rtc_classresume = rtc_resume。 rtc_sysfs_init(rtc_class)。}static void __exit rtc_exit(void){ rtc_dev_exit()。 idr_destroy(amp。}subsys_initcall(rtc_init)。MODULE_AUTHOR(Alessandro Zummo )。MODULE_LICENSE(GPL)。define RTC_DEV_MAX 16 static int rtc_dev_open(struct inode *inode, struct file *file){ int err。 const struct rtc_class_ops *ops = rtcops。rtcflags)) return EBUSY。 err = opsopen ? opsopen(rtc) : 0。rtcirq_lock)。ifdef CONFIG_RTC_INTF_DEV_UIE_EMULstatic void rtc_uie_task(struct work_struct *work){ struct rtc_device *rtc = container_of(work, struct rtc_device, uie_task)。 spin_unlock_irq(amp。 return 0。rtcflags)。} int num = 0。 err = rtc_read_time(rtc, amp。 spin_lock_irq(amp。 if (rtcstop_uie_polling || err) { rtcuie_task_active = 0。 rtcoldsecs = 。 rtcuie_timer_active = 1。 add_timer(amp。 } else if (schedule_work(amp。 } spin_unlock_irq(amp。 if (num) rtc_handle_legacy_irq(rtc, num, RTC_UF)。 unsigned long flags。rtcirq_lock, flags)。 rtcuie_task_active = 1。rtcuie_task) == 0)) rtcuie_task_active = 0。rtcirq_lock, flags)。rtcirq_lock)。 if (rtc
點(diǎn)擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1