linuxÐźŻúÖÆ
linuxÐźŻúÖÆ
ÐźÅÌṩÁËÒ»ÖÖ֪ͨ½ø³Ìϵͳʼþ·¢ÉúµÄ»úÖÆ£¬ËüÒ²ÊÇ×÷ΪÓû§½ø³ÌÖ®¼äͨÐźÍͬ²½µÄ
Ò»ÖÖÔʼ»úÖÆ¡£ÔÚ½ø³ÌÇ¨ÒÆµÄÇé¿öÏ£¬ÈçºÎ´¦ÀíÐźÅÄØ£¿Õⲿ·Ö½éÉÜÁËMOSIXϵͳ¶ÔÐźÅ
»úÖÆµÄ´¦Àí¡£
LINUXÐźŻúÖÆ
ÐźÅÊÇÒì²½µÄ½ø³Ì¼äͨѶ»úÖÆ,ÊÇÔÚÈí¼þ²ã´ÎÉ϶ÔÖжϻúÖÆµÄÒ»ÖÖÄ£Äâ¡£LINUXÄں˵ÄÐÅ
ºÅ»úÖÆ·ûºÏPOSIX.4µÄ¹æ¶¨£¬ÕâÊÇPOSIX.1±ê×¼µÄÒ»¸ö³¬¼¯¡£
ÿ¸ö½ø³ÌµÄtask_struct½á¹¹Öж¼ÓиöÖ¸Õësig£¬Ö¸ÏòÒ»¸ösingal_struct½á¹¹£¬½á¹¹ÖеÄ
Êý×éaction[]Ï൱ÓÚÒ»¸öÐźÅÏòÁ¿±í£¬Ã¿¸öÔªËØÈ·¶¨Á˽ø³Ì½ÓÊÕµ½Ò»¸ö¾ßÌåµÄÐźÅʱӦ
¸Ã²ÉÈ¡µÄÐж¯¡£
struct signal_struct {
atomic_t count;
struct k_sigaction action[_NSIG];
spinlock_t siglock;
};
ÄÇôϵͳÈçºÎÅжÏÒ»¸ö½ø³ÌÊÇ·ñÓÐÐźÅÔڵȴý´¦ÀíÄØ£¿ÕâÊÇͨ¹ýtask_struct½á¹¹ÖеÄsi
gpending³ÉÔ±¡£task_struct½á¹¹ÖеÄblocked³ÉÔ±ÔòΪÆÁ±ÎÐźŵļ¯ºÏ£¬pending³ÉÔ±Ôò
ΪÐźŶÓÁУ¬Ã¿²úÉúÒ»¸öÐźÅÔò°ÑËü¹ÒÈëÕâ¸ö¶ÓÁУ¬ÐźÅλͼsignalÒ²±£´æÔÚÆäÖС£
Óû§³£³£Òª×Ô¼º¶¨Òå¶ÔÐźŵĴ¦Àí³ÌÐò£¬²¢ÇÒÓû§µÄ´¦Àíº¯ÊýÊÇλÓÚÓû§¿Õ¼äµÄ¡£LINUX
ÌṩÁËϵͳµ÷ÓÃsignal£¨sys_signal£©ºÍsigaction£¨sys_sigaction »òsys_rt_sigacti
on£©ÎªÐźÅÉèÖô¦ÀíÏòÁ¿¡£Óû§ÉèÖÃÐźŴ¦ÀíµÄʱ»úÎÒÃÇÊDz»ÄÜÈ·¶¨µÄ£¬¿ÉÒÔÔÚ½ø³ÌǨ
񮂡£¬Ò²¿ÉÒÔÔÚ½ø³ÌÇ¨ÒÆÖ®ºó£¬½ø³Ì¿ÉÒÔÔÚ²»Í¬µÄ½Úµã¼ä¶à´ÎÇ¨ÒÆ£¬Òò´Ë£¬ÈçºÎ±£Ö¤ÐÅ
ºÅ²»±»¶ªÊ§²¢ÇÒ¶¼Äܱ»ÕýÈ·´¦Àí¾ÍºÜÖØÒª¡£²¢ÇÒÎÒÃÇ×¢Òâµ½£¬½ø³ÌÔÚÇ¨ÒÆÊ±£¬²¢²»½«ÐÅ
ºÅÏòÁ¿±íÇ¨ÒÆµ½Ä¿±ê½ø³Ì£¬¶øÖ»Êǽ«½ø³ÌµÄÒì²½ÐźźÍÇ¿ÖÆÐźÅÐÅÏ¢´«Ë͵½Ä¿±ê½ø³Ì¡¾
²Î¼ûmig_send_misc£¨£©ºÍmig_do_receive_misc£¨£©¡¿¡£
struct asig_h
{
unsigned int sigs;/*ÐźÅ*/
int nforced;/*Äں˷¢Ë͵ÄÇ¿ÖÆÐźŵĸöÊý*/
};
struct mosix_task
{¡£¡£¡£¡£¡£¡£¡£
uint32_t asig; /*µ½´ïREMOTEµÄÐźŠ*/
siginfo_t *forced_sigs; /* REMOTEÇ¿ÖÆÐźÅÐÅÏ¢*/
int nforced_sigs; /* REMOTEÇ¿ÖÆÐźŵĸöÊý */
short sigmig; /* Ç¨ÒÆÊ±½ÓÊÕµÄÐźŠ*/
}
int mig_send_misc(int credit)
{ struct mig_misc_h m;
regis
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâÆª·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´Ë×ªÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨ÕâÆª²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
/*
Name: SndKit.c
Copyright: GPLv2
Author: rockins(ybc2084@163.com)
Date: 15-10-06 18:22
Description: implent raw sound record/play
run: ./SndKit [-h] [-d device] [-c channel] [-b bits] [-f hz] [-l len] <-r|-p file>
e.g.:
./SndKit ......
²é¿´´ÅÅÌÒÔ¼°·ÖÇøÃüÁ
fdisk -l
Êä³ö½á¹ûÈçÏ£º
-----------------------------------------------------------------------
Disk /dev/sda: 160.0 GB, 160040803840 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot   ......
¹¦ÄÜÃèÊö£º
»ñÈ¡»òÕßÉèÖÃ
Óëij¸öÌ×½Ó×Ö¹ØÁªµÄÑ¡ ÏѡÏî¿ÉÄÜ´æÔÚÓÚ¶à²ãÐÒé
ÖУ¬ËüÃÇ×Ü»á³öÏÖÔÚ×îÉÏÃæµÄÌ×½Ó×ֲ㡣µ±²Ù×÷Ì×½Ó×ÖÑ¡Ïîʱ£¬Ñ¡ÏîλÓڵIJãºÍÑ¡ÏîµÄÃû³Æ±ØÐë¸ø³ö¡£ÎªÁ˲Ù×÷Ì×½Ó×Ö²ãµÄÑ¡ÏӦ¸Ã ½«²ãµÄÖµÖ¸¶¨ÎªSOL_SOCKET¡£ÎªÁ˲Ù×÷ÆäËü²ãµÄÑ¡Ï¿ØÖÆÑ¡ÏîµÄºÏÊÊÐ ......
ÔÚlinuxÖÐÓû§·ÖΪÁ½Àࣺ1¡¢root³¬¼¶Óû§ 2¡¢ÆÕͨÓû§
/bin
¡¡¡¡Òýµ¼Æô¶¯ËùÐèµÄÃüÁî»òÆÕͨÓû§¿ÉÄÜÓõÄÃüÁî(¿ÉÄÜÔÚÒýµ¼Æô¶¯ºó)¡£
¡¡¡¡/sbin
¡¡¡¡ÀàËÆ/bin £¬µ«²»¸øÆÕͨÓû§Ê¹Óã¬ËäÈ»Èç¹û±ØÒªÇÒÔÊÐíʱ¿ÉÒÔʹÓá£
¡¡¡¡/etc
¡¡¡¡Ìض¨µÄÅ ......