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

Linux Assembly "Hello World" Tutorial, CS 200

 
by Bjorn Chambless
Introduction
The following is designed familiarize the reader with programming in x86 (AT&T
style, that produced by gcc) assembly under Linux and how to interface assembly
and higher-level language code (i.e. C). The tutorial will also briefly cover
debugging your assembly using GDB.
This tutorial requires the following:
an i386 family PC running Linux
GCC, the GNU C-compiler
GDB, the GNU debugger command line debugger
The tutorial was developed on and tested with GCC version 2.95.4 and GDB 19990928 under Linux kernel 2.4.9
I highly recommend working through this tutorial with
"as"
and "gdb"

documentation close at hand.
Source Code
The process begins with a source code program. For example, hello.c
/* hello.c */
#include
main()
{
printf("hello\n").
}
which, when compiled and executed, prints a message
linuxbox> gcc -o hello hello.c
linuxbox> ./hello
hello
The actual compilation process can be viewed by including the -v
option
linuxbox> gcc -v -o hello hello.c
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20010902 (Debian prerelease)
/usr/lib/gcc-lib/i386-linux/2.95.4/cpp0 -lang-c -v -D__GNUC__=2
-D__GNUC_MINOR__=95 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__
-D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix)
-Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ hello.c
/tmp/ccCGCFmG.i
GNU CPP version 2.95.4 20010902 (Debian prerelease) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here: /usr/local/include
/usr/lib/gcc-lib/i386-linux/2.95.4/include /usr/include
End of search list.
The following default directories have been omitted from the search
path: /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../i386-linux/include
End of omitted list. /usr/lib/gcc-lib/i386-linux/2.95.4/cc1
/tm


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

LinuxÉ豸ģÐÍÖ®input×ÓϵͳÏê½â

Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......

Linux 2.6.19.x Äں˱àÒëÅäÖÃÑ¡Ïî¼ò½é

Linux 2.6.19.x Äں˱àÒëÅäÖÃÑ¡Ïî¼ò½é
×÷Õߣº½ð²½¹ú
Code maturity level options
´úÂë³ÉÊì¶ÈÑ¡Ïî
Prompt for development and/or incomplete code/drivers ÏÔʾÉÐÔÚ¿ª·¢ÖлòÉÐδÍê³ÉµÄ´úÂëÓëÇý¶¯.³ý·ÇÄãÊDzâÊÔÈËÔ±»òÕß¿ª·¢Õß,·ñÔòÇëÎðÑ¡Ôñ
General setup
³£¹æÉèÖÃ
Local version - append to kernel release ÔÚÄÚº ......

Linux¶¯Ì¬¿â(.so)ËÑË÷·¾¶

ÔÚLinux ÖУ¬¶¯Ì¬¿âµÄËÑË÷·¾¶³ýÁËĬÈϵÄËÑË÷·¾¶Í⣬»¹¿Éͨ¹ýÈýÖÖ·½·¨À´Ö¸¶¨£º·½·¨Ò»£ºÔÚÅäÖÃÎļþ/etc/ld.so.confÖÐÖ¸¶¨¶¯Ì¬¿âËÑË÷·¾¶£»·½·¨¶þ£ºÍ¨¹ý»·¾³±äÁ¿LD_LIBRARY_PATHÖ¸¶¨¶¯Ì¬¿âËÑË÷·¾¶£»·½·¨Èý£ºÔÚ±àÒëÄ¿±ê´úÂëʱָ¶¨¸Ã³ÌÐòµÄ¶¯Ì¬¿âËÑË÷·¾¶¡£
ÖÚËùÖÜÖª£¬Linux¶¯Ì¬¿âµÄĬÈÏËÑË÷·¾¶ÊÇ/libºÍ/usr/lib¡£¶¯Ì¬¿â±» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ