Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxÏ»ñÈ¡CPUID¡¢Ó²ÅÌÐòÁкÅÓëMACµØÖ·


 
ÔںܶàϵͳÈí¼þµÄ¿ª·¢ÖУ¬ÐèҪʹÓÃһЩϵͳµÄΨһÐÔÐÅÏ¢¡£ËùÒÔ£¬µÃµ½Ö÷»úµÄCPUID¡¢Ó²ÅÌÐòÁкż°Íø¿¨µÄMACµØÖ·£¬¾Í³É¸öÒ»¼þºÜÖØÒªµÄÓ¦Óá£
±¾È˾­¹ýÒ»·¬google¼´×Ô¼ºµÄ×êÑУ¬»ù±¾ÉÏʵÏÖÁËÕ⼸¸ö¹¦ÄÜ¡£ÐèÒªµÄ×¼±¸ÖªÊ¶ÓУº
GCCµÄǶÈë»ã±à£¬¾ßÌåµÄGCCǶÈë»ã±à֪ʶ£¬Çë²Î¿¼Ïà¹ØÊÖ²á
ioctlϵͳµ÷Ó㬾ßÌåµÄµ÷Ó÷½·¨£¬Çë²é¿´ÊÖ²áÒ³
»ñÈ¡CPUID
°´ÕÕÍøÉÏÌṩµÄ˵Ã÷£¬CPUID²¢²»ÊÇËùÓеÄIntel CPU¶¼Ö§³ÖµÄ¡£Èç¹ûÖ§³Ö£¬»ã±àµ÷ÓÃΪ£ºeaxÖÃ0000_0003£¬µ÷ÓÃcpuid¡£
ÒÔÏÂΪʵÏÖ´úÂ루ÔÚÎÒµÄCPUÉÏ£¬²¢Ã»Óеõ½£©£º
#define cpuid(in,a,b,c,d) asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
static int
getcpuid (char *id, size_t max)
{
int i;
unsigned long li, maxi, maxei, ebx, ecx, edx, unused;
cpuid (0, maxi, unused, unused, unused);
maxi &= 0xffff;
if (maxi < 3)
{
return -1;
}
cpuid (3, eax, ebx, ecx, edx);
snprintf (id, max, "%08lx %08lx %08lx %08lx", eax, ebx, ecx, edx);
fprintf (stdout, "get cpu id: %s\n", id);
return 0;
}
»ñÈ¡Ó²ÅÌÐòÁкÅ
Õâ¸öµÄʵÏÖ£¬²ÉÓõÄÊǶÁÈ¡/etc/mtabÎļþ£¬ÕÒµ½/£¨¼´¸ùĿ¼£©¹ÒÔصÄÉ豸Îļþ£¬È»ºó´ò¿ªËü£¬ÔÙÓÃϵͳµ÷ÓÃioctlÀ´ÊµÏֵġ£
ioctlµÚ¶þ¸ö²ÎÊýΪHDIO_GET_IDENTITY, »ñµÃÖ¸¶¨ÎļþÃèÊö·ûµÄ±êÖ¾ºÅ
ioctlµÄµÚÈý¸ö²ÎÊýΪstruct hd_driveid £¬ÔÚlinux/hdreg.hÖУ¬struct hd_driveidµÄÉùÃ÷ÓÐ
struct hd_driveid {
unsigned short config; / lots of obsolete bit flags */
unsigned short cyls; /* Obsolete, "physical" cyls */
unsigned short reserved2; /* reserved (word 2) */
unsigned short heads; /* Obsolete, "physical" heads */
unsigned short track_bytes; /* unformatted bytes per track */
unsigned short sector_bytes; /* unformatted bytes per sector */
unsigned short sectors; /* Obsolete, "physical" sectors per track */
unsigned short vendor0; /* vendor unique */
unsigned short vendor1; /* vendor unique */
unsigned short vendor2; /* Retired vendor unique */
unsigned char serial_no[20]; /* 0 = not_specified */
unsigned short buf_type; /* Retired */
unsigned short buf_size; /* Retired, 512 byte increments


Ïà¹ØÎĵµ£º

ÓÃLinuxÏÂPerl½Å±¾Á¬½ÓSQLServer

×¼±¸¹¤×÷:
¡¡¡¡Óõ½µÄperl À©Õ¹×é¼þ(modules)ÔÚÉÏƪÌù³ö.( win32::odbc Ä£¿é
)ÏÂÔØ×é¼þºó°´ÕÕReadmeÎļþ°²×°µ¹ÏìӦĿ¼.ÅäÖúÃÏàÓ¦µÄodbcÊý¾ÝÔ´.
¡¡¡¡
¡¡¡¡³ÌÐòʵÏÖ:
¡¡¡¡Ê¹ÓÃ
¡¡¡¡use
Win32::ODBC;
¡¡¡¡
¡¡¡¡Óï¾ä°üº¬Ó¦Ê¹ÓõÄÄ£¿éÊÇwin32::odbc,д³öÊý¾Ý¿â
Á¬½Ó×Ö·û´®
¡¡¡¡
¡¡¡¡$DSN = "DSN =
My DSN ......

linux½ø³Ì¼äͨÐÅ·½Ê½Ö®ÄäÃû¹ÜµÀ

linuxµÄ½ø³Ì¼äͨÐÅ·½Ê½Ö÷ÒªÓУºÄäÃû¹ÜµÀ¡¢ÓÐÃû¹ÜµÀ¡¢ÏûÏ¢¶ÓÁС¢¹²ÏíÄÚ´æ¡¢Ðźš¢ÐźÅÁ¿¼°Ðźŵơ¢socketÍøÂçͨÐÅ¡£½üÈÕÓÉÓÚÏîÄ¿ÐèÒª£¬ÓÃlinux±àдarmµÄÓ¦ÓóÌÐò£¬ÀïÃæÓм¸¸ö¹¦ÄÜÄ£¿é£¬Èô¸É½ø³Ì£¬½ø³Ì¼äµÄͨÐÅ·½Ê½Ñ¡ÔñÁ˹ܵÀ¡¢¹²ÏíÄÚ´æºÍÐźÅÁ¿µÄÅäºÏ¡£Õ⼸ÌìÖÕÓڰѳÌÐòµÄ¿ò¼Ü´î½¨ºÃÁË£¬¶øÎÒÒ²¶Ô¹ÜµÀͨÐÅÓÐÁ˽øÒ»²½µÄÈÏʶ¡£ ......

redhat linux ÏÂFTPÅäÖÃ (¶þ)

redhat linux ÏÂFTPÅäÖá£(vsftp)
 
1.Æô¶¯vsftp£º /sbin/service vsftpd start  ±¸×¢d´ú±íÔÙºǫ́Æô¶¯¡£
2.²é¿´ÊÇ·ñÆô¶¯£¬¾ÍµÇ½µ½FTPÊÔÊÔ¡£ µÇ½FTP£ºftp localhost Í˳öFTP£ºbye
3.²é¿´Linux IP £ºifconfig
ÔÚ¿ØÖƹÜÀį́Ï¿ɿ´¼ûÈçÏ´úÂ룺¿ÉÒÔ¿´³ö£¬IP Address ÊÇ£º192.168.0.128
 
4.Èç¹û¾ÖÓòÍ ......

Linux²Ù×÷ϵͳÏÂÉèÖû·¾³±äÁ¿PathµÄ·½·¨

ÓÐÁ½ÖÖÉèÖû·¾³±äÁ¿ PATH µÄ·½·¨¡£µÚÒ»ÖÖÊÊÓÃÓÚΪµ¥Ò»Óû§ÉèÖà PATH£¬µÚ¶þÖÖÊÇΪȫ¾ÖÉèÖà PATH¡£
 
1.ÔÚÓû§Ö÷Ŀ¼ÏÂÓÐÒ»¸ö .bashrc Îļþ£¬¿ÉÒÔÔÚ´ËÎļþÖмÓÈë PATH µÄÉèÖÃÈçÏ£º
export PATH=”$PATH:/your path1/:/your path2/…..”
×¢Ò⣺ÿһ¸ö path Ö®¼äÒªÓà “:“ ·Ö¸ô¡£
× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ