Skip to content

jamaan-s/simpleOS_x86_16

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bootloader and a Kernel from scratch 16bits assembly and C.

This project was made for learning proposes (not a production ready code).

Implemented Bootloader code using Assembly 16bits:

  • Header for floppy image.
  • Print to screen.
  • Read and load kernel from other files into memory.

Implemented Kernel code using C and Assembly 16bits:

  • put, puts, put_f.
  • printf.

Credits:

This project was originally made by OliveStem on YT, Playlist.

The original Github project

Run:

$ make run

or

$ qemu-system-i386 -fda build/main.img

Build:

$ make

build and run:

$ make buildRun

Debug:

run qemu emulator with:

$ make debug

or

$ qemu-system-i386 -fda build/main.img -s -S

in another window terminal run gdb:

$ gdb

in gdb connect gdb to qemu:

(gdb) target remote localhost:1234

in gdb set breakpoint (at the start of the code address):

(gdb) br *0x7C00

Tools used:

To run:

  • qemu emulator (qemu-system-i386).

To build:

  • Nasm (to compile 16bits assembly files).
  • Watcom 32bit compiler (to compile 16 bits C code).
  • mkfs.fat (to create a FAT12 filesystem).
  • mcopy.
  • make.

Other:

  • gdb (debugging).

Notes: I used "Watcom 32bit" because the 64bit failed to install on WSL ubuntu VM, the 32bit worked just fine.

This project was made and tested in side a Linux VM using (WSL with ubuntu image) on Win11. WSL version: 2.6.3.0 Ubuntu image: 24.0.04

About

A simple OS from scratch using NASM and C x86_16bits

Resources

License

Stars

Watchers

Forks

Contributors