4 पॉइंट द्वारा GN⁺ 2025-04-15 | 1 टिप्पणियां | WhatsApp पर शेयर करें
  • ब्राउज़र में Linux और Windows NT चलाने वाला JavaScript/WASM-आधारित PC emulator, एक ऐसा प्रोजेक्ट जिसे Fabrice Bellard ने 2011 में पहले x86 JS emulator के रूप में शुरू किया था और जो आज तक विकसित होता रहा है
  • TinyEMU-आधारित C कोड को emscripten से compile किया जाता है, और VirtIO devices का उपयोग करके filesystem, network और block device support दिया जाता है
  • x86 64-bit CPU emulation में AVX-512, APX जैसे आधुनिक extension instructions तक शामिल हैं, जिससे इसकी परिपक्वता बहुत ऊँची है
  • RISC-V 32/64-bit CPU emulation भी supported है, और Alpine Linux, Buildroot जैसी कई distributions चलाई जा सकती हैं
  • JavaScript engine performance benchmarking, ब्राउज़र के भीतर Unix सीखना, legacy PC software चलाना जैसे व्यावहारिक उपयोग के मामले मौजूद हैं

इतिहास

  • 2011 का पहला version JavaScript में लिखा गया पहला PC/x86 emulator था, जिसमें QEMU के x86 helpers और device code का पुन: उपयोग किया गया
  • 2015 में asm.js subset लागू करके उसे support करने वाले browsers में speed improvement हासिल किया गया
  • 2016 में RISC-V emulator TinyEMU लिखने के बाद, C code को emscripten से JavaScript में बदला गया
    • jor1k(Sebastian Macke) से प्रेरित VirtIO 9P filesystem जोड़ा गया, जिससे remote filesystem access और file import/export आसान हुआ
  • VirtIO devices को x86 JS emulator में भी पुन: उपयोग करने के लिए, JSLinux asm.js code को पहले C में बदला गया और फिर emscripten से दोबारा JavaScript में रूपांतरित किया गया
    • बारीक tuning के जरिए हस्तनिर्मित asm.js version से भी तेज performance हासिल की गई
  • Windows NT चलाने के लिए शुरुआत में emulated Linux के अंदर QEMU को nested mode में चलाने का तरीका इस्तेमाल किया गया
    • क्योंकि x86 emulator AMD SVM virtualization extension को support करता है, इसलिए nested execution में भी यह उपयोगी स्तर पर काम करता था
  • मौजूदा version PS/2 keyboard/mouse, IDE disk, dummy VGA जैसे गायब PC devices को सीधे emulate करके Windows NT को native रूप से चलाता है

x86 CPU emulation

  • x86 CPU emulation, निम्न सुविधाओं के साथ:
    • Pentium-class CPU
    • x87 80-bit floating point (bit exact)
    • PAE
    • CMOV instructions
    • MMX, SSE2 support
    • AMD SVM virtual machine extension (Nested Page Table support)
    • RDPMC के जरिए instruction count पढ़ना
  • ज्ञात सीमाएँ:
    • memory access के समय segment limit और permission checks नहीं किए जाते
    • debug unsupported (DRx registers)

emulated devices

  • 8259 PIC(Programmable Interrupt Controller)
  • 8254 PIT(Programmable Interrupt Timer)
  • 16450 UART(केवल debug के लिए)
  • Real Time Clock
  • PCI bus
  • VirtIO console, 9P filesystem, network, block devices, input
  • Simple framebuffer
  • IDE controller, PS/2 keyboard/mouse, dummy VGA display (सभी वैकल्पिक)

RISC-V CPU emulation

  • 32-bit या 64-bit RISC-V CPU emulation, 64-bit FPU और compressed instructions support के साथ
  • वर्तमान में RISC-V 64-bit Buildroot और Fedora distributions उपलब्ध हैं
  • RISC-V 32-bit images अभी भी उपलब्ध हैं, लेकिन अब सक्रिय रूप से maintain नहीं की जातीं
    • buildroot-riscv32 का console version और X Window version उपलब्ध है

प्रदर्शन

  • 2017 के अनुसार, सामान्य desktop PC पर Firefox browser में x86 emulator लगभग 100 MIPS पर चलता है
  • बिल्ट-इन vmtime utility के जरिए विस्तृत benchmark किए जा सकते हैं

JavaScript terminal

  • मूल JSLinux terminal का बेहतर version, जिसमें scrollbar और URL highlighting support है

Linux distributions

  • Alpine Linux और Buildroot distributions का उपयोग
  • vfsync, qemacs, tcc जैसे custom packages जोड़े गए
  • Fluxbox window manager के जरिए वैकल्पिक X Window support

networking

  • emulator के भीतर से internet access संभव
  • Benjamin Burns द्वारा दिया गया websocket VPN उपयोग किया जाता है
  • bandwidth 40 kB/s तक सीमित, और हर public IP पर अधिकतम 2 connections की अनुमति

उपयोग

  • JavaScript engine benchmarking (जैसे Linux boot time मापना) और asm.js, WASM जैसी नई browser technologies का उपयोग
  • browser छोड़े बिना command-line Unix tools सीखना
  • browser के भीतर सुरक्षित file access (vfsync)
  • legacy PC software चलाना

source code और समान प्रोजेक्ट

  • RISC-V version का source code TinyEMU project में उपलब्ध है, और आसान installation के लिए precompiled demo भी दिया गया है
  • समान projects:
    • jor1k: OpenRISC OR1K CPU emulator
    • v86: PC emulator
    • angel: RISC-V CPU emulator

1 टिप्पणियां

 
ndrgrd 2025-04-16

CORS सेटिंग गलत है, इसलिए लिंक में https://www.bellard.org/jslinux/ की बजाय https://bellard.org/jslinux/ पर जाना होगा, तभी यह सही तरह से काम करता है।