Sean Hincheeinitial push75d07b48 years agoHistory
741 lines · 7.3 KB · HTML
RawDownload
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />	<meta name="keywords" content="9p, 9p2000, research, Plan 9, Inferno, Unix, Open Source, Bell Labs" />	<meta name="description" content="Open source distributed operating system Plan 9 from Bell Labs." />	<link rel="stylesheet" href="/wiki-style.css" media="all" type="text/css" />	<title>Linux emulation (Diff)</title></head><body><h1><a name="top"></a>Linux emulation <i>-Diff-</i></h1> <div class='body'> <!-- ***************************** --> <hr /><div class='diff_head'><a href="index.html">Sat Apr 21 18:32:50 EDT 2012</a>, sl</div><hr />LinuxemuisaprogramthatcanexecuteLinux/i386ELFbinariesonPlan9.ItwasstartedbyRussCoxanddevelopmentwascontinuedbycinap_lenrek.Pleasecontactcinap_lenrekATgmxDOTdewithbugreportsorimprovements.<a name="SOURCE" /><h3>SOURCE</h3> <p class='para'><a href="http://plan9.bell-labs.com/sources/contrib/cinap_lenrek/linuxemu3.tgz">/n/sources/contrib/cinap_lenrek/linuxemu3.tgz</a></p> <p class='para'><a href="http://9hal.ath.cx/usr/cinap_lenrek/linuxemu3.tgz">http://9hal.ath.cx/usr/cinap_lenrek/linuxemu3.tgz</a></p> <a name="DOCUMENTATION" /><h3>DOCUMENTATION</h3> <p class='para'>Documentationisprovidedinthedocdirectory:</p> <pre>	doc/linuxemu.txt	doc/todo.txt</pre> <a name="INSTALLATION" /><h3>INSTALLATION</h3> <pre>	tar xzf linuxemu3.tgz	cd linuxemu3	mk	mk install</pre> <a name="BOOTSTRAP" /><h3>BOOTSTRAP</h3> <p class='para'>YouneedaLinuxrootfilesystempackedinatarball.Go!GetsomeLinuxrootfs:</p> <p class='para'><a href="http://9hal.ath.cx/usr/cinap_lenrek/mroot-linuxemu.tbz">http://9hal.ath.cx/usr/cinap_lenrek/mroot-linuxemu.tbz</a></p> <p class='para'><a href="http://plan9.stanleylieber.com/linuxemu/mroot.tgz">http://plan9.stanleylieber.com/linuxemu/mroot.tgz</a></p> <p class='para'>The-linuxemuversioncontainsnosymlinksandcanbeextractedwithplainplan9toolsbunzip/tar.</p> <p class='para'>Themroot.tgzversioncontainsthesameDebianSargebaseas-linuxemu,butwithseveraladditionalpackagespre-installed:</p> <pre>	9base	dmenu-4.1.1	dwm-5.8.2	gcc 3.3.5	linux-kernel-headers	mercurial 0.9.4	opera 10.11	python 2.3.5	xlib-dev</pre> <p class='para'>andmore.Viewits<a href="http://plan9.stanleylieber.com/linuxemu/setup">setup</a>fileformoredetails.</p> <p class='para'>YoucancreateyourownwithdebootstraponDebianLinux,orhelpwriteaninstallerthatunpacksandinstallsSlackwareonPlan9...Inanycase,linuxemuisnothardwiredtoanyLinuxdistribution!</p> <a name="RUNNING" /><h3>RUNNING</h3> <p class='para'>Usetheprovided"linux"scripttochrootintoyourLinuxrootfs.The"linux"scriptisneccesarybecauseforLinuxprogramstorun,sharedlibrariesfromyourrootfshavetoappearat/liband/usr/lib,whileconfigurationfilesareexpectedtobein/etc.ThescriptwillbuildaprivatenamespaceandbindtheLinuxrootfsoverthePlan9root.theoriginalPlan9namespaceismountedat/9.</p> <pre>	linux -r ./mroot /bin/bash -i</pre> <p class='para'>Ifthe-roptionisomitted,theLinuxrootfsdefaultsto/sys/lib/linux.youmayputyourLinuxrootfsthereoraddabindtoyour$home/lib/profile.</p> <p class='para'>IntheLinuxrootfs,/etc/resolv.confshouldbechangedtomatchyournetworknameserver.Inaddition,/etc/apt/sources.listshouldbeupdatedtoaworkingDebianmirror.(Sargepackagescanstillbeaccessedatdebhttp://archive.debian.org/debian-archive/debiansargemain)</p> <a name="EXAMPLES" /><h3>EXAMPLES</h3> <p class='para'>LinuxX11programsmaybeusedinconjunctionwiththePlan9<a href="http://www.plan9.bell-labs.com/wiki/plan9/X11_installation">equis</a>X11contribpackage.Forexample,toruntheOperawebbrowserunderyourLinuxrootfs,startequisinariowindow,chrootintoyourLInuxrootfsand:</p> <pre>	dwm &amp;	opera &amp;</pre> <p class='para'>Operashould(eventually)appearintheequiswindow.Awindowmanager(thisexampleusesdwm)isrecommendedsothatX11programsworkproperly.</p> <a name="DEBUGGING" /><h3>DEBUGGING</h3> <p class='para'>Iflinuxemucrashes,useacidtofigureoutwhatsgoingon:</p> <pre>	mk acid	acid -l linuxemu.acid &lt;pid&gt;</pre> <p class='para'>Thenyoucanissuethefollowingcommands:</p> <pre>	ustk()				dump a (userspace) stacktrace for the current thread	umem(Current())			dump the memory mappings	ufds(Current())			dump the filedescriptor table	utrace(Current())		dump the internal tracebuffer (enabled by -d option)</pre> <p class='para'>Usexasm()/xcasm()fordisassemblyforLinuxcode.</p> <p class='para'>Youcanalsoenablefulltracelogging:</p> <pre>	linux -r ./mroot -dd /bin/bash -i &gt;[2]/tmp/linuxemu.log</pre> <p class='para'>This

Lines 1–500 of 741.