易截截图软件、单文件、免安装、纯绿色、仅160KB

linux根文件系统挂载

由bootload进入linux后由head.s进入了start_kernel了.
asmlinkage void __init start_kernel(void)
{
       char * command_line;
       extern struct kernel_param __start___param[], __stop___param[];
       ………………..
       setup_arch(&command_line);
       ………….
       ………..
       vfs_caches_init(num_physpages); ………….     
 
…………...
       rest_init();
}
 
重要函数解释
 
1.Setup_arch是解释bootloader传过来的参数,并附相关参数。
 
void __init setup_arch(char **cmdline_p)
{
       struct tag *tags = (struct tag *)&init_tags;
       struct machine_desc *mdesc;
       char *from = default_command_line;
 
       setup_processor();
       mdesc = setup_machine(machine_arch_type);
       machine_name = mdesc->name;
 
       if (mdesc->soft_reboot)
              reboot_setup("s");
 
       if (mdesc->boot_params)
              tags = phys_to_virt(mdesc->boot_params);
 
       /*
        * If we have the old style parameters, convert them to
        * a tag list.
        */
 &nb


相关文档:

Linux erron常量

#define EPERM            1      /* Operation not permitted */
#define ENOENT           2      /* No such file or directory */
#define ESRCH&nbs ......

Linux 内核配置

Linux内核配置办法:
1. make config
这种办法会遍历所有配置项,要求用户逐个选择Y/N/M
2. make menuconfig
这个办法是基于ncurse库编制的图形界面工具。常用
3. make xconfig
用于基于X11的图形工具
4. make gconfig
用于基于gtk+图形工具
5. make defconfig
创建一个默认的配置,生成当前的.config
6. make x ......

Linux 消息重定向办法

Linux 消息重定向办法
command > filename
把标准输出重定向到一个指定文件中
command 1 > fielname
把标准输出重定向到一个指定文件中(同上)
command 2 > filename
把标准错误重定向到一个文件中
command >! filename
把标准输出重定向到一个
指定
文件中,若文件存在,则覆盖
command >&am ......

linux 0.11 内核学习 truncate.c


/*
 * 该文件主要实现的是truncate函数,该函数是释放指定i 
 * 节点在设备上占用的所有逻辑块,包括直接块、一次间
 * 接块和二次间接块
 */
/*
 *  linux/fs/truncate.c
 *
 *  (C) 1991  Linus Torvalds
 */
#include <linux/sched.h>
......

linux 0.11 内核学习 char_dev.c


/*
 *  linux/fs/char_dev.c
 *
 *  (C) 1991  Linus Torvalds
 */
#include <errno.h>
#include <sys/types.h> // 定义了基本的系统数据类型
#include <linux/sched.h>
#include <linux/kernel.h> // 含有一些内核常用函数的原形定义
#include < ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号