📄 hurd.html
字号:
<HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Author" CONTENT="Bruno Bonfils"> <TITLE>Bochs and the GNU/Hurd</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#ececec" LINK="#3333cc" VLINK="#666666"><center><h1>How to use bochs to run the Hurd</h1><font size=2>by Bruno Bonfils, <asyd@debian-fr.org></font></center><h2><li> Introduction</h2><p>Since I don't have enough computers to dedicate a box to the Hurd, I'm tryingto do my own harddrive image disk. I thougt there wassome documentation about how to do that. But since I didn't findanything and I decided to write a small doc. I hope this document will beuseful for some people who wants to try the Hurd.</p><li> The testing box<p>Debian (Sid) GNU/Linux 2.4.19 </p><pre>ii bochs 1.4.1.no.elpin IA-32 (x86) PC emulatorii bochs-x 1.4.1.no.elpin Bochs binary with X interface.ii grub 0.92+cvs200209 GRand Unified Bootloaderii gcc-i386-gnu 1.7-8 Cheap cross-compiler for GNU/Hurd.ii mig-i386-gnu 1.2-1 The GNU distribution of the Mach 3.0 interface</pre><p>If you don't have time and if you trust me, you can download here[1] my own image file. <b>(You don't need to run native-install)</b><p><h2><li> Creating the image</h2><p><i>In this example, I use a 112 MB image disk, but I think youcan use any size without some problem.</i></p><p>Use createdisk command like this :<pre># createdisk hurd.img 112 Disk Geometry:C: 227H: 16S: 63Total size: 117153792 bytes</pre></p<p>Note on a paper or on your memory the disk geometry. Then, use thelosetup command to create a loopback on the whole disk.</p><pre># losetup /dev/loop1 hurd.img</pre><p>Now, call fdisk on /dev/loop1. Go into expert mode, and modify thedisk geometry using the c, h, s commands. Return in normal mode, andcreate an unique primary partition which uses the whole disk. Then,detach the /dev/loop1 using :<pre># losetup -d /dev/loop1</pre></p><h2><li> Installing GNU/Hurd</h2><li> Attach the partition<p> First of all, you need to create a filesystem on the disk. Use thecommand losetup and -o <offset> option to attach /dev/loop1 on the firstpartition of an image disk. Offset is computed like this :offset = sector * block_size (512)<pre># losetup -o 32256 /dev/loop1 hurd.img</pre></p><li> Preparing the filesystem<p>According to The Hurd Installation Guide [2], use mke2fs to create afilesystem.</p><pre># mke2fs -o hurd /dev/loop1</pre>Just mount /dev/loop1 like a typical dev.<pre># mount /dev/loop1 /mnt/gnu</pre><li> Finish the installation<p>Download a GNU/Hurd archive as indicated in the Hurd Installation Guide, and decompress it in /mnt/gnu.</p><pre># cd /mnt/gnu# tar --same-owner -xvzpf ~/gnu-latest.tar.gz</pre><h2><li> Bochs Configuration</h2><p>Copy default configuration (/usr/share/doc/bochs/examples/bochsrc.gz on debian) on your home directory and edit it with your favorite editor (GNU Emacs, i hope ;).</p><p>For my image file I have the following configuration :<pre>romimage: file=/usr/share/bochs/BIOS-bochs-latest, address=0xf0000megs: 128vgaromimage: /usr/share/vgabios/vgabios.binfloppya: 1_44=/dev/fd0, status=ejecteddiskc: file="/home/asyd/travail/hurd/hurd.img", cyl=227, heads=16, spt=63 # edit mecdromd: dev=/dev/cdrom, status=insertedboot: clog: /dev/stdoutpanic: action=askerror: action=reportinfo: action=reportdebug: action=ignorevga_update_interval: 300000keyboard_serial_delay: 250keyboard_paste_delay: 100000floppy_command_delay: 500ips: 1000000mouse: enabled=0private_colormap: enabled=0fullscreen: enabled=0screenmode: name="sample"ne2k: ioaddr=0x280, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0keyboard_mapping: enabled=0, map=keyboard_type: xti440fxsupport: enabled=0</pre>note most of them are actually in the default Debian example file. If you usethese lines, don't forget to read the Networking section.</p><h2><li> Note on GNU Mach</h2><p><i>Remember that the Hurd is not an OS, it's just a collection of librariesand programs, so we can't actually boot the Hurd. We boot GNU Mach, andthen launch the base servers.</i></p><p>The default GNU Mach which is provided by the default GNU/Hurd archive contains some modules / drivers which are not needed in bochs environment. If you use it, you'll probably have some kernel panic while booting. Don't be afraid and just say alwayscont.</p><p><i>Note: in my archive, I use a recompiled GNU Mach which contains only thedrivers which are needed (--enable-floppy --enable-ide --enable-kmsg--enable-ne2000). If you want more informations on how to compile your ownGNU Mach, just send me a mail and I'll add the section in thisdocument.</i></p><h2><li> Final Step</h2><p>Create a grub floppy disk or use my floppy image [3]. Adapt your bochsrcfile according to your choice. If you want install Grub on the image disk,remember to copy stage1, stage2 Grub's files into /mnt/gnu/boot/grub.</p><p>Launch bochs - as root if you want networking (using sudo for example).</p><i>If you have stage1 and stage2 file, you can install Grub on the MBR.</i><pre><grub> root (hd0,0)<grub> setup (hd0)</pre><p>Finally, booting GNU mach</p><pre><grub> root (hd0,0)<grub> kernel /boot/gnumach.gz root=hd0s1<grub> module /boot/serverboot.gz<grub> boot</pre>Now, you can read the official Hurd Installation Guide [2].<h2><li> Networking</h2><p>You can try to test networking between the GNU/Linux (host OS) and the GNU/Hurd.First of all, please read [4], I currently have the *same* problem.</p><p>Verify your kernel configuration, you need to have :<pre>CONFIG_NETLINK_DEV=mCONFIG_ETHERTAP=m</pre>(or y instead or m). Check if /dev/tap0 file exist, else create itwith<pre># mknod /dev/tap0 c 36 16</pre>and run this command on the guest os :<pre># ifconfig tap0 192.168.100.1 netmask 255.255.255.0</pre>Use ip 196.168.100.10 on the GNU/Hurd and you can ping 192.168.100.1</p><h2><li> Links</h2><li> [1] <a href="http://plouc.net/~asyd/hurd/hurd.img.gz">My ownharddisk Image File (~20Mo)</a><li> [2] <ahref="http://web.walfield.org/papers/hurd-installation-guide/english/hurd-install-guide.html">HurdInstallation guide</a><li> [3] Grub Floppy image : <font color="#FF0000">coming soon</font><li> [4] <a href="http://www.geocrawler.com/archives/3/11758/2002/3/350/8049674/">new ethertap interface for linux, by Bryce Denney</a><h2><li> Thanks</h2><li> Mmenal<li> #hurdfr, #hurd, #bochs channels (Freenode network)<li> All people who help me everyday on IRC<hr SIZE=1><center>Copyright (c) <a href="mailto:asyd@debian-fr.org">Bruno Bonfils</a><br>Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.1or any later version published by the Free Software Foundation.<br>Last modified : Sat, 31 Aug 2002 22:54:50 +0200</center></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -