DEV Community

Cover image for Como Criar um Simples Sistema Operacional(só o Kernel) com C++
Marcos Oliveira
Marcos Oliveira

Posted on

1

Como Criar um Simples Sistema Operacional(só o Kernel) com C++

🔊 Nesse vídeo mostrei passo a passo do processo para criar um kernel que é a base para um Sistema Operacional. O boot foi realizado na máquina física e conseguimos printar direto na VGA com um sistema de 32-bit feito com C++ e GNU Assembler.


Para construir na sua máquina

Use o gerenciador de pacotes para instalar o GCC, make, as e ld

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

Clone o repositório e compile:

Depois é só compilar:

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

Para testar no QEMU, por exemplo

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

E então testar:

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

Até com o qemu-system-x86-64 -kernel terminal-root-os.bin.

Se você tem uma máquina virtual ou física com GRUB Legacy, você pode mover pro /boot e editar o grub.cfg:

Exemplo:

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

Adicione uma nova entrada no GRUB:

### BEGIN TERMINALROOTOS

menuentry 'Terminal Root OS' {
  multiboot /boot/terminal-root-os.bin
  boot
}

### END TERMINALROOTOS
Enter fullscreen mode Exit fullscreen mode

Assista ao Vídeo

Como Criar um Simples Sistema Operacional(só o Kernel) com C++

Clique na imagem para assistir o vídeo


Repositório do Terminal Root OS no GitHub: https://github.com/terroo/terminalroot-os.

Heroku

Deliver your unique apps, your own way.

Heroku tackles the toil — patching and upgrading, 24/7 ops and security, build systems, failovers, and more. Stay focused on building great data-driven applications.

Learn More

Top comments (0)

Image of Datadog

Get the real story behind DevSecOps

Explore data from thousands of apps to uncover how container image size, deployment frequency, and runtime context affect real-world security. Discover seven key insights that can help you build and ship more secure software.

Read the Report

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay