{"id":21358242,"url":"https://github.com/snacsnoc/nanopyos","last_synced_at":"2026-01-04T06:43:45.419Z","repository":{"id":228550609,"uuid":"774303649","full_name":"snacsnoc/nanopyos","owner":"snacsnoc","description":"Embedded Python interpreter in a minimal kernel for arm64","archived":false,"fork":false,"pushed_at":"2024-09-15T06:08:34.000Z","size":163,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-15T09:53:20.070Z","etag":null,"topics":["operating-system","os-development","python-os"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snacsnoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-19T10:07:58.000Z","updated_at":"2024-09-15T06:08:38.000Z","dependencies_parsed_at":"2024-09-15T10:01:06.856Z","dependency_job_id":null,"html_url":"https://github.com/snacsnoc/nanopyos","commit_stats":null,"previous_names":["snacsnoc/nanopyos"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fnanopyos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fnanopyos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fnanopyos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snacsnoc%2Fnanopyos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snacsnoc","download_url":"https://codeload.github.com/snacsnoc/nanopyos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225844795,"owners_count":17533161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["operating-system","os-development","python-os"],"created_at":"2024-11-22T05:15:12.297Z","updated_at":"2026-01-04T06:43:45.354Z","avatar_url":"https://github.com/snacsnoc.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NanoPy OS\nNanoPy OS is an experimental project to embed a Python interpreter using MicroPython within a minimal kernel for arm64/i386 architecture\n\n\nSee [Releases](https://github.com/snacsnoc/nanopyos/releases/tag/0.1) for booting a compiled kernel.\n# Building the Toolchain\n\nFirst, set up the toolchain required for cross-compilation.\n\n```\nmkdir -p test-build/toolchain\n```\nBuild directory for source packages:\n```\nmkdir build-dir/\n```\n\nToolchain will be installed to `test-build/toolchain`:\n```bash\nexport PREFIX=/PATH/test-build/toolchain\nexport TARGET=aarch64-elf\nexport PATH=$PREFIX/bin:$PATH\n```\n#### Linux\n```bash\nsudo apt-get install gcc-12 g++-12\nexport CC=/usr/local/bin/gcc-12\nexport CXX=/usr/local/bin/g++-12\nexport LD=/usr/local/bin/gcc-12\n```\n#### Mac\n```bash\nbrew install gcc@12\nexport CC=/opt/homebrew/bin/gcc-12\nexport CXX=/opt/homebrew/bin/g++-12\nexport LD=/opt/homebrew/bin/gcc-12\n```\n\n\nEnter the source directory:\n\n```bash\ncd build-dir/\n```\n\n## Build binutils\n```bash\nwget https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz\ntar xvf binutils-2.42.tar.xz\n```\nBuild out of tree:\n\n```bash\ncd binutils-2.42/\nmkdir build \u0026\u0026 cd build \n\n../configure --prefix=$PREFIX --target=$TARGET --disable-nls --disable-multilib --disable-werror\nmake\nmake install\n```\n\n\n\n\n\n### Build gcc\n\n```bash\nwget http://ftp.gnu.org/gnu/gcc/gcc-12.3.0/gcc-12.3.0.tar.xz\ntar xvzf gcc-12.3.0.tar.xz\ncd gcc-12.3.0\n```\n\n### get mpfr, gmp and mpc\n`bash ./contrib/download_prerequisites`\n\n### gmp (extra, not necessary to build the toolchain)\n```bash\ncd gmp\nmkdir build \u0026\u0026 cd build\n../configure --prefix=$PREFIX --build=aarch64-apple-darwin23 --host=${TARGET} --target=${TARGET} --disable-shared\n\nmake\nmake install\n```\n\n### mpfr (extra, not necessary to build the toolchain)\n```bash\ncd mpfr\nmkdir build \u0026\u0026 cd build\nCFLAGS=\"-I$PREFIX/include\" ../configure --prefix=$PREFIX --host=${TARGET} --target=${TARGET} --with-gmp=$PREFIX/lib\nmake\nmake install\n```\n\n### Build gcc out of tree\n```bash\nmkdir gcc-build\ncd gcc-build\n\n../configure --prefix=${PREFIX} --build=aarch64-apple-darwin23 --target=${TARGET} --disable-shared --disable-multilib --disable-nls --disable-werror --without-headers --without-isl --disable-libsanitizer --enable-languages=c,c++  --with-newlib\n\nmake all-gcc\nmake install-gcc\nmake all-target-libgcc\nmake install-target-libgcc\n```\n\n## Build newlib\n\n```bash\nwget ftp://sourceware.org/pub/newlib/newlib-4.4.0.20231231.tar.gz\ntar xvf newlib-4.4.0.20231231.tar.gz \ncd newlib-4.4.0.20231231\n./configure --prefix=$PREFIX --target=$TARGET --disable-multilib\nmake\nmake install\n```\nNote: this installs to `$PREFIX/$TARGET`\n\n# Building Python Interpreter\n\n\n\n## MicroPython\nClone the MicroPython repository:\n\n```bash\ncd test-build\ngit clone https://github.com/micropython/micropython.git\n```\n\nSee `Makefile.micropython`\n\nThen: \n`make -f Makefile.micropython all V=1 DEBUG=1 #for gdb`\n\n\n## Booting:\n```bash\nqemu-system-aarch64 -nographic -machine virt,virtualization=off -d unimp,int -cpu cortex-a57 -kernel build/firmware.elf  -s -m 8\n```\n## Debugging:\n```\nqemu-system-aarch64 -M virt,virtualization=off -cpu cortex-a57 -kernel build/firmware.elf -nographic -d unimp,int -s -S\n\n#attach gdb:\naarch64-elf-gdb build/firmware.elf\n(gdb) target remote localhost:1234\n\n```\nSimple test build:\n`make -f Makefile.simple`\n\nBoot with:\n\n```qemu-system-aarch64 -nographic -machine virt,virtualization=off -d unimp,int -cpu cortex-a57 -kernel simple-build/firmware.elf```\n\n\n\n\n\n# Resources\nhttps://code.google.com/archive/p/cleese/source/default/source","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnacsnoc%2Fnanopyos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnacsnoc%2Fnanopyos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnacsnoc%2Fnanopyos/lists"}