这个用于给出内核启动的命令行,它和用于进程的cmdline项非常像
yubo@debian:/proc$ cat cmdline BOOT_IMAGE=/vmlinuz-3.2.0-4-686-pae root=UUID=84caed03-f243-4a09-afa5-15be502cbfb9 ro quiet yubo@debian:/proc$
这个文件提供了有关系统cpu的多种信息,格式为:文件由多行构成,每行包括一个域名称,一个冒号和一个值
# 在主目录下写成一个名为 .my.cnf的文件,将下面的内容填入其中
[mysql]
user=user
password=pass
[mysqladmin]
user=user
password=pass
在github上每次push要求输入密码和用户名着实烦恼,那么,怎么样可以不用这样呢
以前我好像是用的ssh的方法,需要密钥,现在明白了github的网站推荐使用https,
所以,暂时以https为主,其他的以后慢慢琢磨.可以在_本地主目录_新建.netrc
输入以
下内容:
machine github.com
login <user>
password <password>
真不容易,搞了很久才搞定。首先,你先设定HOME的环境变量,最好全局的,然后把
_netrc
文件放到你设定的HOME文件夹里,然后再克隆下来就方便了。
这个先不讨论了。
所有的git使用的话必须首先fetch origin
,再开发,否则很容易产生冲突
git config –global core.editor vim
因为有些时候新安装的git默认使用的系统语言,导致不方便,所以,有必要修改默认
编辑系统配置文件 .profile
的语言。
alias git='LANG=en_US git'
并source .profile
一下就可以了。
如果让git能够自己补全命令的话,效率非常的高
方法是将git源代码目录中git/contrib/completion/git-completion.bash
这个文件放到用户主目录下。然后使用source .git-completion.bash
即可。
我把配置文件放在了github
```c /************************* references: http://derekmolloy.ie/writing-a-linux-kernel-module-part-2-a-character-device/ ************************/ #include<linux/mutex.h> #include<linux/err.h> #include<linux/init.h> #include<linux/module.h> #include<linux/device.h> #include<linux/kernel.h> #include<linux/fs.h> #include<asm/uaccess.h> #define DEVICE_NAME “yubochar” #define CLASS_NAME “yubo-c”
MODULE_LICENSE(“GPL”); MODULE_AUTHOR(“yu bo”); MODULE_DESCRIPTION(“a simple linux char driver for the test”); MODULE_VERSION(“0.1”); static int majornumber; static char message[256] = {0}; static short size_of_message; static int numberopens = 0; static struct class* yuboclass = NULL; static struct device* yubodevice = NULL; static DEFINE_MUTEX(yubochar_mutex); /*
* data is being sent from the device to the user.In this case is uses the copy_to_user() function to send the buffer string to the user and captures any
@parma filep A pointer to a file object *@parma buffer The pointer to the buffer to which this function writes the *data *@parma len The length of the b *@parma offset The offset if required */ static ssize_t dev_read(struct file *filep,char *buffer, size_t len, loff_t *offset){ int error_count = 0; / * copy_to_user has the format(to, *from, size) */ error_count = copy_to_user(buffer, message, size_of_message); if(error_count == 0){ printk(KERN_INFO “yubochar: Sent %d characters to the user\n”,size_of_message); /clear the position to the start/ return (size_of_message); } else{ printk(KERN_INFO “yubochar: Failed to send %d characters to the user\n”,error_count); return -EFAULT; } } /
} module_init(yubochar_init); module_exit(yubochar_exit);
今天在lkml上有人问greg,为什么我的patch没有回应,他回答说是在v4.5-rc1
期间,他不能做任何事情,那么,我的patch没有动静,是不是也因为这个原因呢?所以,我还是自己追踪kernel的版本释放的日期,探究其中的规律.
Date: 24 Jan 2016 here
应该由master新开branch,所有的开发及bug在新branch来做.当完成特定目标后,再把它合并到master.所以每个人可以从master拉一条新的branch来开发.
也就是新建的两个分支,都有各自的commit
git commit --amend
rebase
了` git rebase -i HEAD~3`
修改当前版本的倒数第三次的commit,接下来就会出现三行东西:
pick: *****
pick: *****
pick: *****
这时你要修改哪个,就把那行的pick改成edit,然后退出,这时通过git log
,你会发现git的最后一次提交是你选的那个了,这时再使用 git commit --amend
来对commit进行修改.修改完了你还要再回到最后一次,这时使用git rebase --continue
If you want to be sure that it only does a fast-forward, you can say git merge –ff-only origin/master.
这是一个引用块
int main()
{
int a,b;
}