Skip to content

GlieseZ/NanoShellOS

 
 

Repository files navigation

NanoShell

NanoShell 3rd Edition is a preemptively multi-tasked 32-bit operating system with a windowed GUI.

Be advised that this is UNFINISHED/beta-ware software and you should not expect any stability from this software.

Copyright (C) 2022 iProgramInCpp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License only.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see the GNU licenses.

This software is licensed under the GNU General Public License V3 only.

Goals

Note that user mode is "mysteriously" absent. This OS is entirely running in ring-0. I'm not particularly concerned with safety, any app is free to do anything. The design is NOT the best, by ANY means, so do not inspire yours from this design.

Feel free to submit issues you may have with this OS in the Issues tab. To discuss other things, join the Discord server.

  • Hello World

Primordial tasks

  • Paging and dynamic memory allocation
  • Loading an ELF at some virtual address with its own heap and executing it
  • Task Switching (concurrent threads)

User

  • A basic shell, can execute applications
  • Get a GUI running (Also in a task)
  • Applications can use the GUI API
  • Port DOOM
  • (ultimate boss) Port Mesa and Super Mario 64 (based on the DOS port, please)

Drivers

  • PS/2 Mouse and Keyboard
  • EGA Text mode
  • VBE Graphics mode (fast)
  • Bochs/QEMU debugcon (E9 hack)
  • Serial port
  • PCI
  • VirtualBox/QEMU/Bochs graphics device (not VBE)
  • VMware SVGA device
  • Sound devices (e.g. SoundBlaster 16)
  • USB

Permanent memory

  • Block storage abstraction base
  • Optional RAM disk images can be loaded and used as block devices
  • ATA device driver
  • USB stick device driver

File system

  • Root contains several files which are packed neatly into the executable
  • Mounting other file systems to the main one
  • Cleaning up after a while of not having used a certain directory page (can't apply to root or ram disks, you know why)

Build instructions

Linux build:

The following dependencies are required: xorriso clang ld. Install them first. An example of how to install them:

sudo apt-get install xorriso clang

Then, run make.

Building an image

To build the image, run the following set of commands:

make
make initrd
make limine
make image

In the build directory, you should now have an image.iso that you can mount into your favorite x86 emulator and run.

Windows build:

It may or may not come back soon.

Installation

GRUB

If you don't have grub2, install it. It's relatively easy.

Once you have a grub installed on your favorite USB drive, create a grub.cfg inside the grub directory. Add the following lines:

menuentry "NanoShell" {
	multiboot /boot/kernel.bin root=/
	module    /boot/initrd.tar
	set gfxpayload=1024x768x32
	boot
}

Side note: if you've installed NanoShell on a FAT32-formatted IDE hard disk you can use root=/Fat0 (where Fat0 can be swapped out for any FatX device). Also you may change the gfxpayload to any resolution that GRUB supports.

Note that you can place your kernel image anywhere, but I prefer /boot/kernel.bin. Place your kernel image so that grub can find it, and then restart.

Limine

To boot NanoShell using Limine, you can take a look at the example limine.cfg.

TIMEOUT=3

:NanoShell OS

PROTOCOL=multiboot1

CMDLINE=root=/
KERNEL_PATH=boot:///kernel.bin
MODULE_PATH=boot:///initrd.tar

Just like in the grub install example, you can change the root to anywhere.

And you're done! You should be in NanoShell now. Type w to go to the GUI mode.

About

The NanoShell Operating System 🐢

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.6%
  • Other 1.4%