You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Data transfer between the various buffers is a `Producer-Consumer<https://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem>`__ problem. Example:
- The process is the producer and the device is the consumer if it is written from the process to the device; the process will block until there is at least one free space in the consumer's buffer
- The process is the consumer and the device is the producer if it is read from a process from the device; the process will block until there is at least one element in the producer's buffer.
- the driver will be implemented as a kernel module named :command:`uart16550.ko`
50
-
- the driver will be accessed as a character device driver, with different functions depending on the parameters transmitted to the load module:
40
+
- 该驱动程序以名为 :command:`uart16550.ko` 的内核模块形式实现。
41
+
- 该驱动程序是字符设备驱动,会根据传递给加载模块的参数,提供不同的功能操作。
51
42
52
-
- the `major` parameter will specify the major with which the device must be registered
53
-
- the `option` parameter will specify how it works:
43
+
- `major` 参数指定设备必须注册的主设备号。
44
+
- `option` 参数指定驱动程序的工作方式:
54
45
55
-
- OPTION_BOTH: will also register COM1 and COM2, with the major given by the `major` parameter and the minors 0 (for COM1) and 1 (for COM2);
56
-
- OPTION_COM1: will only register COM1, with the major `major` and minor 0;
57
-
- OPTION_COM2: will only register COM2, with the major `major` and minor 1;
58
-
- to learn how to pass parameters in Linux, see `tldp <https://tldp.org/LDP/lkmpg/2.6/html/x323.html>`__
59
-
- the default values are `major=42` and `option=OPTION_BOTH`.
60
-
- the interrupt number associated with COM1 is 4 (`IRQ_COM1`) and the interrupt number associated with COM2 is 3 (`IRQ_COM2`)
61
-
- `the header <https://gitlab.cs.pub.ro/so2/2-uart/-/blob/master/src/uart16550.h>`__ with the definitions needed for special operations;
62
-
- a starting point in implementing read / write routines is the `example<https://ocw.cs.pub.ro/courses/so2/laboratoare/lab04?&#sincronizare_-_cozi_de_asteptare>`__ of uppercase / lowercase character device driver; the only difference is that you have to use two buffers, one for read and one for write;
63
-
- you can use `kfifo <https://lwn.net/Articles/347619/>`__ for buffers;
64
-
- you do not have to use deferred functions to read / write data from / to ports (you can do everything from interrupt context);
65
-
- you will need to synchronize the read / write routines with the interrupt handling routine for the routines to be blocking; it is recommended to use `synchronization with waiting queues <https://ocw.cs.pub.ro/courses/so2/laboratoare/lab04?&#sincronizare_-_cozi_de_asteptare>`__
66
-
- In order for the assigment to work, the `default serial driver` must be disabled:
- `cat /proc/ioports | grep serial` will detect the presence of the default driver on the regions where COM1 and COM2 are defined
69
-
- in order to deactivate it, the kernel must be recompiled, either by setting the serial driver as the module, or by deactivating it completely (this modification is already made on the virtual machine)
It is mandatory to start the implementation of the assignment from the code skeleton found in the `src <https://gitlab.cs.pub.ro/so2/2-uart/-/tree/master/src>`__ directory.
84
-
There is only one header in the skeleton called `uart16550.h <https://gitlab.cs.pub.ro/so2/2-uart/-/blob/master/src/uart16550.h>`__.
85
-
You will provide the rest of the implementation. You can add as many `*.c`` sources and additional `*.h`` headers.
86
-
You should also provide a Kbuild file that will compile the kernel module called `uart16550.ko`.
87
-
Follow the instructions in the `README.md file <https://gitlab.cs.pub.ro/so2/2-uart/-/blob/master/README.md>`__ of the `assignment's repo <https://gitlab.cs.pub.ro/so2/2-uart>`__.
In exceptional cases (the assigment passes the tests by not complying with the requirements)
126
-
and if the assigment does not pass all the tests, the grade will may decrease more than mentioned above.
108
+
在特殊情况下(作业通过了测试但不符合要求),以及如果作业未全部通过测试,成绩可能会降低得更多。
127
109
128
-
Submitting the assigment
110
+
提交作业
129
111
------------------------
130
112
131
-
The assignment will be graded automatically using the `vmchecker-next <https://github.com/systems-cs-pub-ro/vmchecker-next/wiki/Student-Handbook>`__ infrastructure.
132
-
The submission will be made on moodle on the `course's page <https://curs.upb.ro/2022/course/view.php?id=5121>`__ to the related assignment.
133
-
You will find the submission details in the `README.md file <https://gitlab.cs.pub.ro/so2/2-uart/-/blob/master/README.md>`__ of the `repo <https://gitlab.cs.pub.ro/so2/2-uart>`__.
0 commit comments