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
相关文档:
/*
* 该文件实现系统调用read,write和lseek。
*/
/*
* linux/fs/read_write.c
*
* (C) 1991 Linus Torvalds
*/
#include <sys/stat.h>
#include <errno.h>
#include <sys/types.h>
#include <linux/kernel.h>
#include < ......
/*
* 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 < ......
/*
* linux/fs/file_dev.c
*
* (C) 1991 Linus Torvalds
*/
#include <errno.h>
#include <fcntl.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <asm/segment.h>
#define MIN(a,b) (((a)<(b))?(a):(b))
#defi ......
脚本功能: 定期对一些项目进行完整备份.
project.lst 文件格式如下:
project1
project2
备份脚本如下:
#!/bin/sh
#
# subversion data backup script
# by scud http://www.jscud.com
# 2005-11-27
#
# subversion完整备份的脚本,调整好后使用crontab -e 放到自动执行里面即可.
#
#备份日志文件
LogFile=/bac ......