From 749f4e3f9351343fff1dad6d68d99049661712f6 Mon Sep 17 00:00:00 2001 From: yuchen Date: Sat, 7 Mar 2015 22:37:54 +0800 Subject: [PATCH] update related_info --- .gitignore | 1 + related_info/lab1/Makefile | 16 ++++++++++++---- related_info/lab1/lab1-ex0.md | 15 +++++++++++++++ related_info/lab1/{write.s => lab1-ex0.s} | 0 related_info/{lec2/hello.c => lab1/lab1-ex1.c} | 0 related_info/lab1/lab1-ex1.md | 12 ++++++++++++ related_info/lec2/Makefile | 8 -------- 7 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 related_info/lab1/lab1-ex0.md rename related_info/lab1/{write.s => lab1-ex0.s} (100%) rename related_info/{lec2/hello.c => lab1/lab1-ex1.c} (100%) create mode 100644 related_info/lab1/lab1-ex1.md delete mode 100644 related_info/lec2/Makefile diff --git a/.gitignore b/.gitignore index 2d7a07f..2332926 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ tags *.workspace a.out make.log +*.exe diff --git a/related_info/lab1/Makefile b/related_info/lab1/Makefile index e190775..d965aa9 100644 --- a/related_info/lab1/Makefile +++ b/related_info/lab1/Makefile @@ -1,6 +1,14 @@ -all: write +all: lab1-ex0.exe lab1-ex1.exe -write: defines.h write.s - gcc -o write write.s +lab1-ex0.exe: defines.h lab1-ex0.s + gcc -g -o lab1-ex0.exe lab1-ex0.s + +lab1-ex1.exe: lab1-ex1.c + echo "compile and watch the syscalls from lab1-ex1" + gcc -o lab1-ex1.exe lab1-ex1.c + strace -c ./lab1-ex1.exe + echo "watch the interrupts in linux" + more /proc/interrupts + clean: - rm write write.o + rm lab1-ex0.exe lab1-ex1.exe diff --git a/related_info/lab1/lab1-ex0.md b/related_info/lab1/lab1-ex0.md new file mode 100644 index 0000000..416c42d --- /dev/null +++ b/related_info/lab1/lab1-ex0.md @@ -0,0 +1,15 @@ +# +Try below command +``` +gcc -g -o lab1-ex0.exe lab1-ex0.s +``` +Then you will get lab1_ex0.exe + +Try to use below some tools to analysis lab1_ex0.exe +``` +objdump +nm +file + +``` +Try to understand the contents of this .s file. diff --git a/related_info/lab1/write.s b/related_info/lab1/lab1-ex0.s similarity index 100% rename from related_info/lab1/write.s rename to related_info/lab1/lab1-ex0.s diff --git a/related_info/lec2/hello.c b/related_info/lab1/lab1-ex1.c similarity index 100% rename from related_info/lec2/hello.c rename to related_info/lab1/lab1-ex1.c diff --git a/related_info/lab1/lab1-ex1.md b/related_info/lab1/lab1-ex1.md new file mode 100644 index 0000000..764b779 --- /dev/null +++ b/related_info/lab1/lab1-ex1.md @@ -0,0 +1,12 @@ +# +Try below command + +``` +echo "compile and watch the syscalls from lab1-ex1" +gcc -o lab1-ex1.exe lab1-ex1.c +strace -c ./lab1-ex1.exe +echo "watch the interrupts in linux" +more /proc/interrupts +``` + +Try to analysis the means of these output log. diff --git a/related_info/lec2/Makefile b/related_info/lec2/Makefile deleted file mode 100644 index 1c3bb74..0000000 --- a/related_info/lec2/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: hello.c - echo "compile and watch the syscalls from hello" - gcc -o hello hello.c - strace -c ./hello - echo "watch the interrupts in linux" - more /proc/interrupts -clean: - rm ./hello