合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

        代做Operating Systems 、代寫C++程序語言
        代做Operating Systems 、代寫C++程序語言

        時間:2025-02-15  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



        Operating Systems - 

        New York University

        Tandon School of Engineering

        Department of Computer Science and Engineering

        Introduction to Operating Systems

        Spring 2025


        Assignment 3

        (10 points)


        Develop a simple Linux kernel module that runs on your virtual machine. The only functionality required of your

        module is to be able to load and unload, printing a debug message while doing so.

        When a Linux kernel module is loaded, it invokes an init function, and when it is removed (or unloaded), it

        invokes an exit function.

        A) (0 points) Read chapter 2 of the freely available O’Reilly book “Linux Device Drivers, 3

        rd

        Edition”

        (https://lwn.net/Kernel/LDD3/), in particular p.16, as well as your text book p.96 to get you started. Note that

        even though the LDD3 book is written for kernel version 2.6, most mechanisms are applicable with minor or

        no changes. The relevant example code is copied below as a starting point.

        #include

        #include

        MODULE_LICENSE("Dual BSD/GPL");

        static int hello_init(void)

        {

        printk(KERN_ALERT "Hello, world\n");

        return 0;

        }

        static void hello_exit(void)

        {

        printk(KERN_ALERT "Goodbye, cruel world\n");

        }

        module_init(hello_init);

        module_exit(hello_exit);

        The hello_init() function is invoked when you insert your module (using the insmod shell command),

        whereas the hello_exit() is called when you unload your module (using the rmmod shell command).

        B) (0 points) Read the description of the global kernel variable jiffies and the macro HZ in the O’Reilly book

        (search in the searchable pdf). Then read about the ktime_get_boottime() routine in

        https://www.kernel.org/doc/html/latest/core-api/timekeeping.html


        C) (0 points) You may need to install the kernel headers if not already installed. Type:


        sudo apt-get install linux-headers-$(uname -r)


        D) (10 points) Modify the c code given above (which becomes your lab3.c) such that:

        1) The init function prints the tick time in milliseconds (i.e. the timer interval, as we defined it in weeks 1/2)

        after the hello message.

        The init function shall also save the value of jiffies and the current time.

        Operating Systems - Prof. Omar Mansour

        2) The exit function prints a goodbye message and the time in milliseconds between the insertion and

        removal of the module i.e. between init and exit functions) using two different methods:

        a. Using the difference in the value of jiffies from inserting the module to removing the module.

        b. Using the time difference obtained by reading the timer (Hint: use ktime_get_boottime().

        You shall use the Makefile provided with the assignment (In some cases, you may need to slightly modify the

        Makefile provided to suit your setup). You should place it in the same directory as your .c file (lab3.c)

        Hints:

        E) Your module should use printk() to print messages. You will use this print facility to also debug your

        code if needed ( ). More information may be found on https://www.kernel.org/doc/html/latest/core-

        api/printk-basics.html

        F) Use dmesg shell command to view messages printed by printk(), e.g. type:

        dmesg

        You may clear the log using:

        dmesg -C

        What to submit to gradescope:

        Please submit the following files individually:

        1) Source file(s) with appropriate comments.

        The naming should be similar to “lab#_$.c” (# is replaced with the assignment number and $ with the

        question number within the assignment, e.g. lab4_b.c, for lab 4, question b OR lab5_1a for lab 5, question

        1a).

        2) A single pdf file (for images + report/answers to questions), named “lab#.pdf” (# is replaced by the

        assignment number), containing:

         Screen shot(s) of your terminal window showing the current directory, the command used to

        compile your program, the command used to run your program and the output of your program.

        3) Your Makefile, if any. This is applicable only to kernel modules.


        RULES:

         You shall use kernel version 4.x.x or above. You shall not use kernel version 3.x.x.

         You may consult with other students about GENERAL concepts or methods but copying code (or code

        fragments) or algorithms is NOT ALLOWED and is considered cheating (whether copied form other

        students, the internet or any other source).

         If you are having trouble, please ask your teaching assistant for help.

         You must submit your assignment prior to the deadline.

        請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp




         

        掃一掃在手機打開當前頁
      1. 上一篇:代做COP 3402、代寫Python/c++語言程序
      2. 下一篇:代寫COMP S311、代做Java編程語言
      3. 無相關信息
        合肥生活資訊

        合肥圖文信息
        出評 開團工具
        出評 開團工具
        挖掘機濾芯提升發動機性能
        挖掘機濾芯提升發動機性能
        戴納斯帝壁掛爐全國售后服務電話24小時官網400(全國服務熱線)
        戴納斯帝壁掛爐全國售后服務電話24小時官網
        菲斯曼壁掛爐全國統一400售后維修服務電話24小時服務熱線
        菲斯曼壁掛爐全國統一400售后維修服務電話2
        美的熱水器售后服務技術咨詢電話全國24小時客服熱線
        美的熱水器售后服務技術咨詢電話全國24小時
        海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
        海信羅馬假日洗衣機亮相AWE 復古美學與現代
        合肥機場巴士4號線
        合肥機場巴士4號線
        合肥機場巴士3號線
        合肥機場巴士3號線
      4. 短信驗證碼 酒店vi設計

        老子午夜精品无码| 青青热久久久久综合精品| 99er热精品视频| 2021国产精品自在拍在线播放| 亚洲欧洲国产精品香蕉网| 无码国内精品久久人妻麻豆按摩 | 久久se精品动漫一区二区三区| 国产午夜精品一区二区| 亚洲国产精品成人久久蜜臀| 日韩精品无码一区二区三区不卡| 日本精品一区二区在线播放| 亚洲熟女精品中文字幕| 国产精品久久久久久麻豆一区| 亚洲国产精品久久丫| 91大神精品网站在线观看| 欧洲成人午夜精品无码区久久| 久久国产成人精品| 久久精品国产成人| 亚洲Av无码精品色午夜| 国产精品特级毛片一区二区三区 | 久久青青草原国产精品免费| 亚洲精品无码久久久久去q | 欧美人妻少妇精品久久黑人 | 手机日韩精品视频在线看网站| 国产精品第一区揄拍无码| 国产精品露脸国语对白河北| 国产精品国产三级国产普通话a| 国产精品美女乱子伦高| 在线观看国产精品麻豆| 国产精品嫩草影院线路| 97精品伊人久久大香线蕉| 99久久婷婷国产综合精品| 精品久久久中文字幕一区| 国产视频精品视频| 国产精品亚洲综合| 日韩一级视频在线观看播放| 亚洲AV日韩AV天堂一区二区三区| 2015日韩永久免费视频播放| 日韩在线视频网址| 亚洲乱码日产精品a级毛片久久| 国产成人99久久亚洲综合精品|