{"id":18787193,"url":"https://github.com/michaelforney/tinyemu","last_synced_at":"2025-09-15T14:12:00.357Z","repository":{"id":66675404,"uuid":"153828535","full_name":"michaelforney/tinyemu","owner":"michaelforney","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-07T03:51:37.000Z","size":326,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T13:12:17.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelforney.png","metadata":{"files":{"readme":"readme.txt","changelog":"Changelog","contributing":null,"funding":null,"license":"MIT-LICENSE.txt","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":"2018-10-19T18:56:43.000Z","updated_at":"2024-04-14T10:11:03.000Z","dependencies_parsed_at":"2023-04-20T01:25:57.682Z","dependency_job_id":null,"html_url":"https://github.com/michaelforney/tinyemu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michaelforney/tinyemu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Ftinyemu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Ftinyemu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Ftinyemu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Ftinyemu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelforney","download_url":"https://codeload.github.com/michaelforney/tinyemu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelforney%2Ftinyemu/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260419689,"owners_count":23006331,"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":[],"created_at":"2024-11-07T20:53:47.937Z","updated_at":"2025-06-17T18:37:23.097Z","avatar_url":"https://github.com/michaelforney.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"TinyEMU System Emulator by Fabrice Bellard\n==========================================\n\n1) Features\n-----------\n\n- RISC-V system emulator supporting the RV128IMAFDQC base ISA (user\n  level ISA version 2.2, priviledged architecture version 1.10)\n  including:\n\n  - 32/64/128 bit integer registers\n  - 32/64/128 bit floating point instructions\n  - Compressed instructions\n  - dynamic XLEN change\n\n- x86 system emulator based on KVM\n\n- VirtIO console, network, block device, input and 9P filesystem\n\n- Graphical display with SDL\n\n- JSON configuration file\n\n- Remote HTTP block device and filesystem\n\n- small code, easy to modify, no external dependancies\n\n- Javascript demo version\n\n2) Installation\n---------------\n\n- The libraries libcurl, OpenSSL and SDL should be installed. On a Fedora\n  system you can do it with:\n\n  sudo dnf install openssl-devel libcurl-devel SDL-devel\n\n  It is possible to compile the programs without these libraries by\n  commenting CONFIG_FS_NET and/or CONFIG_SDL in the Makefile.\n\n- Edit the Makefile to disable the 128 bit target if you compile on a\n  32 bit host (for the 128 bit RISCV target the compiler must support\n  the __int128 C extension).\n\n- Use 'make' to compile the binaries.\n\n- You can optionally install the program to '/usr/local/bin' with:\n\n  make install\n\n3) Usage\n--------\n\n3.1 Quick examples\n------------------\n\n- Use the VM images available from https://bellard.org/jslinux (no\n  need to download them):\n\n  Terminal:\n\n  ./temu https://bellard.org/jslinux/buildroot-riscv64.cfg\n\n  Graphical (with SDL):\n\n  ./temu https://bellard.org/jslinux/buildroot-x86-xwin.cfg\n\n  ./temu https://bellard.org/jslinux/win2k.cfg\n\n- Download the example RISC-V Linux image\n  (diskimage-linux-riscv-yyyy-mm-dd.tar.gz) and use it:\n\n  ./temu root-riscv64.cfg\n\n  ./temu rv128test/rv128test.cfg\n\n- Access to your local hard disk (/tmp directory) in the guest:\n\n  ./temu root_9p-riscv64.cfg\n\nthen type:\nmount -t 9p /dev/root /mnt\n\nin the guest. The content of the host '/tmp' directory is visible in '/mnt'.\n\n3.2 Invocation\n--------------\n\nusage: temu [options] config_file\noptions are:\n-m ram_size       set the RAM size in MB\n-rw               allow write access to the disk image (default=snapshot)\n-ctrlc            the C-c key stops the emulator instead of being sent to the\n                  emulated software\n-append cmdline   append cmdline to the kernel command line\n-no-accel         disable VM acceleration (KVM, x86 machine only)\n\nConsole keys:\nPress C-a x to exit the emulator, C-a h to get some help.\n\n3.3 Network usage\n-----------------\n\nThe easiest way is to use the \"user\" mode network driver. No specific\nconfiguration is necessary.\n\nTinyEMU also supports a \"tap\" network driver to redirect the network\ntraffic from a VirtIO network adapter.\n\nYou can look at the netinit.sh script to create the tap network\ninterface and to redirect the virtual traffic to Internet thru a\nNAT. The exact configuration may depend on the Linux distribution and\nlocal firewall configuration.\n\nThe VM configuration file must include:\n\neth0: { driver: \"tap\", ifname: \"tap0\" }\n\nand configure the network in the guest system with:\n\nifconfig eth0 192.168.3.2\nroute add -net 0.0.0.0 gw 192.168.3.1 eth0\n\n3.4 Network filesystem\n----------------------\n\nTinyEMU supports the VirtIO 9P filesystem to access local or remote\nfilesystems. For remote filesystems, it does HTTP requests to download\nthe files. The protocol is compatible with the vfsync utility. In the\n\"mount\" command, \"/dev/rootN\" must be used as device name where N is\nthe index of the filesystem. When N=0 it is omitted.\n\nThe build_filelist tool builds the file list from a root directory. A\nsimple web server is enough to serve the files.\n\nThe '.preload' file gives a list of files to preload when opening a\ngiven file.\n\n3.5 Network block device\n------------------------\n\nTinyEMU supports an HTTP block device. The disk image is split into\nsmall files. Use the 'splitimg' utility to generate images. The URL of\nthe JSON blk.txt file must be provided as disk image filename.\n\n4) Technical notes\n------------------\n\n4.1) 128 bit support\n\nThe RISC-V specification does not define all the instruction encodings\nfor the 128 bit integer and floating point operations. The missing\nones were interpolated from the 32 and 64 ones.\n\nUnfortunately there is no RISC-V 128 bit toolchain nor OS now\n(volunteers for the Linux port ?), so rv128test.bin may be the first\n128 bit code for RISC-V !\n\n4.2) Floating point emulation\n\nThe floating point emulation is bit exact and supports all the\nspecified instructions for 32, 64 and 128 bit floating point\nnumbers. It uses the new SoftFP library.\n\n4.3) HTIF console\n\nThe standard HTIF console uses registers at variable addresses which\nare deduced by loading specific ELF symbols. TinyEMU does not rely on\nan ELF loader, so it is much simpler to use registers at fixed\naddresses (0x40008000). A small modification was made in the\n\"riscv-pk\" boot loader to support it. The HTIF console is only used to\ndisplay boot messages and to power off the virtual system. The OS\nshould use the VirtIO console.\n\n4.4) Javascript version\n\nThe Javascript version (JSLinux) can be compiled with Makefile.js and\nemscripten. A complete precompiled and preconfigured demo is available\nin the jslinux-yyyy-mm-dd.tar.gz archive (read the readme.txt file\ninside the archive).\n\n4.5) x86 emulator\n\nA small x86 emulator is included. It is not really an emulator because\nit uses the Linux KVM API to run the x86 code at near native\nperformance. The x86 emulator uses the same set of VirtIO devices as\nthe RISCV emulator and is able to run many operating systems.\n\nThe x86 emulator accepts a Linux kernel image (bzImage). No BIOS image\nis necessary.\n\nThe x86 emulator comes from my JS/Linux project (2011) which was one\nof the first emulator running Linux fully implemented in\nJavascript. It is provided to allow easy access to the x86 images\nhosted at https://bellard.org/jslinux .\n\n\n5) License / Credits\n--------------------\n\nTinyEMU is released under the MIT license. If there is no explicit\nlicense in a file, the license from MIT-LICENSE.txt applies.\n\nThe SLIRP library has its own license (two clause BSD license).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelforney%2Ftinyemu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelforney%2Ftinyemu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelforney%2Ftinyemu/lists"}