Code Monkey home page Code Monkey logo

abydos's Introduction

ABYDOS

AbydOS is a brand new operating system targeting RISC-V64, mainly based on C++.

Features

  • Multi-hart support
  • SV39/SV48/SV57 MMU support
  • DeviceTree-based device probing
  • Under development...

Dependencies

Build

To build this project, you need a Linux platform and a cross-compiling toolchain.

Currently tested on Ubuntu 20.04, with gcc-riscv64-unknown-elf and qemu-system.

After installing the necessary packages, clone the repo and initialize the submodules.

Then use CMake to configure and build. If everything goes well, you should get the kernel ELF AbydOS_KNL and its binary.

About the Toolchain:

The package from Ubuntu/Debian does not contain newlib or libstdc++. Therefore, it is required to use a full toolchain that supports them. Toolchains from riscv-collab are compiled with -mcmodel=medlow by default, which is not compatible with 0x80000000 as the kernel base. I have forked and compiled it with -mcmodel=medany (also other options to get the kernel work) here. Just go to the [Actions] for downloading.

Notes on configuring CMake:

Since riscv64-unknown-elf- does not target a normal system, it cannot pass the compiler test by CMake. Therefore, it is important to add these two command-line arguments to skip the test:

-DCMAKE_C_COMPILER_WORKS:STRING=1 
-DCMAKE_CXX_COMPILER_WORKS:STRING=1

In VSCODE, it can be done by editing the settings.json and add the segment below:

    "cmake.configureSettings": {
        "CMAKE_C_COMPILER_WORKS": 1,
        "CMAKE_CXX_COMPILER_WORKS": 1
    }

Testing

It's not necessary to build OpenSBI for a full installation of QEMU (-bios=default). (But for now we'd use 0x80100000 as kernel start, which does NOT compatible with default 0x80200000) If you don't, please compile it with PLATFORM=generic FW_JUMP_OFFSET=0x80100000 then run the QEMU using the command in the project directory:

qemu-system-riscv64 -M virt -m 256M -nographic -bios build/opensbi/build/platform/generic/firmware/fw_jump.elf -kernel build/AbydOS_KNL

Multi-hart is supported, so -smp 8 can be added to test.

If you'd like to connect a FLASH, just generate a flash file with exact size of 32MB, then add the arguement below:

-drive if=pflash,file=/path/to/pflash,unit=1

Note that unit=1 is required since QEMU takes the first pflash as a boot device.

To debug it, start the QEMU with gdb-stub like:

qemu-system-riscv64 -M virt -m 256M -nographic -bios build/opensbi/build/platform/generic/firmware/fw_jump.elf -kernel build/AbydOS_KNL -gdb tcp::1234 -S

This will suspend until gdb attach and instruct it to continue; then in the secondary terminal, use:

gdb-multiarch build/AbydOS_KNL -ex 'target remote 127.0.0.1:1234'

to attach and debug.

License

Under BSD-3.

abydos's People

Contributors

dynamicloader avatar

Watchers

 avatar

abydos's Issues

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.