1、外文原文 New special files are created with the mknod system call, which can be invoked by the utility of the same name. The syntax for mknod is: mknod name type major minor. So to create the above lp0 entry, you would have to be root and type: # mknod /dev/lp0 c 6 0 You can create them anywhere, as lon
2、g as the hosting file systems support it. Most of the arguments are selfexplanatory, so we will just mention that type corresponds to the class of the device b for block devices and c for character devices. More information can be found in the man page for mknod. User and Kernel Space The first thin
3、g to come to grips with is the difference between programming device drivers and writing normal user space applications. Linux operates in two modes, usermode and supervisormode. We will call the latter kernelmode from know on, since this is the descriptive explanation of what is really going on. Th
4、is reflects a change in the way the processor actually handles instructions it supports these two execution modes internally. Intels x86 (x = 3) names its execution modes Ring 0, 1, 2, and 3, with Ring 0 being the most privileged mode and vice versa. In Linux, Ring 0 signifies kernelmode execution and Ring 3 usermode the other modes are unused. Other architectures have similar features, but name their execution modes differently. We wont bore you with the tedious hardware details, but