linuxÄÚºËinit½ø³Ìº¯ÊýµÄ²¿·Ö´úÂëÈçÏ£º 01 if (execute_command)
02 run_init_process(execute_command);
03
04 run_init_process("/sbin/init");
05 run_init_process("/etc/init");
06 run_init_process("/bin/init");
07 run_init_process("/bin/sh");
08
09 panic("No init found. Try passing init= option to kernel.");
10 }
´úÂëÖÐÎÒÃÇ¿´³ö£¬linuxÄÚºËÔÚ³õʼ»¯µÄ×îÄ©¶Î£¬Ò²¾ÍÊǹÒÔØÁ˸úÎļþϵͳ֮ºó£¬¿ªÊ¼ÁËÓë¸ùÎļþϵͳ£¬Ò²¾ÍÊÇÓû§Ó¦Óõŵͨ£¬ÎÒÃÇ¿´µ½£ºÄں˷ֱð³¢ÊÔÁË/sbin/init, /etc/init, /bin/init, /bin/shËĸöÓ¦ÓõÄÖ´ÐУ¬ÓÉ´Ë¿ÉÒÔÏëµ½£¬Ö»ÒªÎÒÃÇ×¼±¸ÏàÓ¦µÄÓ¦Ó㬲¢ÇÒÖ»ÒªÂú×ãÆäÖÐÖ®Ò»£¬¾Í¿ÉÒÔÆô¶¯ÏµÍ³ÁË£¬Èç¹ûÈκεÄÒ»¸ö¶¼Ã»ÓÐÂú×㣬ÄÇô¾Ã»á³öÏֺܾµäµÄÄÚºËpanic£ºNo init found. Try passing init= option to kernel. ÔÚ´Ë£¬ÎÒÃÇÀûÓÃÏÖÓзÖÎö£¬¹¹½¨Ò»¸ö¿ÉÒÔ˵ÊǺÜСµÄ¸ùÎļþϵͳ£¬busyboxÊÇÕë¶ÔǶÈëʽ¿ª·¢ÐèÇ󣬼¯¸÷ÖÖunix¹¤¾ßÓÚÒ»ÉíµÄºÜСºÜÇ¿´óµÄ¹¤¾ß¼¯¡£busyboxµÄ±àÒë¹ý³Ì²»ÔÙ׸Êö£¬ÏÖ¼ÙÉèbusybox±àÒëºóÒѾÉú³ÉÈ ......
1.A. extract the install file
tar zxvf bxviewer.tar.gz
cd bxviewer
./installbxv
logout
1.B. if system can't find bxv after ur installation, you can always set
it up by hand
if u use bash
vi ~/.bash_profile
add two lines at the end of the file:
export LD_LIBRARY_PATH=${installdir}
export PATH=$PATH:${installdir}
where ${installdir} is the dir where bxv and lib*.so located
sudo cp lib*.so /usr/lib ......
sudo apt-get build-dep firefox
Èô³öÏÖÏÂÃæµÄ´íÎó£º
²»ÄÜÂú×ãÈí¼þ°ü firefox ËùÒªÇóµÄ¹¹½¨ÒÀÀµ¹ØÏµ
Ç뽫 /etc/apt/sources.list ¸ÄΪĬÈϵÄÔ´ ÓоÍÊÇ ×°Íêϵͳºó×Ô´øµÄ£º
#deb cdrom:[Ubuntu 9.04 _Jaunty Jackalope_ - Release i386 (20090421.3)]/ jaunty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ jaunty main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ jaunty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ jaunty-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ jaunty-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubun ......
1¡¢ÏµÍ³Ê±ÖÓ(System Clock)ÓëʵʱʱÖÓ(Real Time Clock)
ʵʱʱÖÓÖ¸µÄÊÇÓ²¼þʱÖÓ£¬¶øÏµÍ³Ê±ÖÓÖ¸µÄÊÇÈí¼þʱÖÓ£¬´æÔÚÓÚLinuxϵͳ֮ÖС£µ±ÏµÍ³Æô¶¯Ê±£¬Linux»á´ÓÓ²¼þ¶Áȡʱ¼ä×öΪϵͳʱ¼ä£¬Ö®ºó±ãÒ»Ö±²ÉÓÃϵͳʱ¼ä¡£LinuxÃüÁîdate¿ÉÒÔÓÃÀ´ÉèÖÃϵͳʱÖÓ£¬¶øhwclock»òÕßclockÔòÓÃÀ´ÉèÖÃʵʱʱÖÓ£¬¼´Ó²¼þʱÖÓ¡£
2¡¢Ê±ÖÓÆµÂÊ
µ¥Î»Ê±¼äÄÚ¾§ÌåÕñµ´Æ÷Ëù²úÉúµÄʱÖÓÂö³å¸öÊý£¬²ÉÓúêCLOCK_TICK_RATE±íʾ¡£
3¡¢Ê±ÖÓÖÐ¶ÏÆµÂÊ(HZ)
µ¥Î»Ê±¼äÄÚ²úÉúµÄʱÖÓÖжϴÎÊý£¬²ÉÓúêHZ±íʾ¡£
4¡¢Ê±ÖÓÖжÏÖÜÆÚ
²ÉÓÃtick±íʾ£¬µ¥Î»ÎªºÁÃë¡£Òò´Ë£¬Ê±ÖÓÖжÏÖÜÆÚ¿ÉÓÉÒÔϹ«Ê½ÇóµÃ
tick = 1000000/HZ
ΪÁËÔÚÉÏʽÓұ߲»Äܱ»Õû³ýʱʵÏÖËÄÉáÎåÈ룬Linux½«ÉÏÊöµÈʽÐÞÕýΪ
tick = (1000000+HZ/2)/2
5¡¢LATCH
Ò»¸öʱÖÖÖжÏÖÜÆÚÖÐËù°üº¬µÄʱÖÖÖÜÆÚ¡£Òò´Ë£¬LATCH¿ÉÓÉÒÔϹ«Ê½ÇóµÃ
LATCH = (1/HZ)/(1/CLOCK_TICK_RATE) = CLOCK_TICK_RATE/HZ
ΪÁËÔÚÉÏʽÓұ߲»Äܱ»Õû³ýʱʵÏÖËÄÉáÎåÈ룬Linux½«ÉÏÊöµÈʽÐÞÕýΪ
LATCH = (CLOCK_TICK_RATE+HZ/2)/HZ
6¡¢jiffies
¸ÃÈ«¾Ö±äÁ¿±íʾϵͳ×ÔÆô¶¯ÒÔÀ´Ëù¾¹ýµÄàÖ´ð(tick)Êý£¬Êý¾Ý½á¹¹Îª32λÎÞ·ûºÅÕûÊý¡£¸Ä±äÁ¿Í¬³£ÔÚÄÚºËÖÐ×öΪʱ¼äʹÓá£
7¡¢xtime
¸ÃÈ«¾Ö±äÁ¿± ......
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#define MAX 1024
int get_file_count(char *root)
{
DIR *dir;
struct dirent * ptr;
int total = 0;
char path[MAX];
dir = opendir(root); /* ´ò¿ªÄ¿Â¼*/
if(dir == NULL)
{
perror("fail to open dir");
exit(1);
}
errno = 0;
while((ptr = readdir(dir)) != NULL)
{
//˳Ðò¶Áȡÿһ¸öĿ¼Ï
//Ìø¹ý“..”ºÍ“.”Á½¸öĿ¼
if(strcmp(ptr->d_name,".") == 0 || strcmp(ptr->d_name,"..") == 0)
{
continue;
}
//printf("%s%s\n",root,ptr->d_name);
//Èç¹ûÊÇĿ¼£¬ÔòµÝ¹éµ÷Óà get_file_countº¯Êý
if(ptr->d_type == DT_DIR)
{
sprintf(path,"%s%s/",root,ptr->d_name);
//pr ......
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#define MAX 1024
int get_file_count(char *root)
{
DIR *dir;
struct dirent * ptr;
int total = 0;
char path[MAX];
dir = opendir(root); /* ´ò¿ªÄ¿Â¼*/
if(dir == NULL)
{
perror("fail to open dir");
exit(1);
}
errno = 0;
while((ptr = readdir(dir)) != NULL)
{
//˳Ðò¶Áȡÿһ¸öĿ¼Ï
//Ìø¹ý“..”ºÍ“.”Á½¸öĿ¼
if(strcmp(ptr->d_name,".") == 0 || strcmp(ptr->d_name,"..") == 0)
{
continue;
}
//printf("%s%s\n",root,ptr->d_name);
//Èç¹ûÊÇĿ¼£¬ÔòµÝ¹éµ÷Óà get_file_countº¯Êý
if(ptr->d_type == DT_DIR)
{
sprintf(path,"%s%s/",root,ptr->d_name);
//pr ......
Linux C + + Training
Syllabus
________________________________________
1, Linux Operating System
System Environment: Ubuntu GNU / Linux, RedHat Linux AS5,
FreeBSD
Course Requirements: proficient use of commonly used Linux
/ UNIX commands.
Time: 1 week.
________________________________________
2, Linux C + + development environment to build, develop
the use of tools
Related content: vi, GCC, GDB, Make, CVS, Subversion,
Eclipse CDT
Course requirements:
Skilled use of vi text
editor;
Skilled use of GCC tool chain for compiling, debugging,
build an executable file or shared library / static library;
Skilled preparation of Makefile;
Skilled configuration, using two kinds of CVS and
Subversion version control tool;
Skilled configuration, use the Eclipse CDT development
tools.
Time: 1 week
________________________________________
3, C + + language
C + + is a
multi-paradigm programming language, com ......
Linux C + + Training
Syllabus
________________________________________
1, Linux Operating System
System Environment: Ubuntu GNU / Linux, RedHat Linux AS5,
FreeBSD
Course Requirements: proficient use of commonly used Linux
/ UNIX commands.
Time: 1 week.
________________________________________
2, Linux C + + development environment to build, develop
the use of tools
Related content: vi, GCC, GDB, Make, CVS, Subversion,
Eclipse CDT
Course requirements:
Skilled use of vi text
editor;
Skilled use of GCC tool chain for compiling, debugging,
build an executable file or shared library / static library;
Skilled preparation of Makefile;
Skilled configuration, using two kinds of CVS and
Subversion version control tool;
Skilled configuration, use the Eclipse CDT development
tools.
Time: 1 week
________________________________________
3, C + + language
C + + is a
multi-paradigm programming language, com ......