Skip to content

fatimafatimaprogrammer/My_Own_64bit_OS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ MyOwn64XOS — A Simple 64-bit Operating System Kernel

🧩 Introduction

MyOwn64XOS is a simple 64-bit kernel developed in C and Assembly.
It demonstrates fundamental operating system concepts such as bootloading, memory paging, long mode transition, and basic VGA output.

Upon startup, the kernel clears the screen, displays a welcome message, and prints a stylized NUST text banner using ASCII characters.


🚀 Features

  • Multiboot2-Compatible Bootloader for GRUB
  • Transition from 32-bit Protected Mode → 64-bit Long Mode
  • Page Table Setup using 2 MiB huge pages
  • Basic VGA Text Output (0xb8000)
  • Custom Print Functions for strings, newlines, and colors
  • ASCII Art Rendering of “NUST”
  • Clean, modular structure separating C and Assembly logic

🧱 Project Structure

MyOwn64XOS/ │

├── kernel.c # Kernel entry point (kernel_main)

├── boot.asm # Bootloader and CPU checks

├── long_mode.asm # 64-bit mode setup and GDT

├── print.c / print.h # VGA text output functions

├── linker.ld # Linker script

└── Makefile # Build and run commands


⚙️ How It Works

1. Bootloader Stage

  • Initializes stack and verifies CPU compatibility (CPUID, Long Mode support)
  • Prepares GDT and memory paging
  • Jumps to 64-bit long mode

2. Memory Paging

  • Sets up page tables (L4 → L3 → L2)
  • Maps memory using 2 MiB huge pages

3. Kernel Initialization

  • Clears VGA text screen

  • Sets text color

  • Displays:

  • Renders ASCII “NUST” pattern


🧠 Technologies Used

  • C – for kernel logic and output functions
  • x86-64 Assembly – for bootloader and low-level setup
  • QEMU – emulator for testing
  • GRUB – Multiboot2-compliant bootloader

🧪 Build and Run Instructions

🔧 Requirements

  • gcc (cross-compiler for i686-elf)
  • nasm
  • qemu-system-x86_64
  • make
  • grub-mkrescue

🛠️ Steps

# Clone repository
git clone https://github.com/yourusername/MyOwn64XOS.git
cd MyOwn64XOS

# Build kernel
make

# Create bootable ISO
make iso

# Run in QEMU
qemu-system-x86_64 -cdrom MyOwn64XOS.iso

🖥️ Example Output

-------------------------------------------------
Welcome to our 64-bit kernel!
-------------------------------------------------

 Printing NUST Text Using Asterisks :

*****         ***   ****          ****   *************   *************
** ***        ***   ****          ****   *************   *************
**   ***      ***   ****          ****   *****              *****
**     ***    ***   ****          ****   ****               *****
**       ***  ***   ****          ****   *************      *****
**        *** ***   ****          ****            *****     *****
**          *****   ****          ****            *****     *****
**           ****   ******************   **************     *****
**           ****   ******************   **************     *****

🎯 Learning Outcomes

In-depth understanding of x86_64 architecture

Practical experience with paging and GDT setup

Hands-on practice with VGA text buffer manipulation

Integrating C and Assembly for OS development

👩‍💻 Contributors

Urooj Fatima Raza (Developer & Author of MyOwn64XOS)

🌟 Acknowledgment

Developed as part of an Operating Systems project to demonstrate the fundamentals of 64-bit kernel design at NUST.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors