summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-04-04 00:56:24 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-04-04 00:56:24 +0200
commit2de01fbb8f3aba6ac5d85b62d8c224220df01842 (patch)
tree678fe25ddf169972e1c4a273855d8017123b7ff4 /hurd
parent271c3a402f9c9db2b38989829e60bc30ed6a7ec4 (diff)
parent636b547be5a607e353c3445ebabcbd780dad9de9 (diff)
Merge branch 'master' of flubber:~hurd-web/hurd-web
Diffstat (limited to 'hurd')
-rw-r--r--hurd/running/debian.mdwn28
-rw-r--r--hurd/running/debian/qemu_image.mdwn23
-rw-r--r--hurd/running/qemu.mdwn232
-rw-r--r--hurd/running/qemu/discussion.mdwn52
-rw-r--r--hurd/translator/procfs/jkoenig.mdwn55
-rw-r--r--hurd/translator/procfs/jkoenig/discussion.mdwn168
-rw-r--r--hurd/translator/tmpfs.mdwn12
-rw-r--r--hurd/translator/tmpfs/discussion.mdwn17
-rw-r--r--hurd/translator/tmpfs/tmpfs_vs_defpager.mdwn121
9 files changed, 537 insertions, 171 deletions
diff --git a/hurd/running/debian.mdwn b/hurd/running/debian.mdwn
index 97d35bd7..fcd4d49b 100644
--- a/hurd/running/debian.mdwn
+++ b/hurd/running/debian.mdwn
@@ -1,28 +1,24 @@
[[!meta title="Debian GNU/Hurd"]]
-### Debian Resources
-
+# Debian Resources
- Official page about the Debian GNU/Hurd port: [Debian GNU/Hurd](http://www.debian.org/ports/hurd/)
+- Debian [[FAQ]] — Frequently Asked Questions
-- Debian [[FAQ]] -- Frequently Asked Questions
-
-### Installing
+## QEMU Image
+[[!inline pages=hurd/running/debian/qemu_image raw=yes feeds=no]]
+# Installing
- [Installation Instructions](http://www.debian.org/ports/hurd/hurd-install)
- - [Upgrading K11 or K14 based systems to
- unstable](http://lists.debian.org/debian-hurd/2007/09/msg00007.html)
-- [[After_install]] -- Do this to get networking, new console and X
-
-### Contributing
+ - [Upgrading K11 or K14 based systems to unstable](http://lists.debian.org/debian-hurd/2007/09/msg00007.html)
+- [[After_install]] — Do this to get networking, new console and X
-- [[Porting]] -- Helping with porting packages
- * [[Patch_submission]] -- How to submit patches for build failures
+# Contributing
+- [[Porting]] — Helping with porting packages
+ * [[Patch_submission]] — How to submit patches for build failures
- [[Creating_image_tarball]]
-### Additional Information
-
+# Additional Information
- [Presentation](http://people.debian.org/~mbanck/talks/hurd_lt2004/html/)
- *Debian GNU/Hurd* by [[MichaelBanck]], LinuxTag 2004 Karlsruhe
+ *Debian GNU/Hurd*, [[MichaelBanck]], LinuxTag 2004 Karlsruhe
- [[Status]]
- [Archive Qualification](http://wiki.debian.org/ArchiveQualification/hurd-i386)
-
diff --git a/hurd/running/debian/qemu_image.mdwn b/hurd/running/debian/qemu_image.mdwn
new file mode 100644
index 00000000..9f828556
--- /dev/null
+++ b/hurd/running/debian/qemu_image.mdwn
@@ -0,0 +1,23 @@
+[[!meta copyright="Copyright © 2011 Free Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+There is a QEMU image with [[Debian GNU/Hurd|debian]] pre-installed available
+as <http://people.debian.org/~sthibault/hurd-i386/debian-hurd.img.tar.gz>.
+
+Usage:
+
+ $ wget http://people.debian.org/~sthibault/hurd-i386/debian-hurd.img.tar.gz
+ $ tar -xz < debian-hurd.img.tar.gz
+ $ qemu -net nic,model=rtl8139 -net user debian-hurd-*.img
+
+Just in case you were wondering: the *root* password is *root*.
+
+[[!if test="destpage(hurd/running/qemu)" then="" else="For more detailed
+instructions, please see the [[hurd/running/QEMU]] page."]]
diff --git a/hurd/running/qemu.mdwn b/hurd/running/qemu.mdwn
index 141ab2b1..aea20ae8 100644
--- a/hurd/running/qemu.mdwn
+++ b/hurd/running/qemu.mdwn
@@ -1,18 +1,29 @@
+[[!meta copyright="Copyright © 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
This page discusses things for [[Unix]] systems, there is a separate page for
[[Microsoft_Windows]] systems.
-
# Readily Available Images
-To try out the Hurd you can use the image of the Debian GNU/Hurd:
+You can use the following images to give the GNU/Hurd a try.
-* [Official Debian GNU/Hurd QEMU image](http://ftp.debian-ports.org/debian-cd/K16/debian-hurd-k16-qemu.img.tar.gz)
+## Debian GNU/Hurd
-(!) Note that the following are unofficial images: they have been prepared by
-volunteers and may not have been tested extensively.
+[[!inline pages=hurd/running/debian/qemu_image raw=yes feeds=no]]
-<!--* [Disk image](http://www.numenor.art.pl/balrog/hurd/) with an installation of
- [[Debian_GNU/Hurd|running/debian]].-->
+## Unofficial Images
+
+Note that the following images are unofficial ones: they have been prepared by
+volunteers and may not have been tested extensively.
* [Disk image](http://draketo.de/dateien/hurd/bab-hurd-qemu-2008-10-29.img.tar.bz2)
with a short intro on translators. Just start it with 'qemu *disk_image.img*'.
@@ -20,9 +31,10 @@ volunteers and may not have been tested extensively.
with it, please have a look at [[its_wikipage|hurd/running/qemu/babhurd_image]]. And when
you use it, please [tell me your experience with it](http://draketo.de/contact)! - [[community/weblogs/ArneBab]]
-Also you can use qemu to easily try one of our [[Hurd_LiveCDs|hurd/running/live_cd/]].
+# Arch Hurd Live CD
-<!--* [Announcement](http://lists.debian.org/debian-hurd/2007/09/msg00000.html) of another image. - The link in the email doesn't work anymore, too old. //-->
+Also you can use QEMU to easily try one of the
+[[Hurd_LiveCDs|hurd/running/live_cd/]].
# What is Needed to create a QEMU image
@@ -39,39 +51,135 @@ Instructions for creating a qemu image from the install CDs from debian installe
# KVM acceleration
+Check if your CPU supports kvm:
+
+ $ egrep '^flags.*(vmx|svm)' /proc/cpuinfo
+
+#### If you don't have hardware support (slow):
+ $ apt-get install qemu
+
+#### If you have hardware support (recommended):
+ $ apt-get install qemu-kvm
+ $ modprobe kvm
+
+Intel VTx/VTd: Enable Intel kvm in the BIOS
+
+On a HP xw4600 Workstation: F10, Security->System Security; Enable VTx and VTd
+
+Check that the kvm module is loaded:
+
+ $ lsmod|grep kvm
+ kvm_intel 38050 0
+ kvm 213800 1 kvm_intel
+
+ $ ls -l /dev/kvm
+ crw-rw----+ 1 root kvm 10, 232 Mar 14 15:02 /dev/kvm
+
+Add yourself to the kvm group:
+
+ $ adduser your_user kvm; logout; login
+
+AMD SVM (AMD-V): Enable AMD-V in the BIOS if not enabled.
+
+Check that the kvm module is loaded:
+
+ $ lsmod|grep kvm
+ kvm_amd 31862 0
+ kvm 214088 1 kvm_amd
+
+More info on kvm at: http://www.linux-kvm.org/page/FAQ
+
If your machine supports hardware acceleration, you should really use the kvm variant of qemu, as it speeds things quite a lot. Note however that kvm tends to make assumptions when accelerating things in the linux kernel, you may need some -no-kvm-something option. At the moment in Debian you need to pass
-no-kvm-irqchip
-else IRQs may hang sooner or later.
+to the command line, see below, if you are running Linux kernels 2.6.37 or 2.6.38 else IRQs may hang sooner or later. The kvm irq problems will be solved in kernel 2.6.39.
+
+# Installing Debian/Hurd with QEMU using the Debian installer
+
+Note: If you have hardware support, replace the qemu commands below with kvm, e.g. qemu-ing -> kvm-img.
+
+First off you will need to create a disk image using `qemu-img`. I have set mine to 4 GiB, although you should be able to get away with less.
+
+ $ qemu-img create hd0.img 4G
+
+Next you will want to start up QEMU and begin the installation process.
+
+ $ qemu -m 512 -hda hd0.img -cdrom mini.iso -net nic,model=rtl8139 -net user
+
+Now at his point do the regular install using `hd0` as your harddrive. Partition it and install the base system.
+
+In the installer make your choice of install option: Default install (or your choice)
+
+ Language: English
+ Country, territory or area: your_choice
+ Locale: your_choice
-# Installing Debian/Hurd with QEMU
+Note that even if you can set the country and locale, your local keyboard is not yet supported.
-First off you will need to create a disk image using `qemu-img`. I have set mine to 2 gigabytes, although you should be able to get away with less(Currently, the maximum disk image size one can create with QEMU is 4.5G).
+In case of problems with timezone or locale settings do the following after the installation is completed
- $ qemu-img create hd0.img 2G
+ To get the correct timezone:
+ $ dpkg-reconfigure tzdata
+ To get your locale setting:
+ $ nano /etc/locale.gen
+ $ locale-gen
-Next you will want to start up QEMU and begin the installation process. The first time you run it you will want to use the `-boot d` option to boot off the cdrom.
+Network: Now configured automatically with dhcp
- $ qemu -hda hd0.img -cdrom debian-K16-hurd-i386-CD1.iso -fda floppy.img -boot d
+ IP address: 10.0.2.15
+ Netmask: 255.255.0.0
+ Gateway: 10.0.2.2
+ Nameserver: 10.0.2.3
-Now at his point do the regular install using `hd0` as your harddrive. Partition it and install the base system. Once you have finished installing the base system select the reboot option as this will ensure the disk is properly un-mounted. When the Debian CD menu comes up again simply close QEMU.
+ Qemu network setup:
+ QEMU VLAN <------> Firewall/DHCP server <-----> Internet
+ | (10.0.2.2)
+ |
+ ----> DNS server (10.0.2.3)
+ |
+ ----> SMB server (10.0.2.4)
-Now run your image with floppy booting (`-boot a`) and finish the install (`./native-install` .. etc).
-You'll want to add more memory or activate swap for `./native-install` or it will hang.
-Starting qemu with `-m 512` worked for me.
-Swap can be activated like this (replace hd0s2 with your swap partition):
+Partitioning method: Guided (or your choice)
- $ cd /dev/
- $ MAKEDEV hd0s2
- $ /hurd/mach-defpager
- $ swapon /dev/hd0s2
+Partitioning `/dev/hd0`: All files in one partition.
-**Important:** Older versions on gnumach needed that the `-M isapc` was passed to qemu. This is not needed anymore.
+**Important**: Since partman does not yet mount other partitions than / automatically at reboot, it is crucial that you choose this option for now.
+
+Once you have finished installing the base system (might take some time) the system is rebooted and next boot will be from the hard disk. Now you are able to log in to your newly installed GNU/Hurd system.
Also see another text about how to [[gnu/create_an_image]] for the
[[GNU_system|gnu]].
+## Running the installed system
+
+Starting qemu/qemu-kvm:
+
+ $ kvm -m 512 -net nic,model=rtl8139 -net user,hostfwd=tcp::5555-:22 -hda hd0.img -vga vmware
+ vmsvga_value_write: guest runs Linux.
+
+Note: See below on port forwarding in the networking section.
+
+Note: Using the vmware vga driver is useful for setting up X windows, see [Debian GNU/Hurd](http://www.debian.org/ports/hurd/hurd-install)
+
+If you have problems with grub hanging during boot with the vmware vga driver: Disable the graphic boot
+
+ $ nano /etc/default/grub
+ uncomment GRUB_TERMINAL=console
+ $ /usr/sbin/update-grub
+
+### A few words about the qemu console
+
+During the graphical emulation, you can use the following keys:
+
+ <Ctrl><Alt>-f Toggle full screen
+ <Ctrl><Alt>-u Restore the screen's un-scaled dimensions
+ <Ctrl><Alt>-n Switch to virtual console 'n'. Standard console mappings are:
+ 1 Target system display
+ 2 Monitor
+ 3 Serial port
+ <Ctrl><Alt> Toggle mouse and keyboard grab.
+
# Transferring Files
@@ -88,13 +196,13 @@ You may wish to mount your disk image on your host system to transfer files. To
hd0.img1 * 63 3515903 1757920+ 83 Linux
hd0.img2 3515904 4193279 338688 82 Linux swap / Solaris
-Now take the number of sectors for the beginning of the partition and multiply it by the sector size. My partition starts at sector 63 and I have a sector size of 512 therefor my offset is 32256.
+Now take the number of sectors for the beginning of the partition and multiply it by the sector size. My partition starts at sector 63 and I have a sector size of 512 therefore my offset is 32256. For a start at 2048 the ofsset is 1048576.
# mount -o loop,offset=32256 hd0.img /mnt/diskimage
## Having QEMU create *virtual FAT disk images*
-[Manual](http://www.nongnu.org/qemu/qemu-doc.html#SEC25).
+[Link to the manual](http://www.nongnu.org/qemu/qemu-doc.html#SEC25).
QEMU has a facility to create FAT file systems on-the-fly:
@@ -120,6 +228,14 @@ If you just want to access the internet from within QEMU, you can setup pfinet f
# settrans -afgp /servers/socket/2 /hurd/pfinet -i eth0 -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0
# echo "nameserver 10.0.2.3" > /etc/resolv.conf
+Alternately DHCP does work now:
+
+ # dhclient eth0
+
+To get ssh working:
+
+ # apt-get install random-egd openssh-server (Similarly for telnet if preferred)
+
(See also <http://www.nongnu.org/qemu/qemu-doc.html#SEC32>.)
Outgoing internet connections should just work then.
@@ -129,8 +245,40 @@ but `apt-get update` should work after you have filled out
After that you should be able to install other network packages,
but note that `ping` doesn't work with QEMU's user-networking stack.
-If you want to connect from the host system to the Hurd system running in QEMU, you need to setup something more advanced, like bridged networking.
+If you want to connect from the host system to the Hurd system running in QEMU, you can use port forwarding in QEMU or to setup something more advanced, like bridged networking.
+## Port Forwarding in QEMU
+(In the following we assume we use kvm!)
+
+#### Logging in to Hurd from a terminal in your host system
+This is the recommended way to work with a Command Line Interface (CLI) since all your keyboard and locale settings are preserved.
+
+a) with ssh (assuming you have installed openssh-server)
+
+ $ kvm -m 1024 -net nic,model=rtl8139 -net user,hostfwd=tcp::5555-:22 -hda hd0.img &
+
+Logging in to the running Hurd:
+
+ $ ssh -p5555 localhost
+
+Copying files:
+
+ 1) On your host
+ To Hurd: scp -p -P5555 file localhost:
+ From Hurd: scp -p -P5555 localhost:file .
+ 2) On Hurd
+ To host: scp -p file {10.0.2.2,your_host_ip}: .
+ From host: scp -p {10.0.2.2,your_host_ip}:file .
+
+b) with telnet (assuming you have installed a telnet server, like telnetd)
+
+ $ kvm -m 1024 -net nic,model=rtl8139 -net user,hostfwd=tcp::5556-:23 -hda hurd-install.qemu &
+
+Logging in to the running Hurd:
+
+ $ telnet localhost 5556
+
+c) With the tap interface, see below.
## Bridged Networking
@@ -184,31 +332,3 @@ system after installation.
[[Image_for_L4]] -- a QEMU image for the Hurd/L4 project.
<http://eyeside.net/hurd/Hurd-on-QEMU.html>
-
-
-# TODO
-
-[[IRC]], #hurd, 2007-07-04.
-
- <azeem-uni> so, is there a way to use a Debian GNU/Hurd partition (/dev/hda6) with qemu directly?
- <tschwinge> Don't dare to do that, please.
- <tschwinge> It will lead to inconsistencies.
- <tschwinge> Because the Linux kernel thinks that it has complete control over the disk, or something.
- <tschwinge> In theory you could run something like ``-hda /dev/hda'', having GRUB installed on there to offer you to boot your Hurd system from hda6 and that will even work, but then don't get the idea to stop qemu, mount that partition on your Linux system and restart qemu. That's where I got lots of inconsistencies then, afterwards.
- <azeem-uni> it's probably the same problem as having that partition mounted, suspending to disk, booting into it in the Hurd, and resume Linux
- <neal> right
- <tschwinge> That's a different problem.
- <tschwinge> Then the partitoon is still mounted.
- <neal> no, I think it is basically the same problem
- <tschwinge> The file system stuff is cached in the kernel.
- <neal> you have data that has not been written to disk yet
- <tschwinge> Right.
- <neal> and neither is prepared for the resource to be shared
- <tschwinge> In the azeem-uni scenarion the data is on the file system layer and in my scenarion it's some disk block caching inside the Linux kernel, I guess.
- <azeem-uni> anyway, do you guys think if I use -hda /dev/hda and tell Grub to boot off /dev/hda6, that the rest of hda should be fine, right?
- <azeem-uni> maybe adding -snapshot makes it totally safe
- <neal> azeem: Should be fine.
- <tschwinge> Yes.
-
-The problem is actually that the linux block cache doesn't make any consistency between /dev/hda and /dev/hda6, so if you give /dev/hda to qemu, qemu writings won't be consistent with mounting /dev/hda6 in linux. You can give /dev/hda6 directly to qemu and it will be fine.
-
diff --git a/hurd/running/qemu/discussion.mdwn b/hurd/running/qemu/discussion.mdwn
new file mode 100644
index 00000000..fd0df4c5
--- /dev/null
+++ b/hurd/running/qemu/discussion.mdwn
@@ -0,0 +1,52 @@
+[[!meta copyright="Copyright © 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+[[!tag open_issue_documentation]]
+
+# Using Partitions
+
+[[IRC]], #hurd, 2007-07-04.
+
+ <azeem-uni> so, is there a way to use a Debian GNU/Hurd partition
+ (/dev/hda6) with qemu directly?
+ <tschwinge> Don't dare to do that, please.
+ <tschwinge> It will lead to inconsistencies.
+ <tschwinge> Because the Linux kernel thinks that it has complete control
+ over the disk, or something.
+ <tschwinge> In theory you could run something like ``-hda /dev/hda'',
+ having GRUB installed on there to offer you to boot your Hurd system from
+ hda6 and that will even work, but then don't get the idea to stop qemu,
+ mount that partition on your Linux system and restart qemu. That's where
+ I got lots of inconsistencies then, afterwards.
+ <azeem-uni> it's probably the same problem as having that partition
+ mounted, suspending to disk, booting into it in the Hurd, and resume
+ Linux
+ <neal> right
+ <tschwinge> That's a different problem.
+ <tschwinge> Then the partitoon is still mounted.
+ <neal> no, I think it is basically the same problem
+ <tschwinge> The file system stuff is cached in the kernel.
+ <neal> you have data that has not been written to disk yet
+ <tschwinge> Right.
+ <neal> and neither is prepared for the resource to be shared
+ <tschwinge> In the azeem-uni scenarion the data is on the file system layer
+ and in my scenarion it's some disk block caching inside the Linux kernel,
+ I guess.
+ <azeem-uni> anyway, do you guys think if I use -hda /dev/hda and tell Grub
+ to boot off /dev/hda6, that the rest of hda should be fine, right?
+ <azeem-uni> maybe adding -snapshot makes it totally safe
+ <neal> azeem: Should be fine.
+ <tschwinge> Yes.
+
+The problem is actually that the linux block cache doesn't make any consistency
+between /dev/hda and /dev/hda6, so if you give /dev/hda to qemu, qemu writings
+won't be consistent with mounting /dev/hda6 in linux. You can give /dev/hda6
+directly to qemu and it will be fine.
diff --git a/hurd/translator/procfs/jkoenig.mdwn b/hurd/translator/procfs/jkoenig.mdwn
index 1275ce52..9543b658 100644
--- a/hurd/translator/procfs/jkoenig.mdwn
+++ b/hurd/translator/procfs/jkoenig.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]]
+[[!meta copyright="Copyright © 2010, 2011 Free Software Foundation, Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
@@ -21,56 +21,3 @@ Testing it is as simple as this:
$ make
$ settrans -ca proc procfs --compatible
$ ls -l proc/
-
-
-# Open Issues
-
-[[!tag open_issue_hurd]]
-
- * IRC, #hurd, around September 2010
-
- <youpi> jkoenig: from a quick read, your procfs implementation seems quite
- simple, probably much more what I was expecting from Madhusudan (who probably
- now hates you :) )
- <youpi> jkoenig: is it not possible to provide a /proc/self which points at the
- client's pid?
- <pinotree> (also, shouldn't /proc/version say something else than "Linux"?)
- <youpi> to make linux tools work, no :/
- <youpi> kfreebsd does that too
- <pinotree> really?
- <youpi> yes
- <youpi> (kfreebsd, not freebsd)
- <pinotree> does kbsd's one print just "Linux version x.y.z" too, or something
- more eg in a second line?
- <pinotree> (as curiosity)
- <youpi> % cat /proc/version
- <youpi> Linux version 2.6.16 (des@freebsd.org) (gcc version 4.3.5) #4 Sun Dec
- 18 04:30:00 CET 1977
- <pinotree> k
- <giselher> I had some problems with killall5 to read the pid from /proc, Is
- this now more reliable?
- <youpi> I haven't tested with jkoenig's implementation
- [...]
- <pinotree> looks like he did 'self' too, see rootdir_entries[] in rootdir.c
- <youpi> but it doesn't point at self
- <antrik> youpi: there is no way to provide /proc/self, because the server
- doesn't know the identity of the client
- <youpi> :/
- <antrik> youpi: using the existing mechanisms, we would need another magic
- lookup type
- <antrik> an alternative idea I discussed with cfhammer once would be for the
- client to voluntarily provide it's identity to the server... but that would
- be a rather fundamental change that requires careful consideration
- <antrik> also, object migration could be used, so the implementation would be
- provided by the server, but the execution would happen in the client... but
- that's even more involved :-)
- <youpi> but we've seen how much that'd help with a lot of other stuff
- <antrik> I'm not sure whether we discussed this on the ML at some point, or
- only on IRC
- <youpi> it "just" needs to be commited :)
- <antrik> in either case, it can't hurt to bring this up again :-)
-
- * IRC, #hurd, around October 2010
-
- <pinotree> the only glitch is that files/dirs have the right user as
- owner, but always with root group
diff --git a/hurd/translator/procfs/jkoenig/discussion.mdwn b/hurd/translator/procfs/jkoenig/discussion.mdwn
new file mode 100644
index 00000000..b66af7de
--- /dev/null
+++ b/hurd/translator/procfs/jkoenig/discussion.mdwn
@@ -0,0 +1,168 @@
+[[!meta copyright="Copyright © 2010, 2011 Free Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+[[!tag open_issue_hurd]]
+
+[[!toc]]
+
+
+# Miscellaneous
+
+IRC, #hurd, around September 2010
+
+ <youpi> jkoenig: from a quick read, your procfs implementation seems quite
+ simple, probably much more what I was expecting from Madhusudan (who
+ probably now hates you :) )
+ <youpi> jkoenig: is it not possible to provide a /proc/self which points at
+ the client's pid?
+ <pinotree> (also, shouldn't /proc/version say something else than "Linux"?)
+ <youpi> to make linux tools work, no :/
+ <youpi> kfreebsd does that too
+ <pinotree> really?
+ <youpi> yes
+ <youpi> (kfreebsd, not freebsd)
+ <pinotree> does kbsd's one print just "Linux version x.y.z" too, or
+ something more eg in a second line?
+ <pinotree> (as curiosity)
+ <youpi> % cat /proc/version
+ <youpi> Linux version 2.6.16 (des@freebsd.org) (gcc version 4.3.5) #4 Sun
+ Dec 18 04:30:00 CET 1977
+ <pinotree> k
+ <giselher> I had some problems with killall5 to read the pid from /proc, Is
+ this now more reliable?
+ <youpi> I haven't tested with jkoenig's implementation
+ [...]
+ <pinotree> looks like he did 'self' too, see rootdir_entries[] in rootdir.c
+ <youpi> but it doesn't point at self
+ <antrik> youpi: there is no way to provide /proc/self, because the server
+ doesn't know the identity of the client
+ <youpi> :/
+ <antrik> youpi: using the existing mechanisms, we would need another magic
+ lookup type
+ <antrik> an alternative idea I discussed with cfhammer once would be for
+ the client to voluntarily provide it's identity to the server... but that
+ would be a rather fundamental change that requires careful consideration
+ <antrik> also, object migration could be used, so the implementation would
+ be provided by the server, but the execution would happen in the
+ client... but that's even more involved :-)
+ <youpi> but we've seen how much that'd help with a lot of other stuff
+ <antrik> I'm not sure whether we discussed this on the ML at some point, or
+ only on IRC
+ <youpi> it "just" needs to be commited :)
+ <antrik> in either case, it can't hurt to bring this up again :-)
+
+
+# root group
+
+IRC, #hurd, around October 2010
+
+ <pinotree> the only glitch is that files/dirs have the right user as
+ owner, but always with root group
+
+
+# `/proc/$pid/stat` being 400 and not 444, and some more
+
+IRC, freenode, #hurd, 2011-03-27
+
+ <pochu> is there a reason for /proc/$pid/stat to be 400 and not 444 like on
+ Linux?
+ <pochu> there is an option to procfs to make it 444 like Linux
+ <pochu> jkoenig: ^
+ <jkoenig> pochu, hi
+ <jkoenig> /proc/$pid/stat reveals information which is not usually
+ available on Hurd
+ <jkoenig> so I made it 400 by default to avoid leaking anything
+ <pochu> is there a security risk in providing that info?
+ <jkoenig> probably not so much, but it seemed like it's not really a
+ descision procfs should make
+ <jkoenig> I'm not sure which information we're speaking about, though, I
+ just remember the abstract reason.
+ <pochu> things like the pid, the memory, the priority, the state...
+ <pochu> sounds safe to expose
+ <jkoenig> also it's 0444 by default in "compatible" mode
+ <jkoenig> (which is necessary for the linux tools to work well)
+ <pochu> yeah I saw that :)
+ <pochu> my question is, should we change it to 0444 by default? if there
+ are no security risks and this improves compatibility, sounds like a good
+ thing to me
+ <pochu> we're already 'leaking' part of that info through e.g. ps
+ <jkoenig> I think /proc should be translated by /hurd/procfs --compatible
+ by default (I'm not sure whether it's already the case)
+ <jkoenig> also I'm not sure why hurd-ps is setuid root, rather than the
+ proc server being less paranoid, but maybe I'm missing something.
+ <pochu> jkoenig: it's not, at least not on Debian
+ <pochu> youpi: hi, what do you think about starting procfs with
+ --compatible by default?
+ <pochu> youpi: or changing /proc/$pid/stat to 0444 like on Linux
+ (--compatible does that among a few other things)
+ <youpi> I guess you need it for something?
+ <pochu> I'm porting libgtop :)
+ <youpi> k
+ <pochu> though I still think we should do this in procfs itself
+ <youpi> ymmv
+ <jkoenig> pochu, youpi, --compatible is also needed because mach's high
+ reported sysconf(_SC_CLK_TCK) makes some integers overflow (IIRC)
+ <youpi> agreed
+ <jkoenig> luckily, tools which use procfs usually try to detect the value
+ /proc uses rather than rely on CLK_TCK
+ <jkoenig> (so we can choose whatever reasonable value we want)
+
+IRC, freenode, #hurd, 2011-03-28
+
+ <antrik> jkoenig: does procfs expose any information that is not available
+ to everyone through the proc server?...
+ <antrik> also, why is --compatible not the default; or rather, why is there
+ even another mode? the whole point of procfs is compatibility...
+ <jkoenig> antrik, yes, through the <pid>/environ and (as mentionned above)
+ <pid>/stat files, but I've been careful to make these files readable only
+ to the process owner
+ <jkoenig> --compatible is not the default because it relaxes this paranoia
+ wrt. the stat file, and does not conform to the specification with regard
+ to clock tick counters
+ <antrik> what specification?
+ <jkoenig> the linux proc(5) manpage
+ <jkoenig> which says clock tick counters are in units of
+ 1/sysconf(_SC_CLK_TCK)
+ <antrik> so you are saying that there is some information that the Hurd
+ proc server doesn't expose to unprivileged processes, but linux /proc
+ does?
+ <jkoenig> yes
+ <antrik> that's odd. I wonder what the reasoning behind that could be
+ <antrik> but this information is available through Hurd ps?
+ <antrik> BTW, what exactly is _SC_CLK_TCK supposed to be?
+ <pinotree> jkoenig: hm, just tried with two random processes on linux
+ (2.6.32), and enrivon is 400
+ <pinotree> (which makes sense, as you could have sensible informations eg
+ in http_proxy or other envvars)
+ <jkoenig> antrik, CLK_TCK is similar to HZ (maybe clock resolution instead
+ of time slices ?)
+ <jkoenig> sysconf(3) says "The number of clock ticks per second."
+ <jkoenig> antrik, I don't remember precisely what information this was, but
+ ps-hurd is setuid root.
+ <jkoenig> anyway, if you run procfs --compatible as a user and try to read
+ foo/1/stat, the result is an I/O error, which is the result of the proc
+ server denying access.
+ <antrik> but Linux /proc acutally uses HZ as the unit IIRC? or is
+ _SC_CLK_TCK=HZ on Linux?...
+ <jkoenig> I expect they're equal.
+ <jkoenig> in practice procps uses heuristics to guess what value /proc uses
+ (for compatibility purposes with older kernels)
+ <jkoenig> I don't think HZ is POSIX, while _SC_CLK_TCK is specifies as the
+ unit for (at least) the values returned by times()
+ <jkoenig> s/specifies/specified/
+ <jkoenig> antrik, some the information is fetched directly from mach by
+ libps, and understandably, the proc server does not give the task port to
+ anyone who asks.
+ <antrik> well, as long as the information is exposed through ps, there is
+ no point in hiding it in procfs...
+ <antrik> and I'm aware of the crazy guessing in libproc... I was actually
+ mentoring the previous procfs implementation
+ <antrik> (though I never got around to look at his buggy code...)
+ <jkoenig> ok
diff --git a/hurd/translator/tmpfs.mdwn b/hurd/translator/tmpfs.mdwn
index 0179ad6c..d1476a92 100644
--- a/hurd/translator/tmpfs.mdwn
+++ b/hurd/translator/tmpfs.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2007, 2008, 2009 Free Software Foundation,
+[[!meta copyright="Copyright © 2007, 2008, 2009, 2011 Free Software Foundation,
Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
@@ -6,8 +6,8 @@ id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
`tmpfs` is a file system server for temporary data storage without using a real
(permanent) [[backing_store]].
@@ -21,9 +21,3 @@ with the additional block-level indirection layer that `ext2` (or any other
disk-based file system) imposes.
However, `tmpfs` is not working correctly at the moment:
-
-[[!inline
-pages="hurd/translator/tmpfs/*"
-show=0
-feeds=no
-actions=yes]]
diff --git a/hurd/translator/tmpfs/discussion.mdwn b/hurd/translator/tmpfs/discussion.mdwn
new file mode 100644
index 00000000..d7a08491
--- /dev/null
+++ b/hurd/translator/tmpfs/discussion.mdwn
@@ -0,0 +1,17 @@
+[[!meta copyright="Copyright © 2011 Free Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+[[!tag open_issue_hurd]]
+
+ * [[notes_bing]]
+
+ * [[notes_various]]
+
+ * [[tmpfs_vs_defpager]]
diff --git a/hurd/translator/tmpfs/tmpfs_vs_defpager.mdwn b/hurd/translator/tmpfs/tmpfs_vs_defpager.mdwn
index ef041a23..f0eb473c 100644
--- a/hurd/translator/tmpfs/tmpfs_vs_defpager.mdwn
+++ b/hurd/translator/tmpfs/tmpfs_vs_defpager.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]]
+[[!meta copyright="Copyright © 2010, 2011 Free Software Foundation, Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
@@ -8,9 +8,12 @@ Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
is included in the section entitled [[GNU Free Documentation
License|/fdl]]."]]"""]]
+[[!tag open_issue_hurd]]
+
\#hurd, freenode, 2010
- <slpz> humm... why does tmpfs try to use the default pager? that's a bad idea, and probably will never work correctly...
+ <slpz> humm... why does tmpfs try to use the default pager? that's a bad
+ idea, and probably will never work correctly...
* slpz is thinking about old issues
<slpz> tmpfs should create its own pagers, just like ext2fs, storeio...
<slpz> slopez@slp-hurd:~$ settrans -a tmp /hurd/tmpfs 10M
@@ -21,53 +24,99 @@ License|/fdl]]."]]"""]]
<slpz> :-)
<pochu> slpz: woo you fixed it?
<slpz> pochu: well, it's WIP, but reading/writing works...
- <slpz> I've replaced the use of default pager for the standard pager creation mechanism
- <antrik> slpz: err... how is it supposed to use swap space if not using the default pager?
- <antrik> slpz: or do you mean that it should act as a proxy, just allocating anonymous memory (backed by the default pager) itself?
- <youpi> antrik: the kernel uses the default pager if the application pager isn't responsive enough
- <slpz> antrik: it will just create memory objects and provide zerofilled pages when requested by the kernel (after a page fault)
- <antrik> youpi: that makes sense I guess... but how is that relevant to the question at hand?...
+ <slpz> I've replaced the use of default pager for the standard pager
+ creation mechanism
+ <antrik> slpz: err... how is it supposed to use swap space if not using the
+ default pager?
+ <antrik> slpz: or do you mean that it should act as a proxy, just
+ allocating anonymous memory (backed by the default pager) itself?
+ <youpi> antrik: the kernel uses the default pager if the application pager
+ isn't responsive enough
+ <slpz> antrik: it will just create memory objects and provide zerofilled
+ pages when requested by the kernel (after a page fault)
+ <antrik> youpi: that makes sense I guess... but how is that relevant to the
+ question at hand?...
<slpz> antrik: memory objects will contain the data by themselves
- <slpz> antrik: as youpi said, when memory is scarce, GNU Mach will start paging out data from memory objects to the default pager
+ <slpz> antrik: as youpi said, when memory is scarce, GNU Mach will start
+ paging out data from memory objects to the default pager
<slpz> antrik: that's the way in which pages will get into swap space
<slpz> (if needed)
- <youpi> the thing being that the tmpfs pager has a chance to select pages he doesn't care any more about
- <antrik> slpz: well, the point is that instead of writing the pages to a backing store, tmpfs will just keep them in anonymous memory, and let the default pager write them out when there is pressure, right?
- <antrik> youpi: no idea what you are talking about. apparently I still don't really understand this stuff :-(
+ <youpi> the thing being that the tmpfs pager has a chance to select pages
+ he doesn't care any more about
+ <antrik> slpz: well, the point is that instead of writing the pages to a
+ backing store, tmpfs will just keep them in anonymous memory, and let the
+ default pager write them out when there is pressure, right?
+ <antrik> youpi: no idea what you are talking about. apparently I still
+ don't really understand this stuff :-(
<youpi> ah, but tmpfs doesn't have pages he doesn't care about, does it?
- <slpz> antrik: yes, but the term "anonymous memory" could be a bit confusing.
- <slpz> antrik: in GNU Mach, anonymous memory is backed by a memory object without a pager. In tmpfs, nodes will be allocated in memory objects, and the pager for those memory objects will be tmpfs itself
- <antrik> slpz: hm... I thought anynymous memory is backed by memory objects created from the default pager?
- <antrik> yes, I understand that tmpfs is supposed to be the pager for the objects it provides. they are obviously not anonymoust -- they have inodes in the tmpfs name space
- <antrik> but my understanding so far was that when Mach returns pages to the pager, they end up in anonymous memory allocated to the pager process; and then this pager is responsible for writing them back to the actual backing store
+ <slpz> antrik: yes, but the term "anonymous memory" could be a bit
+ confusing.
+ <slpz> antrik: in GNU Mach, anonymous memory is backed by a memory object
+ without a pager. In tmpfs, nodes will be allocated in memory objects, and
+ the pager for those memory objects will be tmpfs itself
+ <antrik> slpz: hm... I thought anynymous memory is backed by memory objects
+ created from the default pager?
+ <antrik> yes, I understand that tmpfs is supposed to be the pager for the
+ objects it provides. they are obviously not anonymoust -- they have
+ inodes in the tmpfs name space
+ <antrik> but my understanding so far was that when Mach returns pages to
+ the pager, they end up in anonymous memory allocated to the pager
+ process; and then this pager is responsible for writing them back to the
+ actual backing store
<antrik> am I totally off there?...
- <antrik> (i.e. in my understanding the returned pages do not reside in the actual memory object the pager provides, but in an anonymous memory object)
- <slpz> antrik: you're right. The trick here is, when does Mach return the pages?
- <slpz> antrik: if we set the attribute "can_persist" in a memory object, Mach will keep it until object cache is full or memory is scarce
+ <antrik> (i.e. in my understanding the returned pages do not reside in the
+ actual memory object the pager provides, but in an anonymous memory
+ object)
+ <slpz> antrik: you're right. The trick here is, when does Mach return the
+ pages?
+ <slpz> antrik: if we set the attribute "can_persist" in a memory object,
+ Mach will keep it until object cache is full or memory is scarce
<slpz> or we change the attributes so it can no longer persist, of course
- <slpz> without a backing store, if Mach starts sending us pages to be written, we're in trouble
- <slpz> so we must do something about it. One option, could be creating another pager and copying the contents between objects.
+ <slpz> without a backing store, if Mach starts sending us pages to be
+ written, we're in trouble
+ <slpz> so we must do something about it. One option, could be creating
+ another pager and copying the contents between objects.
<antrik> another pager? not sure what you mean
- <antrik> BTW, you didn't really say why we can't use the default pager for tmpfs objects :-)
- <slpz> well, there're two problems when using the default pager as backing store for translators
- <slpz> 1) Mach relies on it to do swapping tasks, so meddling with it is not a good idea
- <slpz> 2) There're problems with seqnos when trying to work with the default pager from tasks other the kernel itself
+ <antrik> BTW, you didn't really say why we can't use the default pager for
+ tmpfs objects :-)
+ <slpz> well, there're two problems when using the default pager as backing
+ store for translators
+ <slpz> 1) Mach relies on it to do swapping tasks, so meddling with it is
+ not a good idea
+ <slpz> 2) There're problems with seqnos when trying to work with the
+ default pager from tasks other the kernel itself
<slpz> (probably, the latter could be fixed)
- <slpz> antrik: pager's terminology is a bit confusing. One can also say creating another memory object (though the function in libpager is "pager_create")
+ <slpz> antrik: pager's terminology is a bit confusing. One can also say
+ creating another memory object (though the function in libpager is
+ "pager_create")
<antrik> not sure why "meddling" with it would be a problem...
- <antrik> and yeah, I was vaguely aware that there is some seqno problem with tmpfs... though so far I didn't really understand what it was about :-)
+ <antrik> and yeah, I was vaguely aware that there is some seqno problem
+ with tmpfs... though so far I didn't really understand what it was about
+ :-)
<antrik> makes sense now
- <antrik> anyways, AIUI now you are trying to come up with a mechanism where the default pager is not used for tmpfs objects directly, but without making it inefficient?
- <antrik> slpz: still don't understand what you mean by creating another memory object/pager...
+ <antrik> anyways, AIUI now you are trying to come up with a mechanism where
+ the default pager is not used for tmpfs objects directly, but without
+ making it inefficient?
+ <antrik> slpz: still don't understand what you mean by creating another
+ memory object/pager...
<antrik> (and yeat, the terminology is pretty mixed up even in Mach itself)
- <slpz> antrik: I meant creating another pager, in terms of calling again to libpager's pager_create
- <antrik> slpz: well, I understand what "create another pager" means... I just don't understand what this other pager would be, when you would create it, and what for...
+ <slpz> antrik: I meant creating another pager, in terms of calling again to
+ libpager's pager_create
+ <antrik> slpz: well, I understand what "create another pager" means... I
+ just don't understand what this other pager would be, when you would
+ create it, and what for...
<slpz> antrik: oh, ok, sorry
- <slpz> antrik: creating another pager it's just a trick to avoid losing information when Mach's objects cache is full, and it decides to purge one of our objects
- <slpz> anyway, IMHO object caching mechanism is obsolete and should be replaced
+ <slpz> antrik: creating another pager it's just a trick to avoid losing
+ information when Mach's objects cache is full, and it decides to purge
+ one of our objects
+ <slpz> anyway, IMHO object caching mechanism is obsolete and should be
+ replaced
<slpz> I'm writting a comment to bug #28730 which says something about this
<slpz> antrik: just one more thing :-)
- <slpz> if you look at the code, for most time of their lives, anonymous memory objects don't have a pager
+ <slpz> if you look at the code, for most time of their lives, anonymous
+ memory objects don't have a pager
<slpz> not even the default one
- <slpz> only the pageout thread, when the system is running really low on memory, gives them a reference to the default pager by calling vm_object_pager_create
+ <slpz> only the pageout thread, when the system is running really low on
+ memory, gives them a reference to the default pager by calling
+ vm_object_pager_create
<slpz> this is not really important, but worth noting ;-)