1、实验 Initrd.img文件理解 Linux 启动 /bootloader/initrd 阅读下面的三份资料 ,分析 initrd在启动过程的作用 : 1. http:/ 2. http:/ 3. http:/ Bootloader/嵌入式系统 /PC系统启动 比较不同系统的启动过程 ,可以更清楚的理解启动原 理 .比较两个方面 : 1.基本过程具有相似性 2. 引导软件和引导设备具有差异性 使用 uclinux和 LINUX2.4/2.6作为比较对象 Bootloader 作用 uclinux说明 uclinux启动设备和引导程序 实验 实现安全的登录 (难点) 第一部分密钥登录 1.在
2、WINDOWS系统中,使用 PUTTYGEN.EXE获取密钥对 2. 通过 FTP系统上传公钥文件到服务器的用户家目录中, 一般上传目录为: $HOME/.ssh/id_rsa 注意修改目录 .ssh 和文件公钥文件爱你 id_rsa的访问权限 提示: 可以使用下面的脚本建立和修改文件的访问权限 #mkdir -p $HOME/.ssh /* -1 unrunnable, 0 runnable, 0 stopped */ long counter; long priority; unsigned long signal; unsigned long blocked; /* bitmap of
3、masked signals */ unsigned long flags; /* per process flags, defined below */ int errno; long debugreg8; /* Hardware debugging registers */ struct exec_domain *exec_domain; /* various fields */ struct linux_binfmt *binfmt; struct task_struct *next_task, *prev_task; struct task_struct *next_run, *pre
4、v_run; unsigned long saved_kernel_stack; unsigned long kernel_stack_page; int exit_code, exit_signal; /* ? */ unsigned long personality; int dumpable:1; int did_exec:1; int pid; int pgrp; int tty_old_pgrp; int session; /* boolean value for session group leader */ int leader; int groupsNGROUPS; /* *
5、pointers to (original) parent process, youngest child, younger sibling, * older sibling, respectively. (p-father can be replaced with * p-p_pptr-pid) */ struct task_struct *p_opptr, *p_pptr, *p_cptr, *p_ysptr, *p_osptr; struct wait_queue *wait_chldexit; unsigned short uid,euid,suid,fsuid; unsigned s
6、hort gid,egid,sgid,fsgid; unsigned long timeout, policy, rt_priority; unsigned long it_real_value, it_prof_value, it_virt_value; unsigned long it_real_incr, it_prof_incr, it_virt_incr; struct timer_list real_timer; long utime, stime, cutime, cstime, start_time; /* mm fault and swap info: this can ar
7、guably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; unsigned long swap_address; unsigned long old_maj_flt; /* old value of maj_flt */ unsigned long dec_flt; /* page fault count of the last time */ unsigned lon
8、g swap_cnt; /* number of pages to swap on next pass */ /* limits */ struct rlimit rlimRLIM_NLIMITS; unsigned short used_math; char comm16; /* file system info */ int link_count; struct tty_struct *tty; /* NULL if no tty */ /* ipc stuff */ struct sem_undo *semundo; struct sem_queue *semsleeping; /* l
9、dt for this task - used by Wine. If NULL, default_ldt is used */ struct desc_struct *ldt; /* tss for this task */ struct thread_struct tss; /* filesystem information */ struct fs_struct *fs; /* open file information */ struct files_struct *files; /* memory management info */ struct mm_struct *mm; /*
10、 signal handlers */ struct signal_struct *sig; #ifdef _SMP_ int processor; int last_processor; int lock_depth; /* Lock depth. We can context switch in and out of holding a syscall kernel lock. */ #endif ; ELF文件结构 .text .rodata .data .bss .systab .debug .line strtab 节头表 将连续的文件节映射到运行时的存储器段 描述目标文件节 读写存储器段 不加载到存储器 ELF段头 段头表 .init 只读存储器段 第二:进程组织方式 1. 链接方式 2. 索引方式