update lab1_ans and README, README-chinese
This commit is contained in:
parent
89d1308e41
commit
3d394d3913
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,3 +9,5 @@ tags
|
|||||||
*swp
|
*swp
|
||||||
.cproject
|
.cproject
|
||||||
.project
|
.project
|
||||||
|
*.bak
|
||||||
|
*.org
|
||||||
|
27
README
27
README
@ -23,7 +23,8 @@ CONTENTS
|
|||||||
|
|
||||||
os course info
|
os course info
|
||||||
----------------
|
----------------
|
||||||
[os course summary materials](https://github.com/chyyuu/mooc_os)
|
* [newest os course summary materials](https://github.com/chyyuu/mooc_os)
|
||||||
|
* [newest chinese README for ucore_lab](https://github.com/chyyuu/ucore_lab/README-chinese.md)
|
||||||
|
|
||||||
labs info
|
labs info
|
||||||
----------------
|
----------------
|
||||||
@ -45,17 +46,17 @@ VirtualBox soft (https://www.virtualbox.org/) and a virtual disk image with all
|
|||||||
You can download this virtual disk image -- oslabs_for_student_2012.zip (576.2MB,) from http://pan.baidu.com/share/link?shareid=69868&uk=2585194235, which
|
You can download this virtual disk image -- oslabs_for_student_2012.zip (576.2MB,) from http://pan.baidu.com/share/link?shareid=69868&uk=2585194235, which
|
||||||
is an VirtualBox disk image (contains ubuntu 12.04 and needed softs, and is zipped with zip and xz format), and can be unzipped
|
is an VirtualBox disk image (contains ubuntu 12.04 and needed softs, and is zipped with zip and xz format), and can be unzipped
|
||||||
by haozip software (http://www.haozip.com).
|
by haozip software (http://www.haozip.com).
|
||||||
After unzip oslabs_for_student_2012.zip, you will get
|
After unzip oslabs_for_student_XXX.zip, you will get
|
||||||
---
|
---
|
||||||
C:\vms\ubuntu-12.04.vbox.xz
|
C:\vms\ubuntu-14.04.vbox.xz
|
||||||
C:\vms\ubuntu-12.04.vmdk.vmdk.xz
|
C:\vms\ubuntu-14.04.vmdk.vmdk.xz
|
||||||
C:\vms\ubuntu-12.04.vmdk-flat.vmdk.xz
|
C:\vms\ubuntu-14.04.vmdk-flat.vmdk.xz
|
||||||
---
|
---
|
||||||
then you will continue unzip all these files, and get
|
then you will continue unzip all these files, and get
|
||||||
---
|
---
|
||||||
C:\vms\ubuntu-12.04.vbox
|
C:\vms\ubuntu-14.04.vbox
|
||||||
C:\vms\ubuntu-12.04.vmdk.vmdk
|
C:\vms\ubuntu-14.04.vmdk.vmdk
|
||||||
C:\vms\ubuntu-12.04.vmdk-flat.vmdk
|
C:\vms\ubuntu-14.04.vmdk-flat.vmdk
|
||||||
---
|
---
|
||||||
If you installed VirtualBox soft, then the last step is: double clik file "ubuntu-12.04.vbox" and run ubuntu 12.04 in VirtualBox.
|
If you installed VirtualBox soft, then the last step is: double clik file "ubuntu-12.04.vbox" and run ubuntu 12.04 in VirtualBox.
|
||||||
In ubuntu 12.04 login Interface:
|
In ubuntu 12.04 login Interface:
|
||||||
@ -72,11 +73,11 @@ FEDORA 20: GCC-4.8.2
|
|||||||
EXERCISE STEPS
|
EXERCISE STEPS
|
||||||
==============
|
==============
|
||||||
0 Get the newest os lab src codes/docs.(Insure you can connect to github in ubuntu running on VrtualBox)
|
0 Get the newest os lab src codes/docs.(Insure you can connect to github in ubuntu running on VrtualBox)
|
||||||
0.1 If you try to get all codes/docs
|
0.1 If you try to get all codes
|
||||||
$rm -rf ucore_lab
|
$rm -rf ucore_lab
|
||||||
$git clone git://github.com/chyyuu/ucore_lab.git
|
$git clone git://github.com/chyyuu/ucore_lab.git
|
||||||
$cd ucore_lab
|
$cd ucore_lab
|
||||||
0.2 If you gloned ucore_lab and only try to get the updated codes/docs
|
0.2 If you gloned ucore_lab and only try to get the updated codes
|
||||||
$cd ucore_lab
|
$cd ucore_lab
|
||||||
$git pull
|
$git pull
|
||||||
1 $cd labX
|
1 $cd labX
|
||||||
@ -88,7 +89,11 @@ EXERCISE STEPS
|
|||||||
$make qemu
|
$make qemu
|
||||||
OR
|
OR
|
||||||
$make grade
|
$make grade
|
||||||
6 handin your code
|
|
||||||
|
6 debug your code
|
||||||
|
$make debug
|
||||||
|
|
||||||
|
7 handin your code
|
||||||
$make handin
|
$make handin
|
||||||
|
|
||||||
OPTION
|
OPTION
|
||||||
|
@ -96,7 +96,7 @@ ucore OS实验了。
|
|||||||
```
|
```
|
||||||
$ sudo apt-get update
|
$ sudo apt-get update
|
||||||
$ sudo apt-get upgrade
|
$ sudo apt-get upgrade
|
||||||
$ sudo apt-get install build-essential git qemu-system-x86 vim-gnome gdb make diffutils exuberant-ctags tmux openssh-server cscope meld
|
$ sudo apt-get install build-essential git qemu-system-x86 vim-gnome gdb cgdb eclipse-cdt make diffutils exuberant-ctags tmux openssh-server cscope meld
|
||||||
```
|
```
|
||||||
[NOTICE] 最小需要的安装包: build-essential git qemu-system-x86 gdb make diffutils
|
[NOTICE] 最小需要的安装包: build-essential git qemu-system-x86 gdb make diffutils
|
||||||
|
|
||||||
@ -114,8 +114,10 @@ ucore OS实验了。
|
|||||||
```
|
```
|
||||||
$cd labX #X为 1--8
|
$cd labX #X为 1--8
|
||||||
```
|
```
|
||||||
3. 阅读,修改源码,可以用understand软件或vim软件
|
3. 阅读,修改源码,可以用eclipse-cdt, understand, gedit或vim软件
|
||||||
```
|
```
|
||||||
|
$eclipse
|
||||||
|
OR
|
||||||
$understand
|
$understand
|
||||||
```
|
```
|
||||||
4. 修改完毕后,编译实验代码
|
4. 修改完毕后,编译实验代码
|
||||||
@ -126,7 +128,27 @@ ucore OS实验了。
|
|||||||
```
|
```
|
||||||
$make qemu
|
$make qemu
|
||||||
```
|
```
|
||||||
6. 可以运行如下命令,看看自己的得分
|
|
||||||
|
6. 如果需要调试,
|
||||||
|
a. 可基于cgdb的字符方式(以lab1_ans为例)
|
||||||
|
```
|
||||||
|
$cd labcodes_answer/lab1_ans
|
||||||
|
$make debug
|
||||||
|
```
|
||||||
|
可以看到弹出两个窗口,一个是qemu,一个是cgdb
|
||||||
|
可以看到在bootloader的bootmain函数处停了下来。
|
||||||
|
然后我们就可以进一步在cgdb中用gdb的命令进行调试了
|
||||||
|
```
|
||||||
|
(gdb)file bin/kernel #加载ucore kernel的符号信息
|
||||||
|
(gdb)break kern_init #在函数kern_init处(即 0x100000地址处)设置断点
|
||||||
|
(gdb)continue #继续执行
|
||||||
|
```
|
||||||
|
这时就可以看到在kern_init处停了下来,可进一步调试。
|
||||||
|
|
||||||
|
b. 基于eclipse-CDT的debug view进行调试,如果安装了zylin debug插件,则完成初步配置后,
|
||||||
|
也可很方便地进行调试。
|
||||||
|
|
||||||
|
7. 可以运行如下命令,看看自己的得分
|
||||||
$make grade
|
$make grade
|
||||||
|
|
||||||
# 相关资料
|
# 相关资料
|
||||||
@ -139,8 +161,8 @@ ucore OS实验了。
|
|||||||
|
|
||||||
## 希望了解OS设计与实现细节的同学
|
## 希望了解OS设计与实现细节的同学
|
||||||
|
|
||||||
. [OS实验资料](http://pan.baidu.com/s/1i3vbdXV)
|
. [OS实验资料](http://hejq.me/ucore_docs/)
|
||||||
. [OS实验代码](https://github.com/chyyuu/mooc_os_lab)
|
. [OS实验代码](https://github.com/chyyuu/ucore_lab)
|
||||||
. [OS MOOC公开课(实验部分)](http://www.topu.com/mooc/4100)
|
. [OS MOOC公开课(实验部分)](http://www.topu.com/mooc/4100)
|
||||||
|
|
||||||
## 希望自己动手实践OS的同学
|
## 希望自己动手实践OS的同学
|
||||||
|
@ -216,11 +216,11 @@ qemu-nox: $(UCOREIMG)
|
|||||||
$(V)$(QEMU) -serial mon:stdio -hda $< -nographic
|
$(V)$(QEMU) -serial mon:stdio -hda $< -nographic
|
||||||
TERMINAL :=gnome-terminal
|
TERMINAL :=gnome-terminal
|
||||||
gdb: $(UCOREIMG)
|
gdb: $(UCOREIMG)
|
||||||
$(V)$(QEMU) -S -s -parallel stdio -hda $< -serial null &
|
$(V)$(QEMU) -S -s -parallel stdio -hda $< -serial null
|
||||||
debug: $(UCOREIMG)
|
debug: $(UCOREIMG)
|
||||||
$(V)$(QEMU) -S -s -parallel stdio -hda $< -serial null &
|
$(V)$(QEMU) -S -s -parallel stdio -hda $< -serial null &
|
||||||
$(V)sleep 2
|
$(V)sleep 2
|
||||||
$(V)$(TERMINAL) --full-screen -e "gdb -tui -q -x tools/gdbinit"
|
$(V)$(TERMINAL) -e "cgdb -q -x tools/gdbinit"
|
||||||
|
|
||||||
debug-nox: $(UCOREIMG)
|
debug-nox: $(UCOREIMG)
|
||||||
$(V)$(QEMU) -S -s -serial mon:stdio -hda $< -nographic &
|
$(V)$(QEMU) -S -s -serial mon:stdio -hda $< -nographic &
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
file bin/kernel
|
|
||||||
file obj/bootblock.o
|
file obj/bootblock.o
|
||||||
target remote :1234
|
target remote :1234
|
||||||
break bootmain
|
break bootmain
|
||||||
break kern_init
|
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user