LinuxÔ´ÂëÖеÄmktimeËã·¨½âÎö
ÎÒÃÇÖªµÀ£¬´ÓCMOSÖжÁ³öÀ´µÄϵͳʱ¼ä²¢²»ÊÇtime_tÀàÐÍ£¬¶øÊÇÀàËÆÓÚstruct tmÄÇÑù£¬ÄêÔÂÈÕʱ·ÖÃëÊÇ·Ö¿ª´æ´¢µÄ¡£
ÄÇô£¬Òª°ÑËüת»¯ÎªÏµÍ³±ãÓÚ´¦ÀíµÄtime_tÀàÐÍ£¬¾ÍÐèÒªËã·¨½øÐÐת»»¡£
ÎÒÃǶ¼ÖªµÀÎÒÃǵĹ«Àú»¹ÊDZȽϸ´Ôӵģ¬ÓдóÔÂСÔ£¬ÓÐÈòÄê·ÇÈòÄ꣬´¦ÀíÆðÀ´»áºÜÂé·³¡£
µ«ÊÇLinuxµÄÔ´´úÂë½ö½öÓÃÁ˶̶̵ļ¸ÐоÍÍê³ÉÁËÕâ¸ö¸´ÔÓµÄת»»£¨GaussËã·¨£©£¬ÊµÔÚÁîÈ˾ªÆæ¡£»°²»¶à˵£¬ÏÈ¿´Ô´´úÂ룺
include/linux/time.h
static
inline
unsigned
long
mktime
(
unsigned
int
year,
unsigned
int
mon,
unsigned
int
day,
unsigned
int
hour,
unsigned
int
min
,
unsigned
int
sec)
{
if
(
0 >
=
(
int
)
(
mon -
=
2)
)
{
/**/
/* 1..12 -> 11,12,1..10 */
mon +
=
12;
/**/
/* Puts Feb last since it has leap day */
year -
=
1;
}
return
(
(
(
(
unsigned
long
)
(
year/
4 -
year/
100 +
year/
400 +
367*
mon/
12 +
day)
+
year*
365 -
719499
)
*
24 +
hour /**/
/* now have hours */
)
*
60 +
min
/**/
/* now have minutes */
)
*
60 +
sec;
/**/
/* finally seconds */
}
¿´ÉÏÈ¥ÁîÈËÑÛ»¨çÔÂÒ£¬ºÁÎÞÍ·Ð÷¡£ÏÂÃæ¾ÍÈÃÎÒÃǶԸÃËã·¨×÷¾ßÌåµÄ·ÖÎö¡£
ÏȲ»¿´Ç°ÃæµÄ£¬Ö±½Ó¿´returnÄǾ䣬¸ÃʽÕûÌåÉϾßÓÐÕâÑùµÄ½á¹¹£º
T = ((X * 24 + hour) * 60 + min) * 60 + sec
Õâ˵Ã÷¸ÃËã·¨ÊÇÏÈËã³ö´Ó1970Äê1ÔÂ1ÈÕ¿ªÊ¼µÄÌìÊýX£¬ÔÙ½ø¶øÇó³ö¾ßÌåµÄʱ¼äÖµTµÄ¡£
 
Ïà¹ØÎĵµ£º
#!/bin/bash
while getopts "ab:cd:" Option
# b and d take arguments
#
do
case $Option in
a) echo -e "a = $OPTIND";;
b) echo -e "b = $OPTIND $OPTARG";;
c) echo -e "c = $OPTIND";;
d) echo -e "d = $OPTIND $OPTARG";;
esac
done
shift $(($OPTIND - 1)) ......
-------------------------------------------------------------------------------------------------------
By:yuyongbao
QQ:673360056
£±¡¢ linuxϹ²ÏíÎļþ¡£°²×°smbserver¡£È»ºóÔÚ¡¶ÏµÍ³ÉèÖá·Öдò¿ª¡¶·þÎñÆ÷ÉèÖ᷵ġ¶smb¡¡server¡··þÎñÆ÷£¬ÊäÈëÏà¹ØÂ·¾¶¼´¿É¡£È»ºóÔÚwindowÖУ¬Ê¹ÓÃÍøÂçÁÚ¾Ó²éÕÒlinux¡££¨×¢ ......
-------------------------------------------------------------------------------------------------------
//By:yuyongbao
//QQ:673360056
//ƽ̨powerpc mpc8379e linux 2.6.22
£±¡¢ÏÈÓÃfdisk ¸øSD¿¨·ÖÇø£¬ÓÃ×÷Îļþϵͳ¡£
½«¶Á¿¨Æ÷²åÈëPC»úÐéÄâ»ú£¬ÔÚPC»úÉÏÖ´ÐÐfdisk /dev/sdb
Ñ¡Ôñn¡¡¡£¡£¡£¡£¡£¡£¡£¡£² ......
Linux Execution and Virtual Memory Utilization
LinuxÖ´ÐÐÒÔ¼°ÐéÄâÄÚ´æÖ®ÓÃ
When Linux boots, it starts with the MMU disabled, so initially it deals only with physical
memory. The kernel image is copied to physical address 0x8000 in DRAM and executed. First a master page table is created ......
LinuxÉ豸Çý¶¯Ñ§Ï°£Davinci¿ª·¢°åÉÏÔËÐеÄhelloÄ£¿é
¿´Á˺ܶà¸öhello worldÁË£¬×Ô¼ºÀ´Ð´Ò»¸öÔÚdavinci°å¿éÉÏÅܵİɡ£
Ö÷ÌåºÜ¼òµ¥£¬¾ÍÊÇÒ»¸öCÎļþhello_davinci.c¡£
/*================hello_davinci.c==============*/
#include <linux/module.h> /*ËùÓÐÄ£¿é¶¼ÐèÒªµÄÍ·Îļþ*/
#include <lin ......