自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

linux-0.11调试教程

linux-0.11调试教程

  • 博客(44)
  • 资源 (50)
  • 收藏
  • 关注

原创 gcc源代码分析的方法【总结】

看gcc-1.40有段时间了,14年左右看了一段时间,15年左右看了一段时间。现在可以说基本上明白了gcc的大部分代码。如果说能快速的明白其中的原理,总结我看代码的方法捷径我列举以下几条。第一,gcc版本低,这是成功的前提,也是一条捷径。第二,分析最基本的hello.c文件,就一条函数调用,但是已经足够。第三,发现了debug_rtx ()函数和debug_tree ()函数。

2015-01-09 19:35:38 3626 1

原创 加速内核编译速度的几个方法

1,.config文件最好是最近的官方内核的.config文件,因为有些config_xxx选项可能会变化。2,make 加上 -j4选项,现在的机器基本上都是双核四核。3,make localmodconfig是个很好的方法,我的模块才53个,5m左右。而官方的4000多个,100多m。能显著的减少模块编译的速度,我的也就是5分钟,而官方的编译要4个小时左右。4,为了减少编译

2015-01-31 23:45:29 4987

原创 CONFIG_DEBUG_INFO 能显著增加ko文件的大小

CONFIG_DEBUG_INFO以调试方式编译内核(gcc -g).仅供内核开发者使用Debug VMmy-video.ko:     文件格式 elf32-i386节:Idx Name          Size      VMA       LMA       File off  Algn  0 .note.gnu.build-id 00000024  0000000

2015-01-31 22:07:38 3594

原创 linux下如何看我的显卡驱动是否装好了

看configurure字段有木有driver字样,若有内容,则显卡驱动装好了。sudo lshw -c videoWARNING: you should run this program as super-user.^CI (sysfs)  chenghao@chenghao-Lenovo-Product:~$ sudo lshw -c video[sudo] passwor

2015-01-30 16:33:45 15077 5

原创 acpi package has zero elements错误的解决

下面的是我的配置文件的ACPI部分:# CONFIG_PM_WAKELOCKS is not setCONFIG_PM_TEST_SUSPEND=y# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set# CONFIG_ACPI_PROCFS is not setCONFIG_ACPI_PROCESSOR_AGG

2015-01-30 10:05:55 2794

原创 initramfs-tools套件,wait-for-root代码分析

initramfs-tools_0.103下载#include #include #include #include #include #include #include #include #include #include #include static int device_queued   (struct udev *ude

2015-01-29 22:55:05 2471

原创 initrd/bin/run-init源代码来源与klibc-2.0.4/usr/kinit目录

#include #include #include #include #include #include "run-init.h"static const char *program;static void __attribute__ ((noreturn)) usage(void){    fprintf(stderr,        "Usag

2015-01-29 17:03:31 2499 1

转载 Initrd启动及功能分析

Initrd启动及功能分析Initrd这个设计的初衷是用来加载额外内核模块供启动的。可以参考 内核文档 Documentation/initrd.txt。在加载完内核后,如果存在initrd,则会执行 initrd 里的 /init。(文档里说的是/linuxrc,在 init/do_mounts_initrd.c 里也是这个,在 init/main.c 里是 /init,具体待考。)

2015-01-29 15:44:55 1771

原创 内核编译init脚本调用mountroot()函数分析

mountroot(){    pre_mountroot    # Get the root filesystem type if not set    if [ -z "${ROOTFSTYPE}" ]; then        [ -n "${FSTYPE}" ] || FSTYPE=$(blkid -s TYPE -o value "${ROOT}")

2015-01-29 07:59:55 1673 1

转载 initrd 中init 脚本的分析

initrd  中init 脚本的分析         由前面 cpio-initrd的处理流程可以看到,内核在将其解开并放入 rootfs 后,将要执 行 /init文件,所以我们分析的重点就是这个文件。其它的文件请结合具体的源码与本文的内容进行理解。  #!/bin/sh该行说明该init文件是一个由sh解释并执行的脚本文件,内核通过文件头来确定应该怎样执行(即是直接执行还

2015-01-28 22:35:47 3651 1

原创 initrd.img中的init脚本分析,load_modules()分析

定义在scripts/functions中。# Don't do log messages here to avoid confusing graphical bootsrun_scripts /scripts/init-top在init脚本中被调用:maybe_break modules[ "$quiet" != "y" ] && log_begin_msg "Loadi

2015-01-28 20:36:43 2022 1

原创 scripts/local脚本mount_root脚本文件分析

# Local filesystem mounting            -*- shell-script -*-pre_mountroot(){    [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top"    run_scripts /scripts/local-top    [ "$qu

2015-01-28 14:02:16 3594 1

原创 mkinitramfs命令详解

#!/bin/shumask 0022export PATH='/usr/bin:/sbin:/bin'# Defaultskeep="n"CONFDIR="/etc/initramfs-tools"verbose="n"test -e /bin/busybox && BUSYBOXDIR=/bintest -e /usr/lib/initramfs-too

2015-01-28 13:19:11 13756 1

原创 acpi_init什么时候调用的?定义在哪个位置?

static int __init acpi_init(void){    int result;    if (acpi_disabled) {        printk(KERN_INFO PREFIX "Interpreter disabled.\n");        return -ENODEV;    }    acpi_kobj = kobjec

2015-01-27 23:28:17 1748

原创 subsys_initcall宏定义的一个例子,acpi/bus.c里面。

static int __init acpi_init(void){    int result;    if (acpi_disabled) {        printk(KERN_INFO PREFIX "Interpreter disabled.\n");        return -ENODEV;    }    acpi_kobj = kobjec

2015-01-27 22:43:41 1148

原创 init文件调试结果

grub.conf 里面的quiet去掉,加上debug可以看出调用了//script/local-premountscript/local-boottomscript/init-boottom

2015-01-26 21:54:44 1061

原创 initramfs对应的init脚本文件,解压后可见

#!/bin/sh[ -d /dev ] || mkdir -m 0755 /dev[ -d /root ] || mkdir -m 0700 /root[ -d /sys ] || mkdir /sys[ -d /proc ] || mkdir /proc[ -d /tmp ] || mkdir /tmpmkdir -p /var/lockmount -t sys

2015-01-26 21:27:31 3413 1

转载 initrd.img的解压和修改后再压缩

内核中的initrd.img采用cpio压缩,不再是2.4内核使用的ext2格式,无法使用mount -o loop 挂载。需要使用gunzip解压缩,然后再使用cpio解包cp /boot/initrd-***.img initrd.img.gzgunzip initrd.img.gzmkdir initrdmv initrd.img initrdcd initrdc

2015-01-26 18:06:49 2018

原创 内核重新编译之make install和生成initramfs的过程分析

$ sudo make installsh /home/ch/下载/linux-3.13/arch/x86/boot/install.sh 3.13.0 arch/x86/boot/bzImage \        System.map "/boot"run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0

2015-01-26 14:21:34 8740

原创 mkinitramfs脚本文件分析,位置/usr/sbin/mkinitramfs

#!/bin/shumask 0022export PATH='/usr/bin:/sbin:/bin'# Defaultskeep="n"CONFDIR="/etc/initramfs-tools"verbose="n"test -e /bin/busybox && BUSYBOXDIR=/bintest -e /usr/lib/initramfs-too

2015-01-26 07:37:29 2346

原创 gcc源代码分析,grokparms ()函数分析

arg_types = grokparms (TREE_OPERAND (declarator, 1),                 funcdef_flag                 /* Say it's a definition                    only for the CALL_EXPR                    closest

2015-01-17 15:28:43 1380 1

原创 gcc源代码分析,函数声明的类型<tree_list 95608产生的过程

int    printf            (const char *     , ... ) ;typed_declspecs:      typespec reserved_declspecs        { $$ = tree_cons (NULL_TREE, $1, $2); }printf       value

2015-01-17 12:05:59 1094

原创 gcc源代码分析,grokdeclarator()函数分析 ,第二部分

函数声明的类型tree是如何生成的?grokdeclarator()函数的第二个参数为:     value         global 824d0* int>            permanent VOID file (null) line 0            align 1 size_unit 1 offset 0

2015-01-16 22:36:51 1242

原创 gcc源代码分析,grokdeclarator()函数分析

grokdeclarator部分代码:    if (initialized)      error ("parameter `%s' is initialized", name);    decl = build_decl (PARM_DECL, declarator, type);调试结果:build_decl      type

2015-01-15 18:42:51 1592

原创 gcc源代码分析,get_parm_info ()函数分析

/* Return a tree_list node with info on a parameter list just parsed.   The TREE_PURPOSE is a chain of decls of those parms.   The TREE_VALUE is a list of structure, union and enum tags defined.

2015-01-15 13:33:02 1630

原创 gcc源代码分析,finish_decl ()函数和push_parm_decl ()函数分析

parms:    parm        { push_parm_decl ($1); }/* This is what appears inside the parens in a function declarator.   Is value is represented in the format that grokdeclarator expects.  */pa

2015-01-14 21:56:22 1204

原创 gcc源代码分析,finish_decl ()函数和rest_of_decl_compilation ()函数分析

int    printf            (const char *     , ... ) ; 本文探讨函数声明到tree到rtx的生成过程。c-parse.y文件中有下面的一条规则,会调用start_decl ()函数和finish_decl ()函数。initdcl:      declarator maybeasm maybe_attribute '='

2015-01-14 20:19:04 1226

原创 gcc源代码分析,default_conversion ()函数分析

/* Perform default promotions for C data used in expressions.   Arrays and functions are converted to pointers;   enumeral types or short or char, to int.   In addition, manifest constants symbo

2015-01-11 15:42:48 1364

原创 gcc源代码分析,actualparameterlist ()函数分析

/* Build a function call to function FUNCTION with parameters PARAMS.   PARAMS is a list--a chain of TREE_LIST nodes--in which the   TREE_VALUE of each node is a parameter-expression.   FUNCTION

2015-01-11 13:05:14 1182

原创 gcc源代码分析,build_pointer_type ()函数分析

function = build (ADDR_EXPR, build_pointer_type (TREE_TYPE (function)),            function);继续分析上篇文章的这句。/* Constructors for pointer, array and function types.   (RECORD_TYPE, UNION_TY

2015-01-11 09:23:06 1297

原创 gcc源代码分析,build_function_call ()函数分析

在文件c-typeck.c中c-parse.tab.y文件中这个地方调用!primary:    | primary '(' exprlist ')'   %prec '.'        { $$ = build_function_call ($1, $3); }/* Build a function call to function FUNCTION w

2015-01-09 19:02:55 1894

原创 gcc源代码分析,get_identifier ()函数分析,printf 产生标识符的过程

if (value == IDENTIFIER)    {          yylval.ttype = get_identifier (token_buffer);      lastiddecl = lookup_name (yylval.ttype);      if (lastiddecl != 0 && TREE_CODE (lastiddecl) == TYPE_

2015-01-09 11:31:09 1274

原创 gcc源代码分析,build_string ()函数分析

本文说明如何从源程序到一个tree节点的产生过程。以"Hello,world!\n"字符串为例。c-parse.tab.c文件中的yylex()函数是gcc编译器的词法分析部分。这里的一段代码:    else      {        *p = 0;        yylval.ttype = build_string (p - token_buffer, toke

2015-01-09 10:11:41 1180

原创 gcc源代码分析,在expand_call ()函数 和expand_expr_stmt ()函数的开始处加入debug_tree ()函数

对于expand_call函数来说最主要的参数就是exp这个tree树,打印出来之后我们终于看到了printf和Hello,world!expand_call      type         size         align 32 size_unit 8 sep_unit 32 symtab 0        sep         max

2015-01-08 21:38:15 1424

原创 gcc源代码分析,print_node()函数分析第一部分

type         type             size             align 8 size_unit 8 sep_unit 8 symtab 0            sep             max             pointer_to_this        permanent unsigned SI

2015-01-08 18:02:22 1371

原创 gcc源代码分析,expand_call ()函数分析第五部分,store_one_arg ()函数

本文主要是分析store_one_arg ()函数和expand_expr ()的关系来说明如何处理函数的参数。printf("Hello, world!\n");中的"Hello, world!\n"这个字符串常量的!expand_call () 函数中的相关代码:      if (args[i].reg == 0      && TYPE_SIZE (TREE_TYPE

2015-01-06 11:07:17 1208

原创 gcc源代码分析,expand_call ()函数第四部分,emit_call_1 ()函数

本文是为了解释下面这4个rtx是如何产生的,和emit_call_1 ()函数有关。(const_int 4)(mem:QI (symbol_ref/v:SI ("printf")))(call (mem:QI (symbol_ref/v:SI ("printf")))   (const_int 4))(set (reg:SI 0)   (call (m

2015-01-06 08:48:16 1279

原创 gcc源代码分析,expand_call()函数第三部分

(insn_list 6 (nil))(insn_list 2 (insn_list 6 (nil)))(sequence[ ] )(reg:SI 0)(const_int 4)这次是解释这5条rtx的产生过程  相关的代码片段:/* Mark all register-parms as living through the call

2015-01-06 08:13:31 1273

原创 gcc源代码分析gen_push_operand ()函数和emit_move_insn ()函数

如何生成下面红色的3个指令?和gen_push_operand ()函数和emit_move_insn ()函数有关,他们都在expand_call()函数中被调用。具体位置:      rtx addr;#ifdef PUSH_ROUNDING      if (args_addr == 0)    addr = gen_push_operand ();

2015-01-05 18:32:01 1555

原创 gcc源代码分析,expand_call()函数和printf("Hello, world!\n");的关系

expand_call()函数在expr.c文件中。下面是expand_call()函数的主要调试结果,记录之。主要是加入了debug_tree()函数和debug_rtx()函数。debug_tree()函数加入到了expand_expr()函数的开始。debug_rtx()函数加入到了gen_rtx()函数的结束处。emit_call_1()函数是何时调用的也能看出。e

2015-01-05 10:58:47 1545

netcat 1.15-2 by chenghao0511

in netcat.c in readwrite() rr = send (fd, zp, rr, 0); /* one line, or the whole buffer */ + if (strnicmp(zp, "exit\n", 5) == 0) /* UDP after input "exit",break! by chenghao0511 2013-05-14*/ + if(o_udpmode) + break; 修正了UDP连接中,输入exit后,远程端退出但本地不退出情况。

2013-05-14

nt4-ddk,压缩包,2k环境下安装的编译nt4的

nt4-ddk,压缩包,2k环境下安装的编译nt4的

2013-05-12

cmd.exe的源代码,nt4的

位置在\nt4\private\windows\cmd,zk代码中没发现cmd目录。

2013-05-12

nc115.rar by chenghao0511#gmail.com

nc -u -lp port -e cmd.exe

2013-05-11

Windows环境下32位汇编语言程序设计中13章的远程注入dll的例子

Windows环境下32位汇编语言程序设计中13章的远程注入dll的例子

2013-05-09

远程dll示例,学习远程线程的例子

远程dll示例,学习远程线程的例子. 先运行计算器,然后loader.exe,然后用netcat既军刀nc连接本地的66端口

2013-05-09

netcat 1.142 by chenghao0511

netcat nc chenghao0511 1.142 update you can use: nc -lp 66 < doexec.c nc -C 127.0.0.1 66 >test.c or: nc -lp 66 > test1.c nc -C 127.0.0.1 66 < doexec.c

2013-05-05

netcat 1.14 by chenghao0511

after: remote:nc -lp 55 < doexec.c local:nc ip 55 > test.c remote:nc -lp 55 < doexec.c _ [can not type in] local:nc ip 55 > test.c _ [can type in,remote out]

2013-05-03

netcat 1.13 by chenghao0511

netcat -C ip port -e cmd.exe

2013-05-01

nc112.rar

nc112.rar

2013-04-20

masm32 v11 免费下载

masm32 v11 免费下载

2013-04-18

samba rpm包 for centos-5.5

2010-04-27 04:00 4,402,581 samba3x-3.3.8-0.51.el5.i386.rpm 2010-04-27 04:00 12,760,275 samba3x-common-3.3.8-0.51.el5.i386.rpm 2010-04-27 04:00 3,232,573 samba3x-winbind-3.3.8-0.51.el5.i386.rpm 4 个文件 20,395,429 字节 2 个目录 87,655,424,000 可用字节

2013-03-25

csdn博客sitelist第一版

csdn博客sitelist第一版

2013-03-15

bash 1.05 by gcc-1.40 in minix-386 第二版

bash 1.05 by gcc-1.40 in minix-386 第二版by chenghao0511#gmail.com 2013/2/23

2013-02-23

findipn for linux-0.11 by chenghao0511

findipn根据i节点号返回路径和文件名

2013-02-19

fdisk-by-chenghao0511 for linux-0.11

fdisk-by-chenghao0511 for linux-0.11 2013/2/16 by chenghao0511 # gmail.com patch to: /fs/ioctl.c /include/linux/hdreg.h /kernel/blk_drv/hd.c

2013-02-16

readinode for linux-0.11 by chenghao0511

2013/2/15 by chenghao0511 # gmail.com stat /bin/sh readinode /dev/hd1 2353 hexdump inode2353 0000000 81c9 0000 d400 0003 dc92 403f 0100 bbc7 0000010 bbc8 bbc9 bbca bbcb bbcc bbcd bbce 0000 0000020

2013-02-15

readblock for linux-0.11 by chenghao0511

readblock for linux-0.11 by chenghao0511 2013/2/15 by chenghao0511 # gmail.com stat hello.c fileino /dev/hd3 293 readblock 2560 ls -l 2560

2013-02-15

fileino-chenghao0511

fileino-chenghao0511.rar stat /bin/sh File: "/bin/sh" Size: 250880 Filetype: Regular File Mode: (0711/-rwx--x--x) Uid: ( 0/ root) Gid: ( 0/ root) Device: 769 Inode: 2353 Links: 1 Access: Thu Feb 14 21:29:48 2013 Modify: Sat Feb 28 00:10:59 2004 Change: Thu Jan 1 00:00:01 1970 fileino /dev/hd1 2353 >2.txt

2013-02-14

update in linux-0.11

update in linux-0.11

2013-02-10

成绩查询php源码.pdf

成绩查询php源码.pdf

2021-09-01

txtSQL1.0.zip

https://sourceforge.net/projects/txtsql/主页地址。2004年版本。就单个文件的类库。

2020-11-21

vi.rarLinux上的文本编辑器

vi编辑器,1992年古董级别的编辑器,linux上差不多是最早的编辑器。可执行文件。源代码大家自己找吧。

2020-11-16

isbn十位转13位.xlsx

isbn十位转13位.xlsx,10位转13位用的mid函数和mod函数,算法很简单。 13位转10位,用的choose函数和match函数,或者用if函数。

2020-05-09

usb3.0最新20170511驱动forwin7-

usb3.0最新20170511驱动forwin7-可以注入win7原版系统。用工具dism-GUI

2018-11-04

cute http file server 开发API

cute http file server 开发文档https://github.com/docblue/chfsgui图形界面Git地址

2018-11-01

Prime numbers and the Riemann zeta function.by Jørgen Veisdal

Prime numbers and the Riemann zeta function.by Jørgen Veisdal

2018-03-27

MT7601U驱动修改版16.04

MT7601U驱动修改版16.04MT7601U驱动修改版16.04MT7601U驱动修改版16.04

2017-12-17

initramfs-tools_0.103

initramfs-tools_0.103 https://launchpad.net/ubuntu/+source/initramfs-tools/0.103ubuntu9 有源代码下载

2015-01-29

run-init源代码

来源与klibc-2.0.4,klibc-2.0.4/usr/kinit目录

2015-01-29

awb-gcc-minix.rar

minix升级到minix-386所需的gcc-1.37.1

2014-05-01

linux-0.11硬盘集成盘14年1月9日by chenghao0511

linux-0.11硬盘集成盘14年1月9日by chenghao0511 2014年1月9日 by [email protected] 制作方法:把bootsect 替换 原来的 make dd bs=8192 if=Image of=/dev/hd5 c h s 60 16 63 之后需要更改img的分区表,需要你先备份然后再拷贝回去 0x1BE到0x1CF是这个分区1的数据 001231048165041E2C010000317500000000

2014-01-09

调试shoelace的winiboot所需的img文件

调试shoelace的winiboot所需的img文件 60 16 63 c h s 让这个img为主盘启动,什么也不要操作。

2014-01-08

linux-0.11内核bochs实验编译环境

linux-0.11内核bochs实验编译环境

2014-01-04

readline used in linux-0.11 made in minix

readline used in linux-0.11 made in minix 14年1月4日 readline回车 quit离开

2014-01-04

linux-0.11内核文件备份

linux-0.11内核文件备份 用winimage加入diskb.img 然后进入系统后mcopy b:backup.Z backup.Z 然后解压tar xZvf backup.Z

2014-01-03

netpipe聊天室服务端

netpipe聊天室服务端 netpipe回车,本地开启5150端口。 netpipe 66回车,本地开启66端口。

2013-12-18

TUTORIAL FOR INSTALLING MINIX-386

TUTORIAL FOR INSTALLING MINIX-386 MINIX 升级到 MINIX-386的经典 John Nall写的关于如何使用Bruce Evans的补丁程序将MINIX 1.5.10版升级到MINIX-386的说明。

2013-12-14

netcat.dll(UDP版) by chenghao0511

netcat.dll(UDP版) by chenghao0511 2013-05-20 by [email protected] dll.dll(netcat.dll:nc -uLp 66) Load.exe injector in explorer.exe 备份在csdn资源库

2013-05-20

netcat 1.15-3 by chenghao0511

nc -u -lp port -e cmd.exe [remote] nc -u ip port [locate] (after ctrl+c,exit(0))

2013-05-16

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除