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

Linux϶ÁÓ²ÅÌÐòÁкŵijÌÐò


Linux϶ÁÓ²ÅÌÐòÁкŵijÌÐò
/*
* gethddsn.c
*
* Get serial number of ide hard disk.
* example: my Maxtor 15G 's s/n is K306S04C.
*
* Compile with: gcc -O2 gethddsn.c
*
* Xiaoming DONG <xmdong@263.net>
* Aug 24, 2000
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>  /* ioperm() */
#include <asm/io.h>  /* outb(), inb() */
/* get serial number */
int gethddsn(char *ide)
{
  unsigned int ide_info[257];
  unsigned int info_off;
  unsigned long loop2=0;
  int loop, loop1=0;
  if (ioperm(0x1f6, 1, 1)) {
    perror("ioperm"); exit(-1);
  }
  outb(0xa0, 0x1f6);
  if (ioperm(0x1f7, 1, 1)) {
    perror("ioperm"); exit(-1);
  }
  outb(0xec, 0x1f7);
  do {
    if (ioperm(0x1f7, 1, 1)) {
       perror("ioperm"); exit(-1);
    }
  } while (inb(0x1f7) != 0x58 && loop2++ < 0xffff);
  for (info_off=0; info_off != 256; info_off++) {
    if (ioperm(0x1f0, 2, 1)) {
     perror("ioperm"); exit(-1);
    }
    ide_info[info_off] = inw(0x1f0);
  }
  for (loop=10, loop1=0; loop<=19; loop++)
  {
    ide[loop1++] = (char)(ide_info[loop] / 256);
    ide[loop1++] = (char)(ide_info[loop] % 256);
  }
  ide[loop1] = 0;
  if (loop1 > 40) printf("*error*\n");
  return 0;
}
void main()  /* print hard disk number */
{
  static char serial[41];
  gethddsn(serial);
  printf("IDE hard disk s/n: %s\n", serial);
}
/* end of gethddsn.c */


Ïà¹ØÎĵµ£º

Linux/UNIXÃüÁîdd¼ò½é

http://linux.chinaunix.net/doc/system/2005-02-03/1086.shtml
dd ÊÇ Linux/UNIX
ϵÄÒ»¸ö·Ç³£ÓÐÓõÄÃüÁ×÷ÓÃÊÇÓÃÖ¸¶¨´óСµÄ¿é¿½±´Ò»¸öÎļþ£¬²¢ÔÚ¿½±´µÄͬʱ½øÐÐÖ¸¶¨µÄת»»¡£
dd µÄÖ÷ҪѡÏ
Ö¸¶¨Êý×ֵĵط½
ÈôÒÔÏÂÁÐ×Ö·û½áβ³ËÒÔÏàÓ¦µÄÊý×Ö:
b=512, c=1, k=1024, w=2, xm=number m
if=file
Êä
ÈëÎļþÃû£¬È±Ê ......

ÁèÑô½ÌÓýǶÈëʽLinuxÊîÆÚÇ¿»¯°à

½ü¼¸Ä꣬ǶÈëʽÐÐҵѸÃÍ·¢Õ¹£¬Ç¶Èëʽ¼¼ÊõÎÞ´¦²»ÔÚ£¬´ÓËæÉíЯ´øµÄmp3¡¢ÊÖ»ú¡¢PDAµ½¼ÒÍ¥Ö®ÖеÄÖÇÄܵçÊÓ¡¢ÖÇÄܱùÏä¡¢»ú¶¥ºÐ£¬ÔÙµ½¹¤ÒµÉú²ú¡¢ÓéÀÖÖеĻúÆ÷ÈË£¬ÎÞ²»²ÉÓÃǶÈëʽ¼¼Êõ¡£Õâµ¼ÖÂǶÈëʽÈ˲ÅÐèÇóҲѸËÙÔö¼Ó£¬Ç¶Èëʽ¿ª·¢ÒѳÉΪµ±Ç°×îÈÈÃÅ×îÓз¢Õ¹Ç°Í¾µÄÐÐÒµÖ®Ò»¡£Ç¶Èëʽ¿ª·¢ÈËÔ±µÄн×ÊҲˮÕÇ´¬¸ß£¬ÔÚ±±¾©£¬Ç¶Èëʽ³õ¼¶¹¤³Ì ......

ACEÔÚlinuxϵݲװ

±¾ÎÄÏêϸÃèÊöÁËÔÚLinux²Ù×÷ϵͳÉϰ²×°ºÍÅäÖÓ×ÔÊÊӦͨÐÅ»·¾³(ACE)”µÄ¹ý³ÌºÍ×¢ÒâÊÂÏî¡£zCkLinuxÁªÃË
ÎÄÖеÄÃèÊö»ùÓÚRedHat Linux 9²Ù×÷ϵͳºÍACE 5.4°æzCkLinuxÁªÃË
×¼±¸¹¤×÷£ºzCkLinuxÁªÃË
1.È·±£ÄãµÄLinux²Ù×÷ϵͳµÄ¿ª·¢»·¾³(gcc¡¢make……)ÊÇÍêÕûÇÒ¿ÉÓõġ£zCkLinuxÁªÃË
2.ÔÚ°²×°ACEµÄ¹ý³ÌÖÐ ......

Linux»·¾³½ø³Ì¼äͨÐÅ£¨¶þ£©: Ðźţ¨ÉÏ£©

Ò»¡¢Ðźż°ÐźÅÀ´Ô´
Ðźű¾ÖÊ
ÐźÅÊÇÔÚÈí¼þ²ã´ÎÉ϶ÔÖжϻúÖÆµÄÒ»ÖÖÄ£Ä⣬ÔÚÔ­ÀíÉÏ£¬Ò»¸ö½ø³ÌÊÕµ½Ò»¸öÐźÅÓë´¦ÀíÆ÷ÊÕµ½Ò»¸öÖжÏÇëÇó¿ÉÒÔ˵ÊÇÒ»ÑùµÄ¡£ÐźÅÊÇÒì²½µÄ£¬Ò»¸ö½ø³Ì²»±ØÍ¨¹ýÈκβÙ×÷À´µÈ´ýÐźŵĵ½´ï£¬ÊÂʵÉÏ£¬½ø³ÌÒ²²»ÖªµÀÐźŵ½µ×ʲôʱºòµ½´ï¡£
ÐźÅÊǽø³Ì¼äͨÐÅ»úÖÆÖÐΨһµÄÒ첽ͨÐÅ»úÖÆ£¬¿ÉÒÔ¿´×÷ÊÇÒì²½Í¨Ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ