style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-5935214489160196"
data-ad-slot="8007533899">

Linux上的核心訊息紀錄機制解析

sys_get_kernel_syms “struct kernel_sym *table”,User-ModeSystem Call,table0,table0,for for (mod = module_list, i = 0; […]

剖析Linux上的kHttpd網頁伺服

int MainDaemon(void *cpu_poing)MainDaemon0MainDaemon1QueueManagement DaemonMainDaemonint WaitForHeaders(CPUNR)(waitqueue_decode.bmp) int WaitForHeaders(CPUNR) 1.Http Request 2.kHttpdUser Mode Web Server int WaitForHeaders(CPUNR) 2DecodeHeader 4~8IsForUserSpace!=0UserspaceQueue 9~12IsForUserSpace==0DataSendingQueue static int DecodeHeader(const int CPUNR, struct http_request *Request) 2http 3URL 4Mime 5~10MimeUser Mode Web ServerIsForUserSpace 11~15URLUser Mode Web ServerIsForUserSpace 16~28kHttpdkHttpd 18~22cache 23~27ClientcacheClientcache (Request)MainDaemonint WaitForHeaders(CPUNR) 1.ClientcacheMainDaemon(stack_send_httpdheader.bmp)Send304()SendBuffer() 2.MainDaemonSendHTTPHeader(Request)HTTPDataSending(CPUNR)SendBuffer_async()(stack_send_httpheader.bmp) 3.MainDaemonint Userspace(const int CPUNR)User Mode Web Server int Userspace(const int CPUNR) 2AddSocketToAcceptQueueUser Mode Web Server 4User Mode Web Server 8~9User Mode Web ServerHttp static int AddSocketToAcceptQueue(struct socket *sock,const int Port) User Mode Web ServerUser Mode Web Server 4.kHttpd key inkHttpd(stop)(MainDaemon.bmp)sysctl_khttpd_stop1MainDaemon0MainDaemon1Management Daemonkey in(unload)(managementdaemon.bmp)Management Daemon 5. […]

CramFS在Linux嵌入式環境的應用

LinuxLinux KernelLinux Kernel LinuxLinuxLinuxRAMDISKRAMDISKRAMDISK RAMDISK50%8MBFlashEmbedded QTSendMail ServerApache Server……16MB8MBFlashLinuxLinux16MBRAMDISK8MB Flash16MB RAMDISK16 MB8MBFlash LinuxCramFS CramFSLinus TorvaldsTransmetaLinux Kernel2.4.3Linux Kernellinux/fs/cramfsCramFSCramFSCramFSFlash CramFSRAMDISK8MBFlashFlashCramFSCramFSRAMDISKPII 350 RAMDISKCramFSRAMDISKRAMDISKLinux Kernel RAMDISK CramFSCramFSRAMDISK CramFS CramFSCramFS Compressed ROM file system support (CONFIG_CRAMFS) CramFSModuleCramFSLinux LinuxPDACramFSX86X86CramFSCramFS Linux linux/scripts/cramfsmkcramfs make mkcramfsmkcramfsLinuxCramFSCramFSmkcramfsSuperblock……CramFSCramFS CramFSCramFSSuperblock76 bytesCramFSinodecramfs_inode12 bytescramfs_inodecramfs_inode0x00 cramfs_inode + 4040cramfs_inode cramfs_inode + + cramfs_inode + + cramfs_inode + ……..CramFS CramFS CramFScheck_cramfsCramFScramfs_supercramfs_inodeSuperblockinode # ./check_cramfs /dev/hdc2 file len:835584 bytes size of superblock:76 bytes Suprtblock =============== magic:28cd3d45h size:10000h flags:0h future:0h signature: 43 6f 6d 70 72 65 73 73 C o m p r e s s 65 64 20 52 4f 4d 46 53 e d R O M F S fsid: 1b 27 36 d8 ce f2 43 f6 ‘ 6 C 0d 4c 90 17 09 b7 04 d4 L name: 43 6f 6d 70 72 65 73 73 C o m p r e s s 65 64 00 00 00 00 00 00 e d mode:41edh uid:0h size:188 gid:0h namelen:0 offset:19 mode:41edh uid:0h size:0 gid:0h namelen:3 offset:0 lost+found mode:41edh uid:0h size:1208 gid:0h namelen:1 offset:66 bin mode:45edh uid:0h size:3536 gid:f4h namelen:1 offset:368 dev mode:45edh uid:0h size:264 gid:f4h namelen:1 offset:1252 etc mode:41edh uid:0h size:184 gid:0h namelen:1 offset:1330 lib mode:a1ffh uid:0h size:9 gid:0h namelen:2 offset:163260 linuxrc mode:45edh uid:0h size:0 gid:f4h namelen:1 offset:0 proc mode:45edh uid:0h size:176 gid:f4h namelen:1 offset:1376 sbin mode:41edh uid:0h size:0 gid:0h namelen:1 offset:0 tmp mode:45edh uid:0h size:0 gid:f4h namelen:1 offset:0 usr mode:41edh uid:0h size:0 gid:0h namelen:1 offset:0 var magiccramfs.h #define CRAMFS_MAGIC 0x28cd3d45 magic0x28cd3d45size Superblockname C o m p r e s s e d Superblock struct cramfs_inode root; […]