1.Envirment:
Base:windown 7, vmware(ubuntu-18.04.1-live-server-amd64.iso), SecureCRT(ssh remote ubuntu), samba-server(see appendix), vscode IDE to read sourse, QEMU(download official site), TDMGCC(Using its GDB in command line debug).
Exteral: Eclipse
2.source download
link: https://github.com/yuanxinyu/Linux-0.11 (If you searching in bing.com, this is the NO. 1 result.)
3.Compile
The source could compile directly successful without modify anything in ubuntu-18.04-server.
4.Command line Debug
NOTE: Must copy the linux 0.11 project to windows disk, cannot in samba server, or not can't debug.
using qemu(download latest from official site).
Input command: (Cmd copy from source code Makefile,of cause you have to change a little.)
"C:\Program Files\qemu\qemu-system-x86_64.exe" -m 16M -boot a -fda Image -hda hdc-0.11.img -s
After input the command, the linux 0.11 would be running successfully.
If you want to debug step by step, just add -S , like following: (Note: qemu will be stop on starting, need more cmd.)
"C:\Program Files\qemu\qemu-system-x86_64.exe" -m 16M -boot a -fda Image -hda hdc-0.11.img -s -S
Open other cmd windows, then input:
F:\Linux-0.11-master>gdb Image
(gdb) target remote localhost:1234
(gdb) c
Then you would see the linux 0.11 is running successfully.
5.Eclipse Debug
Reference: https://blog.csdn.net/asdfdypro/article/details/44680813
Eclipse Edition:
download link: https://stackoverflow.com/questions/27418096/where-can-i-download-eclipse-android-bundle
1.New a C project.
2.Compile.
NOTE: Compile it must be in vmware, do not with eclipse.
3.Debug.
1.cmd window input:
"C:\Program Files\qemu\qemu-system-x86_64.exe" -m 16M -boot a -fda Image -hda hdc-0.11.img -s -S
2.Open the 'Configurations'
3.
Appendix 1 samba-server create
1 首先确认网络可以相互ping通。
2 终端输入:apt-get install samba
3 先备份 smb.conf 编辑配置,终端输入:
cd /etc/samba/
ls
cp smb.conf smb.conf-201x-xx-xx
4 nano /etc/samba/smb.conf 编辑配置文件
- 找到[homes]下 browseable = no, 把no 改成 yes, 因为只有这样,windows下才能通 过“计算机”看到“homes”共享目录。----至此,您已经能看到samba共享的目录了。
- 当然,以方便调试为目的,所以我们不需要共享homes文件,而是要共享整个根目录。 所以在[homes]这一段下加入一段,不要在[homes]这一段改,否则出错,一定要在下面加,如下:
[all]
comment = /
path = /
read only = no
接着在终端输入:testparm 此命令不但能检查参数是否正确,还能使配置立即生效, 不需要重启。
5 还要创建用户,不然只能看到有共享却无法登录。在终端输入:
smbpasswd -a root 然后就会提示输入密码,其实这个名字可以任意,这里用root是为 了方便记忆,因为我会用最高权限。----到这一步,你就可以登录到samba共享文件里 了。
6 (可以不要这一步)重启samba,终端输入: /etc/init.d/samba restart