Skip to content

chillancezen/ZeldaOS.x86_64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZeldaOS.x86_64

The 64bit version of ZeldaOS which is still written in C&GAS from scratch for study use. Its main goal this time is to support SMP and virtualization. it's able to run a game: tetris inside guest OS asciicast

how to build and run it?

It's handy to run the demo within the root of the repository on a nested-virtualization enabled Linux host(how to enable it?):

#KVM='--enable-kvm --cpu host' ZELDA64=/path/to/repo CC=gcc-4.8 make run

to clean the build, run:

#KVM='--enable-kvm --cpu host' ZELDA64=/path/to/repo CC=gcc-4.8 make clean

Features Inventory

Arch:x86_64 features

  • running in 64-bit long mode
  • SMP boot orchestration.
  • 64-bit IDT management
  • 64-bit segmentation/GDT management
  • Inter-processors Interrupt(IPI) management

Memory features

  • Customed physical memory detection
  • Level 4 paging(2MB pages and 4K pages)

Devices features

  • Basic 16-color video buffer managment
  • APIC(Advanced PIC) management(LAPIC and IOAPIC)
  • Basic serial port output management

Kernel features

  • cusomized bootloader(only support legacy BIOS boot)
  • PXE boot supported with https://github.com/goupaz/pxeboot
  • Synchronization primitives: spinlock...
  • Processor-local storage and per-cpu framework.
  • Kernel PANIC.

VM Monitor

  • Basic vmx mode switch(realmode, protected mode and 64-bit long mode)
  • Memory virtualization(with Intel VT-x EPT mechanism)
  • APIC virtualization(in progress)
  • IO emulation(PIO and MMIO)
  • IO devices(serial port, video and keyboard), details can be found from wiki
  • SMP virtualization(in progress)

screenshot of the demononstration.

The Game: Tetris running as guest OS: image of green window

ZeldaOS64 provides a normal video window to display some runtime information(TBC): image of green window

also we have pretty beautiful screen of death(like BSOD from Microsoft Windows, It's derived from VMware ESXi vmkernel: Purple Screen of Death:PSOD)

sreen of death

the output of serial port is streamed like: output of serial port