摘要: 在头文件 <linux/kernel.h> 中定义了 【8种可用的日志级别字符串】KERN_EMERG 用于紧急事件消息,它们一般是系统崩溃之前提示的消息。KERN_ALERT 用于需要立即采取动作的情况。KERN_CRIT 临界状态,通常涉及严重的硬件或软件操作失败。KERN_ERR 用于报告错误状态;设备驱动程序会经常使用KERN_ERR来报告来自硬件的问题。KERN_WARNING 对可能出现问题的情况进行警告,这类情况通常不会对系统造成严重问题。KERN_NOTICE 有必要进行提示的正常情形。许多与安全相关的状况用这个级别进行汇报。KERN_INFO 提示性信息。很多驱动 阅读全文
posted @ 2011-10-15 22:17 Jack204 阅读(4021) 评论(0) 推荐(0) 编辑
摘要: 问题描述:1 You have a knapsack that has capacity (weight) C.2 You have several items I1,…,In.3 Each item Ij has a weight wj and a benefit bj.4 You want to place a certain number of copies(可以有重复) of each item Ij in the knapsack so that:5 The knapsack weight capacity is not exceeded and6 The total benefit 阅读全文
posted @ 2011-10-15 00:20 Jack204 阅读(516) 评论(0) 推荐(0) 编辑
摘要: ----------每周2晚上-----ACM--------------------逛论坛的时候------多去算法板块去转转,学习下大家提出来的问题---------------------10点半后晚上回来--------如果没有什么特别的节目需要去看的话,就去学习算法的一类问题(要理论联系实际)-----------加油!踏踏实实学习实实在在的知识,我行的。去实践,我就能成长! 阅读全文
posted @ 2011-10-14 23:37 Jack204 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 这次的基本配置主要包括: 调整emacs的c的编辑模式indent的长度,在.emacs中加入:(setq-default c-basic-offset 8 tab-width 8 indent-tabs-mode t) 调整color-theme,在将color-theme要求的安装包放到.emacs.d的customer的文件夹中,并将~/.emacs.d/customer加入emacs的load-path中,在~/.emacs中加入:(require 'color-theme) (color-theme-initi... 阅读全文
posted @ 2011-10-14 20:53 Jack204 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Init Call Mechanism in the Linux KernelBy Andrew MurrayIntroductionThe Linux kernel has for a long time (at least since v2.1.23) contained a clever and well-optimised mechanism for calling initialisation code in drivers. It's clever because its functionality is largely abstracted from the driver 阅读全文
posted @ 2011-10-12 16:32 Jack204 阅读(295) 评论(0) 推荐(0) 编辑
摘要: Kernel. EXPORT_SYMBOL解析Code Segment:include/module.h:struct kernel_symbol { unsigned long value; const char *name;};/* For every exported symbol, place a struct in the __ksymtab section */#define __EXPORT_SYMBOL(sym, sec) \ __CRC_SYMBOL(sym, sec) \ static const char __kstrtab_##sym[] \ __attribute__ 阅读全文
posted @ 2011-10-12 15:26 Jack204 阅读(837) 评论(0) 推荐(0) 编辑
摘要: 有很多种模式,我经常用的是 :real mode , protected mode.protected mode三卷手册上说的真是太好了,我没什么要说的直接intel vol3a 搞定。-------------小记录下real mode, 它的linear address = segment-address * 4 + logical-address.因为real mode没有page, 线性地址就是物理地址.-------------一个段大小为64k,所以segment-address = 01000h, 代表linear-address = 01000h * 4, 即使010000h下 阅读全文
posted @ 2011-10-10 22:02 Jack204 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 因为elf格式中不同的section,不同的segment有不同的作用。这里只是注重整体ELF的作用,具体详细的用到了再看。1 Elf files have a dual nature:Compilers, assemblers, and linkers treat the file as a set of logical sections described by a section header table.The system loader treats the file as a set of segments described by a program header table.2 阅读全文
posted @ 2011-10-09 23:45 Jack204 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 1 在没有操作系统时候写assembly的时候,stack的使用是很直接的,申请一块空间,并且在使用pop,push之前将esp赋值为stack空间的最高地址,直接汇编成纯的可执行代码就行。2 可是当在写有操作系统的assembly代码时候,需要按照操作系统中的assembly格式书写。并将assembly汇编成OS中指定的可执行文件的格式,才能够正确执行,因为在现在的操作系统中,执行这段汇编代码的时候已经是在保护模式中了。3 在写c代码的时候也是一个道理,在操作系统上运行c程序的时候,不妨以linux的elf文件为例,若为可执行文件的时候,文件中不包括stack空间。stack段是在加载进操 阅读全文
posted @ 2011-10-09 21:37 Jack204 阅读(369) 评论(0) 推荐(0) 编辑
摘要: 1 Request:method: GET, HEAD, POST.(...)Get --- Retrive Data.Head --- The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. (只有head,没有body)Post --- 上交数据。head:小组1:Accept --- certain media types which are acceptable for the response.Accept-Charset -- 阅读全文
posted @ 2011-10-09 19:41 Jack204 阅读(2351) 评论(0) 推荐(0) 编辑