LinuxÄÚºËÔö¼Óϵͳµ÷ÓÃ
1.linux ϵͳµ÷ÓõĻù±¾ÔÀí
linuxµÄϵͳµ÷ÓÃÐÎʽÓëPOSIX¼æÈÝ£¬Ò²ÊÇÒ»Ì×CÓïÑÔº¯ÊýÃûµÄ¼¯ºÏ¡£È»¶ø£¬linuxϵͳµ÷ÓõÄÄÚ²¿ÊµÏÖ·½Ê½È´ÓëDOCµÄINT 21HÏàËÆ£¬ËüÊǾ¹ýINT 0X80HÈíÖжϽøÈëºó£¬ÔÙ¸ù¾Ýϵͳµ÷ÓúŷÖÃűðÀàµØ·þÎñ¡£
´Óϵͳ·ÖÎöµÄ½Ç¶È£¬linuxµÄϵͳµ÷ÓÃÉæ¼°4¸ö·½ÃæµÄÎÊÌâ¡£
(1)Óëϵͳµ÷ÓÃÓйصÄÊý¾Ý½á¹¹ºÍº¯Êý
º¯ÊýÃûÒÔ“sys_”¿ªÍ·£¬ºó¸ú¸Ãϵͳµ÷ÓõÄÃû×Ö¡£ÀýÈ磬ϵͳµ÷ÓÃfork()µÄÏìÓ¦º¯ÊýÊÇsys_fork()(¼ûkernel/fork.c),exit()µÄÏìÓ¦º¯ÊýÊÇsys_exit()(¼ûkernel/fork.c)¡£
Îļþinclude/asm/unisted.hΪÿ¸öϵͳµ÷Óù涨ÁËΨһµÄ±àºÅ¡£¼ÙÉèÓÃname±íʾϵͳµ÷ÓõÄÃû³Æ£¬ÄÇôϵͳµ÷ÓúÅÓëϵͳµ÷ÓÃÏìÓ¦º¯Êý
µÄ¹ØϵÊÇ£ºÒÔϵͳµ÷ÓúÅ_NR_name×÷Ϊϱ꣬¿ÉÕÒ³öϵͳµ÷Óñísys_call_table(¼ûarch/i386/kernel
/entry.S)ÖжÔÓ¦±íÏîµÄÄÚÈÝ£¬ËüÕýºÃ ÊǸÃϵͳµ÷ÓõÄÏìÓ¦º¯Êýsys_nameµÄÈë¿ÚµØÖ·¡£ÏµÍ³µ÷
Óñísys_call_table¼Ç¼Á˸÷sys_nameº¯ÊýÔÚ±íÖеÄλ Ö㬹²190Ïî¡£ÓÐÁËÕâÕÅ±í£¬¾ÍºÜÈÝÒ׸ù¾ÝÌض¨ÏµÍ³µ÷ÓÃ
ÔÚ±íÖеÄÆ«ÒÆÁ¿£¬ÕÒµ½¶ÔÓ¦µÄϵͳµ÷ÓÃÏìÓ¦º¯ÊýµÄÈë¿ÚµØÖ·¡£ÏµÍ³µ÷ÓÃ±í¹²256ÏÓàϵÄÏîÊǿɹ©Óû§×Ô¼ºÌí¼ÓµÄϵͳµ÷Óÿռ䡣
(2)½ø³ÌµÄϵͳµ÷ÓÃÃüÁîת»»ÎªINT 0x80ÖжϵĹý³Ì
ºê¶¨Òå_syscallN()¼ûinclude/asm/unisted.h)ÓÃÓÚϵͳµ÷Óõĸñʽת»»ºÍ²ÎÊýµÄ´«µÝ¡£NÈ¡0~5Ö®¼äµÄÕûÊý¡£
²ÎÊý¸öÊýΪNµÄϵͳµ÷ÓÃÓÉ_syscallN()¸ºÔð¸ñʽת»»ºÍ²ÎÊý´«µÝ¡£ÏµÍ³µ÷ÓúŷÅÈëEAX¼Ä´æÆ÷£¬Æô¶¯INT 0x80
ºó£¬¹æ¶¨·µ»ØÖµËÍEAX¼Ä´æÆ÷¡£
(3)ϵͳµ÷Óù¦ÄÜÄ£¿éµÄ³õʼ»¯
¶Ôϵͳµ÷Óõijõʼ»¯Ò²¾ÍÊǶÔINT
0x80µÄ³õʼ»¯¡£ÏµÍ³Æô¶¯Ê±£¬»ã±à×Ó³ÌÐòsetup_idt(¼ûarch/i386/kernel/head.S)×¼±¸ÁË1ÕÅ256ÏîµÄidt±í£¬ÓÉ
start_kernel()(¼û
init/main.c),trap_init()(¼ûarch/i386/kernel/traps.c)µ÷ÓõÄCÓïÑԺ궨Òå
set_system_gate(0x80,&system_call)(¼û
include/asm/system.h)ÉèÖÃ0x80ºÅÈíÖжϵķþÎñ³ÌÐòΪ
system_call(¼ûarch/i386/kernel/entry.S),system.call¾ÍÊÇËùÓÐϵͳµ÷ÓõÄ×ÜÈë¿Ú¡£
(4)ÄÚºËÈçºÎΪ¸÷ÖÖϵͳµ÷Ó÷þÎñ
µ±½ø³ÌÐèÒª½øÐÐϵͳµ÷ÓÃʱ£¬±ØÐëÒÔCÓïÑÔº¯ÊýµÄÐÎʽдһ¾äϵͳµ÷ÓÃÃüÁî¡£¸ÃÃüÁîÈç¹ûÒÑÔÚij¸öÍ·Îļþ
ÖÐÓÉÏàÓ¦µÄ_syscallN()Õ¹¿ª£¬ÔòÓû§³ÌÐò±ØÐë°üº¬¸ÃÎÄ ¼þ¡£µ±½ø³ÌÖ´Ðе½Óû§³ÌÐòµ
Ïà¹ØÎĵµ£º
Æô¶¯ÅäÖãº
/etc/init.d/rcS
# mkfs.jffs2 -r yyfs/ -o yy.jffs2 -p -l -n -e 0x8000 -m size
ÄÚºËÆô¶¯ÏÔʾ£º
unable to open an initial console.
½â¾ö£º
´´½¨rootfs¹ý³ÌÖУ¬ÔÚ/devĿ¼ÏÂÊÖ¶¯´´½¨ÈçϽڵ㣺
mknod -m 660 null c 1 3
mknod -m 660 console c 5 1
Taking the GNU/Linux hos ......
1 ºìñ
rpm -ivh °²×°
-e ɾ³ý
-u Éý¼¶
-q ²éѯ
2 ubuntu
deb dpkg -i °²×°
&n ......
½ñÌìºÜ¹û¶ÏµÄ°ÑÒ»Ö±ÔÚÐéÄâ»úÉÏ°²×°µÄLinuxжÔØÁË£¬¸Ð¾õÊÔÁËһС¶Îʱ¼äÔÚVMwareÉÏÃæ°²×°µÄLinux£¬Ê¹²»³ö¸Ð¾õÀ´¡£¸üΪÖØÒªµÄÊǾÝ˵£¨ÎÒÒ²Ö»ÄܵÀÌý;˵ÁË£©java³ÌÐò¿ª·¢ºÜ¶àÊÇÔÚLinux»·¾³Ï¿ª·¢µÄ£¨ÄѵÀÊÇÒòΪÔÚLinuxÏÂÔËÐУ¿£©¡£ÎªÁ˸ü¼ÓµÄ½Ó½üÉú²ú£¬ÎÒ¾ö¶¨°²×°Ë«ÏµÍ³¡£
&n ......
ÎÒÕâÀï˵µÄioctlº¯ÊýÊÇÔÚÇý¶¯³ÌÐòÀïµÄ£¬ÒòΪÎÒ²»ÖªµÀ»¹ÓÐûÓбðµÄ³¡ºÏÓõ½ÁËioctl£¬ ËùÒԾ͹涨ÁËÎÒÃÇÌÖÂ۵ķ¶Î§¡£ÎªÊ²Ã´ÒªÐ´ÆªÎÄÕÂÄØ£¬ÊÇÒòΪÎÒÇ°Ò»Õó×Ó±»ioctl¸ø¸ã»ìÁË£¬Õ⼸Ìì²ÅŪÃ÷°×Ëü£¬ÓÚÊÇÔÚÕâÀïÇåÀíÒ»ÏÂÍ·ÄÔ¡£
Ò»¡¢ ʲôÊÇioctl¡£
ioctlÊÇÉ豸Çý¶¯³ÌÐòÖжÔÉ豸µÄI/OͨµÀ½øÐйÜÀíµÄº¯Êý¡£Ëùν¶ÔI/OͨµÀ½øÐйÜÀí£ ......
Ò»¡¢rpm°ü°²×°·½Ê½²½Ö裺
1¡¢ÕÒµ½ÏàÓ¦µÄÈí¼þ°ü£¬±ÈÈçsoft.version.rpm£¬ÏÂÔص½±¾»úij¸öĿ¼£»
2¡¢´ò¿ªÒ»¸öÖնˣ¬su -³ÉrootÓû§£»
3¡¢cd soft.version.rpmËùÔÚµÄĿ¼£»
4¡¢ÊäÈërpm -ivh soft.version.rpm
¶þ¡¢deb°ü°²×°·½Ê½²½Ö裺
1¡¢ÕÒµ½ÏàÓ¦µÄÈí¼þ°ü£¬±ÈÈçsoft.version.deb£¬ÏÂÔص½±¾»úij¸öÄ¿Â ......