Operating System Project
Winter Semester (2024-25)
TEAM MEMBERS
1. Aditya Kumar Singh – 23JE0050
2. Aditya Vikram Chaudhary – 23JE0056
3. Agrawal Dhruv – 23JE0060
4. Allimalli Teja Venkata Durga Manikanta – 23JE0077
5. Amaram Rushi Vivek – 23JE0085
6. Amgoth Pavan Nayak – 23JE0089
7. Anirban Das – 23JE0104
8. Anish Asthana – 23JE0105
CUSTOM GAMING OS Enhancing Graphics,
Emulation, and Audio
BASED ON SERENITYOS Processing
CUSTOM GAMING OS
Base: SerenityOS Source Code: SerenityOS Documentation: SerenityOS
https://serenityos.org GitHub Wiki
https://serenityos.org
https://github.com/Serenity https://github.com/Serenity
https://github.com/SerenityOS/serenity https://github.com/SerenityOS/serenity/wiki
OS/serenity OS/serenity/wiki
https://github.com/SerenityOS/serenity https://github.com/SerenityOS/serenity/wiki
Modification Goals:
1. Integrate an emulator for 2. Add audio processing 3. Enhance graphics drivers
retro games. libraries for game for gaming support.
soundtracks.
PROGRESS UPDATE
GitHub: https://github.com/anirban2005143a/OS-Project--Serenity-OS
- Successfully built the Custom Gaming OS
based on SerenityOS.
- Ongoing work on porting a retro gaming
emulator (SameBoy).
1. The OS is fully functional and
running on QEMU.
- Current Status:
2. Facing issues in reflecting the
changes made in the SameBoy
Port in the actual OS.
Running
EXPLORING
SerenityOS on
QEMU – A Step- SERENITYOS: SETUP
by-Step Journey
AND FIRST LOOK
SERENITYOS IS A WRITTEN IN C++,
MODERN, OPEN-SOURCE DESIGNED FOR
OS INSPIRED BY RETRO DEVELOPERS & OS
WHAT IS DESKTOPS. ENTHUSIASTS.
SERENITYOS?
LIGHTWEIGHT GUI WITH FOCUS ON SIMPLICITY,
BUILT-IN APPS (TEXT ELEGANCE, AND
EDITOR, TERMINAL, LEARNING.
BROWSER).
MINIMUM: DUAL-CORE RECOMMENDED: QUAD-
CPU, 4GB RAM, ~10GB CORE CPU, 8GB+ RAM,
DISK SPACE. SSD FOR FASTER BUILDS.
SYSTEM
REQUIREMENTS
SETUP ENVIRONMENT:
HIGH-END LAPTOP WITH
MULTI-CORE CPU.
GitHub Repo:
1. Clone the https://github.com
repository: /SerenityOS/sere
nity
2. Install Meta/serenity.sh
dependencies: install-system-
dependencies
STEPS TO SET
UP 3. Rebuild
toolchains:
Meta/serenity.sh
rebuild-toolchain
SERENITYOS
4. Build Meta/serenity.sh
SerenityOS: build
5. Run in QEMU: Meta/serenity.sh
run
CHALLENGES Issues: Missing C++ toolchain, CMake error
(Ninja), Clang build freezing.
FACED Solutions: Installed Ninja (ninja-build
package), used prebuilt toolchains, cleaned
up failed builds.
Successfully launched in QEMU.
RUNNING Features visible:
SERENITYOS - GUI with taskbar and icons.
- Open applications (browser, terminal, file
manager).
Terminal output shows system debug logs.
Choosing and
modifying an
INTEGRATE AN
existing retro game
emulator to run on
EMULATOR FOR RETRO
SerenityOS GAMES.
Overview: SameBoy is a high-accuracy Game Boy
and Game Boy Color emulator.
Why Choose SameBoy?
- It was the first emulator that appeared in a quick
search for retro game emulators on GitHub.
PORTING - Source code was easily available and well-
organized.
SAMEBOY TO - It has a proper website explaining its use cases
and providing documentation.
SERENITYOS - Supports both Game Boy (DMG) and Game Boy
Color (CGB) emulation.
Goal: Port SameBoy to SerenityOS, ensuring
compatibility with SerenityOS's GUI and APIs.
Development Environment: Ubuntu with QEMU for
running SerenityOS.
- Clone and build SerenityOS using
`Meta/serenity.sh build`.
SETTING UP - Run SerenityOS in QEMU with
`Meta/serenity.sh run`.
THE - Create a new directory for the SameBoy port
DEVELOPMENT within the SerenityOS `Ports` directory.
ENVIRONMENT - Copy the SameBoy core files (`Core`
directory) into
`~/serenity/Ports/SameBoy/sameboy_core/`.
- Identify and remove SDL dependencies from the
original SameBoy frontend files.
- Use conditional compilation (`#ifdef SERENITY`)
to exclude SDL code when building for
SerenityOS.
ADAPTING - Replace SDL functions with SerenityOS
SAMEBOY equivalents:
- Use `GUI::Window` instead of
FOR `SDL_CreateWindow`.
SERENITYOS - Use `Gfx::Bitmap` and `Gfx::Painter` for
rendering instead of SDL textures.
- Integrate the SameBoy core with SerenityOS's
GUI by creating a custom widget
(`EmulatorWidget`) to handle rendering.
CODE SNIPPETS
Emulator Widget to show the startup of emulator in SerenityOS
Inside Main Loop Window Show (used hardcoded path for a Tetris.gb game for GameBoy)
- Build the SameBoy port using `Meta/serenity.sh build`.
- Run the port within SerenityOS in QEMU using
`Meta/serenity.sh run`.
- Use the serial console to access the SerenityOS shell:
- Switch to `serial0` in QEMU monitor (`Ctrl+a x` → type
`serial0`).
- Login as root (`root` → no password).
RUNNING AND
TROUBLESHOOTING - Locate the executable using `find / -name SameBoyPort`.
- Run the executable from its location
(`./SameBoyPort` or `/bin/SameBoyPort`).
- Debug issues:
- Verify ROM loading with debug messages (`warnln()`).
- Check rendering logic (e.g., pixel transfer from SameBoy core
to `Gfx::Bitmap`).