Linuxϼ¸Àý×¥°ü³ÌÐò´úÂë
×¥°ü³ÌÐò1 grub_allpacket.c
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int sock, n,i;
char buffer[2048];
unsigned char *iphead, *ethhead;
struct ifreq ethreq;
if ( (sock=socket(PF_PACKET, SOCK_RAW,
htons(ETH_P_IP)))<0) {
perror("socket");
exit(1);
}
/* Set the network card in promiscuos mode */
strncpy(ethreq.ifr_name,"eth0",IFNAMSIZ);
if (ioctl(sock,SIOCGIFFLAGS,ðreq)==-1) {
perror("ioctl");
close(sock);
exit(1);
}
ethreq.ifr_flags|=IFF_PROMISC;
if (ioctl(sock,SIOCSIFFLAGS,ðreq)==-1) {
perror("ioctl");
close(sock);
exit(1);
}
while (1) {
printf("----------\n");
n = recvfrom(sock,buffer,2048,0,NULL,NULL);
printf("%d bytes read\n",n);
printf("the frame content is :\n");
for(i=0;i<n;)
{
printf("%02x",(unsigned char)buffer[i]);
fflush(stdout);
i=i+1;
if(i%8==0)
printf("\n");
else
printf(":");
}
printf("\n");
/* Check to see if the packet contains at least
&nbs
Ïà¹ØÎĵµ£º
×ÔÓÉÈí¼þ Linux Ö®¸¸£ºÀîÄÉ˹·ÍÐÎÖ×È(Linus Torvalds)
¡¡¡¡µ¼Ó28ËêµÄ·ÒÀ¼ÇàÄêÀîÄÉ˹´´ÔìÁËÒ»¸öȫеÄÊÀ½ç£º¾ÍÊÇÒ»ÖÖÃûΪLinuxµÄ²Ù×÷ϵͳ¡£ËüËù²úÉúµÄÁ¦Á¿¾ö¶¨Á˱à³ÌÁìÓòµÄзÕΧ£¬ÕýÈçÎÒÃǵĻ·¾³¾ö¶¨Á˶¯Ö²ÎïµÄÌØÐÔÒ»Ñù¡£´´Ôì¼ò½àÓÅÑŵijÌÐò£¬Ð´³ö¸É¾»¶øÎÞÈß³¤µÄ´úÂ룬»òÕßÊdz¬Ò»Á÷µÄ³ÌÐò£¬¾Í×ãÒÔÓ®µÃͬÐÐÃǵÄ×ð ......
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 yo ......
Load Bios
Read MBR's config to find out the os
Load the kernel of the os
init Process starts
execute /etc/rc.d /sysinit
start other modules (etc/modules.conf)
execute the run level scripts
execute /etc/rc.d/rc.local
execute /bin/login
shell started
......
¼¶
±ð£º Öм¶
M.
Tim Jones
, ×ÔÓÉ×÷¼Ò
2009 Äê 11 ÔÂ 19 ÈÕ
´¦ÀíÆ÷ÒѾÑݱä
ΪÕë¶ÔÐéÄâ»·¾³Ìá¸ßÐÔÄÜ£¬µ« I/O ·½Ãæ·¢ÉúÁËʲô±ä»¯ÄØ£¿Á˽âÒ»ÖÖÃûΪÉ豸£¨»ò PCI£©Í¸´«£¨passthrough£©µÄ I/O
ÐÔÄÜÔöÇ¿¼¼Êõ£¬ÕâÖÖ´´Ð¼¼Êõͨ¹ýʹÓÃÀ´×Ô Intel® (VT-d) »ò AMD (IOMMU) µÄÓ²¼þÖ§³Ö¸Ä½ø PCI Éè ......
ͨ¹ý±à¼/etc/inittabÀïµÄid:5:initdefault:ÕâÒ»Ðеİ¢À²®Êý×Ö£¬¿ÉʵÏÖÆô¶¯Ä£Ê½µÄת»»¡£ÀýÈ罫
id:5:initdefault:ÐÞ¸ÄΪid:3:initdefault:ÖØÐÂÆô¶¯ÏµÍ³ºó£¬ÎÒÃǿɿ´µ½ÔÀ´µÄX-WindowͼÐβÙ×÷½çÃæ×ª»»³ÉÁË
Console×Ö·û½çÃæ¡£
ÔÚ×Ö·û½çÃæÏ´òÈëÃüÁîstartx¿É½øÈëͼÐνçÃæ£¬Í¼ÐνçÃæÏ¼üÈëctrl+alt+backspace½øÈë×Ö·û½çÃæ¡ ......