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µÄ½ø³Ì¼äͨÐÅ·½Ê½Ö÷ÒªÓУºÄäÃû¹ÜµÀ¡¢ÓÐÃû¹ÜµÀ¡¢ÏûÏ¢¶ÓÁС¢¹²ÏíÄÚ´æ¡¢Ðźš¢ÐźÅÁ¿¼°Ðźŵơ¢socketÍøÂçͨÐÅ¡£½üÈÕÓÉÓÚÏîÄ¿ÐèÒª£¬ÓÃlinux±àдarmµÄÓ¦ÓóÌÐò£¬ÀïÃæÓм¸¸ö¹¦ÄÜÄ£¿é£¬Èô¸É½ø³Ì£¬½ø³Ì¼äµÄͨÐÅ·½Ê½Ñ¡ÔñÁ˹ܵÀ¡¢¹²ÏíÄÚ´æºÍÐźÅÁ¿µÄÅäºÏ¡£Õ⼸ÌìÖÕÓڰѳÌÐòµÄ¿ò¼Ü´î½¨ºÃÁË£¬¶øÎÒÒ²¶Ô¹ÜµÀͨÐÅÓÐÁ˽øÒ»²½µÄÈÏʶ¡£
......
ǶÈëʽLinuxÏ´®¿Ú±à³Ì
Ò»¡¢ÅäÖÃÄÚºË
ÔÚǶÈëʽLinuxϽøÐд®¿Ú±à³Ì֮ǰ£¬ÏÈÔÚÄÚºËÖÐÅäÖô®¿Ú²¿·Ö£¬ÈçÏ£º
Device Drivers--->
character devices--->
Serial drivers--->
&nb ......
ÆäʵÎÄÕÂËã²»ÉÏÔ´´£¬ÊÇÅöµ½ÎÊÌâµÄʱºòÉÏÍø¶«ËÑËÑÎ÷ËÑËѵÄÄÚÈÝ£¬ËãÊǽ軨Ï×·ðÁË°É£¬¸ÐлԴ´Õß¡£
1. °²×°ÐéÄâ»ú£¬ÎÒÓõÄÊÇÒ»¸öÂÌ»¯°æ¡£Ð½¨ÐéÄâ»úµÄ¹ý³ÌÈçÏ£º
Õª×Ô£ºhttp://blog.163.com/zongbin521/blog/static/10217990200981094622635/
ÎÒÃÇÒÔ´´½¨LINUXϵͳΪÀý¡£
µÚÒ»²½:Æô¶¯VMware£¬ÔÚÆäÖ÷½çÃæ“Ö÷Ò³” ......
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.Èç¹û¾ÖÓòÍ ......
·½·¨Ò»
mount -o iocharset=cp936 /dev/hda5 /mnt/d
·½·¨¶þ
rhel5 ¹ÒÔØ·ÇLinux·ÖÇøµÄ·½·¨
½ñÌìÖÕÓÚ°²×°ºÃÁËrhel5 client,ÔÚÅäÖÿª·¢»·¾³µÄʱºòÓöµ½Á˵ÚÒ»¸öÎÊÌ⣺µÇ¼ºó×ÀÃæÉÏûÓжÁµ½ÎÒµÄWindowsÎļþ·ÖÇø¡£ºÜ
¶à¹¤¾ß¶¼ÔÚÄÇÀï´æ×Å£¬ËùÒÔ£¬Ò»¶¨Òª°ÑËüÕÒ³öÀ´¡£
ÏÈÊÇÔÚÊéÉÏÕÒµ½Á˹ÒÔØÆäËü·ÖÇøµÄ·½·¨£¬ÔÚÖÕ¶ËÄÚÓà ......