Đang chuẩn bị liên kết để tải về tài liệu:
Creating a device-file node

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Creating a device-file node presents A device-driver example, The Linux commands, Removing a device-file, LKM’s have full privileges, Developers disapprove, ‘Open Source’ philosophy, How to invoke ‘unlink’, Use ‘man’ for prototypes. | Creating a device-file node An introduction to some privileged Linux system-calls (needed for an upcoming programming exercise) A device-driver example • We want to build a simple device-driver, one that would let ordinary applications read and/or write to the CMOS memory (e.g. to adjust the date or time-of-day) • This will require that we have a so-called device ‘special’ file in the ‘/dev’ directory • Creating such a file normally requires the privileges of a System Administrator – but could be accomplished via a suitable LKM The Linux commands • If a System Administrator wanted to setup a device-file in the ‘/dev’ directory named ‘cmos’ that has read-and-write privileges, the following commands would be used: root# mknod /dev/cmos c 70 0 root# chmod a+rw /dev/cmos • Here the ‘c’ argument indicates that the file-node is for a ‘character-mode’ device • Values 70 and 0 are arbitrary id-numbers Removing a device-file • To delete a file from the ‘/dev’ directory, the SysAdmin uses the ‘unlink’ command: root# unlink /dev/cmos • Because of standard privilege-restrictions on the ‘/dev’ directory, these commands will fail if executed by unprivileged users • Students have not been given sufficient privileges to successfully execute these ‘mknod’, ‘chmod’ and ‘unlink’ commands LKM’s have full privileges • But CS students in this class DO possess privileges that allow them to install, and to remove, Linux kernel modules: user$ /sbin/insmod cmos.ko user$ /sbin/rmmod cmos.ko • While installed, modules execute inside the kernel itself, with no privilege barriers • Hence we should be able to perform the steps necessary to create a .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.