forked from yuan-xy/Linux-0.11
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
袁新宇
committed
Apr 30, 2012
1 parent
e3ed742
commit 8793585
Showing
6 changed files
with
83 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,35 @@ | ||
# This file is the Makefile Header for every sub Makefile, which designed to | ||
# simplfy the porting and maintaining operation | ||
# author: falcon <[email protected]> | ||
# update: 2008-10-29 | ||
|
||
AS = as --32 | ||
LD = ld | ||
#LDFLAGS = -m elf_i386 -x | ||
LDFLAGS = -m elf_i386 | ||
CC = gcc | ||
CFLAGS = -g -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer -fstrength-reduce #-Wall | ||
|
||
CPP = cpp -nostdinc | ||
AR = ar | ||
|
||
# we should use -fno-stack-protector with gcc 4.3 | ||
gcc_version=$(shell ls -l `which gcc` | tr '-' '\n' | tail -1) | ||
UNAME := $(shell uname) | ||
|
||
ifeq ($(UNAME), Linux) | ||
AS = as --32 | ||
LD = ld | ||
#LDFLAGS = -m elf_i386 -x | ||
LDFLAGS = -m elf_i386 | ||
CC = gcc | ||
CFLAGS = -g -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer -fstrength-reduce #-Wall | ||
|
||
CPP = cpp -nostdinc | ||
AR = ar | ||
STRIP = strip | ||
OBJCOPY = objcopy | ||
# we should use -fno-stack-protector with gcc 4.3 | ||
gcc_version=$(shell ls -l `which gcc` | tr '-' '\n' | tail -1) | ||
endif | ||
|
||
|
||
|
||
ifeq ($(UNAME), Darwin) | ||
AS = i386-elf-as --32 | ||
LD = i386-elf-ld | ||
#LDFLAGS = -m elf_i386 -x | ||
LDFLAGS = -m elf_i386 | ||
CC = i386-elf-gcc-4.3.2 | ||
CFLAGS = -gdwarf-2 -g3 -m32 -fno-builtin -fno-stack-protector -fomit-frame-pointer -fstrength-reduce #-Wall | ||
|
||
CPP = i386-elf-cpp-4.3.2 -nostdinc | ||
AR =i386-elf-ar | ||
STRIP = i386-elf-strip | ||
OBJCOPY = i386-elf-objcopy | ||
endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
Linux-0.11 | ||
========== | ||
|
||
The old Linux kernel source ver 0.11 which has been tested under modern Linux, Mac OSX and Windows. | ||
The old Linux kernel source ver 0.11 which has been tested under modern Linux, Mac OSX and Windows. | ||
|
||
1. Build on Linux | ||
|
||
1.1. Linux Setup | ||
|
||
* a linux distribution: debian , ubuntu and mint are recommended | ||
* some tools: gcc gdb qemu | ||
* a linux-0.11 hardware image file: hdc-0.11.img, please download it from http://www.oldlinux.org, or http://mirror.lzu.edu.cn/os/oldlinux.org/, ant put it in the root directory. | ||
|
||
1.2. hack linux-0.11 | ||
|
||
$ make help // get help | ||
$ make // compile | ||
$ make start // boot it on qemu | ||
$ make debug // debug it via qemu & gdb, you'd start gdb to connect it. | ||
|
||
$ gdb tools/system | ||
(gdb) target remote :1234 | ||
(gdb) b main | ||
(gdb) c | ||
|
||
|
||
2. Build on Mac OS X | ||
|
||
2.1. Mac OS X Setup | ||
|
||
* install qemu | ||
$ sudo port install qemu | ||
* install cross compiler gcc and binutils | ||
$ sudo port install i386-elf-binutils i386-elf-gcc qemu | ||
* install gdb. you need download the gdb source and compile it to use gdb because port doesn't provide i386-elf-gdb, or you can use the pre-compiled gdb in the tools directory. | ||
* a linux-0.11 hardware image file: hdc-0.11.img | ||
|
||
2.2. hack linux-0.11 | ||
|
||
same as section 1.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters