Coder Social home page Coder Social logo

ahmadsayed / mentos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mentos-team/mentos

0.0 1.0 0.0 25.94 MB

An educational 32-bit linux-like Operating System.

Home Page: https://mentos-team.github.io/MentOS/

License: Other

CMake 2.74% C 94.10% Assembly 1.96% C++ 0.64% Objective-C 0.56%

mentos's Introduction

MentOS

forthebadge forthebadge forthebadge

What is MentOS

MentOS (Mentoring Operating system) is an open source educational operating system. The goal of MentOS is to provide a project environment that is realistic enough to show how a real Operating System work, yet simple enough that students can understand and modify it in significant ways.

There are so many operating systems, why did we write MentOS? It is true, there are a lot of education operating system, BUT how many of them follow the guideline de fined by Linux?

MentOS aims to have the same Linux's data structures and algorithms. It has a well-documented source code, and you can compile it on your laptop in a few seconds! If you are a beginner in Operating-System developing, perhaps MentOS is the right operating system to start with.

Developers

Main Developers:

Prerequisites

MentOS is compatible with the main Unix distribution operating systems. It has been tested with Ubuntu and MacOS, but specifically tested on Ubuntu 18.04.

For compiling the main system:

  • nasm
  • gcc
  • g++
  • make
  • cmake
  • git

To run and try:

  • qemu-system-i386

For debugging:

  • ccmake
  • cgdb
  • xterm

For MacOS, you have additional dependencies:

Prerequisites installation commands

For Ubuntu:

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y build-essential git cmake qemu-system-i386 
sudo apt-get install -y cgdb xterm #<- for debug only

For MacOS:

You need to install additionally the i386-elf cross-compiler. The simplest installation method is through Homebrew package manager. Install Homebrew if you don't already have and exec the following commands:

brew update && brew upgrade
brew tap nativeos/i386-elf-toolchain
brew install i386-elf-binutils i386-elf-gcc git cmake qemu nasm
brew install cgdb xterm #<- for debug only

Compiling MentOS

Compile and boot MentOS with qemu in Unix systems:

cd <clone_directory>
mkdir build
cd build
cmake ..
make
make qemu

If you want to access to the shell, use one of the usernames listed in files/passwd.

For MacOS, the steps are the same but instead of cmake .., you have to put an additional argument in order to use the i386-elf cross-compiler:

cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake ..

Change the scheduling algorithm

MentOS provides three different scheduling algorithms:

  • Round-Robin
  • Priority
  • Completely Fair Scheduling

If you want to change the scheduling algorithm:

cd build

# Round Robin scheduling algorithm
cmake -DSCHEDULER_TYPE=SCHEDULER_RR ..
# Priority scheduling algorithm
cmake -DSCHEDULER_TYPE=SCHEDULER_PRIORITY ..
# Completely Fair Scheduling algorithm
cmake -DSCHEDULER_TYPE=SCHEDULER_CFS ..

make
make qemu

Otherwise you can use ccmake:

cd build
cmake ..
ccmake ..

Now you should see something like this:

BUILD_DOCUMENTATION              ON
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX             /usr/local
DEBUGGING_TYPE                   DEBUG_STDIO
ENABLE_BUDDY_SYSTEM              OFF
SCHEDULER_TYPE                   SCHEDULER_RR

Select SCHEDULER_TYPE, and type Enter to scroll the three available algorithms (SCHEDULER_RR, SCHEDULER_PRIORITY, SCHEDULER_CFS). Afterwards,

type c
type g
make
make qemu

Enable to Buddy System

MentOS provides a Buddy System to manage the allocation and deallocation of page frames in the physical memory.

If you want to enable the MentOS's Buddy System:

cd build
cmake -DENABLE_BUDDY_SYSTEM=ON ..
make
make qemu

Otherwise you can use ccmake:

cd build
cmake ..
ccmake ..

Now you should see something like this:

BUILD_DOCUMENTATION              ON
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX             /usr/local
DEBUGGING_TYPE                   DEBUG_STDIO
ENABLE_BUDDY_SYSTEM              OFF
SCHEDULER_TYPE                   SCHEDULER_RR

Select ENABLE_BUDDY_SYSTEM, and type Enter. You should see something like this:

BUILD_DOCUMENTATION              ON
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX             /usr/local
DEBUGGING_TYPE                   DEBUG_STDIO
ENABLE_BUDDY_SYSTEM              ON
SCHEDULER_TYPE                   SCHEDULER_RR

Afterwards,

type c
type g
make
make qemu

Use Debugger

If you want to use GDB to debug MentOS:

cd build
cmake ..
make
make qemu-gdb

If you did everything correctly, you should have 3 windows with:

1) - Kernel Booting on qemu
2) - Shell with video printing of statistics previously discussed
3) - Debugger cgdb with code screening

mentos's People

Contributors

galfurian avatar mircodemarchi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.