TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tiniest x86-64-Linux emulator

192 pointsby begoonover 2 years ago

6 comments

molticrystalover 2 years ago
They also made cosmopolitan libc [0] which outputs a single binary that runs on many platforms.<p>&gt; The above command fixes GCC so it outputs portable binaries that will run on every Linux distro in addition to Mac OS X, Windows NT, FreeBSD, OpenBSD, and NetBSD too. Your program will also boot on bare metal too. In other words, you&#x27;ve written a normal textbook C program, and thanks to Cosmopolitan&#x27;s low-level linker magic, you&#x27;ve effectively created your own operating system which happens to run on all the existing ones as well.<p>Brought up recently here: &quot;Debugging C with Cosmopolitan Libc&quot; [1]<p>And introduced here &quot;Cosmopolitan Libc: build-once run-anywhere C library&quot; [2]<p>[0] <a href="https:&#x2F;&#x2F;justine.lol&#x2F;cosmopolitan&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;justine.lol&#x2F;cosmopolitan&#x2F;index.html</a><p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33312012" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33312012</a><p>[2] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25556286" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25556286</a>
评论 #33680304 未加载
评论 #33678236 未加载
xmonkeeover 2 years ago
man, jart&#x27;s projects make me feel that 1&#x2F;10x engineer
评论 #33677853 未加载
评论 #33677238 未加载
评论 #33694592 未加载
psychphysicover 2 years ago
Biggest thing for me here is I didn&#x27;t realise qemu-x86_64 was only 10mb!
comexover 2 years ago
&gt; It&#x27;ll be nice to know that any normal PC program we write will &quot;just work&quot; on Raspberry Pi and Apple ARM. All we have to do embed an ARM build of the emulator above within our x86 executables, and have them morph and re-exec appropriately, similar to how Cosmopolitan is already doing doing with qemu-x86_64, except that this wouldn&#x27;t need to be installed beforehand. The tradeoff is that, if we do this, binaries will only be 10x smaller than Go&#x27;s Hello World, instead of 100x smaller.<p>…No mention of the fact that an interpreter is typically at least 10x slower than native execution. The readme does say &quot;we&#x27;re still likely to add something like jit in the near future&quot;, but for now this isn&#x27;t very practical.
评论 #33678610 未加载
评论 #33679924 未加载
codedokodeover 2 years ago
This project is interesting, but I looked at tests folder and there is not many tests despite software is so complex. Also I wonder, isn&#x27;t it better to write tests in languages like Python?<p>Also, I don&#x27;t see what&#x27;s the use of Cosmopolitan Libc. In what situation does one need a CLI-only binary that can run on any system?
评论 #33692263 未加载
评论 #33687890 未加载
yjftsjthsd-hover 2 years ago
That&#x27;s beautifully worked.<p><pre><code> o&#x2F;&#x2F;blink&#x2F;blink </code></pre> What&#x27;s the double slash for?
评论 #33678573 未加载
评论 #33677190 未加载