{"id":101103,"date":"2021-08-27T10:23:05","date_gmt":"2021-08-27T08:23:07","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/emulyator-risc-v-v-forme-pikselnogo-shejdera-pozvolivshij-zapustit-linux-v-vrchat"},"modified":"2021-08-27T10:23:05","modified_gmt":"2021-08-27T08:23:07","slug":"emulyator-risc-v-v-forme-pikselnogo-shejdera-pozvolivshij-zapustit-linux-v-vrchat","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/emulyator-risc-v-v-forme-pikselnogo-shejdera-pozvolivshij-zapustit-linux-v-vrchat","title":{"rendered":"RISC-V emulator in the form of a pixel shader, enabling Linux to run in VRChat","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>The results of the experiment on launching Linux within a virtual 3D space of the multiplayer online game VRChat, which allows the uploading of 3D models with their own shaders, have been published. To realize the conceived idea, an emulator of the RISC-V architecture was created, executed on the GPU as a pixel (fragment) shader (since VRChat does not support compute shaders and UAV). The emulator's code is published under the MIT license.    <\/p>\n<p>The emulator is based on an implementation in the C language, which itself utilized the developments of the minimalist riscv-rust emulator, developed in Rust. The prepared C code is translated into a pixel shader in HLSL, suitable for loading into VRChat. The emulator provides full support for the rv32imasu instruction set architecture, the SV32 memory management unit, and a minimal set of peripheral devices (UART and timer). The prepared capabilities are sufficient for loading the Linux kernel 5.13.5 and the basic BusyBox command-line environment, which can be interacted with directly from the virtual world of VRChat.     <center><img decoding=\"async\" alt=\"RISC-V emulator in the form of a pixel shader, enabling Linux to run in VRChat\" src=\"\/wp-content\/uploads\/2021\/08\/da291c8d8172791b2e58d6cdb1c5b2e4.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/center>  <center><img decoding=\"async\" alt=\"RISC-V emulator in the form of a pixel shader, enabling Linux to run in VRChat\" src=\"\/wp-content\/uploads\/2021\/08\/7661b3895d32075c5e6cdf7f043d3532.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/center>    <\/p>\n<p>The emulator is implemented in a shader in the form of a custom dynamic texture (Unity Custom Render Texture), enhanced with the Udon scripts provided for VRChat, which are used to control the emulator during its execution. The contents of the RAM and the state of the CPU of the emulated system are saved in the form of a texture, sized 2048&#215;2048 pixels. The emulated CPU operates at a frequency of 250 kHz. In addition to Linux, Micropython can also be run on the emulator.    <center><img decoding=\"async\" alt=\"RISC-V emulator in the form of a pixel shader, enabling Linux to run in VRChat\" src=\"\/wp-content\/uploads\/2021\/08\/5b2ea8a3fcf98bff04a6455682381a67.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/center>    <\/p>\n<p>To organize persistent data storage with read and write support, a trick is employed involving the use of a Camera object attached to a rectangular area generated by the shader, directing the output of the rendered texture into the shader's input. Thus, any pixel written during the execution of the pixel shader can be read during the processing of the next frame.     <\/p>\n<p>When pixel shaders are applied, a separate instance of the shader is launched for each pixel of the texture in parallel. This characteristic significantly complicates implementation and requires separate coordination of the entire emulated system's state and matching the position of the processed pixel with the CPU state or the RAM content of the emulated system (each pixel can encode 128 bits of information). The shader code requires the inclusion of a vast number of checks, for which a Perl preprocessor (perlpp) was utilized to simplify implementation.           <center>  <div class=\"youtube-placeholder\" data-id=\"G2u7NOpzcBQ\" onclick=\"loadVideo(this)\">\r\n        <img decoding=\"async\" src=\"https:\/\/img.youtube.com\/vi\/G2u7NOpzcBQ\/hqdefault.jpg\" alt=\"Play video\" loading=\"lazy\" width=\"480\" height=\"360\" style=\"width:100%;height:auto;\">\r\n        <div class=\"play-button\"><\/div>\r\n    <\/div><\/center><br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=55694\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Linux \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 online-\u0438\u0433\u0440\u044b VRChat, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 3D-\u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0439 \u0438\u0434\u0435\u0438 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b RISC-V, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 GPU \u0432 \u0432\u0438\u0434\u0435 \u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u043e\u0433\u043e (\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043d\u043e\u0433\u043e) \u0448\u0435\u0439\u0434\u0435\u0440\u0430 (VRChat \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u044b \u0438 UAV). \u041a\u043e\u0434 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 MIT. \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":101104,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-101103","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Linux \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 online-\u0438\u0433\u0440\u044b VRChat, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 3D-\u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/emulyator-risc-v-v-forme-pikselnogo-shejdera-pozvolivshij-zapustit-linux-v-vrchat\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u042d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 RISC-V \u0432 \u0444\u043e\u0440\u043c\u0435 \u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0432\u0448\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Linux \u0432 VRChat | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Linux \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 online-\u0438\u0433\u0440\u044b VRChat, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 3D-\u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/emulyator-risc-v-v-forme-pikselnogo-shejdera-pozvolivshij-zapustit-linux-v-vrchat\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-08-27T08:23:07+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-08-27T08:23:07+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47RISC-V emulator in the form of a pixel shader that enabled Linux to run in VRChat | ProHoster","description":"The results of an experiment on launching Linux within a virtual 3D space of the multiplayer online game VRChat, which allows the loading of 3D models with custom shaders, have been published.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/emulyator-risc-v-v-forme-pikselnogo-shejdera-pozvolivshij-zapustit-linux-v-vrchat","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u042d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 RISC-V \u0432 \u0444\u043e\u0440\u043c\u0435 \u043f\u0438\u043a\u0441\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0432\u0448\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Linux \u0432 VRChat | ProHoster","og:description":"\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Linux \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 online-\u0438\u0433\u0440\u044b VRChat, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 3D-\u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438.","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/emulyator-risc-v-v-forme-pikselnogo-shejdera-pozvolivshij-zapustit-linux-v-vrchat","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2021-08-27T08:23:07+00:00","article:modified_time":"2021-08-27T08:23:07+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"101103","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-08-27 08:26:07","updated":"2022-09-27 18:54:52","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/101103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=101103"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/101103\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/101104"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=101103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=101103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=101103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}