# oslab_final **Repository Path**: whxway/oslab_final ## Basic Information - **Project Name**: oslab_final - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-11 - **Last Updated**: 2021-12-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 操作系统大作业 ## 部分内容 `command` 内容: - attack.c 简化缓冲区溢出攻击,跳转到栈中执行while(1) - attack_2.c 改进缓冲区溢出攻击,屏幕输入:`000040000000000000000@00` - inject.c 修改 elf 文件 - pwd.c 运行崩溃 - rsa.c rsa算法实现 - ls.c ls 实现 - ps.c ps 实现 ## 功能说明 **默认开启文件校验以及DEP防护机制** - 鼠标灵敏度过高,在某些bochs版本中可能需要在bochs界面手动打开鼠标。 - 修改 `kernel/main.c` 中 `ENABLE_CHECKUSM` 关闭文件校验。 - 修改 `kernel/clock.c` 中 `ENABLE_DEP` 关闭 DEP 防护机制。 - 后台运行 ```shell $ command & ``` - 并发运行 ```shell $ command1 && command2 ``` ## 编译运行 ```shell make image bochs -q ``` ## GDB 调试 - 在编译 `bochs` 时: ```shell ./configure --enable-gdb-stub ``` 详细配置:[bochs 利用 gdb 调试](https://bochs.sourceforge.io/doc/docbook/user/debugging-with-gdb.html) - `shell1` 中 ```shell bochs -q -f bochsrc.gdb ``` - `shell2` 中 ```shell gdb --command=.gdbinit ``` ## 已知问题 已知一些 bug 由于时间关系不印象后续实验,所以没有修改。 - pwd 运行会崩溃 - 并发或者后台执行后,有概率出现无法返回shell的 bug,和 wait 函数 / wait 的利用有关。 - 注释掉 `kernel/main.c:389` 会导致程序卡死等问题出现。 ```c printf("backgroud : %d\n", back_ground); ```