Coder Social home page Coder Social logo

citruz / pongoos-qemu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from checkra1n/pongoos

63.0 5.0 5.0 1.24 MB

Fork of PongoOS which can be run in QEMU

Home Page: https://checkra.in

License: MIT License

C 39.20% Shell 0.10% Python 0.20% Makefile 0.06% Objective-C 58.12% C++ 1.16% Assembly 1.13% Dockerfile 0.02%

pongoos-qemu's Introduction

pongoOS for QEMU

screenshot

Fork of PongoOS which can be run in QEMU. Working so far:

  • Framebuffer (ramfb)
  • UART/serial (pl011)
  • Interrupt Controller (GICv2)
  • Device tree parsing
  • QEMU fw_cfg parsing

Not working:

  • Everything else

It can be run both virtualized using Hypervisor.framework on M1 or emulated with TCG. Although only the latter supports gdb debugging.

You need to use the utmapp fork of qemu which has HVF support and working TCG emulation. Apply the following patch to change the memory layout to what pongo expects:

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 27dbeb549e..8a208badcb 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -160,7 +160,7 @@ static const MemMapEntry base_memmap[] = {
     [VIRT_PCIE_PIO] =           { 0x3eff0000, 0x00010000 },
     [VIRT_PCIE_ECAM] =          { 0x3f000000, 0x01000000 },
     /* Actual RAM size depends on initial RAM and device memory settings */
-    [VIRT_MEM] =                { GiB, LEGACY_RAMLIMIT_BYTES },
+    [VIRT_MEM] =                { 0x800000000, LEGACY_RAMLIMIT_BYTES },
 };

 /*

Run with Hypervisor.framework

qemu-system-aarch64 \
   -cpu host -M virt,highmem=off -accel hvf \
   -device loader,file=build/Pongo.bin,addr=0x1000,force-raw=on   \
   -device loader,addr=0x1000,cpu-num=0 -m 4096 \
   -device ramfb \
   -serial stdio

Run emulated

qemu-system-aarch64 \
    -cpu cortex-a72 -M virt -accel tcg \
    -device loader,file=build/Pongo.bin,addr=0x1000,force-raw=on \
    -device loader,addr=0x1000,cpu-num=0 -m 4096 \
    -device ramfb \
    -serial stdio

Using qemu's -s -S arguments, you can attach gdb and step through the execution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.