linux϶¯Ì¬¿âÓ뾲̬¿â
ÌåÑéÒ»ÏÂlinuxϱàдºÍʹÓö¯Ì¬¿âÓ뾲̬¿â£¬·¶Àý£ºhelloworld³ÌÐò¡£
Ê×Ïȱàд¾²Ì¬¿â£º
hellos.h
#ifndef _HELLO_S_H
#define _HELLO_S_H
void prints(char *str);
#endif
hellos.c
#include "hellos.h"
#include <stdio.h>
void prints(char *str)
{
printf("print in static way:%s",str);
}
¿ªÊ¼±àÒë³É¾²Ì¬¿â£º
gcc -c -o hellos.o hellos.c
ar cqs libhellos.a hellos.o
main.c
#include "hellos.h"
int main(void)
{
char *text = "hello,world\n";
prints(text);
}
ʹÓþ²Ì¬¿â±àÒ룺gcc -o hello main.c -static -L. -lhellos
È»ºóÔËÐÐhello,Êä³ö£º
print in static way: Hello World!
ɾ³ý
libhellos.aºÍ
hellos.*ºó, ³ÌÐòÈÔÈ»Õý³£ÔËÐС£
±àд¶¯Ì¬¿â
£º
hellod.h
#ifndef _HELLO_D_H
#define _HELLO_D_H
void printd(char *str);
#endif
hellod.c
#include "hellod.h"
#include <stdio.h>
void printd(char *str)
{
printf("print in dynamic way:%s",str);
}
±àÒëÉú³É¶¯Ì¬¿â£ºgcc -shared -o libhellod.so hellod.c
ÕâÑù£¬libhellod.so¾ÍÊÇÉú³ÉµÄ¶¯Ì¬¿â¡£
export LD_LIBRARY_PATH=/root/program/link/dynamic/:$LD_LIBRARY_PATH£¬Ö¸¶¨¿âÎļþ·¾¶¡£
Èç¹ûϵͳװÁËSELINUXµÄ»°£¬ÒªÖ´ÐÐchcon -t textrel_shlib_t /root/program/link/dynamic/libhellod.so¸Ä±äȨÏÞ¡£
main.c
#include "hellod.h"
int main(void)
{
char *text = "hello,world\n";
printd(text);
}
gcc -o hello main.c -L./ -lhellod
È»ºóÔËÐÐhello¿ÉÒÔ¿´µ½Êä³ö
print in dynamic way: Hello World!
Èç¹ûɾ³ý¿âÎļþ£¬»á³öÏÖ£º./hello: error while loading shared libraries: libhellod.so: cannot open shared object file: No such file or directory
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
ÓÃPuTTYµÇ¼Linuxºó£¬ºº×ÖÏÔʾΪÂÒÂëµÄÁ½ÖÖ½â¾ö°ì·¨
×¢£º±¾ÎÄËùÊöLinuxΪredhat¡£
ÓÃPuTTYµÇ¼Linuxºóʱ£¬Ä¬ÈÏʹÓõÄÊÇutf-8×Ö·û¼¯£¬¶øÎÒÃdz£ÓõÄwin 2000¡¢xpϵͳʹÓõÄÊÇGBK×Ö·û¼¯£¬Õâ¾ÍÊÇÂÒÂëµÄÔÒò£¬°ï½â¾ö°ì·¨ÓÐÁ½ÖÖ£º
1£¬Ð޸Ŀͻ§¶ËÉèÖÃ
ÔÚPuTTYµÄReconfigration££TranslationÀïµÄcharacter setÀォ×Ö·û¼¯ÉèÖÃÎ ......
VMwar ......
linux/arch/i386/boot/compressed/head.S
ÔÚsetup()½áÊøºó£¬´Ëº¯Êý¾Í±»Òƶ¯µ½ÎïÀíµØÖ·0x00100000´¦»òÕß0x00001000´¦£¬ÕâÈ¡¾öÓÚÄÚºËÓ³ÏñÊDZ»¸ß×°ÔØµ½ramÖл¹ÊǵÍ×°ÔØµ½ramÖС£
½â¶Áº¯Êý£º
startup_32:
cld
cli
&n ......