DEV Community

Cover image for How to Create a Simple Operating System (Kernel Only) with C++
Marcos Oliveira
Marcos Oliveira

Posted on

1

How to Create a Simple Operating System (Kernel Only) with C++

๐Ÿ”Š In this video I showed step by step the process to create a kernel which is the basis for an Operating System. The boot was performed on the physical machine and we were able to print directly to the VGA with a 32-bit system made with C++ and GNU Assembler.


To build on your machine

Use the package manager to install GCC, make, as and ld

sudo apt install build-essential
Enter fullscreen mode Exit fullscreen mode

Clone the repository and compile:

Then just compile:

git clone https://github.com/terroo/terminalroot-os
cd terminal-root-os/
make
Enter fullscreen mode Exit fullscreen mode

To test on QEMU, for example

sudo apt install qemu-kvm
Enter fullscreen mode Exit fullscreen mode

And then test:

qemu-system-i386 -kernel terminal-root-os.bin
Enter fullscreen mode Exit fullscreen mode

Even with qemu-system-x86-64 -kernel terminal-root-os.bin.

If you have a virtual or physical machine with GRUB Legacy, you can move to /boot and edit grub.cfg:

Example:

sudo mv terminal-root-os.bin /boot/
sudo vim /boot/grub/grub.cfg
Enter fullscreen mode Exit fullscreen mode

Add a new entry to GRUB:

### BEGIN TERMINALROOTOS

menuentry 'Terminal Root OS' {
  multiboot /boot/terminal-root-os.bin
  boot
}
### END TERMINALROOTOS
Enter fullscreen mode Exit fullscreen mode

Watch the Video

The video is in Portuguese, but you can use Youtube's automatic translator

How to Create a Simple Operating System (Kernel Only) with C++

Click on the image to watch the video


Terminal Root OS repository on GitHub: https://github.com/terroo/terminalroot-os.

Image of Docusign

๐Ÿ› ๏ธ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs