All Projects → aksudya → nachos

aksudya / nachos

Licence: other
Nachos XMU操作系统课程实验

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects
c
50402 projects - #5 most used programming language
assembly
5116 projects

Projects that are alternatives of or similar to nachos

OperatingSystem
PKU OS course project and notes based on Nachos and XV6
Stars: ✭ 118 (+280.65%)
Mutual labels:  operating-system, nachos
WacOS
A Linux distribution that mimics MacOS (modern and classic) iOS, and other Apple operating systems, but is open, customizable, and free to use on non-apple hardware.
Stars: ✭ 18 (-41.94%)
Mutual labels:  operating-system
cxos
Operating System development experiment in Ada
Stars: ✭ 32 (+3.23%)
Mutual labels:  operating-system
TravorOS
A simple OS running on Intel x86 architecture | No longer updating
Stars: ✭ 24 (-22.58%)
Mutual labels:  operating-system
poplar
Microkernel and userspace written in Rust exploring modern ideas
Stars: ✭ 217 (+600%)
Mutual labels:  operating-system
KnutOS
An x86_64 hobbyist OS written in C and Assembly
Stars: ✭ 16 (-48.39%)
Mutual labels:  operating-system
aero
Aero is a new modern, experimental, unix-like operating system following the monolithic kernel design. Supporting modern PC features such as long mode, 5-level paging, and SMP (multicore), to name a few.
Stars: ✭ 407 (+1212.9%)
Mutual labels:  operating-system
NightOS
A highly secure, performant and robust operating system for the future 🌔 🚀
Stars: ✭ 15 (-51.61%)
Mutual labels:  operating-system
flower
A learning OS
Stars: ✭ 50 (+61.29%)
Mutual labels:  operating-system
OpenHarmony
华为鸿蒙分布式操作系统(Huawei OpenHarmony)开发技术交流,鸿蒙技术资料,手册,指南,共建国产操作系统万物互联新生态。
Stars: ✭ 373 (+1103.23%)
Mutual labels:  operating-system
Operating-Systems-Notes
📚 Compendium of all the important OS concepts and key points. https://applied-programming.github.io/Operating-Systems-Notes/
Stars: ✭ 273 (+780.65%)
Mutual labels:  operating-system
TomatOS-old
TomatOS
Stars: ✭ 12 (-61.29%)
Mutual labels:  operating-system
WindowsIoTEverywhere
Images & drivers to get WIndows 10 IoT running on off-the-shelf tablets, mini-pcs, and various computers.
Stars: ✭ 23 (-25.81%)
Mutual labels:  operating-system
scaraOS
A 32bit multiboot OS kernel for IA32 (PC/AT) systems.
Stars: ✭ 31 (+0%)
Mutual labels:  operating-system
rCore-Tutorial-v3
Let's write an OS which can run on RISC-V in Rust from scratch!
Stars: ✭ 470 (+1416.13%)
Mutual labels:  operating-system
Methylenix
The operating system written in Rust
Stars: ✭ 32 (+3.23%)
Mutual labels:  operating-system
SimpleOS
Operating System Coded in Assembly and C
Stars: ✭ 72 (+132.26%)
Mutual labels:  operating-system
operatingsystem
操作系统复习:知识整理
Stars: ✭ 17 (-45.16%)
Mutual labels:  operating-system
rnk
rnk is a RTOS targeting ARM architecture.
Stars: ✭ 22 (-29.03%)
Mutual labels:  operating-system
infinity
A secure, modern and intelligent operative system
Stars: ✭ 27 (-12.9%)
Mutual labels:  operating-system

nachos

操作系统课程实验

此处为实验三代码

lab1分支为实验一代码

lab2分支为实验二代码

lab3_beta分支为完整版实验三代码

此代码为code文件夹中的内容

因为存在符号链接的问题,直接下载后替换code文件夹中的内容可能会导致编译错误。

建议参考此代码对你的原文件直接进行修改

所有代码均在ubuntu 18.04上编译测试

在每次实验做完后会将代码合并到master

要查看其它实验请切换分支或点击上面的链接查看

实验三已合并

如果有其他问题或者需要详细实验报告的可以邮件联系我


实验三代码
lab3_beta分支处代码实验三已更新完毕
lab3分支处代码为另外一种电梯调度算法,仅实现了单个容量有限的电梯,没实现多个电梯

两种算法区别如下:

lab3_beta算法:

电梯获取当前方向要去的最高(或最低)楼层,然后在上升(或下降)过程中检测当前楼层是否有请求,若有请求则停下。

lab3算法:

电梯实时(每上升或下降一层)检测并计算下一个要去的楼层,然后向那个楼层移动。

对于单个电梯,两种算法的运行效果相同,但是对于多个电梯,lab3分支所使用的算法不好实现运行也不直观,故采用lab3_beta所使用的算法


使用方法:编译后cd到threads目录下使用

1. 测试eventbarrier

./nachos -e

2. 测试alarm

./nachos -g

3. 测试bridge

./nachos -h

切换算法方法:

在Bridge.h头文件中修改宏定义

#define FCFS                  //先来先服务算法
#define ONE_DIRECTION         //同方向优化算法
#define BASIC_TRAFFIC_LIGHT   //基础版红绿灯算法
#define ADV_TRAFFIC_LIGHT     //改进版红绿灯算法(动态调节)

将除你想测试的算法之外的宏定义注释掉即可

在threadtest.cc文件中可以修改对应的测试参数

int Total_num=100;            //总测试的车辆数
int direc_0_percent=3;        //0方向来的车占的比例,	x/10
int random_come_time = 10;    //车辆生成的随机时间间隔 即random()%x

可对bridge进行不同测试

4. 测试elevator

./nachos -i

切换算法方法:

选择你想要测试的算法并注释掉其他的宏定义即可

可在Elevator.h文件中修改宏定义选择运行模式

#define SINGLE_ELEVATOR
#define MULTIPLE_ELEVATOR				//选择单个或多个电梯

#define BOUNDED_ELEVATOR
#define UNBOUNDED_ELEVATOR				//选择电梯容量是否有限

在Elevator.h文件中可以修改对应的测试参数

#define OPEN_AND_CLOSE_DOOR     20		//电梯开关门的时间
#define RIDER_ENTER_OUT         10		//一个乘客进出电梯的时间
#define ELEVATOR_MOVE_ONE_FLOOR 40		//电梯移动一层楼的时间
#define ELEVATOR_CAPACITY		5		//电梯容量

在threadtest.cc文件中可以修改对应的测试参数

int num_floors = 5;						//楼层数
int total_riders = 50;					//生成的总乘客数
int E_random_come_time = 5;				//乘客生成的随机时间间隔 即random()%x
int elevator_num=5;						//电梯个数(测试单个电梯时此参数无效)

可对bridge进行不同测试

2018/4/16 更新

开始做实验三

2018/4/17 更新

实现eventbarrier并进行了测试

2018/4/23更新

实现alarm并测试

2018/4/27更新

实现bridge的先来先服务算法及同方向优化算法并进行了测试

2018/5/1更新

使用instance单例对alarm及bridge进行了重构

2018/5/6更新

实现并测试了bridge的基本红绿灯算法以及动态调度的红绿灯算法

2018/5/19更新

实现并测试了Elevator的使用SCAN算法的单个无限容量电梯和单个有限容量电梯的调度策略

2018/5/22更新

简化电梯的调度算法

2018/6/9更新

完成并测试多个电梯调度算法

2018/6/15更新

修改电梯调度算法的错误

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].