Skip to content

A minimal operating system written in x86 Assembly that boots directly from BIOS and displays a Hello World message with love. Built from scratch using NASM and QEMU.

License

Notifications You must be signed in to change notification settings

Sreeju7733/helloworld-os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Building a Bootable "Hello World" OS in Assembly

"Most people write Hello World in C. I wrote mine in Assemblyโ€ฆ and booted it."

Yes. It's simple. But it's booted with love. โค๏ธ


๐Ÿง  What Is It?

A tiny, minimal operating system that boots directly from a .img file, shows a "Hello, World!" message using BIOS interrupts, and displays a cute signature line โ€” all in 16-bit real mode Assembly.

blog

๐Ÿ”ง Tools Used:

  • NASM โ€“ The Netwide Assembler (to write and compile x86 Assembly code)
  • QEMU โ€“ Emulator to run and test your bootable image
  • BIOS Interrupts โ€“ Like int 0x10 for controlling screen output
  • Hex and Boot Signatures โ€“ 0x7C00 offset and 0xAA55 at the end for boot sector

๐Ÿ›  How It Works:

  1. Assembly Language โ€“ This OS is written in pure 16-bit x86 Assembly (real mode).
  2. BIOS Boot โ€“ When you boot from the image, BIOS loads the first 512 bytes (the boot sector) from the drive into memory at 0x7C00.
  3. Video Interrupts โ€“ We use int 0x10 (BIOS video service) to print text to the screen.
  4. No OS dependencies โ€“ Itโ€™s raw metal. Your code runs directly on the hardware.
  5. Boot Signature โ€“ The last two bytes are 0xAA55, which tells the BIOS it's a valid boot sector.

๐ŸŒˆ Features:

  • ๐Ÿ–ฅ๏ธ Bootable image (.img) that runs on any x86 machine/emulator.
  • โœ๏ธ Prints "Hello, World!" and a custom line: "Booted with love ;)"
  • โš™๏ธ Works both on 32-bit and 64-bit emulators
  • ๐Ÿ“œ Pure assembly, no C, no OS, no clutter โ€” minimalism at its best
  • ๐Ÿ‘จโ€๐Ÿ’ป A beginner-friendly intro to low-level system programming

โ–ถ๏ธ How to Run:

1. Clone the Repo:

git clone https://github.com/Sreeju7733/helloworld-os.git
cd helloworld-os

2. Assemble the Boot Sector:

nasm -f bin main.asm -o helloworld.img

3. Run with QEMU:

qemu-system-x86_64 -drive format=raw,file=helloworld.img

๐Ÿช„ And boom! Youโ€™ll see "Hello, World!" + your lovely message.

P.S. Even though itโ€™s small, itโ€™s technically a real operating system. ๐Ÿ˜‰

About

A minimal operating system written in x86 Assembly that boots directly from BIOS and displays a Hello World message with love. Built from scratch using NASM and QEMU.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published