FOS is an educational OS for Ain Shams University Operating Systems Course CSW355, forked and refactored from MIT Operating Systems Lab 6.828. It was created by Dr. Mahmoud Hossam and currently maintained by Dr. Ahmed Salah.
FOSv2 is the next version of FOS. It provides a much faster and better environment using other editing and virtualization tools.
- 1. What's Different?
- 2. Set up Environment
- 3. Setup Workspace
- 4. Debugging
- 5. Solve FOSv1 Assignments on FOSv2
- 6. Contribute
- No Eclipse! — Can be used with any text editor, defaults to Visual Studio Code.
- Uses QEMU instead of Bochs — QEMU is much faster, and needs less configuration files, also has better options.
- Independent source code — Separate the OS's code from its environment dependencies and build tools.
- No Leftovers — Remove JOS's leftovers from source code.
- Smaller size — Remove unused packages and files from the environment, 50% smaller than FOSv1.
- Open source — Allow contributions, improvements and bugs fixes, to make FOS better.
FOS needs an Linux environment to run as expected. For Windows users, the methods below try to mimic a Linux environment on Windows, choose any of them. For Linux users, just setup your environment as described below.
-
Linux-like Environment:
-
Toolchain:
- Download the
i386-elf-toolchain
for Windows. - Extract
i386-elf-toolchain-windows.rar
inC:\cygwin\opt\cross\
(create this folder if it doesn't exist).
- Download the
-
Emulator:
-
Update
PATH
:-
Add the following to your
PATH
environment variable:C:\Program Files\qemu C:\cygwin\bin C:\cygwin\opt\cross\bin
-
Requires Windows 10 build 16215+
The Windows Subsystem for Linux lets developers run a GNU/Linux environment including most command-line tools, utilities, and applications directly on Windows, unmodified, without the overhead of a virtual machine.
- Open Control Panel > Programs > Turn Windows Features on or off > Check "Windows Subsystem for Linux".
- From Microsoft Store, download Ubuntu.
- Launch Ubuntu from your start menu.
- Set up your environment as described below in the Linux section. (Install missing tools if any command wasn't found.)
# Required Packages
sudo apt-get update
sudo apt-get install build-essential qemu-system-i386 gdb libfl-dev
# Create directory
sudo mkdir /opt/cross
cd /opt/cross
# Install Toolchain
sudo wget https://github.com/YoussefRaafatNasry/fos-v2/releases/download/toolchain/i386-elf-toolchain-linux.tar.bz2
sudo tar xjf i386-elf-toolchain-linux.tar.bz2
sudo rm i386-elf-toolchain-linux.tar.bz2
# Update your PATH in your ~/.bashrc file.
echo 'export PATH="$PATH:/opt/cross/bin"' >> ~/.bashrc
- Download and Install Visual Studio Code.
- Download or Clone* this repo and Open it in VS Code
git clone https://github.com/YoussefRaafatNasry/fos-v2.git cd fos-v2/ code .
- Install all recommended extensions from the bottom right corner.
- Run the build task → Ctrl + Shift + B.
*Cloning is recommended to get the latest changes using
git pull
- Add breakpoints to your code.
- Start Debugging → F5.
- Fix your bugs!
FOSv2 has changed kern/Makefrag
in 8e2612dc
. This changes can cause errors after adding assignments' files (which usually conatin a kern/Makefrag
file made for FOSv1). To solve this issue:
- Copy the assignments' files into your FOSv2 project (choose overwrite if prompted).
- Open the new
kern/Makefrag
and replace these lines by those ones.
(or simply replace all occurences of$(OBJDIR)/kern/bochs.img
by$(IMAGE)
)