mknod command

 

Creates a special file.

 

 

mknod Name { b | c } Major Minor

 

mknod Name { p }

 

The mknod command makes a directory entry and corresponding i-node for a special file. The first parameter is the name of the Name entry device. Select a name that is descriptive of the device. The mknod command has two forms that have different flags.

The first form of the mknod command can only be executed by root or a member of the system group. In the first form, the b or c flag is used. The b flag indicates the special file is a block-oriented device (disk, diskette, or tape). The c flag indicates the special file is a character-oriented device (other devices).

The last two parameters of the first form are numbers specifying the Major device, which helps the operating system find the device driver code, and the Minor device, that is the unit drive or line number, which may be either decimal or octal. The major and minor numbers for a device are assigned by the device's configure method and are kept in the CuDvDr class in ODM. It is important that major and minor numbers be defined in this object class to insure consistency of device definitions through the system.

In the second form of the mknod command, the p flag is used to create FIFOs (named pipelines).

 


b Indicates the special file is a block-oriented device (disk, diskette, or tape).
c Indicates the special file is a character-oriented device (other devices).
p Creates FIFOs (named pipelines).

 

To create the special file for a new diskette drive, enter:
mknod /dev/fd2 b 1 2

This creates the /dev/fd2 special file that is a special block file with the major device number 1 and the minor device number 2.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值