Linux-0.11 compile

Linux-0.11 编译

参考链接: 泰晓科技

编译环境

cat /etc/issue
Ubuntu 14.04.2 LTS
uname -a
Linux wonfee-ThinkPad-T540p 3.16.7-ckt5my-very-own-kernel #1 SMP Fri Feb 27 23:04:29 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
gcc -v
gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-8ubuntu1)
qemu-x86_64 -version
qemu-x86_64 version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.10), Copyright (c) 2003-2008 Fabrice Bellard 

下载:

git clone https://gitlab.com/tinylab/linux-0.11.git

编译:

cd linux-0.11 && make

硬盘启动:

make start-hd

硬盘启动调试:

make debug-hd
gdb images/kernel.sym
(gdb) target remote :1234
(gdb) b main
(gdb) c

查阅文档
[README.md]

 make help 
<<<<This is the basic help info of linux-0.11>>>

Usage:
     make --generate a kernel floppy Image with a fs on hda1
     make start -- start the kernel in vm (qemu/bochs)
     make start-fd -- start the kernel with fs in floppy
     make start-hd -- start the kernel with fs in hard disk
     make debug -- debug the kernel in qemu/bochs & gdb at port 1234
     make debug-fd -- debug the kernel with fs in floppy
     make debug-hd -- debug the kernel with fs in hard disk
     make disk  -- generate a kernel Image & copy it to floppy
     make cscope -- genereate the cscope index databases
     make tags -- generate the tag file
     make cg -- generate callgraph of the default main entry
     make cg f=func d=dir|file b=browser -- generate callgraph of func in file/directory
     make clean -- clean the object files
     make distclean -- only keep the source code files

Note!:
     * You need to install the following basic tools:
          ubuntu|debian, qemu|bochs, ctags, cscope, calltree, cflow, graphviz 
          vim-full, build-essential, hex, dd, gcc 4.3.2...
     * Becarefull to change the compiling options, which will heavily
     influence the compiling procedure and running result.

Author:
     * 1991, linus write and release the original linux 0.95(linux 0.11).
     * 2005, jiong.zhao<gohigh@sh163.net> release a new version 
     which can be used in RedHat 9 along with the book 'Explaining 
     Linux-0.11 Completly', and he build a site http://www.oldlinux.org
     * 2008, falcon<wuzhangjin@gmail.com> release a new version which can be
     used in ubuntu|debian 32bit|64bit with gcc 4.3.2, and give some new 
     features for experimenting. such as this help info, boot/bootsect.s and
     boot/setup.s with AT&T rewritting, porting to gcc 4.3.2 :-)
     * 2011, tigercn<moonlight.yang@gmail.com> port to new system and gcc.
     * 2012, yuanxinyu<yuanxinyu.hangzhou@gmail.com> add Mac OS X support.
     * 2015, falcon <wuzhangjin@gmail.com> back reorganize and maintain it.

<<<Be Happy To Play With It :-)>>>

生成函数调用关系图:

sudo apt-get install graphviz
make cg
display callgraph/main.__init_main_c.svg