Skip to content

vs4vijay/vizix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VIZIX

An operating system for fun and learning

Development Flow (Write an OS)

  • Create Boot Sector

Development Tools Required

  • qemu
  • nasm
  • gcc

PS: On Mac, Using homebrew: brew install qemu nasm

Running

  • nasm -f bin Vizix.asm -o Vizix.bin
  • qemu Vizix.bin

Bootsector Example:

; Infinite loop
loop:
    jmp loop 

; Fill with 510 zeros minus the size of the previous code
times 510-($-$$) db 0

; Magic number
dw 0xaa55

Registers:

  • General Purpose Registers:
    • ax; Accumulator (EAX)
    • bx; Base (EBX)
    • cx; Counter (ECX)
    • dx; Data (EDX)
  • Stack Registers:
    • bp; Base Pointer, Stores the base address of stack (EBP)
    • sp; Stack Pointer, Stores the top address of stack, sp gets decremented (ESP)
  • Pointer Registers:
    • si; Source Index, (ESI)
    • di; Destination Index, (EDI)
    • ip; Instruction Pointer
  • Segmentation: Obsolete memory protection technique
    • Segment Register: Can be altered using registers
      • cs; Code Segment; Can not be altered
      • ds; Data Segment
      • ss; Stack Segment
      • es; Extra Segment
      • fs, gs; General Purpose Segment
  • Special Registers:
    • CR0,2,3
    • DR0,1,2,3,6,7
    • TR4,5,6,7

Bootloaders:

  • Geek Loading: Everything in Boot Record
  • One-stage Loading
  • Two-stage Loading: GRUB (GRand Unified Bootloader)

References:

Hardware