diff options
author | Thomas Schwinge <thomas@schwinge.name> | 2010-12-13 17:11:51 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@schwinge.name> | 2010-12-13 17:11:51 +0100 |
commit | 2d75167da62e3486836e5f1773e5f1ab06e43fe8 (patch) | |
tree | e44fc83e0b1419836d1b21652ad1d38b8d0af2c4 /hurd | |
parent | 217998d56f5b6424a685f8c87f2c0e924d1c89da (diff) | |
parent | 5c5c16e265d8ef56b71f319885f32bf144bdea23 (diff) |
Merge branch 'master' into external_pager_mechanism
Conflicts:
microkernel/mach/external_pager_mechanism.mdwn
Diffstat (limited to 'hurd')
300 files changed, 10772 insertions, 958 deletions
diff --git a/hurd/authentication.mdwn b/hurd/authentication.mdwn index 7ccd9b45..2d6084bf 100644 --- a/hurd/authentication.mdwn +++ b/hurd/authentication.mdwn @@ -1,23 +1,16 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!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]]."]]"""]] UIDs on the Hurd are separate from processes. A process has [[capabilities|capability]] designating so-called UID vectors that -are implemented by an [[auth]] server. This +are implemented by an [[translator/auth]] server. This makes them easily [[virtualizable|virtualization]]. When a process wishes to gain access to a resource provided by a third diff --git a/hurd/binutils.mdwn b/hurd/binutils.mdwn new file mode 100644 index 00000000..f9266448 --- /dev/null +++ b/hurd/binutils.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +[[!meta redir=/binutils]] diff --git a/hurd/building.mdwn b/hurd/building.mdwn new file mode 100644 index 00000000..1674b770 --- /dev/null +++ b/hurd/building.mdwn @@ -0,0 +1,118 @@ +Additional to the following text, a further [[example]] has be posted. + +/!\ The following information may very well be incomplete and out-dated. + + +# Building the Hurd from Source + +If you want to build the Hurd libraries and servers (translators) yourself +instead of just using pre-built binaries, follow these instructions. + +One note before we begin: the likelihood that the compiled result will actually +do what you expect it to do is the highest if you try building from the Debian +source packages. This is especially true if you want to use your compilation +within a Debian system. + +Note that for building code to run on GNU/Hurd systems, you need a toolchain +for the GNU Hurd. You can either compile on a GNU/Hurd system, or need a +cross-compiler targeting GNU/Hurd. Our [[toolchain page|toolchain]] has the +details. + + +## Getting the Source Code + +You can chose between getting the [sources from the developers's +RCS](http://savannah.gnu.org/cvs/?group=hurd): + + $ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/hurd co hurd + +... or (if you are working on a Debian system) the ones that are used for the +[current Debian hurd package](http://packages.debian.net/source/unstable/hurd): + + $ apt-get source hurd + +Please see the Debian [[running/debian/FAQ]] before using `apt-get source`. + +The unpacked source tree is around 20 MiB, and the build tree (configured with +`--disable-profile`) is around 100 MiB. + +## Preparing for the Build + +### ... on Debian systems + +Building the Hurd requires the *build-essential* and *fakeroot* packages, their +dependencies and additional packages that are specified by the source hurd +package: + + # apt-get install build-essential fakeroot + # apt-get build-dep hurd + +### ... on non-Debian systems + +[TODO] + +## Building + +### Debian `.deb` Files + +Change into the directory with the downloaded / unpacked Hurd sources, e.g. + + $ cd hurd-[TODO] + +If you want to work on the sources before building them, it's advisable to +first apply the patches the Debian hurd package additionally contains: + + $ debian/rules apply-patches + +Then edit and change whatever files you want and finally start the build +process with + + $ dpkg-buildpackage -us -uc -nc -b -rfakeroot + +The `.deb` packages will then drop out at the `../` directory. + +### Building, but not the Debian Way + +The Hurd has to be built in a separate directory: + + $ mkdir hurd-build + $ cd hurd-build + + $ [...]/hurd-[TODO]/configure --disable-profile + $ make + $ make install + +Notice that `make install` will install the Hurd in `/`, not in `/usr/local/` +or `/local/`, so your current Hurd servers will be replaced. [TODO: how to +install somewhere else.] + +By default profiling versions of all the libraries and code are generated but +this is useless in most of the cases, so we disable them by specifying +`--disable-profile` on `configure`'s command line. + +If you just want to build a specific server or library, you can pass its name +to `make`: + + $ make ext2fs + $ make libtrivfs + +This will automatically build all libraries that are required to build the +requested server or library. + + +## RPC IDs + +[TODO: update / integrate somewhere.] + +If you want to trace the RPC calls made by some process by using `rpctrace` +command, you will also want some more human-readable output of this +command. This is achieved by generating `hurd.msgids` file that includes the +mapping between the number of the RPC call and its name: + + $ cd build/hurd + $ make hurd.msgids + $ cp hurd.msgids ~ + +Now you can use this file in the following way: + + $ rpctrace -i ~/hurd.msgids ls diff --git a/hurd/building/cross-compiling.mdwn b/hurd/building/cross-compiling.mdwn new file mode 100644 index 00000000..73c19b4d --- /dev/null +++ b/hurd/building/cross-compiling.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2010 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 stable_URL]] + +[[!meta redir=/toolchain/cross-gnu]] diff --git a/hurd/building/example.mdwn b/hurd/building/example.mdwn new file mode 100644 index 00000000..bf31bf7e --- /dev/null +++ b/hurd/building/example.mdwn @@ -0,0 +1,60 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +I checked out the source code on my Ubuntu GNU/Linux system connected to the +Internet using: + + cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/hurd co hurd + +I mounted the hurd directory on Ubuntu from my GNU Hurd system connected to the +LAN through NFS: + + settrans -ac /mnt /hurd/nfs ubuntu:/home/shaks/code + +Copy the hurd directory, locally. + +For compilation, you require build-essential, libc0.3-dev, hurd-dev. I used +Debian GNU Hurd K10 CDs for installation and they are available in the first +CD. + + apt-get update + apt-get install build-essential libc0.3-dev hurd-dev + +Enter into the hurd directory and start building it: + + cd hurd + mkdir build + cd build + ../configure + make + +There is a "libiohelp needed by" error. So, do a manual compilation for +libiohelp. + + cd .. + make libiohelp + cd build + make + +There is a "libiostore needed by" error. So, do a manual compilation for +libiostore. + + cd .. + make libiostore + cd build + make + +There is a "libiohelp.so: No such file or directory" error. + +Copy libiohelp/libiohelp.so file to build/libiohelp/ and re-run make, + + make + +The executables are created in the subdirectories in build/ directory. diff --git a/hurd/concepts.mdwn b/hurd/concepts.mdwn index dca95ed9..e8183d79 100644 --- a/hurd/concepts.mdwn +++ b/hurd/concepts.mdwn @@ -1,21 +1,15 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!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]]."]]"""]] * [[Translator]] * [[Virtual_File_System]] * [[Authentication]] +* [[Virtualization]] * [[Neighborhurd]] diff --git a/hurd/console.mdwn b/hurd/console.mdwn index 5ce57008..4f976efd 100644 --- a/hurd/console.mdwn +++ b/hurd/console.mdwn @@ -13,9 +13,8 @@ The latest Hurd package in Debian has all that is needed to run (dunno about hur -- [[Main/JoachimNilsson]] - 17 Apr 2005 -## <a name="Table_of_Contents"> Table of Contents </a> +Additional information about the console can be found in the [Hurd Console Tutorial](http://uwhug.org.uk/index.pl?Hurd_Console_Tutorial) -%TOC% ## <a name="What_is_the_new_console_"> What is the new console? </a> @@ -35,7 +34,7 @@ The console server provides a scrollback buffer for each virtual console. Curren The client interface of the server is quite complicated, because it is based on shared memory and broadcasts the data to potentially many clients without blocking. It also includes a notification scheme so that clients remain idle when there is no console activity. This saves cpu power (compared to the alternative which would be polling). -**The default console client**, which you will normally use to use a virtual console in a console server. Rather than writing many similar console client programs, I decided to write only one initially and make it extensible via dynamically loaded modules called "drivers". +**The default console client**, which you will normally use to use a virtual console in a console server. Rather than writing many similar console client programs, I decided to write only one initially and make it extensible via dynamically loaded modules called "drivers". The console client uses libcons, of course. There are a number of drivers that exists already: @@ -62,7 +61,7 @@ _Note:_ * _LeftCtrl_ + _LeftAlt_ + _Backspace_ terminates the console client, and reverts the VGA card etc to its original state. * _RightAlt_ + _Keypad_ enables you to directly enter unicode characters in hexadecimal numbers. 0-9 have their standard meaning, and NumLock is 0xa, Keypad `/` is 0xb, `*` is 0xc, `-` is 0xd, `+` is 0xe and the enter key at the lower right of the keypad is 0xf. Up to four digits are memorized, if you type more, the earlier ones are forgotten. This allows to cover up typing mistakes. -_For example:_AltGr + (Keypad 4, Keypad 1) = 0x41 = 'A'.<br />AltGr + (Keypad 2, 6, 3, NumLock) = 0x263a = smiley. +_For example:_AltGr + (Keypad 4, Keypad 1) = 0x41 = 'A'.<br />AltGr + (Keypad 2, 6, 3, NumLock) = 0x263a = smiley. You can get unicode tables from <http://www.unicode.org> * The generic\_speaker driver supports the speaker commonly found in PCs and other computers. It is good enough for a simple bell tone or a small melody. I have several default bell styles implemented, but currently there is no configuration option to access them at run time, sorry! Load this module to make the console beep on ^G. @@ -236,7 +235,7 @@ The `console-server` watches for new hurdio terms (devices translated with `/hur Squeezed at the end so nobody sees it ;) -**console server:** Is probably too lax in permission checking. Does not implement settable tab stops. Does not allow to change encoding at run time. Does not allow any other screen size but 80x25. +**console server:** Is probably too lax in permission checking. Does not implement settable tab stops. Does not allow to change encoding at run time. Does not allow any other screen size but 80x25. Combining characters is not supported. @@ -248,11 +247,11 @@ Copy & Paste not supported. Should support other text modes (integrate svgatextmode?) -**pc\_kbd driver:** No keyboard layout but US supported! Maybe in some cases left/right shift/ctrl/alt is allowed where both left and right should be allowed. Keyboard LEDs are only supported when using OSKIT-Mach or the CVS branch gnumach-1-branch of GNU Mach. +**pc\_kbd driver:** No keyboard layout but US supported! Maybe in some cases left/right shift/ctrl/alt is allowed where both left and right should be allowed. Keyboard LEDs are only supported when using OSKIT-Mach or the CVS branch gnumach-1-branch of GNU Mach. -**ncursesw driver:** Doesn't work properly on other terminals but UTF-8. Should not use C-w, this should be configurable. Does not support use of scroll back buffer. +**ncursesw driver:** Doesn't work properly on other terminals but UTF-8. Should not use C-w, this should be configurable. Does not support use of scroll back buffer. -**Other programs:** Readline doesn't support multibyte encodings (4.2 and earlier). term doesn't either (all versions). +**Other programs:** Readline doesn't support multibyte encodings (4.2 and earlier). term doesn't either (all versions). ---- diff --git a/hurd/contributing.mdwn b/hurd/contributing.mdwn deleted file mode 100644 index 819d354b..00000000 --- a/hurd/contributing.mdwn +++ /dev/null @@ -1,55 +0,0 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. - -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] - -# Porting Applications - -Debian is currently the Hurd distribution of choice among Hurd -users and developers. Approximately half of the Debian archive -has been compiled successfully on the Hurd, however, many -programs fail to build for various reasons. A [list of build -failures including error messages](http://unstable.buildd.net/buildd/hurd-i386_Failed.html) -can be found, as well as a [preliminary analysis](http://lists.debian.org/debian-hurd/2007/07/msg00000.html) -of them. If you want to port any of these, file patches in the -[Alioth patch tracker](http://alioth.debian.org/tracker/?atid=410472&group_id=30628&func=browse) - for review. It might be a good idea to record your intention -to port something in the [Alioth task tracker](http://alioth.debian.org/pm/task.php?group_project_id=34&group_id=30628&func=browse) so other people do not do duplicated work. You can also just -install the Hurd and find what doesn't work for you and port -it and then file patches for that package in [above patch tracker](http://alioth.debian.org/tracker/?atid=410472&group_id=30628&func=browse). -Another important task is making sure that patches go upstream as -well, especially for GNU projects. - -If you want to further development, a list of interesting -projects is available in the [Alioth task tracker](http://alioth.debian.org/pm/task.php?group_project_id=35&group_id=30628&func=browse). -Those projects are not necessarily Debian specific, but do -not touch the Hurd proper. - -# Hurd Proper - -If you are interested in developping the Hurd proper, there is -plenty of work to do. Before you can significantly contribute, -take some time to learn about the system, e.g., -[[microkernels_for_beginners|microkernel/for_beginners]]. Until you can do the basic exercises -listed there, you won't be able to significantly contribute to -the Hurd. - -See the [[ToDo]]. - -# GNU Mach - -[[GNU_Mach|microkernel/mach/gnumach]] is the underlying microkernel used by the -Hurd. It has a number of deficencies; -[[microkernel/mach/gnumach/RevivalProject]]. diff --git a/hurd/critique.mdwn b/hurd/critique.mdwn index 56150df7..c432cc17 100644 --- a/hurd/critique.mdwn +++ b/hurd/critique.mdwn @@ -1,24 +1,20 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] -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.txt]]. +[[!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]]."]]"""]] -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!meta title="A Critique of the GNU Hurd Multi-server Operating System"]] -[[NealWalfield]] and [[MarcusBrinkmann]] wrote a paper titled -"[A Critique of the GNU Hurd Multi-Server Operating System](http://walfield.org/papers/200707-walfield-critique-of-the-GNU-Hurd.pdf)." -This was published in ACM SIGOPS Operating Systems Review in -July 2007. This is sometimes referred to as "the critique." +Neal Walfield and Marcus Brinkmann wrote a paper titled [*A Critique of +the GNU Hurd Multi-server Operating +System*](http://walfield.org/papers/200707-walfield-critique-of-the-GNU-Hurd.pdf). +This was published in ACM SIGOPS Operating Systems Review in July 2007. This +is sometimes referred to as *the critique*. The paper provides a technical overview of the Hurd's architecture and critiques some of the decisions made. diff --git a/hurd/dde.mdwn b/hurd/dde.mdwn new file mode 100644 index 00000000..dedb7d10 --- /dev/null +++ b/hurd/dde.mdwn @@ -0,0 +1,22 @@ +[[!meta copyright="Copyright © 2009, 2010 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]]."]]"""]] + + * [[community/gsoc/project ideas/driver glue code]] + + * [[open issues/user-space device drivers]] + + * [[open issues/device drivers and io systems]] + +--- + +There is an effort going on to make [[/DDE]] usable in GNU/Hurd +userspace. + +See Zheng Da's [[project page|zhengda]], as well as another [[guide]]. diff --git a/hurd/dde/guide.mdwn b/hurd/dde/guide.mdwn new file mode 100644 index 00000000..56f7683c --- /dev/null +++ b/hurd/dde/guide.mdwn @@ -0,0 +1,153 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +If you haven't: install hurd to partition +get grub image +boot hurd in single user (change grub entry accordingly to the installed partition) + +> $ export TERM=mach + +> $ ./native-install + +reboot to other debian + +suppose hurd partition is hdd1 + +as root + +> $ mount /dev/hdd1 /mnt -t ext2 + +> $ cd /mnt/etc/apt + +> $ echo "deb http://ftp.debian-ports.org/debian unreleased main" >> sources.list + +> $ echo "deb-src http://ftp.debian-ports.org/debian unreleased main" >> sources.list + +> $ echo "deb http://ftp.uk.debian.org/debian unstable main" >> sources.list + +> $ echo "deb-src http://ftp.uk.debian.org/debian unstable main" >> sources.list + +> $ wget http://www.gnu.org/software/hurd/hurd/running/debian/DebianAptOffline/apt.conf.offline + +> $ cd /mnt + +> $ apt-get -c etc/apt/apt.conf.offline update + +> $ apt-get -c etc/apt/apt.conf.offline upgrade + +> $ apt-get -c etc/apt/apt.conf.offline install git-core + +> $ apt-get -c etc/apt/apt.conf.offline build-dep hurd gnumach + +> $ apt-get -c etc/apt/apt.conf.offline install build-essential libpciaccess-dev libpcap0.8-dev + +> $ cd /mnt/home + +> $ git clone git://git.sv.gnu.org/hurd/incubator.git -b dde hurd_dde + +> $ git clone git://git.sv.gnu.org/hurd/gnumach.git -b master-user_level_drivers gnumach_dde + + +suppose you need forcedeth driver + +Download http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.29.y.git;a=blob_plain;f=drivers/net/forcedeth.c;hb=HEAD from mozilla like +browser to /mnt/home as forcedeth.c + +reboot back to hurd (multiuser) + +> $ apt-get update + +> $ apt-get upgrade + +> $ apt-get install git-core + +> $ apt-get build-dep hurd gnumach + +> $ apt-get install build-essential libpciaccess-dev libpcap0.8-dev + + +> $ cd /home/gnumach_dde + +> $ autoreconf -i && ./configure --enable-kdb --enable-device-drivers=none --enable-lpr --enable-floppy --enable-ide + +> $ make + +> $ cd ../hurd_dde + +> $ cp -r dde_pcnet32 dde_forcedeth + +> $ cd dde_forcedeth + +> $ rm pcnet32.c + +> $ cp /home/forcedeth.c ./ + +> $ sed -i 's/pcnet32/forcedeth/g' Makefile + +> $ sed -i 's/pcnet32/forcedeth/g' .gitignore + +> $ sed -i 's:-lhurd-slab:../libhurd-slab/libhurd-slab.a:' Makefile + +> $ sed -i 's:-I/include:-I..:' Makefile + +> $ nano forcedeth.c + +add this line after the last #include + + #include <ddekit/timer.h> + +> $ cd .. + +> $ git add dde_forcedeth + +> $ git commit -a -m 'Add forcedeth driver' + +> $ autoreconf -i && ./configure + +> $ mkdir -p hurd/include/ddekit + +> $ make libddekit libmachdev devnode pfinet + +> $ cd libdde_linux26 + +> $ make + +> $ cd ../dde_forcedeth + +> $ make + +If the make fails it might be necassary to replace some of the -l options (or all) in Makefile with the real path to the library objects (example: change *-lhurd-slab* to *../libhurd-slab/libhurd-slab.a*) + +> $ cp /home/gnumach_dde/gnumach /boot/gnumach_dde + +> $ mkdir /hurd/dde + +> $ cp /home/hurd_dde/devnode/devnode /hurd/dde + +> $ cp /home/hurd_dde/pfinet/pfinet /hurd/dde + +> $ cp /home/hurd_dde/dde_forcedeth/dde_forcedeth /hurd/dde/forcedeth + +reboot to hurd with the new gnumach_dde + +> $ settrans -c /dev/forcedeth /hurd/dde/forcedeth + +> $ settrans -c /dev/eth0 /hurd/dde/devnode -M /dev/forcedeth eth0 + +> $ settrans -c /servers/socket/2 /hurd/dde/pfinet -i /dev/eth0 -a 192.168.1.194 -g 192.168.1.254 -m 255.255.255.0 + + +replace the ip, gateway and mask with your own ones + +> $ nano /etc/resolv.conf + +add line: nameserver 192.168.1.254 + +DONE diff --git a/hurd/debugging.mdwn b/hurd/debugging.mdwn index 3ff2fba4..d6e9c8b5 100644 --- a/hurd/debugging.mdwn +++ b/hurd/debugging.mdwn @@ -1,27 +1,25 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008, 2010 Free Software Foundation, +Inc."]] -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.txt]]. +[[!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]]."]]"""]] -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] # Strategies * [[GDB]] -- the GNU debugger + * [[gdb/Backtrace]]s * [[subhurd]] -- running another Hurd system in parallel * [[rpctrace]] -- tracing [[RPC]]s # About Specific Packages -* [[glibc]] + * [[glibc]] + * [[translator]]s + * [[trap_in_the_kernel]] diff --git a/hurd/debugging/gdb.mdwn b/hurd/debugging/gdb.mdwn index 75474128..1fede74f 100644 --- a/hurd/debugging/gdb.mdwn +++ b/hurd/debugging/gdb.mdwn @@ -1,26 +1,15 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] -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.txt]]. +[[!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]]."]]"""]] -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] - -The [GNU debugger *GDB*](http://www.gnu.org/software/gdb/) works on GNU/Hurd +The [[GNU_debugger_*GDB*|/gdb]] works on GNU/Hurd systems as it does on other system, but has some additional [hurd-specific features](http://sourceware.org/gdb/current/onlinedocs/gdb_19.html#Hurd%20Native) to offer, such as [[noninvasive_debugging]] (for avoiding [[deadlock]]s), for example. - -* [Manual](http://sourceware.org/gdb/documentation/) - -* [When disassemble doesn't work](http://lists.gnu.org/archive/html/bug-hurd/2007-02/msg00039.html) diff --git a/hurd/debugging/gdb/noninvasive_debugging.mdwn b/hurd/debugging/gdb/noninvasive_debugging.mdwn index fc6653e7..fa7a3c5b 100644 --- a/hurd/debugging/gdb/noninvasive_debugging.mdwn +++ b/hurd/debugging/gdb/noninvasive_debugging.mdwn @@ -1,23 +1,16 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] -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.txt]]. +[[!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]]."]]"""]] -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] - -Sometimes using [[GDB]] on a system server can result in a [[deadlock]]. You +Sometimes using [[GDB]] on a [[system_server|translator]] can result in a [[deadlock]]. You can however still use GDB by using the [`set noninvasive`](http://sourceware.org/gdb/current/onlinedocs/gdb_19.html#Hurd%20Native) option. This indicates to GDB to not stop the program but allows you to -nevertheless examine its state. Thus, you can get back traces and value of +nevertheless examine its state. Thus, you can get [[/gdb/backtrace]]s and values of variables (and watch them change underneath you). diff --git a/hurd/debugging/glibc.mdwn b/hurd/debugging/glibc.mdwn index a0890fe8..e9817132 100644 --- a/hurd/debugging/glibc.mdwn +++ b/hurd/debugging/glibc.mdwn @@ -1,13 +1,24 @@ +[[!meta copyright="Copyright © 2007, 2008, 2010 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]]."]]"""]] + Here are some hints about how to approach testing after nontrivial changes to glibc have been done. --- -First step is having the build a glibc complete. This is actually more -difficult than one might expect, as it involves (towards the end of the build -process; unless you are cross-building, of course), that the newly created -libraries and loader actually work: they're used to run the `rpcgen` -program. If that step doesn't succeed, it'll look similar to this: +First step is having the build of glibc succeed. This is actually more +difficult than one might expect as it involves (towards the end of the build +process -- unless you are cross-compiling, of course -- that the +newly created libraries and loader actually work: they'll be used to run the +`rpcgen` program. If that step doesn't succeed, it'll look similar to this: [...] CPP='gcc -E -x c-header' [...]/build/elf/ld.so.1 --library-path [...] [...]/build/sunrpc/rpcgen [...] @@ -15,19 +26,35 @@ program. If that step doesn't succeed, it'll look similar to this: --- -If building glibc succeeds, the next thing to try is running the test suite, or -parts of it. +Unless cross-compiling, the next thing you'll probably want to do +is running the test suite, or parts of it. -Here is a list of known failures: - -[TODO]. +There is a list of [[known failures|open_issues/glibc_testsuite]]. --- -Make sure static linking is working OK at all. The `elf/sln` program (a -stripped-down `ln` that is statically linked) in the glibc build ought to test -that. Also, static linking under various conditions will already have been -tested when running the test suite, especially in `elf/` and `dlfcn/`. +If you've been doing simple changes to glibc functions that end up in +`libc.so`, you may test them like this (like for a `strerror_l` implementation +in this case): + + $ LD_PRELOAD=./libc.so ./ld.so ./a.out 10 1073741928 de_DE.utf8 + 1073741928 (0x40000068): Computer bought the farm + 1073741928 (0x40000068): Der Computer hat den Bauernhof erworben + +You usually will only have luck using the new `libc.so` (from +`[glibc-build]/libc.so`) in combination together with the new `ld.so` (from +`[glibc-build]/elf/ld.so`): + + $ LD_PRELOAD=./libc.so ./a.out 10 1073741928 de_DE.utf8 + Killed + $ LD_PRELOAD=./libc.so /lib/ld.so ./a.out 10 1073741928 de_DE.utf8 + Killed + +Make sure static linking is working OK at all. Running the +`[glibc-build]/elf/sln` program (a stripped-down `ln` that is statically +linked) ought to test that. Also, static linking under various conditions will +already have been tested when running the test suite, especially in `elf/` and +`dlfcn/`. Make sure static linking with cthreads is working. If you can get an `ext2fs.static` compiled and linked against the new glibc, that is good. @@ -41,8 +68,8 @@ Then debug its startup as a normal program on your working hurd. Then try its full server startup. - $ settrans -ca node [...]/ext2fs.static <BACKEND> - $ cd node/ + $ settrans -ca node [...]/ext2fs.static BACKING_STORE + $ ls -l node/ [...] Make sure dynamic linking for servers is working. If you haven't broken the @@ -51,7 +78,7 @@ glibc's `testrun.sh` does it. [TODO]: Is this the correct way to do that? - $ settrans -ca node [glibc]/build/testrun.sh /hurd/ext2fs <BACKEND> + $ settrans -ca node [glibc]/build/testrun.sh /hurd/ext2fs BACKING_STORE $ cd node/ [...] @@ -62,10 +89,3 @@ Test it in a [[subhurd]]. --- Test it on a real system. - ---- - -Sources: - -* <http://lists.gnu.org/archive/html/bug-hurd/2007-02/msg00038.html> -* [[Thomas_Schwinge|tschwinge]]'s mind diff --git a/hurd/debugging/rpctrace.mdwn b/hurd/debugging/rpctrace.mdwn index c2aabc42..de46c08d 100644 --- a/hurd/debugging/rpctrace.mdwn +++ b/hurd/debugging/rpctrace.mdwn @@ -1,19 +1,13 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. - -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!meta copyright="Copyright © 2007, 2008, 2009, 2010 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]]."]]"""]] *rpctrace* is -- roughly -- an equivavlent to Linux's *strace* or Solaris' or BSD's *truss*. It is used to trace [[remote_procedure_call|rpc]]s a process is @@ -24,6 +18,8 @@ See `rpctrace --help` about how to use it. # Issues and Patches +[[!tag open_issue_hurd]] + * <http://savannah.gnu.org/patch/?2104> -- don't assert that local port names are valid * <http://savannah.gnu.org/bugs/?3939> -- `rpctrace`d program hangs when signal @@ -31,12 +27,27 @@ See `rpctrace --help` about how to use it. * <http://savannah.gnu.org/patch/?1633> -- terminated with `C-c` `rpctrace`d programs hang * <http://savannah.gnu.org/patch/?5580> -- more readable output -* <http://savannah.gnu.org/bugs/?20612> -- heisenbug +* IRC, unknown channel, unknown date + + <youpi> how to rpctrace a translator ? + <youpi> ah, just settrans /usr/bin/rpctrace... + <youpi> hum, it hung, and killing it got a Mach panic (thread in unexpected + state) ... + +* IRC, unknown channel, unknown date + + <antrik> hm... for a funny effect, try running rpctrace on + /servers/socket/1, and then use dpkg... ;-) -# TODO +* IRC, unknown channel, unknown date. - <youpi> how to rpctrace a translator ? - <youpi> ah, just settrans /usr/bin/rpctrace... - <youpi> hum, it hung, and killing it got a Mach panic (thread in unexpected - state) ... + <youpi> the problem of rpctrace is that it's a man in the middle :) + <youpi> so in principle, by design authentication stuff shouldn't work + <antrik> I don't think the Hurd auth mechanism in any way prevents or tries to prevent man-in-the-middle... + <youpi> maybe, but just try, you'll see all kinds of issue as soon as you have authentication stuff + <youpi> and the basic reason is that being a man in the middle needs special care + <youpi> which rpctrace doesn't completely do + <antrik> it's a while since I have dived into rpctrace; but AIUI, it should work just fine if the proxying is done properly + <antrik> note that there is a number of known bugs in rpctrace, for which zhengda has sent patches... though I haven't reviewed all of them I think + <antrik> there are some nasty Mach operations that are really hard to proxy -- but I don't think the auth mechanism needs any of these... diff --git a/hurd/debugging/subhurd.mdwn b/hurd/debugging/subhurd.mdwn index caad950b..7b5b07b1 100644 --- a/hurd/debugging/subhurd.mdwn +++ b/hurd/debugging/subhurd.mdwn @@ -85,6 +85,6 @@ W3 Sources: -* <http://www.gnu.org/software/hurd/howto/subhurd.html> +* [[subhurd/running_a_subhurd]] * <http://lists.gnu.org/archive/html/bug-hurd/2007-02/msg00030.html> * [[Thomas_Schwinge|tschwinge]]'s mind diff --git a/hurd/debugging/translator.mdwn b/hurd/debugging/translator.mdwn new file mode 100644 index 00000000..d439e17b --- /dev/null +++ b/hurd/debugging/translator.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + +[[!inline +pages="hurd/debugging/translator/* and !*/discussion" +show=0 +feeds=no +actions=yes]] diff --git a/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn b/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn new file mode 100644 index 00000000..b7cfc3c9 --- /dev/null +++ b/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn @@ -0,0 +1,37 @@ +[[!meta copyright="Copyright © 2008, 2009, 2010 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]]."]]"""]] + +Sometimes it may already be helpful to capture a translator's `stdout` and +`stderr`, for example in this situation where [[translator/pfinet]] was +silently dying all the time, without any console output: + + $ sudo settrans -fgap ↩ + /servers/socket/2 ↩ + /bin/sh -c '/hurd/pfinet -i eth0 -a [...] > /tmp/stdout 2> /tmp/stderr' + $ [...] + $ cat /tmp/stdout + NET4: Linux TCP/IP 1.0 for NET4.0 + IP Protocols: ICMP, UDP, TCP + TCP: Hash tables configured (ehash 65536 bhash 65536) + $ cat /tmp/stderr + pfinet: ../../hurd.work/pfinet/ethernet.c:196: ethernet_xmit: Unexpected error: (os/device) invalid IO size. + +(Trying to run [[GDB]] in this case was of no help -- due to a bug in GDB +(supposedly) it wouldn't catch the fault.) + +Be made aware that both `stdout` and `stderr` will be block bufferend and no +longer line buffered when doing such a redirection, so you'll have to arrange +for appropriate `fflush`es on these, or force them to be line buffered again +using the appropriate glibc magic (`setvbuf`). Otherwise you'll see text in +the output files only if either glibc herself decides to flush (after some KiB +of text) the after translator exits. + +There is also a [[related open issue|open_issues/translator_stdout_stderr]]. diff --git a/hurd/debugging/translator/gdb.mdwn b/hurd/debugging/translator/gdb.mdwn new file mode 100644 index 00000000..82a50736 --- /dev/null +++ b/hurd/debugging/translator/gdb.mdwn @@ -0,0 +1,53 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Say you want to try running file system server ([[`ext2fs`|translator/ext2fs]], +[[`jfs`|translator/jfs]], ...) against a modified version of +[[`libpager`|libpager]] and debug the latter one using [[debugging/GDB]]. + +Set the [[hurd/translator]] like this: + + $ settrans -fgap ↩ + jfs.img.i ↩ + /usr/bin/env ↩ + LD_LIBRARY_PATH=~tschwinge/tmp/hurd/hurd.ogi/build/libpager ↩ + "$PWD"/jfs.obj/jfs ↩ + "$PWD"/jfs.img + +Then, when starting GDB, start it like this (or use an equivalent method, of +course): + + $ LD_LIBRARY_PATH=~tschwinge/tmp/hurd/hurd.ogi/build/libpager ↩ + gdb ↩ + ~tschwinge/tmp/jfs/jfs.obj/jfs 15436 + GNU gdb 6.5-debian + [...] + Reading symbols from /lib/libdiskfs.so.0.3...Reading symbols from /lib/debug/lib/libdiskfs.so.0.3...done. + done. + Loaded symbols for /lib/libdiskfs.so.0.3 + Reading symbols from /devel4/tschwinge/tmp/hurd/hurd.ogi/build/libpager/libpager.so.0.3...done. + Loaded symbols for /devel4/tschwinge/tmp/hurd/hurd.ogi/build/libpager/libpager.so.0.3 + Reading symbols from /lib/libstore.so.0.3...Reading symbols from /lib/debug/lib/libstore.so.0.3...done. + done. + Loaded symbols for /lib/libstore.so.0.3 + [...] + (gdb) break pager_demuxer + Breakpoint 1 at 0x105c98d: file ../../libpager/demuxer.c, line 27. + [...] + Breakpoint 1, pager_demuxer (inp=0x12bded0, outp=0x12bbec0) at ../../libpager/demuxer.c:27 + 27 { + (gdb) list + 22 /* Demultiplex a single message directed at a pager port; INP is the + 23 message received; fill OUTP with the reply. */ + 24 int + 25 pager_demuxer (mach_msg_header_t *inp, + [...] + +Voilà. diff --git a/hurd/debugging/trap_in_the_kernel.mdwn b/hurd/debugging/trap_in_the_kernel.mdwn new file mode 100644 index 00000000..11f989e3 --- /dev/null +++ b/hurd/debugging/trap_in_the_kernel.mdwn @@ -0,0 +1,27 @@ +[[!meta copyright="Copyright © 2010 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_gnumach open_issue_documentation]] + +IRC, #hurd, September 2010 + + <diegonc> when an application executes an out instruction in user mode, how is + kernel mode entered? general protection trap? + <youpi> some sort of trap, yes + <youpi> I'd rather think about illegal instruction, but yes + <diegonc> hm.. so to debug what happens inside that instruction I'll have to + break at the trap handler. Can I instruct kdb to stop only when a given task + caused the trap? + <youpi> applications usually don't trap, so what I usually do is to uncomment + the test at the end of user_trap() before the call to kdb_trap() + <diegonc> "if (debug_all_traps_with_kdb && .. " <- that test? + <youpi> yes + <youpi> so comment the test to make kdb_trap() called all the time + <diegonc> oh, I understand now :) diff --git a/hurd/documentation.mdwn b/hurd/documentation.mdwn new file mode 100644 index 00000000..874ce847 --- /dev/null +++ b/hurd/documentation.mdwn @@ -0,0 +1,71 @@ +[[!meta copyright="Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +2009 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]]."]]"""]] + +# Introductory Material + + * [[What_Is_the_GNU_Hurd]] + + * [[Advantages]] + + * [[FAQ]] + + * [[*The_Hurd_and_Linux*|/hurd-and-linux]], a comment by Richard Stallman. + + * [[*Towards_a_New_Strategy_of_OS_Design*|/hurd-paper]], an architectural + overview by Thomas Bushnell, BSG. + + * [[*The_Hurd*|/hurd-talk]], a presentation by Marcus Brinkmann. + + * A document about *[[translators]]* by Marcus Brinkmann. + + * [[*A_Critique_of_the_GNU_Hurd_Multi-server_Operating_System*|critique]], an + analysis of the GNU Hurd on GNU Mach system, written by Neal Walfield and + Marcus Brinkmann. + +## External + + * [*Examining the Legendary HURD + Kernel*](http://www.informit.com/articles/printerfriendly.aspx?p=1180992), + an article by David Chisnall. + + Also covers a bit of GNU's and the Hurd's history, fundamental techniques + applied, comparisions to other systems. + + +# Development + + * *[[The_GNU_Hurd_Reference_Manual|reference_manual]]*. + + * The *[[Hurd_Hacking_Guide]]*, an introduction to GNU Hurd and Mach + programming by Wolfgang Jährling. + + * [*Manually Bootstrapping a + Translator*](http://walfield.org/pub/people/neal/papers/hurd-misc/manual-bootstrap.txt), + a text by Neal Walfield about how to *manually connect the translator to + the filesystem*. + + * [[*The_Authentication_Server*|auth]], the transcript of a talk about the + details of the authentication mechanisms in the Hurd by Wolfgang Jährling. + + * [*The Mach Paging Interface as Used by the + Hurd*](http://lists.gnu.org/archive/html/l4-hurd/2002-06/msg00001.html), a + text by Neal Walfield. + + * In the + [[Position_paper_*Improving_Usability_via_Access_Decomposition_and_Policy*|ng/position_paper]] + Neal Walfield and Marcus Brinkmann give an overview about how a future, + subsequent system may be architected. + + * [*Generalizing mobility for the Hurd*](http://users.student.lth.se/cs07fh9/2009-hammar-hurd-mobility.pdf), + a thesis written by Carl Fredrik Hammar, + investigates the mobility aspect of stores + and how it can be generalized and used for other applications. + The background chapter may be of interest to new developers. diff --git a/hurd/documentation/auth.html b/hurd/documentation/auth.html new file mode 100644 index 00000000..27f9ca2c --- /dev/null +++ b/hurd/documentation/auth.html @@ -0,0 +1,168 @@ +[[!meta copyright="Copyright © 2002, 2008 Free Software Foundation, Inc."]] + +[[!meta license="Verbatim copying and distribution of this entire article is +permitted in any medium, provided this notice is preserved."]] + +[[!meta title="The Authentication Server, the transcript of a talk about the +details of the authentication mechanisms in the Hurd by Wolfgang Jährling"]] + +<H3><A NAME="contents">Table of Contents</A></H3> +<UL> + <LI><A HREF="#intro" NAME="TOCintro">Introduction</A> + <LI><A HREF="#ids" NAME="TOCids">How IDs are represented and used</A> + <LI><A HREF="#posix" NAME="TOCposix">POSIX and beyond</A> + <LI><A HREF="#servers" NAME="TOCservers">Related servers</A> +</UL> +<HR> + +<H3><A HREF="#TOCintro" NAME="intro">Introduction</A></H3> +<P> +In this text, which mostly resembles the talk I gave at Libre Software +Meeting 2002 in Bordeaux, I will describe what the auth server does, +why it is so important and which cool things you can do with it, both +on the programming and the user side. I will also describe related +programs like the password and fakeauth servers. Note that this text +is targeted at programmers who want to understand the auth mechanism +in detail and are already familiar with concepts like Remote Procedure +Calls (RPCs) as well as the way User- and Group-IDs are used in the +POSIX world. + +<P> +The auth server is a very small server, therefore it gives a useful +example when you want to learn how a server typically looks like. One +reason why it is so small is that the auth interface, which it +implements, consists of only four RPCs. You can find the interface in +hurd/hurd/auth.defs and the server itself in hurd/auth/. + +<H3><A HREF="#TOCids" NAME="ids">How IDs are represented and used</A></H3> +<P> +Each process holds (usually) one port to auth (an auth_t in C source, +which actually is a mach_port_t, of course). The purpose of auth is +to manage User-IDs and Group-IDs, which is the reason why users often +will have no choice but to make use of the systems main auth server, +which does not listen on /servers/auth; instead you inherit a port to +auth from your parent process. Each such port is (internally in the +auth server) associated with a set of effective User- and Group-IDs as +well as a set of available User- and Group-IDs. So we have four sets +of IDs in total. The available IDs can be turned into corresponding +effective IDs at any time. + +<P> +When you send an auth_getids RPC on the port you hold, you will get +information about which IDs are associated with it, so you can figure +out which permissions you have. But how will a server know that you +have these permissions and therefore know which actions (e.g. writing +into file "foo") it is supposed to do on your behalf and which not? +The establishing of a trusted connection to a server works as follows: + +<P><OL> +<LI>A user wants a server to know its IDs</LI> +<LI>The user requests a reauthentication from the server</LI> +<LI>In this request the user will include a port</LI> +<LI>Both will hand this port to auth</LI> +<LI>The user uses auth_user_authenticate</LI> +<LI>The server uses auth_server_authenticate</LI> +<LI>The server also passes a new port to auth</LI> +<LI>auth matches these two requests</LI> +<LI>The user gets the new port from auth</LI> +<LI>The server learns about the IDs of the user</LI> +<LI>The user uses the new port for further communication</LI> +</OL> + +<P> +We have different RPCs for users and servers because what we pass and +what we get back differs for them: Users get a port, and servers get +the sets of IDs, and have to specify the port which the user will get. + +<P> +It is interesting to note that auth can match the requests by +comparing two integers, because when you get the same port from two +people, you will have the same mach_port_t (which is nothing but an +integer). + +<P> +All of this of course only works if they use the same auth server, +which is why I said often you have no choice other than to use the +one main auth server. But this is no serious restriction, as the auth server has +almost no functionality one might want to replace. In fact, there is +one replacement for the default auth implementation, but more on that +later. + +<H3><A HREF="#TOCposix" NAME="posix">POSIX and beyond</A></H3> +<P> +Before we examine what is possible with this design, let us take a +short look at how the POSIX semantics are implemented on top of this +design. When a program that comes out of POSIX-land asks for its own +effective User- or Group-ID, we will tell it about the first of the +effective IDs. In the same sense, the POSIX real User- or Group-ID is +the first available ID and the POSIX saved User- or Group-ID is the +second available ID, which is why you have the same ID two times in +the available IDs when you log into your GNU/Hurd machine (you can +figure out which IDs you have with the program "ids", that basically +just does an auth_getauth RPC). When you lack one of those IDs (for +example when you have no effective Group-ID), a POSIX program asking +for this particular information will get "-1" as the ID. + +<P> +But as you can imagine, we can do more than what POSIX specifies. Fox +example, we can modify our permissions. This is always done with the +auth_makeauth RPC. In this RPC, you specify the IDs that should be +associated with the new port. All of these IDs must be associated +with either the port where the RPC is sent to or one of the additional +ports you can specify; an exception is the superuser root, which is +allowed to creat ports that are associated with arbitrary IDs. +Hereby you can convert available into effective IDs. + +<P> +This opens the door to a bunch of nice features. For example, we have +the addauth program in the Hurd, which makes it possible to add an ID +to either a single process or a group of processes if you hold the ID or know the +appropriate password, and there is a corresponding rmauth program that +removes an ID. So when you are working on your computer with GNU +Emacs and want to edit a system configuration file, you switch to +Emacs' shell-mode, do an "addauth root", enter the password, edit the +file, and when you are done switch back to shell-mode and do "rmauth +root". These programs have some interesting options, and there are +various other programs, for setting the complete list of IDs (setauth) +and so on. + +<H3><A HREF="#TOCservers" NAME="servers">Related servers</A></H3> +<P> +Finally, I want to explain two servers which are related to auth. The +first is the password server, which listens on /servers/password. If +you pass to it a User- or Group-ID and the correct password for it, it +will return a port to auth to you which is associated with the ID you +passed to it. It can create such a port because it is running as +root. So let us assume you are an FTP server process. You will start +as root, because you want to use port 21 (in this case, "port" does +not refer to a mach_port_t, of course). But then, you can drop all +your permissions so that you run without any ID. This makes it far +less dangerous to communicate with yet unknown users over the +network. But when someone now hands a username and password to you, +you can ask the password server for a new auth port. The password +server will check the data you pass to it, for example by looking into +/etc/shadow, and if it is valid, it will ask the auth server for a new +port. It receives this port from auth and then passes it on to you. +So you have raised your permissions. (And for the very curious: Yes, +we are well aware of the differences between this concept and +capabilities; and we also do have some kinds of capabilities in +various parts of the Hurd.) + +<P> +My second example is the fakeauth server. It also implements the auth +protocol. It is the part of the fakeroot implementation that gives a +process the impression that it runs as root, even if it doesn't. So +when the process asks fakeauth about its own IDs, fakeauth will tell +the process that it runs as root. But when the process wants to make +use of the authentication protocol described earlier in this text, +fakeauth will forward the request to its own auth server, which will +usually be the systems main auth server, which will then be able to +match the auth_*_authenticate requests. So what fakeauth does is +acting as a proxy auth server that gives someone the impression to run +as root, while not modifying what that one is allowed to do. + +<P> +At this point, I have said at least most of what can be said about the +auth server and the protocol it implements, so I will finish by saying +that it might be an interesting task (for you) to modify some existing +software to take advantage of the features I described here. diff --git a/hurd/documentation/hurd-and-linux.mdwn b/hurd/documentation/hurd-and-linux.mdwn new file mode 100644 index 00000000..678ea8da --- /dev/null +++ b/hurd/documentation/hurd-and-linux.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=/hurd-and-linux]] diff --git a/hurd/documentation/hurd-paper.mdwn b/hurd/documentation/hurd-paper.mdwn new file mode 100644 index 00000000..06c23662 --- /dev/null +++ b/hurd/documentation/hurd-paper.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=/hurd-paper]] diff --git a/hurd/documentation/hurd-talk.mdwn b/hurd/documentation/hurd-talk.mdwn new file mode 100644 index 00000000..83dcaf74 --- /dev/null +++ b/hurd/documentation/hurd-talk.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=/hurd-talk]] diff --git a/hurd/documentation/translators.html b/hurd/documentation/translators.html new file mode 100644 index 00000000..8ae2c180 --- /dev/null +++ b/hurd/documentation/translators.html @@ -0,0 +1,236 @@ +[[!meta copyright="Copyright © 1998, 1999, 2007, 2008 Free Software Foundation, +Inc."]] + +[[!meta license="Verbatim copying and distribution of this entire article is +permitted in any medium, provided this notice is preserved."]] + +[[!meta title="Translators"]] + +By Marcus Brinkmann. + +<ul> +<li><a href="#concept" name="TOC_concept">Concept</a></li> +<li><a href="#examples" name="TOC_examples">Examples</a></li> +<li><a href="#actpas" name="TOC_actpas">Passive Translators, Active Translators</a></li> +<li><a href="#manage" name="TOC_manage">Managing Translators</a></li> +</ul> +<h3><a href="#TOC_concept" name="concept">Concept</a></h3> +<p> +Before we take a closer look at translators, let us consider regular +filesystems. A filesystem is store for a hierarchical tree of directories +and files. You access directories and files by a special character string, +the path. Furthermore, there are symbolic links to refer to one file at +several places in the tree, there are hard links to give one and the same +file several names. There are also special device files for communication +with the hardware device drivers of the kernel, and there are mount points +to include other stores in the directory tree. Then there are obscure +objects like fifos and hard links.</p> +<p> +Although these objects are very different, they share some common +properties, for example, they have all an owner and a group associated with +them as well as access rights (permissions). This information is written in +inodes. This is a actually a further commonality: Every object has exactly +one inode associated with it (hard links are somewhat special as they share +one and the same inode). Sometimes, the inode has further information +stored in it. For example, the inode can contain the target of a symbolic +link.</p> +<p> +However, these commonalities are usually not exploited in the +implementations, despite the common programming interface to them. All +inodes can be accessed through the standard POSIX calls, for example +<code>read()</code> and <code>write()</code>. For example, to add a new +object type (for example a new link type) to a common monolithic unix +kernel, you would need to modify the code for each filesystem +seperately.</p> +<p> +In the Hurd, things work differently. Although in the Hurd a special +filesystem server can exploit special properties of standard object types +like links (in the ext2 filesystem with fast links, for example), it has a +general interface to add such features without modifying existing code.</p> +<p> +The trick is to allow a program to be inserted between the actual content of +a file and the user accessing this file. Such a program is called a +translator, because it is able to process the incoming requests in many +different ways. In other words, a translator is a Hurd server which provides +the basic filesystem interface.</p> +<p> +Translators have very interesting properties. From the kernels point of +view, they are just another user process. This means, translators can be run +by any user. You don't need root priviligies to install or modify a +translator, you only need the access rights for the underlying inode the +translator is attached to. Many translators don't require an actual file to +operate, they can provide information by their own means. This is why +the information about translators is stored in the inode.</p> +<p> +Translators are responsible to serve all file system operations that involve +the inode they are attached to. Because they are not restricted to the usual +set of objects (device file, link etc), they are free to return anything +that makes sense to the programmer. One could imagine a translator that +behaves like a directory when accessed by <code>cd</code> or +<code>ls</code> and at the same time behaves like a file when accessed by +<code>cat</code>.</p> +<h3><a href="#TOC_examples" name="examples">Examples</a></h3> +<h4>Mount Points</h4> +<p> +A mount point can be seen as an inode that has a special translator attached +to it. Its purpose would be to translate filesystem operations on the mount +point in filesystem operations on another store, let's say, another +partition.</p> +<p> +Indeed, this is how filesystems are implemented under the Hurd. A +filesystem is a translator. This translator takes a store as its argument, +and is able to serve all filesystem operations transparently.</p> +<h4>Device Files</h4> +<p> +There are many different device files, and in systems with a monolithical +kernel, they are all provided by the kernel itself. In the Hurd, all device +files are provided by translators. One translator can provide support for +many similar device files, for example all hard disk partitions. This way, +the number of actual translators needed is quite small. However, note that +for each device file accessed, a seperate translator task is started. +Because the Hurd is heavily multi threaded, this is very cheap.</p> +<p> +When hardware is involved, a translator usually starts to communicate with +the kernel to get the data from the hardware. However, if no hardware access +is necessary, the kernel does not need to be involved. For example, +<code>/dev/zero</code> does not require hardware access, and can therefore +be implemented completely in user space.</p> +<h4>Symbolic Links</h4> +<p> +A symbolic link can be seen as a translator. Accesing the symbolic link +would start up the translator, which would forward the request to the +filesystem that contains the file the link points to.</p> +<p> +However, for better performance, filesystems that have native support +for symbolic links can take advantage of this feature and implement +symbolic links differently. Internally, accessing a symbolic link would not +start a new translator process. However, to the user, it would still look +as if a passive translator is involved (see below for an explanation what a +passsive translator is).</p> +<p> +Because the Hurd ships with a symlink translator, any filesystem server that +provides support for translators automatically has support for symlinks (and +firmlinks, and device files etc)! This means, you can get a working +filesystem very fast, and add native support for symlinks and other features +later.</p> +<h3><a href="#TOC_actpas" name="actpas">Passive Translators, Active Translators</a></h3> +<p> +There are two types of translators, passive and active. They are really +completely different things, so don't mix them up, but they have a close +relation to each other.</p> +<h4>Active Translators</h4> +<p> +An active translator is a running translator process, as introduced above. +You can set and remove active translators using the +<code>settrans -a</code></a> +command. The <code>-a</code> option is necessary to tell +<code>settrans</code> that you want to modify the active translator.</p> +<p> +The <code>settrans</code> command takes three kind of arguments. First, you +can set options for the <code>settrans</code> command itself, like +<code>-a</code> to modify the active translator. Then you set the inode you +want to modify. Remember that a translator is always associated with an +inode in the directory hierarchy. You can only modify one inode at a time. +If you do not specify any more arguments, <code>settrans</code> will try to +remove an existing translator. How hard it tries depends on the force +options you specify (if the translator is in use by any process, you will +get "device or resource busy" error message unless you force it to go away).</p> +<p> +But if you specify further arguments, it will be interpreted as a command +line to run the translator. This means, the next argument is the filename of +the translator executable. Further arguments are options to the translator, +and not to the <code>settrans</code> command.</p> +<p> +For example, to mount an ext2fs partition, you can run +<code>settrans -a -c /mnt /hurd/ext2fs /dev/hd2s5</code>. The +<code>-c</code> option will create the mount point for you if it doesn't +exist already. This does not need to be a directory, by the way. To unmount, +you would try <code>settrans -a /mnt</code>.</p> +<h4>Passive Translators</h4> +<p> +A passive translator is set and modified with the same syntax as the active +translator (just leave away the <code>-a</code>, so everything said above is +true for passive translators, too. However, there is a difference: passive +translators are not yet started.</p> +<p> +This makes sense, because this is what you usually want. You don't want the +partition mounted unless you really access files on this partition. You +don't want to bring up the network unless there is some traffic and so +on.</p> +<p> +Instead, the first time the passive translator is accessed, it is +automatically read out of the inode and an active translator is started on +top of it using the command line that was stored in the inode. This is +similar to the Linux automounter functionality. However, it does not come as +an additional bonus that you have to set up manually, but an integral part of +the system. So, setting passive translators defers starting the translator +task until you really need it. By the way, if the active translator dies for +some reason, the next time the inode is accessed the translator is +restarted.</p> +<p> +There is a further difference: active translators can die or get lost. As +soon as the active translator process is killed (for example, because you +reboot the machine) it is lost forever. Passive translators are not transient +and stay in the inode during reboots until you modify them with the +<code>settrans</code> program or delete the inodes they are attached to. +This means, you don't need to maintain a configuration file with your mount +points.</p> +<p> +One last point: Even if you have set a passive translator, you can still +set a different active translator. Only if the translator is automatically +started because there was no active translator the time the inode was +accessed the passive translator is considered.</p> +<h3><a href="#TOC_manage" name="manage">Managing Translators</a></h3> +<p> +As mentioned above, you can use +<code>settrans</code></a> +to set and alter passive and active translators. There are a lot of options +to change the behaviour of <code>settrans</code> in case something goes +wrong, and to conditionalize its action. Here are some common usages:</p> +<ul><li><code>settrans -c /mnt /hurd/ext2fs /dev/hd2s5</code> mounts a +partition, the translator will stay across reboots.</li> +<li><code>settrans -a /mnt /hurd/ext2fs ~/dummy.fs</code> mounts a +filesystem inside a data file, the translator will go away if it dies.</li> +<li><code>settrans -fg /nfs-data</code> forces a translator to go away.</li> +</ul> +<p> +You can use the <code>showtrans</code></a> +command to see if a translator is attached to an inode. This will only show +you the passive translator though.</p> +<p> +You can change the options of an active (filesystem) translator with +<code>fsysopts</code> without actually restarting it. This is very +convenient. For example, you can do what is called "remounting a +partition read-only" under Linux simply by running <code>fsysopts +/mntpoint --readonly</code>. The running active translator +will change its behaviour according to your request if possible. +<code>fsysopts /mntpoint</code> without a parameter shows you the current +settings.</p> +<h4>Examples</h4> +<p> +I recommend that you start by reading the <code>/bin/mount</code> command, +it is only a small script. Because setting filesystem translators is +similar to mounting partitions, you can easily grasp the concept this way. +Make a file system image with <code>dd if=/dev/zero of=dummy.fs bs=1024k +count=8; mke2fs dummy.fs</code> and "mount" it with <code>settrans -c dummy +/hurd/ext2fs `pwd`/dummy.fs</code>. Note that the translator is not started +yet, no new <code>ext2fs</code> process is running (verify with <code>ps +Aux</code>). Check that everything is correct using <code>showtrans</code></p> +<p> +Now type <code>ls dummy</code> and you will notice the short delay that +occurs while the translator is started. After that, there will be no more +delays accessing dummy. Under Linux, one would say that you automounted a +loop file system. Check with <code>ps Aux</code> that there is an <code>ext2fs +dummy</code> process up and running now. Now put some files into the new +directory. Try to make the filesystem read-only with <code>fsysopts</code>. +Note how further write attempts fail now. Try to kill the active translator +with <code>settrans -g</code>.</p> +<p> +You should have some understanding of what is going on now. Now remember +that this was only <em>one</em> special server, the Hurd ext2fs server. +There are many more server in the <code>hurd</code> directory. Some of them +are for filesystems. Some are needed for file system features like links. +Some are needed for device files. Some are useful for networking. Imagine +"mounting" an FTP Server with <code>settrans</code> and downloading files +simply with the standard <code>cp</code> command. Or editing your web sites +with <code>emacs /ftp/homepage.my.server.org/index.html</code>!</p> diff --git a/hurd/faq.mdwn b/hurd/faq.mdwn index 3f0cc7e5..413aaf3f 100644 --- a/hurd/faq.mdwn +++ b/hurd/faq.mdwn @@ -1,45 +1,20 @@ -In addition to the [general FAQ](http://www.gnu.org/software/hurd/docs.html#TOCfaq) there are the following typical newbie questions. (There is an [updated version](http://tuxou.ouvaton.org/hurd/) which is not official yet.) - -If you still have problems, do not hesitate to make use of the [[MailingLists]] or the [[IRC]]. - -* **_You say GNU, don't you mean GNU/Hurd?_** - * Yes and no. GNU refers to the system as a whole, while GNU/Hurd is more specific, saying that it is the GNU system running on the Hurd -- to differentiate it from the GNU system running on Linux, GNU/Linux. Also see [[GNU/GnuNames]] - -* **_What editor can I use?_** - * `nano` is the default editor on a fresh install, not `ae`. - -* **_Why can't I get the answers I need from Hurd hackers?_** - * This [document](http://www.catb.org/~esr/faqs/smart-questions.html) may help you understand some developers attitudes and social norms. - -* **_Where are the virtual consoles I use when running GNU/Linux?_** - * You need to [use screen](http://www.gnu.org/software/hurd/faq.en.html#q4-6) instead, also available when running GNU/Linux. - * The [new console](http://lists.debian.org/debian-hurd/2002/debian-hurd-200209/msg00054.html) by Marcus Brinkmann could also be used. It supports the Alt-Fn keys for switching like in GNU/Linux. NOTE: that message has an error in the configuration steps, it says `/dev/vts` when it means `/dev/vcs`. A more up-to-date howto is [[console]]. - -* **_What is a translator?_** - * The official FAQ [answers](http://www.gnu.org/software/hurd/faq.en.html#q4-2) this question by a reference to [hurd-doc-translator](http://www.debian.org/ports/hurd/hurd-doc-translator). - -* **_Where's the sauce?_** - * It's on [Savannah](http://savannah.gnu.org). See also the [GNU Development Resources](http://www.gnu.org/software/devel.html), for more information. - -* **_What is this "libio" stuff?_** - * There was an ABI change for glibc0.3. It's recommended you reinstall your GNU/Hurd system if you run a system installed before the summer of 2002. This is a similar cause for the various Linux distributions who changed from libc5 to libc6 or glibc2 around 1998. - -* **_What is GNU Mach vs. oskit-mach?_** - * These are different versions of the Mach microkernel that supports the Hurd that runs on top of it. For more info, see [[Mach]] - -* **_What software is available for GNU?_** - * Most packages from [Debian](http://www.debian.org/) [GNU/Linux](http://www.gnu.org/gnu/linux-and-gnu.html) which aren't linux-specific ([Packages That Won't Be Ported](http://www.debian.org/ports/hurd/hurd-devel-debian)) are expected to work on GNU/Hurd too. See the database in <http://packages.debian.org/>. Programs which need pthreads, including [GNOME](http://www.gnome.org), [KDE](http://www.kde.org), [Mozilla](http://www.mozilla.org), [OpenOffice](http://www.openoffice.org), [SDL](http://www.libsdl.org), etc. are being worked on currently using Neal Walfields libpthreads. See the [[Distrib/PortingIssues]] document for some common build problems and their solutions. - * If you can't fetch a package with "apt-get install ", try building it from source: "apt-get source && cd <package\_dir> && debian/rules binary". - * As of January 2007, 50% of Debian packages have been ported on the Hurd. Of course, bug testing is welcome. - -* **_How do I initialize a serial console on the Hurd?_** - * You can try out the Serial Howto at <http://www.nongnu.org/thug/serial-howto.txt> - * For a real serial console at boot time you need to rebuild your GNUmach 1.x kernel. For more info see the Utah release notes at [http://www.cs.utah.edu/flux/mach4-i386/html/mach4-UK22.html#serial\_console](http://www.cs.utah.edu/flux/mach4-i386/html/mach4-UK22.html#serial_console) - -* **_Will GNU work in Vmware?_** - * It's highly recommended and easier to get a full image for Bochs. See [[Distrib]] - * It didn't use to, [Hurd bootstrap fails](http://lists.debian.org/debian-hurd/2002/debian-hurd-200207/msg00069.html). Vmware is not [free software](http://www.gnu.org/philosophy/free-sw.html) and it is [[Distrib/VmWare]]. We recommend to use [free](http://www.gnu.org/philosophy/free-sw.html) alternatives, like [[Distrib/BochsEmulator]]. - * A faster, more widespread and [free](http://www.gnu.org/philosophy/free-sw.html) recent alternative is [QEMU](http://hurd.gnufans.org/bin/view/Distrib/QEMU). You can find more informations on [[running/QEMU]]. - * If someone prefers using VMWare: - * It works with VMWare Workstation 4.0.5 build-6030. - * Running Debian GNU/HURD in VMWare works for me -- [[Main/MichaelAblassmeier]] - 03 Mar 2004 +[[!meta copyright="Copyright © 2008, 2010 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]]."]]"""]] + +[[!meta title="GNU Hurd FAQ"]] + +See also other [[/FAQ]]. + +[[!inline +pages="hurd/faq/* and !*/discussion" +show=0 +feeds=no +actions=yes +rootpage="hurd/faq" postformtext="Add a new item titled:"]] diff --git a/hurd/faq/how_about_drivers.mdwn b/hurd/faq/how_about_drivers.mdwn new file mode 100644 index 00000000..0556fd28 --- /dev/null +++ b/hurd/faq/how_about_drivers.mdwn @@ -0,0 +1,17 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="What drivers does GNU/Hurd have?"]] + +Currently, Mach integrates drivers from Linux 2.0 through some glue code. As +it's very old, that limits hardware support a lot, of course. We are however +working on using the DDE toolkit to run linux drivers in userland processes, +which provides both long-term support for new hardware and safety against driver +bugs. diff --git a/hurd/faq/how_to_switch_microkernels.mdwn b/hurd/faq/how_to_switch_microkernels.mdwn new file mode 100644 index 00000000..21f7a371 --- /dev/null +++ b/hurd/faq/how_to_switch_microkernels.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2009, 2010 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]]."]]"""]] + +[[!meta title="How difficult would it be to switch to another microkernel?"]] + +One would have to reimplement the `mach/` and `sysdeps/mach/` parts of +[[glibc]] and [[libpthread]]. Quite a few other Hurd tools also assume a +[[microkernel/Mach]] kernel and would have to be adapted or rewritten. diff --git a/hurd/faq/old-stuff.mdwn b/hurd/faq/old-stuff.mdwn new file mode 100644 index 00000000..df2058c0 --- /dev/null +++ b/hurd/faq/old-stuff.mdwn @@ -0,0 +1,45 @@ +In addition to the [general FAQ](http://www.gnu.org/software/hurd/docs.html#TOCfaq) there are the following typical newbie questions. (There is an [updated version](http://tuxou.ouvaton.org/hurd/) which is not official yet.) + +If you still have problems, do not hesitate to make use of the [[mailing lists]] or the [[IRC]]. + +* **_You say GNU, don't you mean GNU/Hurd?_** + * Yes and no. GNU refers to the system as a whole, while GNU/Hurd is more specific, saying that it is the GNU system running on the Hurd -- to differentiate it from the GNU system running on Linux, GNU/Linux. Also see [[GNU/GnuNames]] + +* **_What editor can I use?_** + * `nano` is the default editor on a fresh install, not `ae`, but a lot of editors are available. + +* **_Why can't I get the answers I need from Hurd hackers?_** + * This [document](http://www.catb.org/~esr/faqs/smart-questions.html) may help you understand some developers attitudes and social norms. + +* **_Where are the virtual consoles I use when running Linux?_** + * You need to [use screen](http://www.gnu.org/software/hurd/faq.en.html#q4-6) instead, also available when running GNU/Linux. + * The [new console](http://lists.debian.org/debian-hurd/2002/debian-hurd-200209/msg00054.html) by Marcus Brinkmann could also be used. It supports the Alt-Fn keys for switching like in Linux. NOTE: that message has an error in the configuration steps, it says `/dev/vts` when it means `/dev/vcs`. A more up-to-date howto is [[console]]. + +* **_What is a translator?_** + * The official FAQ [answers](http://www.gnu.org/software/hurd/faq.en.html#q4-2) this question by a reference to [hurd-doc-translator](http://www.debian.org/ports/hurd/hurd-doc-translator). + +* **_Where's the sauce?_** + * It's on [Savannah](http://savannah.gnu.org). See also the [GNU Development Resources](http://www.gnu.org/software/devel.html), for more information. + +* **_What is this "libio" stuff?_** + * There was an ABI change for glibc0.3. It's recommended you reinstall your GNU/Hurd system if you run a system installed before the summer of 2002. This is a similar cause for the various Linux distributions who changed from libc5 to libc6 or glibc2 around 1998. + +* **_What is GNU Mach vs. oskit-mach?_** + * These are different versions of the Mach microkernel that supports the Hurd that runs on top of it. For more info, see [[Mach]] + +* **_What software is available for GNU?_** + * Most (2/3) packages from [Debian](http://www.debian.org/) [GNU/Linux](http://www.gnu.org/gnu/linux-and-gnu.html) which aren't linux-specific ([Packages That Won't Be Ported](http://www.debian.org/ports/hurd/hurd-devel-debian)) are expected to work on GNU/Hurd too. See the database in <http://packages.debian.org/>. Notably, [GNOME](http://www.gnome.org), and [KDE](http://www.kde.org) work. See the [[porting/guidelines]] document for some common build problems and their solutions. + * If you can't fetch a package with "apt-get install ", try building it from source: "apt-get source && cd <package\_dir> && debian/rules binary". + * As of April 2010, 65% of Debian packages have been ported on the Hurd. Of course, bug testing is welcome. + +* **_How do I initialize a serial console on the Hurd?_** + * You can try out the Serial Howto at <http://www.nongnu.org/thug/serial-howto.txt> + * For a real serial console at boot time you need to rebuild your GNUmach 1.x kernel. For more info see the Utah release notes at [http://www.cs.utah.edu/flux/mach4-i386/html/mach4-UK22.html#serial\_console](http://www.cs.utah.edu/flux/mach4-i386/html/mach4-UK22.html#serial_console) + +* **_Will GNU work in Vmware?_** + * It's highly recommended and easier to get a full image for qemu. See [[Distrib]] + * It didn't use to, [Hurd bootstrap fails](http://lists.debian.org/debian-hurd/2002/debian-hurd-200207/msg00069.html). Vmware is not [free software](http://www.gnu.org/philosophy/free-sw.html) and it is [[Distrib/VmWare]]. We recommend to use [free](http://www.gnu.org/philosophy/free-sw.html) alternatives, like [[Distrib/BochsEmulator]]. + * A faster, more widespread and [free](http://www.gnu.org/philosophy/free-sw.html) recent alternative is [QEMU][[running/QEMU]]. You can find more informations on [[running/QEMU]]. + * If someone prefers using VMWare: + * It works with VMWare Workstation 4.0.5 build-6030. + * Running Debian GNU/HURD in VMWare works for me -- [[Main/MichaelAblassmeier]] - 03 Mar 2004 diff --git a/hurd/faq/old_faq.txt b/hurd/faq/old_faq.txt new file mode 100644 index 00000000..617d7661 --- /dev/null +++ b/hurd/faq/old_faq.txt @@ -0,0 +1,562 @@ +[[!meta copyright="Copyright © 2001, 2002, 2003, 2004, 2005, 2008 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]]."]]"""]] + + Frequently Asked Questions about the GNU Hurd + +This document attempts to answer the questions that most often plague +users when they are talking about, installing, using, compiling and +developing the GNU Hurd as well as its binary distribution Debian +GNU/Hurd. Be sure to read this before asking for help. + +The GNU Hurd is under active development and a stable version has not +yet been released. Be aware that: there is a lot of work yet to be +completed; you will find bugs; your system will crash. That said, there +is a lot of room for contributions at all levels: development of the +Hurd and Mach proper, porting applications, writing documentation and, +most importantly, user feedback. + +Should you have a question that is not answered by this document and you +feel that it should be, submit it and, if possible, with an answer. + +Each section is copyright its respective author(s). Permission is +granted to copy, distribute and/or modify this document under the terms +of the GNU Free Documentation License, Version 1.1 or any later version +published by the Free Software Foundation; with no Invariant Sections, +with no Front-Cover Texts and with no Back-Cover Texts. A copy of the +license is included in the file COPYRIGHT. + + Neal H Walfield + neal@cs.uml.edu + +? Installation + +?? What partition type should I use for my GNU/Hurd partitions? + +{MB} You should use an ext2 filesystem. Alternatively, you may use BSD +style ufs. The partition type number for ext2fs is 0x83 (this is the +same as in Linux), not 0x63 (GNU HURD). Thomas explains why 0x63 is the +wrong choice: + + One day we may have a new filesystem format, which would + probably be called the GNU Hurd filesystem format, and might + well use that partition code. + +Regardless, as Roland points out, it is always an error to use that code +for an ext2fs partition, + +?? How do I name partitions? + +{MB,NHW} I knew you would ask this. If I had to reduce this FAQ to only +one question, I'd choose this one. It is pretty easy, but you have to +know that there are actually several incompatibly naming convention. + +First, the Hurd: if the disk is question is a SCSI disk, you must know +the SCSI device number; if it is an IDE disk, you must know what +controller the disk is on and whether it is a master or a slave. The +Hurd uses the BSD naming convention which, is to say, disks are ordered +according to their physical location, numerically, starting from zero. +This naming scheme is quite similar to that found in Linux. There, the +master disk on the primary controller is designated as `hda' and the +slave as `hdb'. On the secondary controller, the master and the slave +are designated by `hdc' and `hdd' respectively. Under the Hurd, `hda' +would become `hd0', `hdb' would be referred to as `hd1', etc. + +In the Hurd, like in BSD, partitions are called `slices' and are +numbered starting from one. Thus, to name a particular partition, we +take the disk name, append a `s' and the partition number. Again, this +is similar to Linux except, there is no `s'. For instance, `hda1' would +become `hd0s1'. + +GRUB, the boot loader, uses a completely different nomenclature: it +probes the BIOS and appends each disk in turn to an array. Both disks +and partitions are enumerated using zero based arrays. The format is: +`hd (<disk>, <partition>)'. Thus, `hd (0, 1)' refers to the second +partition on the first drive detected by the BIOS. As Grub now has tab +completion, there is not a lot of guess work. + +?? Can I use partitions larger than 2GB? + +{MB} No, not currently. The filesystem servers need to be changed to +not map the whole store into memory, which is not too difficult. For +large files, some interfaces need to be changed, which is a bit harder +but still doable. + +?? How much swap do I need? + +{NHW} Generally, a lot; once you run out, Mach panics. I have at least +128MB of ram and 256MB of swap on all of machines running GNU/Hurd. + +?? Can I share swap space between GNU/Linux and GNU/Hurd? + +{NHW} Yes. The default pager recognises and respects Linux swap +partitions. It will also swap to a raw partition, i.e. anything that it +does not recognize as Linux swap. Therefore: BE CAREFUL. + +?? Why do I get ``Operation not permitted error''? + +{MB} You forgot to set the file system owner of the GNU/Hurd partition to +``hurd''. The Hurd uses additional information in the inodes to set +translators. To make this work, the partition must be marked as ``owned +by the Hurd''. This is normally done by passing the `-o hurd' option to +`mke2fs' when creating ext2 system from other operating systems +(filesystems created in GNU/Hurd automatically enable this option). +If you failed to do this, you can still use the `e2os' script. + +?? After `native-install' is finished, I had to write tthhiiss + wwaayy. In particular, I had to type `rreebboooott' to reboot. + +{MB} Funny, isn't it? In addition to the rescue `term' server in +`/tmp/console', another `term' server got started and is clobbing the +keyboard input. After a reboot this problem vanishes as only one `term' +server will remain. If `tar' would support translator, we would not +have this problem... Even if you don't experience this problem right +after the installation, reboot immediately so you don't hit this bug by +accident. + +? Setup + +?? How do I add a swap partition? + +{MB} A swap partition is also called a paging file. Usually, it is +sufficient to add the swap partition to `/etc/fstab', just as you would +under Linux. You can swap to a Linux swap partition and the Hurd will +honour the Linux swap signature (both versions). The Hurd will just as +happily swap to any other raw disk space and overwrite anything it +finds. So, be careful! + +If you want to swap to a file or make sure that it checks the Linux swap +signature before, you need to edit `/boot/servers.boot'. The syntax is +the partition device file name plus, optionally, the swap file inside an +ext2fs partition, followed by a space and then one of: +`$(add-raw-paging-file)', `$(add-linux-paging-file)', +`$(add-paging-file)'. The first works with any partition or file and +does not honour any swap signature or other data. The second has a +safety check and only uses the file if a Linux swap signature is found. +The third looks for a swap signature first and falls back to raw paging +if it failed to find one. This is also the default for entries in +`/etc/fstab'. + +?? How do I set up a network? + How do I set up a loopback device? + +{MB} In the former case, be sure that GNU Mach detected your network +card. Either way, you need to setup `pfinet'. Documentation can be +found at: + + http://www.debian.org/ports/hurd/hurd-doc-server#pfinet + +Don't forget to fill in `/etc/resolv.conf', `/etc/hosts', etc. + +Of course, you only need to do this if the installation routine didn't +do it for you. + +?? Can I use the GNU/Linux version of `e2fsck' on a GNU/Hurd partition? + +{MB} Yes, at least since `e2fsprogs-1.05'. Check this with `e2fsck -V' +first. + +{NHW} Do not try to defrag your partition as this utility does not know +about translators. + +?? Why are pipes not working? + +{MB} `settrans -fgc /servers/socket/1 /hurd/pflocal' should help. + +? Usage + +?? Where is the documentation? + +{NHW,MM} There are neither man pages nor info nodes for the Hurd +translators and commands. Documentation lives inside of the binaries +and can be found by passing the `--help' option to a given command. +For instance: + + # /hurd/ext2fs --help + +will tell you what types of options the ext2fs translator accepts. + +The GNU/Hurd User's Guide and the GNU Hurd Reference Manual both +provide some help about the usage of and concepts behind the GNU Hurd. +You can find them, among others, at: + + http://www.gnu.org/software/hurd/docs.html + +?? What is a translator? + +{MB} There is a text about translators available at: + + http://www.debian.org/ports/hurd/hurd-doc-translator + +Read this and ask further questions on the mailing lists. + +?? What is the login shell? + +{MB} The Hurd has the concept of a not-logged in user. This user has +neither user ids nor groups ids. This stems from the fact that the Hurd +supports uid and gid sets and one possibility is, of course, the empty +set. Rather than deny access in this case, filesystems in the Hurd offer a +fourth permission triplet (i.e. rwx) which is used to determine the +privileges for users with no credentials. This, however, needs to be +enabled on a file by file basis. By default, the `other' permission +triplet is used. + +The Hurd login shell is a shell running with neither uids nor gids. To +restrict access to your files, either enable and change the fourth +permission triplet or change the login shell of the `login' user in the +password file to `/bin/loginpr' which implements the standard login +prompt. + +?? How do I use non-US keyboard bindings? + +{NHW,FH} Take a look at: + + http://www.xs4all.nl/~mgerards/xkb8.tar.gz + +If you want a Debian package, you can add to your +'etc/apt/sources.list' + + deb http://debian.duckcorp.org/unstable/binary-hurd-i386/ ./ + +and then run + + apt-get install console-driver-xkb. + +?? How do I enable color on the console? + +{NHW} If you are using the GNU Mach microkernel, you can set your +terminal to `mach-color'. For instance: + + # export TERM=mach-color + +?? How can I enable virtual consoles? + +{AMS} This can be done by running the following command: + + console -d vga -d pc_kbd -d generic_speaker /dev/vcs + +If something went wrong, or if you just wish to exit the Hurd console +then hitting C-A-<backspace> will exit it. + +?? What is the status of X? + +{MB} It works! The packages are available at any Debian ftp mirror. +XFree86 4.0.2 is available, as are some of the v3 servers. Instructions +on how to use the packages are in the mailing list archive (link follow +later). + +?? Why does X not work? + +{MB} Try `export LD_LIBRARY_PATH=/usr/X11R6/lib'. This is a linker +issue. GNU/Hurd expects that `RPATH' is used, however, Debian takes +certain measures to avoid this. Note that this does not cut it for suid +binaries because of security implications. We expect to rectify this +by using `RUNPATH', which is specified in the new ELF standard. + +?? What are these strange pids `2' and `3'? + +{MB} Two is the kernel, three is the default pager and four is the root +filesystem. + +?? Why does `ps aux' give me strange output? + +{MB,MM} Try `ps Aux'. Indeed, under GNU/Hurd, `ps aux' doesn't list +all processes: it omits the session and group leaders, and the +processes without parent. + +?? I have a hung process that I want to kill, however, `ps' is now + hanging too. + +{MB} Interrupt it and pass it the `-M' option. + +{NHW} By default, `ps' gathers information from both the proc server and +the processes themselves (via their message port). If a process it +hung, it will not be able respond to its message port and thus, ps will +wait forever. The `-M' option instructs ps to not gather information +that would require use of the message port. + +?? Where are ... + +{MB} `fdisk' and `dmesg' are not yet ported. + +Instead of `free', use `vmstat' and `vminfo'. + +For kernel messages, read `/dev/klog' directly. Note, once you read +this, it is gone forever. + + +?? Is there a `/proc' filesystem? + +{MB} No. Maybe there will be an emulation filesystem someday for +programs that rely it. If you are wondering about the empty `/proc' +directory, this is a relict from a Debian GNU/Linux package +(specifically, `base-files'). + +You can probe for existing hardware devices with the devprobe utility. + +?? Why does the command `df' not work? + +{NHW} It does, you just have to tell it what filesystem to query. E.g. + + # df / + +?? Why are my translators dying? + +{NHW} Try passing the `-ap' flag to settrans. By default, settrans only +sets a passive translator, therefore, no output will show up on your +terminal. Using `-ap', however, sets both the active and the passive +translator which, means that the translator starts immediately and its +stderr is connected to you terminal. + +Additionally, the biggest problem is passing relative paths to passive +translators. You cannot predict what the current working directory of a +translator will be when it is setup as a passive translator. + +?? Why can I `read' a directory? + +{MB} It is important to understand that there is nothing special about a +directory under the Hurd, it is just another file. This fits in with +the translator concept where a translator can appear as a directory but +provide also as a file. + +? Trouble shooting + +?? When the APM support in the BIOS spins down my disk drives, the + Hurd is unable to wake up. What's wrong? + +{MB} APM is not supported in the current version of GNU Mach, sorry. +Please disable APM in your BIOS setup. + +?? What are these messages referring to `default pager', `paging', + and `pager request'? + +{MB} The default pager handles virtual memory allocation. If it can't +allocate a new memory page because you are out of memory, some terrible +things may happen. Whenever you get errors referring to any of these, +you either need more memory (make sure you have swap) or you have found +a memory leak. + +?? What is a gratuitous error? + +{MB} This comes from `strerror(EGRATUITOUS)'. If you check glibc's +documentation, it will say that this error code has no purpose. This, +however, is not quite true. You only get this when something terrible +happens. Thomas explains: + + More precisely `EGRATUITOUS' officially means that some server + has responded in an impossible or protocol-violating fashion. + There are some cases in the Hurd where `EGRATUITOUS' is returned + and probably something else should be chosen instead. + +If you can reproduce this error message, please report it. + +?? What does ``computer bought the farm'' mean ? + +{FH} This message is the text that corresponds to the errno code +`EIEIO'. Roland McGrath explains: + + That message is not output by any particular servers at + particular times; rather it is the perror text for the errno + code EIEIO, which is returned by various RPCs and functions + for a variety of "hopeless" error conditions. + + +?? What does ``/dev/hd0s1: MOUNTED READ-ONLY; MUST USE `fsysopts + --writable''' mean? + +{NHW} In this case, /dev/hd0s1 was not unmounted cleanly. The Hurd +will, on boot up, run ``fsck -p'' on any partitions that it finds in +/etc/fstab, so, you may want to consider adding this partition to that +file. If you are sure that the partition is fine, you can run: + + # fsysopts /home --writable + +to ask the translator sitting on /home to change from read-only to +read/write mode. Note that the command is being sent to the filesystem +and not the store (e.g. /dev/hd0s1). + +?? When GNU/Hurd crashes, GNU Mach automatically reboots. Is + there anyway I can make it pause so I can write down the error? + +{MB} Pass the `-H' option to init (add it to the boot command line), and +`init' will tell Mach to enter the kernel debugger instead to rebooting +it. At the debugger prompt (`db>'), you can type `reboot' any time to +reboot the system. + +? Porting + +?? What programs have been ported? + +{NHW} A lot, take a look at the Debian archive. Many programs, however, +do not necessarily need to be ported; they have just never been +compiled. + +?? Is porting easy? + +{NHW} Porting applications to GNU/Hurd is relatively easy assuming the +application is POSIX compliant as GNU/Hurd does its best to be a +conforming operating system. + +The most common error made by programmers is assuming the MAXPATHLEN and +PATH_MAX are defined. On most operating systems this is set to a few +thousand, however, on GNU/Hurd, there is no maximum and thus, this is +not set. The correct thing to do is to submit a patch to the upstream +author that allocates memory dynamically. + +?? How can I help? + +{NHW} A effort to compile all of the Debian packages is underway by Jeff +Bailey. Take a look at: + + http://people.debian.org/~jbailey/oasis/group/Debian/index.html + +to see what has been done and how you can help. + +? Compiling + +?? Where can I get the source? + +{AMS} Instructions on how to download the CVS tree from Savanah are +avaiable at https://savannah.gnu.org/cvs/?group=hurd + +{NHW} To get the source to the latest debian package, look on any +debian mirror. + +?? Can I cross compile? + +{NHW} Yes. If you are running Debian GNU/Linux on IA32, this is quite +easy as there is a cheap cross compiler available; all that is required +is installing the gcc-i386-gnu and mig-i386-gnu Debian packages. When +running configure, you will have to specify tools directly: + + # MIG=/usr/bin/i386-gnu-mig CC=/usr/bin/i386-gnu-gcc \ + ../src/hurd/configure ... + +If you are running another distribution, you will have to do this the +long way. You can find instructions at the Cross Compiling HOW-TO +available at: + + http://hurddocs.sourceforge.net/howto/cross.html + +Farid Hajji <farid.hajji@ob.kamp.net> also talks about his experiences +at: + + http://lists.debian.org/debian-hurd-0012/msg00062.html + +?? Any general tips? + +{NHW} Yeah, building in the source tree is untested. Try: + + # ../src/hurd/configure ... + +? Development + +?? What is OSKit-Mach? + +{NHW,FH} There are two versions of GNU Mac that are in use: GNU Mach +1.x and GNU Mach 2.x, formerly known as OSKit-Mach. The former uses +the drivers from Linux 2.0.x while the latter uses the University of +Utah's OSKit library for drivers. You can find out more about the +OSKit library at: + + http://www.cs.utah.edu/flux/oskit + +GNU Mach 2.x is usable, but some things are still missing or not +working, like the serial port and scsi drivers. This is why GNU Mach +2.0 hasn't released yet and the two versions coexist. + +?? Where is the documentation? + +{NHW} There were several books written on the Mach kernel. The +information that they contain is still mostly pertinent and should be +considered required reading for potential hackers. They can be found +at: + + http://www.cs.cmu.edu/afs/cs/project/mach/public/www/doc/publications.html + +The documentation for the Hurd is quite inadequate. The starting of a +book, ``The GNU Hurd'' is in the doc directory in the Hurd source. You +can read this using: + + # info hurd + +The authoritative place is, of course, the source code; that does not, +however, mean that we would not welcome more documentation. To get +started, take a look at <hurd>/doc/navigating. + +?? How do I make sure that my code is POSIX compliant? + +{NHW} Unfortunately, you have to buy the POSIX standard from IEEE. The +Single Unix Specification version 2, a superset of POSIX, is available +for free on the Internet. Try: + + http://www.unix-systems.org/online.html + +?? Who do I submit patches to? + +{NHW} If they are against the Hurd, Mach or MiG, send a patch to the +bug-hurd mailing list. + +If they are against other packages, the Debian BTS is a good place. In +this case, be sure to advise the debian-hurd mailing list of the bug. + +?? In what format should patches for the Hurd and GNU Mach be? + +{MB} All patches should be sent in unified context diff format (option +`-u' to GNU diff). It is helpful for us if you also use the `-p' +option which includes information about the function changed by a +patch. Changes that are similar can be grouped together in one file, +but unrelated changes should be sent in seperate files. The patches +can be included in the message or as a MIME attachement. They should +not be compressed and/or archived unless they are very large, and if +they are very large it is probably better to store them on-line at +some place and only sent an URL. + +Write a ChangeLog entry for each change, following the format of the +existing files. Here is an example: + + 2000-12-02 Marcus Brinkmann <marcus@gnu.org> + + * ops.c (op_readlink): Before returning, check if the buffer + pointed to by transp is ours. If not, munmap it. + (op_read): Likewise for bp. + (op_readdir): Don't alloca a buffer here. Instead initialize + BUF and BUFSIZE to 0 and let the server (eh, MiG) do it. + munmap BUF before returning. + +The file name and the name of the function changed should always be +spelled out completely, and not abbreviated or otherwise mangled (like +foo.{c,h}), because that would make searching for all changes to a +file or function impossible. Local variable names are all +capitalized. There are two spaces between sentences. You can use +``C-x 4 a'' in Emacs to add a new ChangeLog entry. If you do that +with the mark being in a function, Emacs will automatically fill in +the file and function name for you. + +Do not send in a patch for the ChangeLog file. Rather include the +ChangeLog entries in the message that contains the patch. Patches for +ChangeLog files often conflict. + +If you have the original source tree in the directory `hurd-orig', and +the modified source tree in the directory `hurd', the following +command will produce a good patch (please make sure there are no extra +files like backups in the modified tree, or leave away the option +`-N'). You will need to collect the ChangeLog entries seperately. + + # diff -x ChangeLog -Nurp hurd-orig hurd + + +Answers were given by (in chronological order): +* {NHW} Neal H Walfield <neal@cs.uml.edu> +* {MB} Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> +* {AMS} Alfred M. Szmidt <ams@gnu.org> +* {OK} Ognyan Kulev <ogi@fmi.uni-sofia.bg> +* {FH} Frédéric Henry <neryel@reveries.info> +* {MM} Manuel Menal <mmenal@hurdfr.org> diff --git a/hurd/faq/old_hurd_faq.txt b/hurd/faq/old_hurd_faq.txt new file mode 100644 index 00000000..c7e0ffe8 --- /dev/null +++ b/hurd/faq/old_hurd_faq.txt @@ -0,0 +1,289 @@ +The Unofficial (and no longer maintained) GNU Hurd FAQ, Version 0.13 + +Contributions by: + +Michael I. Bushnell <mib@gnu.org> +Len Tower <tower@gnu.org> +Trent Fisher <trent@gnurd.uu.pdx.edu> +jlr@usoft.spb.su +Remy Card <Remy.Card@masi.ibp.fr> +Louis-Dominique Dubeau <hallu@info.polymtl.ca> + +Original Document by: Derek Upham <upham@cs.ubc.ca> + + +============================== + +Contents: + +Q0. Where can I get the Unofficial GNU Hurd FAQ? +Q2. Where can I get a copy? +Q3. Why bother writing a new OS when we have Linux and 386/BSD? +Q4. What's all this about Mach 3.0 (and Mach 4.0)? +Q5. Where can I find more information? +Q6. What's a proper machine? +Q7. What sort of machines will run Hurd in the future? +Q8. What is the current development status? +Q9. What sort of system would we have if the Hurd was bootable today? + +============================== + +Q0. Where can I get the Unofficial GNU Hurd FAQ? + +The Unofficial Hurd FAQ (what you are reading now) is occasionally +posted to the USENET newsgroup, gnu.misc.discuss. It is also +available from + + http://www.enci.ucalgary.ca/~gord/hurd/hurd-faq.txt (Broken Link ?) + +If you don't have WWW access, you may send mail to me, Gordon +Matzigkeit <gord@enci.ucalgary.ca> with a subject line that reads: + + Subject: send hurd-faq + +You should receive a PGP-signed copy of the current version of this +document in a matter of minutes. + + +Q2. Where can I get a copy? + +To put it simply, you can't. It is still under development (by +Michael Bushnell, Roland McGrath and Miles Bader). It is almost, but +not quite, at the point where you can do real work on it. Keep your +fingers crossed. + +Some people have actually bootstrapped it, but the work is not easy, +and the current snapshot won't work until a new multiserver boot +mechanism is made. + +If you *really* want to try it, beware that it is still pre-alpha +code, and that it will likely crash on you. See Trent Fisher's Hurd +pages (under question 5) for the latest information. + + +Q3. Why bother writing a new OS when we have Linux and 386/BSD? + +For one thing, Linux and BSD don't scale well. Hardware designers are +shifting more and more toward multiprocessor machines for performance, +and standard Unix kernels do not provide much multiprocessor support. +The Hurd, on the other hand, runs on top of the Mach 3.0 micro-kernel +[[1]] from CMU. Mach was designed precisely for multiprocessing +machines, so its portability should carry over nicely to the Hurd. + +In addition, the Hurd will be considerably more flexible and robust +than generic Unix. Wherever possible, Unix kernel features have been +moved into unprivileged space. Once there, anyone who desires can +develop custom replacements for them. Users will be able to write and +use their own file systems, their own `exec' servers, or their own +network protocols if they like, all without disturbing other users. + +The Linux kernel has now been modified to allow user-level file +systems, so there is proof that people will actually use features such +as these. It will be much easier to do under the Hurd, however, +because the Hurd is almost entirely run in user space and because the +various servers are designed for this sort of modification. + + +Q4. What's all this about Mach 3.0 (and Mach 4.0)? + +As mentioned above, Mach is a micro-kernel, written at Carnegie Mellon +University. A more descriptive term might be a greatest-common-factor +kernel, since it provides facilities common to all ``real'' operating +systems, such as memory management, interprocess communication, +processes, and a bunch of other stuff. Unfortunately, the system +calls used to access these facilities are only vaguely related to the +familiar and cherished Unix system calls. There are no "fork", +"wait", or "sleep" system-calls, no SIGHUPs, nothing like that. All +this makes it rather difficult to, say, port GNU Emacs to a Mach box. + +The trick is, of course, to write an emulation library. Unix programs +can then use (what they think are) POSIX system calls and facilities +while they are really using Mach system calls and facilities. + +The simplest way of going about this is to take an ordinary Unix +kernel, open it up, and rip out all the machine-specific guts; any +time the Unix kernel talks to the machine, replace the code with calls +to the Mach micro-kernel. Run this fake kernel on a Mach machine and +you end up with something that looks and acts just like Unix (even to +GNU Emacs). Note that the Unix kernel we have implemented is just one +Really Big Mach program (called a single-server). + +The Hurd, on the other hand, breaks the giant Unix kernel down into +various Mach programs running as daemons. Working in concert with +facilities placed in the C library, these daemons provide all of the +POSIX system-calls and features; from the outside they look just like +a standard Unix kernel. This means that, for practical purposes, +anything that you can port to Linux will also port to the Hurd. + +Of course, if a user wishes to run his own daemons, he can do that as +well.... + +Mach 4.0 is an enhanced version of Mach 3.0, put out by the people at +the University of Utah. They are working on another free operating +system, and part of it includes an enhanced, more flexible version of +Mach. The Hurd has moved to Mach 4.0, which is good, because it is a +lot easier to build than 3.0 was. + +You can find more information on Mach by browsing the Hurd pages given +in the next answer, or by looking at the Project Mach and Flux +homepages at: + +Carnegie Mellon University (for Mach versions before 4.0): + + http://www.cs.cmu.edu/afs/cs.cmu.edu/project/mach/public/www/mach.html + +the University of Utah (for Mach 4.0): + + http://www.cs.utah.edu/projects/flux/mach4/html/ + + +Q5. Where can I find more information? + +The June 1995 GNU's Bulletin contains the following official +information: + + The GNU Hurd now runs programs native. We have implemented both + shared libraries using ELF, & the popular `ext2' file system used + by Linux. It can run GCC, `make', Emacs, & most other GNU + utilities. Progress is being made so rapidly that by the time you + read this it probably does much more. It is right on the verge of + being self-hosting (able to run on its own well enough to compile + its own source code, & be used for its own development). We have + much better device supportm [sic] & some new utilities, including a + fancy `ps' & `settrans'. For a complete system we still have much + more work to do, but we will make an alpha release as soon as the + network software is finished & shared libraries have been well + tested. We have a mailing list to announce progress; to be added + to it, ask `hurd-announce-request@gnu.org'. + +The Portland State University CS department (via Trent Fisher) +maintains a WWW server with various Hurd documents, including Michael +Bushnell's Hurd paper, all the collected GNU's Bulletins, and various +announcements posted to "gnu.misc.discuss". The top-level GNU page is + + http://www.cs.pdx.edu/~trent/gnu/gnu.html + +and the Hurd page is + + http://www.cs.pdx.edu/~trent/gnu/hurd/hurd.html + +People in Europe might want to try the GNU WWW server for DESY +Germany, first: + + http://info.desy.de/gnu/www + +This site lacks culled, Hurd-specific information at the moment, but +it does have the last two GNU's Bulletins plus lots of general +information. + +There is a snapshot of the Hurd development tree on +"alpha.gnu.ai.mit.edu" in the "/gnu" directory. It is updated as +significant changes are made, and not guaranteed to run. + +You can subscribe to the Hurd announcement list by sending a request +to "hurd-announce-request@gnu.org". This is a moderated list +for distributing Hurd info to ``all and sundry'', and anyone can join. +In addition, there is a private (invitation-only) list for developers +to coordinate their efforts. It's not even worth thinking about +unless you (a) have a lot of free time on your hands, (b) know Unix +internals and Mach very well, and (c) have a proper machine. + + +Q6. What's a proper machine? + +A ``proper machine'', at the moment, means an x86 box running Mach 3.0 +(or 4.0), with FreeBSD 2.x, NetBSD 1.x, or Linux. + +A single-server OS is no longer required for development because by +the time the Hurd bootstrap mechanism is finished, the Hurd will +probably be self-hosting. + +Linux, FreeBSD, or NetBSD will only be required to splat the Hurd +binaries onto a partition of some sort, and to provide a way of +transferring files to the Hurd until the networking code is ready. + + +Q7. What sort of machines will run Hurd in the future? + +The first thing a prospective Hurd machine needs is a Mach 3.0 port. +According to the most recent "comp.os.mach" FAQ (which hasn't been +updated since February 1994), the following chips have redistributable +Mach micro-kernels and device drivers: + + Intel 80x86 (ISA and PS/2 buses) + Motorola 68000 (Sun 3) + Motorola 88000 (Omron Luna) + DEC Vax + DEC Pmax (DECstation 3100) + DEC Alpha + MIPS R4000 (DECstation 5000 et al.) + IBM RS/6000 + Apple Macintosh + +IBM is planning to run WorkplaceOS (the OS/2 successor) over Mach 3.0 +on the PowerPC chip (closely related to the RS/6000), so the PowerPC +will likely be added to this list soon. The University of Utah has +ported Mach 4.0 to the HP700, but it is not yet stable. + +Sun Sparc machines have a redistributable Mach microkernel, but the +device drivers require a SunOS 4.1.1 source license. + +In addition, any prospective Hurd machine needs a port of the GNU C +library. Version 1.07.4 of the library can handle the following +chips: + + Intel 80x86 (BSD, Dynix, Hurd, SCO, SysV) + Motorola 68000 (HP BSD, NEWS, Sun 4) + MIPS R4000 (Ultrix) + Sun Sparc (Solaris 2, Sun 4) + DEC Alpha (OSF/1, mostly finished) + +So if the next Hurd snapshot is self-hosting, we will be able to run +it (in theory) on Intel 80x86s, Motorola 68000s, MIPS R4000s and DEC +Alphas. + +People who can port the Mach micro-kernel to new architectures are +encouraged to do so. People who can port the GNU C library to new +chips (a much larger group) are also encouraged to do so. You can +help out here without knowing anything about Mach or having any +special machine. Note that once the GNU C library exists for a new +chip, for _any_ OS, making a Hurd port later is simple (and making +ports to other chips becomes easier as well---the effects are +cumulative). + +By current indications, the other hardware requirements (RAM, disk +space, and the like) will be about the same as those of BSD 4.4. + + +Q8. What is the current development status? + +Please see Trent Fisher's Hurd pages for details. + + +Q9. What sort of a system would we have if the Hurd was bootable +today? + +Quite likely, if you already use an end-user system like Linux, +FreeBSD, or NetBSD, you'll be disappointed with the Hurd. It will +take some time before the OS hackers really get to work on +applications and major enhancements. + +But, rest assured, Hurd development should proceed very rapidly. + +Of course, if you think you can help, or you just enjoy neat stuff, +then you'll probably like the Hurd. When you actually understand a +fraction of what's going on behind the scenes, it's very impressive. + +All I'm saying is that I'm not expecting all the Windows '95 users in +the world to switch to the Hurd right away. Wait a little while, +maybe 5-6 years (ample time for GNUStep and Guile to be in use), and +GNU users everywhere will be very happy that the FSF proceeded with +the Hurd. :) + + +============================== + +Footnotes: + +[[1]] Yes, I know that ``micro-kernel'' is about as apt a description +as ``Reduced Instruction Set Chip'', but we're stuck with it. diff --git a/hurd/faq/release.mdwn b/hurd/faq/release.mdwn new file mode 100644 index 00000000..d80c6825 --- /dev/null +++ b/hurd/faq/release.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + +[[!meta title="When will the Hurd be released?"]] + +Next year. + +Save that, read about the Hurd's [[status]]. diff --git a/hurd/faq/slash_usr_symlink.mdwn b/hurd/faq/slash_usr_symlink.mdwn new file mode 100644 index 00000000..5c47f4e1 --- /dev/null +++ b/hurd/faq/slash_usr_symlink.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2001, 2002, 2003, 2004, 2005, 2008 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]]."]]"""]] + +[[!meta title="Why is `/usr' a symbolic link to `.'?"]] + +The distinction between `/` and `/usr` has historical reasons. Back when [[Unix]] +systems were booted from two tapes, a small root tape and a big user tape. +Today, we like to use different partitions for these two spaces. The Hurd +throws this historical garbage away. We think that we have found a more +flexible solution called union filesystems, which allow to create virtual +filesystems which are the union of several other filesystems. However, support +for union filesystems is still in early development. diff --git a/hurd/faq/smp.mdwn b/hurd/faq/smp.mdwn new file mode 100644 index 00000000..953784da --- /dev/null +++ b/hurd/faq/smp.mdwn @@ -0,0 +1,17 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="Does GNU/Hurd support SMP/Multicore?"]] + +The Hurd servers themselves are multithreaded, so they should be able to take benefit of the parallelism brought by SMP/Multicore boxes. This has however never been tested yet because of the following. + +Mach used to be running on SMP boxes like the [[http://en.wikipedia.org/wiki/Intel_iPSC/860 | iPSC 860]], so has an infrastructure for running on them. It has however not (yet) been ported to nowadays' SMP standards like ACPI etc. + +That is why for now GNU/Hurd will only uses one logical processor (i.e. one core or one thread, depending on the socket type). diff --git a/hurd/faq/still_useful.mdwn b/hurd/faq/still_useful.mdwn new file mode 100644 index 00000000..bffeaebd --- /dev/null +++ b/hurd/faq/still_useful.mdwn @@ -0,0 +1,46 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +what are the advantages with the Hurd over Linux, in general of course, nothing +in depth + +> Flexibility for the user: +> +> transparent ftp +> +> $ cd /ftp://ftp.debian.org/debian +> $ ls +> +> personnal filesystem +> +> $ dd < /dev/zero > myspace.img bs=1M count=1024 +> $ mke2fs myspace.img +> $ settrans myspace /hurd/ext2fs myspace.img +> $ cd myspace + +>> Just curious, but I keep seeing these (and other similar) concepts being +>> brought up as the amazing selling points of the Hurd, but all of this is +>> entirely doable now in Linux with FUSE or things like it. + +>>> Nowadays, at LAST, yes, partly. + +>> I'm not sure if an ftp filesystem has been implemented for FUSE yet, but its +>> definately doable; and loopback filesystems like in your second example have +>> been supported for years. + +>>> As a normal user? And establish a tap interface connected through ppp over +>>> ssh or whatever you could want to imagine? + +>> What, then, are the major selling points or benefits? + +>>> These were just examples, Linux is trying to catch up in ugly ways indeed +>>> (yes, have a look at the details of fuse, it's deemed to be inefficient). +>>> In the Hurd, it's that way from the _ground_ and there is no limitation +>>> like having to be root or ask for root to add magic lines, etc. diff --git a/hurd/faq/top.mdwn b/hurd/faq/top.mdwn new file mode 100644 index 00000000..9e385c0f --- /dev/null +++ b/hurd/faq/top.mdwn @@ -0,0 +1,16 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="What is a replacement for procps' top?"]] + +Here is a replacement to use, until the real `top` works, which depends on +[[hurd/translator/procfs]] and some [[!taglink porting|open_issue_porting]]. + + $ while :; do ps -e -v -s CPU --top=22 -r; sleep 5; done diff --git a/hurd/faq/which_microkernel.mdwn b/hurd/faq/which_microkernel.mdwn new file mode 100644 index 00000000..6180dbbb --- /dev/null +++ b/hurd/faq/which_microkernel.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="What happened to the L4/Coyotos/viengoos micro-kernels?"]] + +L4 was promising but happened to not be suitable for implementing a general-purpose operating system on top of it. See [[history/port_to_l4]]. + +Coyotos is abandoned upstream + +Neal Walfield started working on a newly designed kernel called [[viengoos|microkernel/viengoos]]. Unfortunately, he currently lacks time and the projects it paused. + +In the meanwhile, people are thus continuing with [[microkernel/mach]]. diff --git a/hurd/gcc.mdwn b/hurd/gcc.mdwn new file mode 100644 index 00000000..129aa8a9 --- /dev/null +++ b/hurd/gcc.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +[[!meta redir=/gcc]] diff --git a/hurd/gettinghelp.mdwn b/hurd/gettinghelp.mdwn deleted file mode 100644 index b3bbcbf6..00000000 --- a/hurd/gettinghelp.mdwn +++ /dev/null @@ -1,33 +0,0 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. - -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] - -# Essential Documentation - -* [[FAQ]] -* [[microkernel/mach/gnumach/HardwareCompatibilityList]] - -# Forums - -Please follow these [guidelines](http://catb.org/~esr/faqs/smart-questions.html) -when asking your question. Namely: spend some time trying -to solve the problem on your own (e.g., [search the web](http://www.google.com), -use this wiki, etc.), show us that you did so when you -ask your question, and provide as many relevant details as possible -reproducing them as exactly as possible. - -* [[MailingLists]] -* [[IRC]] diff --git a/hurd/glibc.mdwn b/hurd/glibc.mdwn new file mode 100644 index 00000000..bdfed833 --- /dev/null +++ b/hurd/glibc.mdwn @@ -0,0 +1,21 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[General_information|/glibc]] about the glibc. + +For information about how the glibc integrates into the system, see sections +2.1 and 2.5 of the [[critique]]. + +[[Hurd-specific_API]]. + +[[Debugging_glibc|debugging/glibc]]. + +[[Internals]]. diff --git a/hurd/glibc/hurd-specific_api.mdwn b/hurd/glibc/hurd-specific_api.mdwn new file mode 100644 index 00000000..7ead63cd --- /dev/null +++ b/hurd/glibc/hurd-specific_api.mdwn @@ -0,0 +1,184 @@ +[[!meta copyright="Copyright © 2002, 2007, 2008, 2010 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]]."]]"""]] + +[[!meta title="Hurd-specific glibc API"]] + +These functions have meaning only under Hurd. They are needed to get port +names that are used in native Hurd API (the [[RPC]]s to servers). The `.defs` +and `.h` files can be found in `/include/hurd` when all development files are +installed (Debian package `hurd-dev`.) Note that `.defs` are not included in C +programs -- they are used to produce `.h` files. + +<!-- TODO. Need to convert this to a proper table. --tschwinge --> + +<dl> + <p> + </p> + <dt><tt>file_t</tt></dt> + <dt><tt><b>getcwdir</b> (void);</tt></dt> + <p> + </p> + <dd>Get <tt>file_t</tt> port name of current working directory. See <tt>&lt;hurd/fs.defs&gt;</tt> and <tt>&lt;hurd/fs.h&gt;</tt>.</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>setcwdir</b> (file_t);</tt></dt> + <dd>Set current working directory.</dd> + <p> + </p> + <dt><tt>file_t</tt></dt> + <dt><tt><b>getcrdir</b> (void);</tt></dt> + <dd>Get <tt>file_t</tt> port name of current root directory.</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>setcrdir</b> (file_t);</tt></dt> + <p> + </p> + <dd>Set current root directory.</dd> + <p> + </p> + <dt><tt>file_t</tt></dt> + <dt><tt><b>file_name_lookup</b> (const char *file, int flags, mode_t mode);</tt></dt> + <dd>Open a port to FILE with the given FLAGS and MODE (see <tt>&lt;fcntl.h&gt;</tt>). The file lookup uses the current root and working directory. Returns a port to the file if successful; otherwise sets <tt>errno</tt> and returns <tt>MACH_PORT_NULL</tt>.</dd> + <p> + </p> + <dt><tt>file_t</tt></dt> + <dt><tt><b>file_name_lookup_under</b> (file_t startdir, const char *file, int flags, mode_t mode);</tt></dt> + <dd>Open a port to FILE with the given FLAGS and MODE (see <tt>&lt;fcntl.h&gt;</tt>). The file lookup uses the current root directory, but uses STARTDIR as the "working directory" for file relative names. Returns a port to the file if successful; otherwise sets <tt>errno</tt> and returns <tt>MACH_PORT_NULL</tt>.</dd> + <p> + </p> + <dt><tt>file_t</tt></dt> + <dt><tt><b>file_name_path_lookup</b> (const char *file_name, const char *path, int flags, mode_t mode, char **prefixed_name);</tt></dt> + <dd>Lookup FILE_NAME and return the node opened with FLAGS &amp; MODE (see <tt>hurd_file_name_lookup</tt> for details), but a simple file name (without any directory prefixes) will be consecutively prefixed with the pathnames in the <tt>:</tt> separated list PATH until one succeeds in a successful lookup. If none succeed, then the first error that wasn't ENOENT is returned, or ENOENT if no other errors were returned. If PREFIXED_NAME is non-NULL, then if the result is looked up directly, *PREFIXED_NAME is set to NULL, and if it is looked up using a prefix from PATH, *PREFIXED_NAME is set to malloc'd storage containing the prefixed name.</dd> + <p> + </p> + <dt><tt>file_t</tt></dt> + <dt><tt><b>file_name_split</b> (const char file, char **name);</tt></dt> + <dd>Split FILE into a directory and a name within the directory. The directory lookup uses the current root and working directory. If successful, stores in *NAME a pointer into FILE where the name within directory begins and returns a port to the directory; otherwise sets <tt>errno</tt> and returns <tt>MACH_PORT_NULL</tt>.</dd> + <p> + </p> + <dt><tt>file_t</tt></dt> + <dt><tt><b>directory_name_split</b> (const char *file, char **name);</tt></dt> + <p> + </p> + <dd>Split DIRECTORY into a parent directory and a name within the directory. This is the same as <tt>file_name_split</tt>, but ignores trailing slashes.</dd> + <p> + </p> + <dt><tt>FILE *</tt></dt> + <dt><tt><b>fopenport</b> (io_t port, const char *mode);</tt></dt> + <dd>Open a stream on a port. MODE is as for <tt>fopen</tt>. If successful, this consumes a user reference for PORT (which will be deallocated on fclose).</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>openport</b> (io_t port, int flags);</tt></dt> + <p> + </p> + <dd>Open a [[unix/file_descriptor]] on a [[microkernel/mach/port]]. FLAGS + are as for <tt>open</tt>; flags affected by <tt>io_set_openmodes</tt> are + not changed by this. If successful, this consumes a user reference for + PORT (which will be deallocated on close.) See + <tt>&lt;hurd/io.defs&gt;</tt> and + <tt>&lt;hurd/io.h&gt;</tt>. + </dd> + <p> + </p> + <dt><tt>task_t</tt></dt> + <dt><tt><b>pid2task</b> (pid_t pid);</tt></dt> + <p> + </p> + <dd>Return the task control port of process PID. On error, sets <tt>errno</tt> and returns <tt>MACH_PORT_NULL</tt>.</dd> + <p> + </p> + <dt><tt>pid_t</tt></dt> + <dt><tt><b>task2pid</b> (task_t task);</tt></dt> + <dd>Return the PID of the task whose control port is TASK. On error, sets <tt>errno</tt> and returns -1. </dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>geteuids</b> (int n, uid_t *uidset);</tt></dt> + <dd>Get the effective UID set.</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>seteuids</b> (int n, const uid_t *uidset);</tt></dt> + <dd>Set the effective UID set.</dd> + <p> + </p> + <dt><tt>auth_t</tt></dt> + <dt><tt><b>getauth</b> (void);</tt></dt> + <dd>Get port name of current authentication server. See <tt>&lt;hurd/auth.defs&gt;</tt> and <tt>&lt;hurd/auth.h&gt;</tt>.</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>setauth</b> (auth_t);</tt></dt> + <p> + </p> + <dd>Set current authentication server.</dd> + <p> + </p> + <dt><tt>process_t</tt></dt> + <dt><tt><b>getproc</b> (void);</tt></dt> + <dd>Get port name of current process server. See <tt>&lt;hurd/process.defs&gt;</tt> and <tt>&lt;hurd/process.h&gt;</tt>.</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>setproc</b> (process_t);</tt></dt> + <p> + </p> + <dd>Set current process server.</dd> + <p> + </p> + <dt><tt>mach_port_t</tt></dt> + <dt><tt><b>getcttyid</b> (void);</tt></dt> + <dd>Get the CTTY port.</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>setcttyid</b> (mach_port_t);</tt></dt> + <dd>Set the CTTY port.</dd> + <p> + </p> + <dt><tt>kern_return_t</tt></dt> + <dt><tt><b>get_privileged_ports</b> (host_priv_t *host_priv_ptr, device_t *device_master_ptr);</tt></dt> + <dd>Fetch the host privileged port and device master port from the process server.</dd> + <p> + </p> + <dt><tt>mode_t</tt></dt> + <dt><tt><b>getumask</b> (void);</tt></dt> + <dd>Get the current `umask' value without changing it (this glibc functions is available only under GNU Hurd.)</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>vpprintf</b> (io_t port, const char *format, va_list arg);</tt></dt> + <dd>Write formatted output to PORT, a Mach port supporting the i/o protocol, according to the format string FORMAT, using the argument list in ARG.</dd> + <p> + </p> + <dt><tt>thread_t</tt></dt> + <dt><tt><b>hurd_thread_self</b> (void);</tt></dt> + <dd>Return the current thread's thread port. This is a cheap operation (no [[system call]]), but it relies on Hurd signal state being set up.</dd> + <p> + </p> + <dt><tt>error_t</tt></dt> + <dt><tt><b>hurd_thread_cancel</b> (thread_t thread);</tt></dt> + <p> + </p> + <dd>Cancel pending operations on THREAD. If it is doing an interruptible RPC, that RPC will now return EINTR; otherwise, the "cancelled" flag will be set, causing the next <tt>hurd_check_cancel</tt> call to return nonzero or the next interruptible RPC to return <tt>EINTR</tt> (whichever is called first).</dd> + <p> + </p> + <dt><tt>int</tt></dt> + <dt><tt><b>hurd_check_cancel</b> (void);</tt></dt> + <p> + </p> + <dd>Test and clear the calling thread's "cancelled" flag.</dd> + <p> + </p> +</dl> diff --git a/hurd/glibc/internals.mdwn b/hurd/glibc/internals.mdwn new file mode 100644 index 00000000..897da92e --- /dev/null +++ b/hurd/glibc/internals.mdwn @@ -0,0 +1,35 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +Some bits about this, some bits about that. + +# Controlling TTY + +Hurd controlling tty behavior is generally consistent with BSD's, including +`TIOCSCTTY`. Linux also has `TIOCSCTTY` and it is harmless to use it there. +But BSD and Hurd never do an implicit `TIOCSCTTY` (hence our `O_NOCTTY` is +zero). + +C.f. <http://lists.gnu.org/archive/html/bug-hurd/2009-10/msg00030.html> and the +following messages. + +# Sinals + +[[Unix]] signals are implemented in glibc. + +In every process, signals are handled in a separate signal thread. + + [Why does kill hang sometimes?] + <youpi> kill send the signal to the process + <youpi> if the process is hung, killing waits + <youpi> signals should be just asynchronous, but apparently for some reason + Roland & co wanted some syunchronization + +[[!taglink open_issue_glibc]] diff --git a/hurd/history.mdwn b/hurd/history.mdwn deleted file mode 100644 index 1b45d25f..00000000 --- a/hurd/history.mdwn +++ /dev/null @@ -1,19 +0,0 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. - -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] - -<a href="http://lists.gnu.org/archive/html/l4-hurd/2005-10/msg00718.html" target="_top">History 1997-2003</a></dt> -<dd> Personal view of Marcus Brinkmann about Hurd development in 1997-2003. diff --git a/hurd/hurd_hacking_guide.mdwn b/hurd/hurd_hacking_guide.mdwn index 91b33bcf..ea9aa259 100644 --- a/hurd/hurd_hacking_guide.mdwn +++ b/hurd/hurd_hacking_guide.mdwn @@ -1,20 +1,25 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] -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.txt]]. +[[!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]]."]]"""]] -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +Originally written by Wolfgang Jährling, the *Hurd Hacking Guide* contains an +introduction to GNU Hurd and GNU Mach programming, an overview of some of the +Hurd's features. It also contains a tutorial on writing your own +[[translator]]. -Originally written by Wolfgang Jährling, the [Hurd Hacking Guide](http://www.gnu.org/software/hurd/hacking-guide/hhg.html) -contains an overview of some of the Hurd's features. -Also contains a tutorial on writing your own [[translator]]. +Before using the code in the example (trivfs) please do read the Changelog. A lot of changes might have taken place. + + * [HTML version](http://www.gnu.org/software/hurd/hacking-guide/hhg.html) for + browsing online, + * [PostScript version](http://www.gnu.org/software/hurd/hacking-guide/hhg.ps) + [187kB, 37 pages], + * [ASCII text + version](http://www.gnu.org/software/hurd/hacking-guide/hhg.txt) [59kB], + * [Texinfo source](http://www.gnu.org/software/hurd/hacking-guide/hhg.texi) + [60kB]. diff --git a/hurd/interface.mdwn b/hurd/interface.mdwn new file mode 100644 index 00000000..75fda808 --- /dev/null +++ b/hurd/interface.mdwn @@ -0,0 +1,14 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="Interfaces"]] + +[[!map pages="hurd/interface/* and !hurd/interface/*_*" +show=title]] diff --git a/hurd/interface/dir_link.mdwn b/hurd/interface/dir_link.mdwn new file mode 100644 index 00000000..0f1db578 --- /dev/null +++ b/hurd/interface/dir_link.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/23]] diff --git a/hurd/interface/dir_lookup.mdwn b/hurd/interface/dir_lookup.mdwn new file mode 100644 index 00000000..40e79538 --- /dev/null +++ b/hurd/interface/dir_lookup.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/18]] diff --git a/hurd/interface/dir_mkdir.mdwn b/hurd/interface/dir_mkdir.mdwn new file mode 100644 index 00000000..bf386818 --- /dev/null +++ b/hurd/interface/dir_mkdir.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/20]] diff --git a/hurd/interface/dir_mkfile.mdwn b/hurd/interface/dir_mkfile.mdwn new file mode 100644 index 00000000..01828a03 --- /dev/null +++ b/hurd/interface/dir_mkfile.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/25]] diff --git a/hurd/interface/dir_notice_changes.mdwn b/hurd/interface/dir_notice_changes.mdwn new file mode 100644 index 00000000..5763a0a3 --- /dev/null +++ b/hurd/interface/dir_notice_changes.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/26]] diff --git a/hurd/interface/dir_readdir.mdwn b/hurd/interface/dir_readdir.mdwn new file mode 100644 index 00000000..b41e8d49 --- /dev/null +++ b/hurd/interface/dir_readdir.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/19]] diff --git a/hurd/interface/dir_rename.mdwn b/hurd/interface/dir_rename.mdwn new file mode 100644 index 00000000..3839487f --- /dev/null +++ b/hurd/interface/dir_rename.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/24]] diff --git a/hurd/interface/dir_rmdir.mdwn b/hurd/interface/dir_rmdir.mdwn new file mode 100644 index 00000000..d69fdd30 --- /dev/null +++ b/hurd/interface/dir_rmdir.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/21]] diff --git a/hurd/interface/dir_unlink.mdwn b/hurd/interface/dir_unlink.mdwn new file mode 100644 index 00000000..a8861bac --- /dev/null +++ b/hurd/interface/dir_unlink.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/22]] diff --git a/hurd/interface/file_chauthor.mdwn b/hurd/interface/file_chauthor.mdwn new file mode 100644 index 00000000..6fcf97f1 --- /dev/null +++ b/hurd/interface/file_chauthor.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/02]] diff --git a/hurd/interface/file_check_access.mdwn b/hurd/interface/file_check_access.mdwn new file mode 100644 index 00000000..5ab4af57 --- /dev/null +++ b/hurd/interface/file_check_access.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/09]] diff --git a/hurd/interface/file_chflags.mdwn b/hurd/interface/file_chflags.mdwn new file mode 100644 index 00000000..6e55536b --- /dev/null +++ b/hurd/interface/file_chflags.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/04]] diff --git a/hurd/interface/file_chmod.mdwn b/hurd/interface/file_chmod.mdwn new file mode 100644 index 00000000..0bbb8d92 --- /dev/null +++ b/hurd/interface/file_chmod.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/03]] diff --git a/hurd/interface/file_chown.mdwn b/hurd/interface/file_chown.mdwn new file mode 100644 index 00000000..a99bcf85 --- /dev/null +++ b/hurd/interface/file_chown.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/01]] diff --git a/hurd/interface/file_exec.mdwn b/hurd/interface/file_exec.mdwn new file mode 100644 index 00000000..5f4b57f9 --- /dev/null +++ b/hurd/interface/file_exec.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/00]] diff --git a/hurd/interface/file_get_fs_options.mdwn b/hurd/interface/file_get_fs_options.mdwn new file mode 100644 index 00000000..b04c70a3 --- /dev/null +++ b/hurd/interface/file_get_fs_options.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/30]] diff --git a/hurd/interface/file_get_storage_info.mdwn b/hurd/interface/file_get_storage_info.mdwn new file mode 100644 index 00000000..87166c90 --- /dev/null +++ b/hurd/interface/file_get_storage_info.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/15]] diff --git a/hurd/interface/file_get_translator.mdwn b/hurd/interface/file_get_translator.mdwn new file mode 100644 index 00000000..6c8565f4 --- /dev/null +++ b/hurd/interface/file_get_translator.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/28]] diff --git a/hurd/interface/file_get_translator_cntl.mdwn b/hurd/interface/file_get_translator_cntl.mdwn new file mode 100644 index 00000000..befbf1a3 --- /dev/null +++ b/hurd/interface/file_get_translator_cntl.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/29]] diff --git a/hurd/interface/file_getcontrol.mdwn b/hurd/interface/file_getcontrol.mdwn new file mode 100644 index 00000000..94503b23 --- /dev/null +++ b/hurd/interface/file_getcontrol.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/11]] diff --git a/hurd/interface/file_getfh.mdwn b/hurd/interface/file_getfh.mdwn new file mode 100644 index 00000000..369afb17 --- /dev/null +++ b/hurd/interface/file_getfh.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/17]] diff --git a/hurd/interface/file_getlinknode.mdwn b/hurd/interface/file_getlinknode.mdwn new file mode 100644 index 00000000..64efb810 --- /dev/null +++ b/hurd/interface/file_getlinknode.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/16]] diff --git a/hurd/interface/file_lock.mdwn b/hurd/interface/file_lock.mdwn new file mode 100644 index 00000000..8860d24b --- /dev/null +++ b/hurd/interface/file_lock.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/07]] diff --git a/hurd/interface/file_lock_stat.mdwn b/hurd/interface/file_lock_stat.mdwn new file mode 100644 index 00000000..78abebb5 --- /dev/null +++ b/hurd/interface/file_lock_stat.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/08]] diff --git a/hurd/interface/file_notice_changes.mdwn b/hurd/interface/file_notice_changes.mdwn new file mode 100644 index 00000000..f6646410 --- /dev/null +++ b/hurd/interface/file_notice_changes.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/10]] diff --git a/hurd/interface/file_reparent.mdwn b/hurd/interface/file_reparent.mdwn new file mode 100644 index 00000000..80cd174e --- /dev/null +++ b/hurd/interface/file_reparent.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/31]] diff --git a/hurd/interface/file_set_size.mdwn b/hurd/interface/file_set_size.mdwn new file mode 100644 index 00000000..cf1e376c --- /dev/null +++ b/hurd/interface/file_set_size.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/06]] diff --git a/hurd/interface/file_set_translator.mdwn b/hurd/interface/file_set_translator.mdwn new file mode 100644 index 00000000..4a43bdad --- /dev/null +++ b/hurd/interface/file_set_translator.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/27]] diff --git a/hurd/interface/file_statfs.mdwn b/hurd/interface/file_statfs.mdwn new file mode 100644 index 00000000..f5086d34 --- /dev/null +++ b/hurd/interface/file_statfs.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/12]] diff --git a/hurd/interface/file_sync.mdwn b/hurd/interface/file_sync.mdwn new file mode 100644 index 00000000..160c86ca --- /dev/null +++ b/hurd/interface/file_sync.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/13]] diff --git a/hurd/interface/file_syncfs.mdwn b/hurd/interface/file_syncfs.mdwn new file mode 100644 index 00000000..a52e92b0 --- /dev/null +++ b/hurd/interface/file_syncfs.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/14]] diff --git a/hurd/interface/file_utimes.mdwn b/hurd/interface/file_utimes.mdwn new file mode 100644 index 00000000..ab09a58b --- /dev/null +++ b/hurd/interface/file_utimes.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fs/05]] diff --git a/hurd/interface/fs.mdwn b/hurd/interface/fs.mdwn new file mode 100644 index 00000000..4f217c5a --- /dev/null +++ b/hurd/interface/fs.mdwn @@ -0,0 +1,25 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="fs: Filesystem"]] + +All these objects also implement the generic IO facilities. + +To get or set the translator currently running on a file, use +[[`file_set_translator`|file_set_translator]], +[[`file_get_translator`|file_get_translator]], or +[[`file_get_translator_cntl`|file_get_translator_cntl]] on a port gotten with +the `FS_LOOKUP_NOTRANS` flag to [[`dir_lookup`|dir_lookup]]. You can send +these [[RPC]]s to a port to a translated node (looked up without +`FS_LOOKUP_NOTRANS`) to stack a new translator on top of the existing one. + +[[!map pages="hurd/interface/fs/* and !hurd/interface/fs/*/*" +show=title]] diff --git a/hurd/interface/fs/00.mdwn b/hurd/interface/fs/00.mdwn new file mode 100644 index 00000000..29b93731 --- /dev/null +++ b/hurd/interface/fs/00.mdwn @@ -0,0 +1,30 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_exec"]] + + routine file_exec ( + exec_file: file_t; + RPT + exec_task: task_t; + flags: int; + argv: data_t SCP; + envp: data_t SCP; + fdarray: portarray_t SCP; + portarray: portarray_t SCP; + intarray: intarray_t SCP; + deallocnames: mach_port_name_array_t SCP; + destroynames: mach_port_name_array_t SCP); + +Overlay a task with a file. Necessary initialization, including authentication +changes associated with set[ug]id execution must be handled by the filesystem. +Filesystems normally implement this by using [[`exec_newtask`|exec_newtask]] or +[[`exec_loadtask`|exec_loadtask]] as appropriate. diff --git a/hurd/interface/fs/01.mdwn b/hurd/interface/fs/01.mdwn new file mode 100644 index 00000000..7b9c7a31 --- /dev/null +++ b/hurd/interface/fs/01.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_chown"]] + + routine file_chown ( + chown_file: file_t; + RPT + new_owner: uid_t; + new_group: gid_t); + +Change owner and/or group. diff --git a/hurd/interface/fs/02.mdwn b/hurd/interface/fs/02.mdwn new file mode 100644 index 00000000..3158d2c6 --- /dev/null +++ b/hurd/interface/fs/02.mdwn @@ -0,0 +1,36 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_chauthor"]] + + routine file_chauthor ( + chauth_file: file_t; + RPT + new_author: uid_t); + + Whan that Aprill with hith thoureth thoote + The droghte of March hath perthed to the roote, + And bathed every veyne in thwith licour, + Of which vertu engendred is the flour; + Whan Zephiruth eek with hith thweete breeth + Inthpired hath in every holt and heeth + The tender croppeth, and the yonge thonne + Hath in the Ram his halve courth yronne, + And thmale foweleth maken melodye, + That thlepen all the nyght with open ye + (Tho Priketh hem Nature in hir corageth), + Thanne longen folk to goon on pligrimageth, + And palmereth for to theken thtraunge thtrondeth, + To ferne halweth, kowthe in thondry londeth: + And thpethially, from every thireth ende + Of Engelond to Cantebury they wende, + The hooly blithful martyr for to theke, + That hem hath holpen whan that they were theeke. diff --git a/hurd/interface/fs/03.mdwn b/hurd/interface/fs/03.mdwn new file mode 100644 index 00000000..d697ec90 --- /dev/null +++ b/hurd/interface/fs/03.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_chmod"]] + + routine file_chmod ( + chmod_file: file_t; + RPT + new_mode: mode_t); + +Change mode bits. diff --git a/hurd/interface/fs/04.mdwn b/hurd/interface/fs/04.mdwn new file mode 100644 index 00000000..d0386eab --- /dev/null +++ b/hurd/interface/fs/04.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_chflags"]] + + routine file_chflags ( + chflags_file: file_t; + RPT + new_flags: int); + +Change file flags. diff --git a/hurd/interface/fs/05.mdwn b/hurd/interface/fs/05.mdwn new file mode 100644 index 00000000..184e2ffd --- /dev/null +++ b/hurd/interface/fs/05.mdwn @@ -0,0 +1,23 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_utimes"]] + + routine file_utimes ( + utimes_file: file_t; + RPT + new_atime: time_value_t; + new_mtime: time_value_t); + +Change access and modify times. + +If the microseconds value is -1 (all bits on) then the time should be set to +the current time and the remainder of the `time_value_t` ignored. diff --git a/hurd/interface/fs/06.mdwn b/hurd/interface/fs/06.mdwn new file mode 100644 index 00000000..393f1a9b --- /dev/null +++ b/hurd/interface/fs/06.mdwn @@ -0,0 +1,21 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_set_size"]] + + routine file_set_size ( + trunc_file: file_t; + RPT + new_size: loff_t); + +Change the size of the file. If the size increases, new blocks are +zero-filled. After successful return, it is safe to reference mapped areas of +the file up to `new_size`. diff --git a/hurd/interface/fs/07.mdwn b/hurd/interface/fs/07.mdwn new file mode 100644 index 00000000..d6408763 --- /dev/null +++ b/hurd/interface/fs/07.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_lock"]] + + routine file_lock ( + lock_file: file_t; + RPT + flags: int); + +Apply/manipulate advisory lock. diff --git a/hurd/interface/fs/08.mdwn b/hurd/interface/fs/08.mdwn new file mode 100644 index 00000000..fbb3d53b --- /dev/null +++ b/hurd/interface/fs/08.mdwn @@ -0,0 +1,21 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_lock_stat"]] + + routine file_lock_stat ( + lock_file: file_t; + RPT + out mystatus: int; + out otherstatus: int); + +Return current lock status. `mystatus` tells what kind of lock the caller has; +`otherstatus` tells what kind of lock anyone has (including the caller). diff --git a/hurd/interface/fs/09.mdwn b/hurd/interface/fs/09.mdwn new file mode 100644 index 00000000..02c778c2 --- /dev/null +++ b/hurd/interface/fs/09.mdwn @@ -0,0 +1,24 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_check_access"]] + + routine file_check_access ( + file: file_t; + RPT + out allowed: int); + +Find out what kind of access this file permits the current user (regardless of +the current open modes for this port). `allowed` is a bitwise *or* of +`O_READ`, `O_WRITE`, and `O_EXEC`. This is not necessarily the same as what an +`open` or `exec` would allow; `O_EXEC` is set for *root* even if no executable +bits are on (in which case [[`file_exec`|file_exec]] should fail) and `O_WRITE` +is set a directory can be modified, even though it can't be written directly. diff --git a/hurd/interface/fs/10.mdwn b/hurd/interface/fs/10.mdwn new file mode 100644 index 00000000..56ce204f --- /dev/null +++ b/hurd/interface/fs/10.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_notice_changes"]] + + routine file_notice_changes ( + file: file_t; + RPT + port: mach_port_send_t); + +Notice changes to file `file`. Send notification messages (see +[[`fs_notify.defs`|fs_notify]]) to `port` as they occur. diff --git a/hurd/interface/fs/11.mdwn b/hurd/interface/fs/11.mdwn new file mode 100644 index 00000000..94aa4ee0 --- /dev/null +++ b/hurd/interface/fs/11.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_getcontrol"]] + + routine file_getcontrol ( + file: file_t; + RPT + out control: mach_port_send_t); + +Return control port for this filesystem. diff --git a/hurd/interface/fs/12.mdwn b/hurd/interface/fs/12.mdwn new file mode 100644 index 00000000..b69b591b --- /dev/null +++ b/hurd/interface/fs/12.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_statfs"]] + + routine file_statfs ( + file: file_t; + RPT + out info: fsys_statfsbuf_t); + +Return filesystem status. diff --git a/hurd/interface/fs/13.mdwn b/hurd/interface/fs/13.mdwn new file mode 100644 index 00000000..2e06e0c4 --- /dev/null +++ b/hurd/interface/fs/13.mdwn @@ -0,0 +1,60 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_sync"]] + + routine file_sync ( + file: file_t; + RPT + wait: int; + omit_metadata: int); + +Sync the individual file. If `omit_metadata` is set, then it is only necessary +for the server to updated the actual contents of the file, not any associated +metadata. + +# Implementation Examples + +Servers that either don't keep any unsynchronized state (or don't have a +backing store at all) can simply `return 0`. Examples: [[translator/nfs]]. + +## [[libtrivfs]] + +Pass the call through to the underlying node. + +### [[storeio]] / [[streamio]] + +Instead of to the underlying node, pass the call through to the backend +(device). + +## [[libnetfs]] + +Invoke `netfs_attempt_sync`. + +## [[libdiskfs]] + +Invoke `diskfs_file_update`. + +# Usage Examples + +## [[glibc]] + + * `fdatasync` + + `file_syncfs (FD, true, true)` -- invoke it on the passed file descriptor, + do wait for completion, do allow omitting to update the associated + metadata. + + * `fsync` + + `file_syncfs (FD, true, false)` -- invoke it on the passed file descriptor, + do wait for completion, don't allow omitting to update the associated + metadata. diff --git a/hurd/interface/fs/14.mdwn b/hurd/interface/fs/14.mdwn new file mode 100644 index 00000000..a13c0bd8 --- /dev/null +++ b/hurd/interface/fs/14.mdwn @@ -0,0 +1,67 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_syncfs"]] + + routine file_syncfs ( + file: file_t; + RPT + wait: int; + do_children: int); + +Synchronize the entire filesystem. + +This function has a companion in [[`fsys_syncfs`|fsys_syncfs]], which is +invoked on the server's control port instead of an arbitrary node. Both of +them are usually implemented in equivalent ways. + +# Implementation Examples + +Servers that either don't keep any unsynchronized state (or don't have a +backing store at all) can simply `return 0`. Examples: [[translator/nfs]]. + +The implementation typically doesn't care on which specific node (as exported +by the implementing server) [[`file_syncfs`|file_syncfs]] is being invoked on. + +## [[libtrivfs]] + +Invoke [[`file_sync`|file_sync]] on the underlying node. Rationale: the +underlying node represents this filesystem's backend, and once this node is +synchronized, the whole [[libtrivfs]]-based filesystem is to be considered +synchronized. + +### [[storeio]] / [[streamio]] + +Instead of the to underlying node, pass the call through to the backend +(device). + +## [[libnetfs]] + +Invoke `netfs_attempt_syncfs`. + +## [[libdiskfs]] + +Invoke [[`fsys_syncfs`|fsys_syncfs]] on all active children, and invoke +`diskfs_sync_everything` and `diskfs_set_hypermetadata`. + +# Usage Examples + +## [[glibc]] + + * `sync` + + `file_syncfs ("/", false, true)` -- invoke it on the process' root directory + (`INIT_PORT_CRDIR`), don't wait for completion, do synchronize child + filesystems. + +## [[Hurd]] + + * [[`syncfs`|syncfs]] diff --git a/hurd/interface/fs/15.mdwn b/hurd/interface/fs/15.mdwn new file mode 100644 index 00000000..50dcce1b --- /dev/null +++ b/hurd/interface/fs/15.mdwn @@ -0,0 +1,23 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_get_storage_info"]] + + routine file_get_storage_info ( + file: file_t; + RPT + out ports: portarray_t, dealloc; + out ints: intarray_t, dealloc; + out offsets: off_array_t, dealloc; + out data: data_t, dealloc); + +Return information on the storage used to hold this file. See the comment for +`enum file_storage_class` in `<hurd/hurd_types.h>` the details. diff --git a/hurd/interface/fs/16.mdwn b/hurd/interface/fs/16.mdwn new file mode 100644 index 00000000..8ba776c1 --- /dev/null +++ b/hurd/interface/fs/16.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_getlinknode"]] + + routine file_getlinknode ( + file: file_t; + RPT + out linknode: mach_port_send_t); + +Return the node for hard links to this potentially translated file. This +returns a potentially unauthenticated node. diff --git a/hurd/interface/fs/17.mdwn b/hurd/interface/fs/17.mdwn new file mode 100644 index 00000000..8895434a --- /dev/null +++ b/hurd/interface/fs/17.mdwn @@ -0,0 +1,41 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_getfh"]] + + routine file_getfh ( + file: file_t; + RPT + out filehandle: data_t, dealloc); + +Return a file handle for this file. This can be used by NFS and such. It is +not guaranteed that this call will work; if it doesn't, then this filesystem +cannot be NFS mounted. + +Currently file handles are only used by `nfsd` with the purpose of +having some stable representation of nodes (TODO: Add references). +The only translator library that implements `file_getfh` and the +complementary [[`fsys_getfile`|fsys_getfile]] is `libdiskfs`, so if +you are linking against a different library you should expect that the +filesystem exported by your translator will not be supported by `nfsd` +by default. + +If you would like your non-`libdiskfs` translator to be supported by +`nfsd`, you should implement these two RPCs on your own. The idea is +that to each node exported by your translator you should put in +correspondence a unique file handle. A file handle is a 28-byte +value. The first 4 bytes are not used. Then comes a 4-byte number +which should identify your node somehow (`libdiskfs` uses the index +into the internally maintained node cache). After it there comes a +4-byte number which should bear a similar function to the `st_gen` +field of a `stat` structure. Following this specification, you should +be able to implement `file_getfh` and `fsys_getfile` in a proper way +to get `nfsd` support. diff --git a/hurd/interface/fs/18.mdwn b/hurd/interface/fs/18.mdwn new file mode 100644 index 00000000..dbe606f3 --- /dev/null +++ b/hurd/interface/fs/18.mdwn @@ -0,0 +1,34 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_lookup"]] + + routine dir_lookup ( + start_dir: file_t; + RPT + file_name: string_t; + flags: int; + mode: mode_t; + out do_retry: retry_type; + out retry_name: string_t; + out result: mach_port_send_t); + +Translate a file name, following all symlinks. Upon return, if `do_retry` is +`FS_RETRY_MAGICAL` then `retry_name` specifies what to do, the list of +possibilities is documented in `<hurd/hurd_types.h>`; if `FS_RETRY_REAUTH`, +then `result` should be reauthenticated before being used. If `retry_name` is +the empty string and the retry type is `FS_RETRY_NORMAL`, then no further +[[`dir_lookup`|dir_lookup]] calls are required; `result` is the port to use. +Otherwise the [[`dir_lookup`|dir_lookup]] call should be repeated, sent to +`result` (or the reauthenticated port) with `retry_name` passed for +`file_name`. This call is required to be supported by all files (even +non-directories) if the filename is null, and should function in that case as a +re-open of the file. diff --git a/hurd/interface/fs/19.mdwn b/hurd/interface/fs/19.mdwn new file mode 100644 index 00000000..86625d44 --- /dev/null +++ b/hurd/interface/fs/19.mdwn @@ -0,0 +1,29 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_readdir"]] + + routine dir_readdir ( + dir: file_t; + RPT + out data: data_t, dealloc[]; + entry: int; + nentries: int; + bufsiz: vm_size_t; + out amount: int); + +Read entries from the directory. Each entry is identified by an index number +starting at 0 and running through the file. This call fetches `nentries` (or +any convenient number if `nentries` is -1) entries starting at `entry`, +returning an array of struct directs in `data`. The number of entries +successfully read is returned in `amount`. If `entry` is bigger than the index +of the last entry, then 0 is returned in `amount`. If `bufsize` is nonzero, +never return more than `bufsize` bytes of data regardless. diff --git a/hurd/interface/fs/20.mdwn b/hurd/interface/fs/20.mdwn new file mode 100644 index 00000000..da57f0b5 --- /dev/null +++ b/hurd/interface/fs/20.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_mkdir"]] + + routine dir_mkdir ( + directory: file_t; + RPT + name: string_t; + mode: mode_t); + +Create directory. diff --git a/hurd/interface/fs/21.mdwn b/hurd/interface/fs/21.mdwn new file mode 100644 index 00000000..c562333a --- /dev/null +++ b/hurd/interface/fs/21.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_rmdir"]] + + routine dir_rmdir ( + directory: file_t; + RPT + name: string_t); + +Remove directory. diff --git a/hurd/interface/fs/22.mdwn b/hurd/interface/fs/22.mdwn new file mode 100644 index 00000000..24fcdd9e --- /dev/null +++ b/hurd/interface/fs/22.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_unlink"]] + + routine dir_unlink ( + directory: file_t; + RPT + name: string_t); + +Remove non-directory. diff --git a/hurd/interface/fs/23.mdwn b/hurd/interface/fs/23.mdwn new file mode 100644 index 00000000..44621d37 --- /dev/null +++ b/hurd/interface/fs/23.mdwn @@ -0,0 +1,27 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_link"]] + + routine dir_link ( + dir: file_t; + RPT + file: file_t; + name: string_t; + excl: int); + +Create a hard link. + +If `dir` and `file` are not implemented by the same filesystem, `EXDEV` should +be returned. If the two filesystems, however can inter-operate and guarantee +the appropriate POSIX semantics, they can communicate by a private protocol and +allow hard links between them. If `excl` is set, then fail if `name` already +exists in `dir`. diff --git a/hurd/interface/fs/24.mdwn b/hurd/interface/fs/24.mdwn new file mode 100644 index 00000000..aac2df60 --- /dev/null +++ b/hurd/interface/fs/24.mdwn @@ -0,0 +1,24 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_rename"]] + + routine dir_rename ( + olddirectory: file_t; + RPT + oldname: string_t; + newdirectory: file_t; + newname: string_t; + excl: int); + +Rename file -- comments similar to those for [[`dir_link`|dir_link]] apply here +about `EXDEV`. If `excl` is set, then fail if `newname` already exists in +`newdirectory`. diff --git a/hurd/interface/fs/25.mdwn b/hurd/interface/fs/25.mdwn new file mode 100644 index 00000000..9b08d54f --- /dev/null +++ b/hurd/interface/fs/25.mdwn @@ -0,0 +1,25 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_mkfile"]] + + routine dir_mkfile ( + directory: file_t; + RPT + flags: int; + mode: mode_t; + out newnode: mach_port_send_t); + +Create a new file without linking it into the filesystem. You still must have +write permission on the specified directory, even though it will not actually +be written. Return in `newnode` a port to the file. `flags` are the same as +for [[`dir_lookup`|dir_lookup]], but `O_CREAT` and `O_TRUNC` are assumed even +if not specified. diff --git a/hurd/interface/fs/26.mdwn b/hurd/interface/fs/26.mdwn new file mode 100644 index 00000000..82a7bca1 --- /dev/null +++ b/hurd/interface/fs/26.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="dir_notice_changes"]] + + routine dir_notice_changes ( + directory: file_t; + RPT + port: mach_port_send_t); + +Notice changes to directory `dir`. Send directory change notifications (see +[[`fs_notify.defs`|fs_notify]]) to `port` as they occur. diff --git a/hurd/interface/fs/27.mdwn b/hurd/interface/fs/27.mdwn new file mode 100644 index 00000000..9a7bd13f --- /dev/null +++ b/hurd/interface/fs/27.mdwn @@ -0,0 +1,29 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_set_translator"]] + + routine file_set_translator ( + file: file_t; + RPT + passive_flags: int; + active_flags: int; + oldtrans_flags: int; + passive: data_t SCP; + active: mach_port_send_t); + +Set a translator for future lookups to a file. + +`passive` is the passive translator; `active` is the active translator. + +The `flags` are `FS_TRANS_*`, defined in `<hurd/hurd_types.h>`. `oldflags` are +sent in an [[`fsys_goaway`|fsys_goaway]] to an existing active translator if +there is one and it is to be killed. diff --git a/hurd/interface/fs/28.mdwn b/hurd/interface/fs/28.mdwn new file mode 100644 index 00000000..13ac4b7a --- /dev/null +++ b/hurd/interface/fs/28.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_get_translator"]] + + routine file_get_translator ( + file: file_t; + RPT + out translator: data_t, dealloc); + +Return the stored permanent translator for this file. diff --git a/hurd/interface/fs/29.mdwn b/hurd/interface/fs/29.mdwn new file mode 100644 index 00000000..1cc3950a --- /dev/null +++ b/hurd/interface/fs/29.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_get_translator_cntl"]] + + routine file_get_translator_cntl ( + file: file_t; + RPT + out translator_cntl: mach_port_send_t); + +Return the translator control port to the active translator (if any) for this +file. diff --git a/hurd/interface/fs/30.mdwn b/hurd/interface/fs/30.mdwn new file mode 100644 index 00000000..653af42f --- /dev/null +++ b/hurd/interface/fs/30.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_get_fs_options"]] + + routine file_get_fs_options ( + file: file_t; + RPT + out options: data_t, dealloc); + +Return the options describing the way the receiving filesystem is running. +(Suitable as an arg for [[`fsys_set_options`|fsys_set_options]]). diff --git a/hurd/interface/fs/31.mdwn b/hurd/interface/fs/31.mdwn new file mode 100644 index 00000000..32e7efda --- /dev/null +++ b/hurd/interface/fs/31.mdwn @@ -0,0 +1,21 @@ +[[!meta copyright="Copyright © 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2009 +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]]."]]"""]] + +[[!meta title="file_reparent"]] + + routine file_reparent ( + file: file_t; + RPT + parent: mach_port_t; + out new_file: mach_port_send_t); + +Return a new file, `new_file`, with the same semantics as `file`, but with +lookups of `..` (if `file` is a directory) redirected to `parent`. diff --git a/hurd/interface/fsys.mdwn b/hurd/interface/fsys.mdwn new file mode 100644 index 00000000..cea10d30 --- /dev/null +++ b/hurd/interface/fsys.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +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]]."]]"""]] + +[[!meta title="fsys: Filesystem Control"]] + +[[!map pages="hurd/interface/fsys/* and !hurd/interface/fsys/*/*" +show=title]] diff --git a/hurd/interface/fsys/00.mdwn b/hurd/interface/fsys/00.mdwn new file mode 100644 index 00000000..68e0479e --- /dev/null +++ b/hurd/interface/fsys/00.mdwn @@ -0,0 +1,23 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +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]]."]]"""]] + +[[!meta title="fsys_startup"]] + + routine fsys_startup ( + bootstrap: mach_port_t; + RPT + openflags: int; + control_port: mach_port_send_t; + out realnode: mach_port_send_t); + +Sent by filesystem on its bootstrap port upon startup. `realnode` is the node +this filesystem is the translator for, opened with flags `flags` (`O_NOTRANS` +is assumed even if not provided). diff --git a/hurd/interface/fsys/01.mdwn b/hurd/interface/fsys/01.mdwn new file mode 100644 index 00000000..9cb95de5 --- /dev/null +++ b/hurd/interface/fsys/01.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +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]]."]]"""]] + +[[!meta title="fsys_goaway"]] + + routine fsys_goaway ( + fsys: fsys_t; + RPT + flags: int); + +Filesystem should go away. Bye. diff --git a/hurd/interface/fsys/02.mdwn b/hurd/interface/fsys/02.mdwn new file mode 100644 index 00000000..63b84c48 --- /dev/null +++ b/hurd/interface/fsys/02.mdwn @@ -0,0 +1,33 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +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]]."]]"""]] + +[[!meta title="fsys_getroot"]] + + routine fsys_getroot( + fsys: fsys_t; + RPT + #ifdef FSYS_GETROOT_UREPLY + ureplyport ureply: mig_reply_port_t; + #endif + dotdot_node: mach_port_send_t; + gen_uids: idarray_t; + gen_gids: idarray_t; + flags: int; + out do_retry: retry_type; + out retry_name: string_t; + out file: mach_port_send_t); + +Return a file to the root of the filesystem. `flags` are as for +[[`dir_lookup`|dir_lookup]] (but `O_CREAT` and `O_EXCL` are not meaningful). +`do_retry`, `retry_name`, and `result` are as for [[`dir_lookup`|dir_lookup]]. +The port should be authenticated with `gen_uids` and `gen_gids` (except, of +course, for `FS_RETRY_REAUTH` and `FS_RETRY_MAGICAL). `dotdot_node` is an +unauthenticated port for the directory in which this root is located. diff --git a/hurd/interface/fsys/03.mdwn b/hurd/interface/fsys/03.mdwn new file mode 100644 index 00000000..b0c033c2 --- /dev/null +++ b/hurd/interface/fsys/03.mdwn @@ -0,0 +1,22 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +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]]."]]"""]] + +[[!meta title="fsys_getfile"]] + + routine fsys_getfile ( + fsys: fsys_t; + RPT + gen_uids: idarray_t; + gen_gids: idarray_t; + filehandle: data_t; + out file: mach_port_send_t); + +Get a file given a file handle (see [[`file_getfh`|file_getfh]]). diff --git a/hurd/interface/fsys/04.mdwn b/hurd/interface/fsys/04.mdwn new file mode 100644 index 00000000..7b370d2b --- /dev/null +++ b/hurd/interface/fsys/04.mdwn @@ -0,0 +1,58 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="fsys_syncfs"]] + + routine fsys_syncfs ( + fsys: fsys_t; + RPT + wait: int; + do_children: int); + +Synchronize the entire filesystem. + +This function has a companion in [[`file_syncfs`|file_syncfs]], which is +invoked on an arbitrary node instead of the server's control port. Both of +them are usually implemented in equivalent ways. + +# Implementation Examples + +Servers that either don't keep any unsynchronized state (or don't have a +backing store at all) can simply `return 0`. Examples: [[translator/symlink]], +[[translator/nfs]]. + +## [[libtrivfs]] + +Invoke [[`file_sync`|file_sync]] on the underlying node. Rationale: the +underlying node represents this filesystem's backend, and once this node is +synchronized, the whole [[libtrivfs]]-based filesystem is to be considered +synchronized. + +### [[storeio]] / [[streamio]] + +Instead of to the underlying node, pass the call through to the backend +(device). + +## [[libnetfs]] + +Invoke `netfs_attempt_syncfs`. + +## [[libdiskfs]] + +Invoke [[`fsys_syncfs`|fsys_syncfs]] on all active children, and invoke +`diskfs_sync_everything` and `diskfs_set_hypermetadata`. + +# Usage Examples + +## [[libdiskfs]] + +In the implementations of both [[`file_syncfs`|file_syncfs]] and +[[`fsys_syncfs`|fsys_syncfs]], [[`fsys_syncfs`|fsys_syncfs]] is invoked on all +active children. diff --git a/hurd/interface/fsys/05.mdwn b/hurd/interface/fsys/05.mdwn new file mode 100644 index 00000000..5caf6b17 --- /dev/null +++ b/hurd/interface/fsys/05.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="fsys_set_options"]] + + routine fsys_set_options ( + fsys: fsys_t; + RPT + options: data_t; + do_children: int); + +Pass a server-specific options string. This usually includes flags similar to +command line options, e.g., `--readonly`, or `--sync=30`. diff --git a/hurd/interface/fsys/06.mdwn b/hurd/interface/fsys/06.mdwn new file mode 100644 index 00000000..c8ccbed8 --- /dev/null +++ b/hurd/interface/fsys/06.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="fsys_getpriv"]] + + routine fsys_getpriv ( + fsys: fsys_t; + RPT + out host_priv: mach_port_send_t; + out device_master: mach_port_send_t; + out fstask: mach_port_send_t); + +This is only implemented by bootstrap filesystems. diff --git a/hurd/interface/fsys/07.mdwn b/hurd/interface/fsys/07.mdwn new file mode 100644 index 00000000..4700416d --- /dev/null +++ b/hurd/interface/fsys/07.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="fsys_init"]] + + routine fsys_init ( + fsys: fsys_t; + sreplyport reply_port: sreply_port_t; + proc_server: mach_port_send_t; + auth_handle: auth_t); + +This is only implemented by bootstrap filesystems. diff --git a/hurd/interface/fsys/08.mdwn b/hurd/interface/fsys/08.mdwn new file mode 100644 index 00000000..42ac277d --- /dev/null +++ b/hurd/interface/fsys/08.mdwn @@ -0,0 +1,23 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="fsys_forward"]] + + routine fsys_forward ( + server: mach_port_t; + RPT + requestor: mach_port_send_t; + argv: data_t); + +Ask `server` to provide [[`fsys`|fsys]] translation service for us. +`requestor` is the bootstrap port supplied to the original translator, and +`argv` are the command line arguments. If the recipient accepts the request, +he (or some delegate) should send [[`fsys_startup`|fsys_startup]] to +`requestor` to start the filesystem up. diff --git a/hurd/interface/fsys/09.mdwn b/hurd/interface/fsys/09.mdwn new file mode 100644 index 00000000..fa5c4117 --- /dev/null +++ b/hurd/interface/fsys/09.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta title="fsys_get_options"]] + + routine fsys_get_options ( + server: fsys_t; + RPT + out options: data_t, dealloc); + +Return the options describing the operation of the receiving filesystem +(sutiable for [[`fsys_set_options`|fsys_set_options]]). diff --git a/hurd/interface/fsys_forward.mdwn b/hurd/interface/fsys_forward.mdwn new file mode 100644 index 00000000..1ab16003 --- /dev/null +++ b/hurd/interface/fsys_forward.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/08]] diff --git a/hurd/interface/fsys_get_options.mdwn b/hurd/interface/fsys_get_options.mdwn new file mode 100644 index 00000000..5a48d24d --- /dev/null +++ b/hurd/interface/fsys_get_options.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/09]] diff --git a/hurd/interface/fsys_getfile.mdwn b/hurd/interface/fsys_getfile.mdwn new file mode 100644 index 00000000..d292f265 --- /dev/null +++ b/hurd/interface/fsys_getfile.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/03]] diff --git a/hurd/interface/fsys_getpriv.mdwn b/hurd/interface/fsys_getpriv.mdwn new file mode 100644 index 00000000..6c4332ba --- /dev/null +++ b/hurd/interface/fsys_getpriv.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/06]] diff --git a/hurd/interface/fsys_getroot.mdwn b/hurd/interface/fsys_getroot.mdwn new file mode 100644 index 00000000..ff03c482 --- /dev/null +++ b/hurd/interface/fsys_getroot.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/02]] diff --git a/hurd/interface/fsys_goaway.mdwn b/hurd/interface/fsys_goaway.mdwn new file mode 100644 index 00000000..bf431a08 --- /dev/null +++ b/hurd/interface/fsys_goaway.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/01]] diff --git a/hurd/interface/fsys_init.mdwn b/hurd/interface/fsys_init.mdwn new file mode 100644 index 00000000..2be8dfb9 --- /dev/null +++ b/hurd/interface/fsys_init.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/07]] diff --git a/hurd/interface/fsys_set_options.mdwn b/hurd/interface/fsys_set_options.mdwn new file mode 100644 index 00000000..7f977c20 --- /dev/null +++ b/hurd/interface/fsys_set_options.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/05]] diff --git a/hurd/interface/fsys_startup.mdwn b/hurd/interface/fsys_startup.mdwn new file mode 100644 index 00000000..21cbdee3 --- /dev/null +++ b/hurd/interface/fsys_startup.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/00]] diff --git a/hurd/interface/fsys_syncfs.mdwn b/hurd/interface/fsys_syncfs.mdwn new file mode 100644 index 00000000..88955524 --- /dev/null +++ b/hurd/interface/fsys_syncfs.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=fsys/04]] diff --git a/hurd/io_path.mdwn b/hurd/io_path.mdwn new file mode 100644 index 00000000..598ad967 --- /dev/null +++ b/hurd/io_path.mdwn @@ -0,0 +1,52 @@ +[[!meta copyright="Copyright © 2008, 2010 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]]."]]"""]] + +[[!meta title="I/O Path"]] + + +# read + + * [[glibc]]'s `read` is in `glibc/sysdeps/mach/hurd/read.c:__libc_read`. + + * That calls `glibc/hurd/fd-read.c:_hurd_fd_read()`. + + * That calls `__io_read`, which is an [[RPC]], i.e., that actually results + into the [[translator/ext2fs]] server calling + `hurd/libdiskfs/io-read.c:diskfs_S_io_read`. + + * That calls `_diskfs_rdwr_internal`, which calls + `hurd/libpager/pager-memcpy.c:pager_memcpy`, which usually basically just + tell the kernel to virtually project the memory object corresponding to the + file in the caller process's memory. No read is actually done. + + * Then, when the process actually reads the data, the kernel gets the user + page fault (`gnumach/i386/i386/trap.c:user_trap`), which calls `vm_fault`, + etc., until actually getting to `gnumach/vm/vm_fault/vm_fault_page` which + eventually calls `memory_object_data_request`, which is an [[RPC]], i.e., + that actually results into the [[translator/ext2fs]] server calling + `hurd/libpager/data-request.c:_pager_seqnos_memory_object_data_request`. + + * That calls `hurd/ext2fs/pager.c:pager_read_page`, which looks for where the + data is on the disk, and eventually calls + `hurd/libstore/rdwr.c:store_read`, which eventually calls `device_read`, + which is an [[RPC]], i.e., that actually gets into the kernel calling + `gnumach/linux/dev/glue/block.c:device_read`. + + * ext2fs eventually finishes the data_request() function, the kernel installs + the page into the process that got a fault. + + +# Documentation + + * In [*Linux kernel design patterns - part + 3*](http://lwn.net/Articles/336262/) (2009-06-22), Neil Brown gives a + nice overview of the related layering inside the Linux kernel, + including the VFS layer, page cache and directory entry cache + (dcache). diff --git a/hurd/libchannel.mdwn b/hurd/libchannel.mdwn new file mode 100644 index 00000000..3e19fb18 --- /dev/null +++ b/hurd/libchannel.mdwn @@ -0,0 +1,68 @@ +[[!meta copyright="Copyright © 2008, 2010 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]]."]]"""]] + +# libchannel + +*libchannel* was accepted as a project for [[Google_Summer_of_Code|community/gsoc]] (or +just GSoC) in 2007. It was written by Carl Fredrik Hammar who was mentored by +Richard Braun. + + +## Outline + +*libchannel* was intended to be used to cleanly and efficiently +implement *channel* translators that would correspond to character +device files. In other words, translators for input devices, sound, +network and the like. + +There are many cases where one wishes to stack translators over one +another. Take networking as an example, you may wish to have a pseudo +network device that balance traffic over two real devices. + +The problem with stacking translators this way is that it's +inefficient, for every RPC to the balancer a RPC is made to each of +the real devices. Now a RPC isn't really *that* expensive, but in a +more complex example with more layers the overhead of these RPC's makes +such a stacking infeasible. + +However, by using *libchannel* a translator can provide a description +of what it does (i.e. the code and data it uses), which a translator +layered untop can fetch and use directly. Now only strictly required +RPC's needs to be sent. + + +## Result + +By the end of GSoC 2007, *libchannel* had mostly reached the initial +goals. There some code missing, most notably the code for +transferring channels via RPC, but similar code was already present in +*libstore* and can be trivially adapted for *libchannel*. It also +needed more debugging. + +Despite these minor deficiencies, the project was considered a +success, never the less. + + +## Future directions + +However, while *libchannel* matched the original specifications. It's +believed that it's too inflexible to make use of in many specific +cases and that a more general solution is desired. While the +discussion isn't over yet, it seems *libchannel* will become a support +library to implement specialized channel libraries, e.g. *libaudio* +and *libnetwork* or similar. + +So work on *libchannel* will continue, in one form or another. + + +# Related + + * [*Van Jacobson's network channels*](http://lwn.net/Articles/169961/) + (2006-01-31) by Jonathan Corbet. diff --git a/hurd/libfshelp.mdwn b/hurd/libfshelp.mdwn new file mode 100644 index 00000000..4eda91b6 --- /dev/null +++ b/hurd/libfshelp.mdwn @@ -0,0 +1,29 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +TODO. + + +# Open Issues + +[[!tag open_issue_hurd]] + + * IRC, unknown channel, unknown date + + <flavioc> antrik, i had some problems with CLISP. it goes into an infinite loop when there's no stdin or stdout (fshelp closes them when a translator starts). At first I tried to patch it but CLISP has very intricate dependencies on them, so I just created a wraper program (run-lisp-trans) that opens /dev/null as stdin and stdout and then exec's clisp + <marcus> flavioc, antrik: I would suggest to modify libfshelp to start translators with stdin/stdout mapped to /dev/null. + <marcus> or is there a good reason not to? + <flavioc> marcus, the problem is in clisp :-), it should not expect that stdin/stdout are always open + <marcus> flavioc: I agree, but there is really no point in making it hard. many programs will fail if stdin, stdout or stderr are not occupied. historically, they expect them to be there, so IMO libfshelp should be changed + <marcus> flavioc: it's a simple solution, works everywhere and shouldn't do any harm :) + <flavioc> marcus, I see. should I propose that on the mailing list? :-) + <marcus> flavioc: it might be simpler to just crack the svn server and sneak it in :) + <marcus> if you submit a patch I will look at it and check it in if it is ok + <marcus> and see if Roland is still watching ... :D diff --git a/hurd/libhello_example.mdwn b/hurd/libhello_example.mdwn new file mode 100644 index 00000000..2c5490e2 --- /dev/null +++ b/hurd/libhello_example.mdwn @@ -0,0 +1,167 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +## Howto write a Hurd library + +Build the Hurd sources: +------------------------ + +Refer to this [[hurd/building/example]]. + +Create the library files: +---------------------- + +Create a directory, say, libhello in the Hurd sources directory. + +Create a lhello.h header file: + + /* lhello.h - Example library header file. + Copyright (C) 2006 Free Software Foundation, Inc. + Written by Shakthi Kannan <shaks@shakthimaan.com>. + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + The GNU Hurd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the GNU Hurd; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #ifndef _HURD_HELLO_H + #define _HURD_HELLO_H 1 + + struct hello + { + int x; + }; + + #endif /* _HURD_HELLO_H */ + +Replace filename, year, author name and e-mail address appropriately. + +Create a lhello.c file: + + /* lhello.c - Example library .c file. + Copyright (C) 2006 + Free Software Foundation, Inc. + Written by Shakthi Kannan <shaks@shakthimaan.com>. + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + The GNU Hurd is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the GNU Hurd; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #include "lhello.h" + + void + print_hello (void) + { + struct hello example; + example.x = 2; + printf ("foo and bar are %d words!\n", example.x); + } + +Replace header file year, author name and e-mail address appropriately. + +Create a Makefile + + # + # Copyright (C) 2006 Free Software Foundation, Inc. + # + # This file is part of the GNU Hurd. + # + # The GNU Hurd is free software; you can redistribute it and/or + # modify it under the terms of the GNU General Public License as + # published by the Free Software Foundation; either version 2, or (at + # your option) any later version. + # + # The GNU Hurd is distributed in the hope that it will be useful, but + # WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + dir := libhello + makemode := library + + libname := libhello + SRCS = lhello.c + installhdrs = lhello.h + LCLHDRS = $(installhdrs) + + OBJS = $(SRCS:.c=.o) + + include ../Makeconf + +Update the Makeconf file: + +Add libhello to lib-subdirs target in the top-level Makefile in the Hurd +sources. + + cd build + ../configure + make + +Testing the library +------------------- + +Write a file, say, foo.c: + + /* foo.c */ + + #define _GNU_SOURCE + + int + main (int argc, char *argv[]) + { + print_hello(); + return 0; + } + +Static compilation and linking method: + + gcc -g -o foo foo.c -L/path/to/libhello -lhello -static + +Run the example: + + ./foo + +Compilation and dynamic linking method: + + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libhello + gcc -g -o foo foo.c -L/path/to/libhello -lhello + +where /path/to/libhello = /path/to/hurd/build/libhello + +Run the example: + + ./foo diff --git a/hurd/libihash.mdwn b/hurd/libihash.mdwn new file mode 100644 index 00000000..8da04095 --- /dev/null +++ b/hurd/libihash.mdwn @@ -0,0 +1,54 @@ +[[!meta copyright="Copyright © 2009, 2010 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]] + + * Hurd libihash + + * old + + * new + + * hurd-l4 libhurd-ihash + + * [[viengoos libhurd-ihash|microkernel/viengoos/projects/new_hash_function]] + + IRC, unknown channel, unknown date + + <neal> so, we need a new ihash implementation + <neal> marcusb: When 80% full, the collision rate is very high. + <neal> marcusb: I tested using 512mb / 4096 entries + <neal> marcusb: Changing the load factor to 30% resulted in my program running more than an order of magnitude faster. + <marcusb> yeah, it shouldn't get so full + <marcusb> don't we do an exponential back-off in the array size? + <marcusb> of course it's clear we can do much better + <marcusb> the ihash algo is very simple + <marcusb> I'm not even sure it makes much sense to have a generic library + + +# Alternatives? + + * glibc + + * include/inline-hashtab.h + + * locale/programs/simple-hash.h + + * misc/hsearch_r.c + + * NNS; cf. f46f0abfee5a2b34451708f2462a1c3b1701facd + + * libstdc++: `unordered_map`, `tr1/unordered_map`, `ext/hash_map` + + * <http://cmph.sourceforge.net/> + + * <http://libhashish.sourceforge.net/> + + * <http://www.azillionmonkeys.com/qed/hash.html> diff --git a/hurd/libnetfs.mdwn b/hurd/libnetfs.mdwn new file mode 100644 index 00000000..8625f8bc --- /dev/null +++ b/hurd/libnetfs.mdwn @@ -0,0 +1,298 @@ +[[!meta copyright="Copyright © 2007, 2008, 2010 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]]."]]"""]] + +#libnetfs + +##What This Is + +This document is an attempt at a short overview of the main concepts +used in the process of development of translators using +*libnetfs*. You will **not** find here a detailed description of the +required callbacks (for this take a look at +<http://www.debian.org/ports/hurd/reference-manual/hurd.html>). You +will **not** find a complete example of code either (usually, +*unionfs* is suggested as an example) + +##What libnetfs Is + +*libnetfs* is a Hurd library used in writing translators providing +some virtual directory structures. For example, if you would like to +create a translator which shows a *.tar* archive in a unpacked way, +you will definitely want to use *libnetfs*. However, it is important +to understand one thing: real filesystem servers (like *ext3* and +such) do **not** use *libnetfs*, instead, they rely on *libdiskfs*, +which is, generally speaking, seriously different from *libnetfs*. + +All in all, *libnetfs* is the library you would choose when you want +to write a translator which will show a file (or a directory) in a +modified way (for example, if you'd like to show only *.sh* files or +make an archive look unpacked). As different from *[[libtrivfs]]*, using +*libnetfs*, you can show to your clients not just a single file, but a +whole directory tree. + +##How It Works: Short Description + +With the aid of *libnetfs* a translator (supposedly) publishes a +directory tree. All lookups in this directory tree are directed to the +translator and the latter is free to provide whatever (consistent) +information as the result of the lookup. Of course, all other usual +requests like reading, writing, setting a translator, etc. are +directed to the translator, too. The translator has either to +implement the required functionality in the corresponding callback or +just return an appropriate error code (for example, EOPNOTSUPP), if +the callback is compulsory. + +##The Main Concepts: Nodes + +The most fundamental thing to understand about *libnetfs* is the +notion of a **node**. Nearly always there are two types of nodes in a +*libnetfs*-based translator: + +* Generic **node**, defined in *<hurd/netfs.h>*. This node contains + information read and written by the programmer (like field + *nn_stat*), as well as some internal information (like fields + *references* and *transbox*). Of course, the programmer is free to + use these fields at will, but they should know what they are doing. + +* Custom **netnode**, defined by the programmer and containing only + the information valuable for the programmer, but not for *libnetfs*. + +The generic node is probably the most important primitive introduced +by *libnetfs*. Callbacks receive the nodes they should work with as +parameters; some of them return nodes as the result of their +operation. To some extent of certainty, a *libnetfs* node can be +perceived similarly to a filesystem node -- the building-brick out of +which everything is composed. + +As it can be seen from the definition in *<hurd/netfs.h>*, a reference +to a netnode is stored in each generic node. In a way, a netnode can +be perceived as the custom attachment to the information contained in +a generic node. The link between these is quite strong. At first this +might not look like a very important thing, but let's analyze a simple +example: you would like to show the contents of a directory in a +filtered way. As a filtering criterion you would like to use the +result of the execution of a command specified as a command line +argument to the translator. If a client looks up a 'file' in the +directory tree provided by the translator, the latter should feed the +name of the file to the filtering command and decide whether to hide +this file or not upon receiving the result. + +To avoid trouble, the translator had better use the *absolute* name of +'file'. Obviously, the translator would like to organize all of the +nodes in a hierarchy. To make things work more or less fast, it is a +reasonable decision to construct the absolute path to a node at +creation and store it inside the netnode (which, in turn, is inside +the node). However, such an approach is not a good one when using +*libnetfs*. Generally speaking, a *new* generic node is created at +each lookup, and, together with it, a new netnode is constructed. The +conclusion is that a *libnetfs* node is a rather transient phenomenon, +and when we want to store some information which is relatively +expensive to obtain, we need something more than a generic node + +netnode. At this moment most of the translators (like *unionfs*, +*ftpfs*, etc.) introduce the concept of a **light node**. + +A **light node** is a user-defined node which contains some +information expensive to obtain, which had better not be stored +directly in a netnode. All netnodes, contained in generic nodes which +resulted in lookups of the same file, share references (pointers, +actually) to a single light node. Light nodes are created when the +first attempt to lookup a file is done, and they are destroyed when no +netnodes reference them. It is very important to understand that +*libnetfs* does **not** enforce the programmer to define light +nodes. Everything can be stored within netnodes inside generic +nodes. Light nodes are just a matter of organizing data in an +efficient way. + +Probably, you are already thinking ``Why cannot *netnodes* be shared? +Why do we need yet another notion?''. The answer is that the link +between a netnode and a *libnetfs* node should be one-to-one, because +netnodes usually store information specific of *only one* node, whilst +light nodes contain information common to several nodes. If one chose +to share netnodes, one would not be able to store additional +information per a *libnetfs* node, and this is quite a serious problem +in most practical problems. + +##Why a libnetfs Node Is Not Quit a Filesystem Node + +The most demonstrative argument in this case is the definition of +*struct node* in *<hurd/netfs.h>*. If you try to find in this +definition some reference to other generic node called *parent*, or an +array of references called *children* (which would be quite classical +for a member of a hierarchy), you will fail. There are fields *next* +and *prevp*, but these are for internal use and only include the node +in an internally maintained *list*, not a tree. Surprisingly enough, +*libnetfs* does **not** manage the tree-like structure for you. You +have to do that *on you own*. This is another moment when light nodes +come triumphantly to light. Most *libnetfs*-based translators organize +their light nodes in the tree-like structure reflecting the directory +tree shown to the user. When a lookup is performed, a light node is +either created or reused (if it has already been created in a previous +lookup). The result of the lookup is a *libnetfs* node created basing +on the information contained in the found light node. + +From the point of view of a *libnetfs* programmer, light nodes are the +conceptual filesystem nodes. A translator knows who is the parent of +who *only* from studying the links between light nodes. And a light +node does contain a reference to its parent and an array of references +to children. When a translator is asked to fetch a file, it finds this +file in the tree of light nodes firstly, creates a *libnetfs* node +based on the found light node, and returns the latter as the +result. Therefore, it is not quite right to perceive *libnetfs* nodes +as filesystem nodes. Instead, the focus of attention should stay upon +light nodes. + +##How It Works: A More Verbose Description + +At first let us see how the a *libnetfs*-based translator responds to +lookup requests. At the beginning the *netfs_attempt_lookup* callback +is called. It knows the generic *libnetfs* node corresponding to the +directory under which the lookup shall take place, the name it has to +lookup, and the information about the user requesting the lookup. This +callback is supposed to create a new *libnetfs* node corresponding to +the requested file or return an error. As it has been said before, +usually translators browse their hierarchy of light nodes to know +whether a file exists within a directory or not. Note that +*netfs_attempt_lookup* does not know the flags with which a +*file_name_lookup* call is done, what it has to do is just to provide +a new node or return an error. + +Then *netfs_validate_stat* callback is called and a node and +information about the user is passed inside. This callback is a rather +simple one: it has to assure that the *nn_stat* field of the supplied +node is valid and up to date. Translators which mirror parts of real +filesystem, like *unionfs*, usually treat the node corresponding to the +root of their node hierarchy in a specific way. The reason is that the +root node is not a mirror of a real file -- it is almost always a +directory in translators of this kind. + +The third stage is an invocation of +*netfs_check_open_permissions*. This callback is, probably, one of the +simplest in most cases. It knows some information about the user +requesting the open, about the node that is about to be returned to +the user, and about the flags supplied by the user in the call to +*file_name_lookup*. Besides that, this callback is provided with the +information whether the requested lookup ended in creating a new file +or whether the requested file already +existed. *netfs_check_open_permissions* has to decide if the user has +the right to access the resulting file under the permissions specified +in flags. It has to return either 0 or the corresponding error. + +These are the most basic steps of the lookup. Note that if the file +was requested with O_CREAT flag and *netfs_attempt_lookup* could not +locate this file, *netfs_attempt_create_file* is called. In many ways +a typical implementation of this callback might be similar to the +implementation of *netfs_attempt_lookup*. However, +*netfs_attempt_create_file* will most probably have to do less checks. + +Let's move to listing the contents of a directory. The corresponding +callback, *netfs_get_dirents* is triggered when a user invokes +*dir_readdir* upon a directory provided by the translator. The +parameters of *netfs_get_dirents* are therefore very similar to the +parameters of *dir_readdir*. Actually, translator *fakeroot* only +calls *dir_readdir* in this callback and nothing more. In translators +which need more complex handling (like filtering the contents) the +code of this is more sophisticated. Sometimes the listing of directory +entries happens in several stages: *netfs_get_dirents* may call +something like *node_entries_get*, and the latter may invoke +*dir_entries_get*. The latter function calls *dir_readdir* and +converts the result to an array of *struct dirent* +'s. *node_entries_get* converts the array of *struct dirent* 's to a +linked list and decides whether a specific file shall be included in +the result or not. Finally, *netfs_get_dirents* converts the linked +list provided by *node_entries_get* to the format of the result of +*dir_readdir* and returns the converted data to the user. The +described stages are the stages of listing directory entries in +*unionfs*, for instance. + +Other callbacks are, generally speaking, less sophisticated. For +example, when the client wants to read (write) from a node provided +by *netfs_attempt_lookup*, the callback *netfs_attempt_read* +(*netfs_attempt_write*) is triggered. Both callbacks have sets of +parameters to the corresponding *io_read* and *io_write* functions. + +While browsing the code of very many *libnetfs*-based translators, you +might notice that they define callbacks starting with +*netfs_S_*. Usually a name similar to that of one of the file +management function follows (like netfs_S_*dir_lookup*). These +callbacks are triggered when the corresponding functions are called on +files shown by the translator. Such translators override parts of the +core functionality provided by *libnetfs* to achieve better +performance or to solve specific problems. + +##Synchronization is Crucial + +A *libnetfs* programmer shall always keep in mind that, as different +from *[[libtrivfs]]*-based translators, *libnetfs*-based translators are +always multithreaded. To guard data against damage each node +incorporates a lock. Moreover, each light node usually contains a +lock, too. This happens because *libnetfs* nodes and light nodes are +loosely coupled and are often processed separately. + +##Node Cache + +Most of *libnetfs* translators organize a *node cache*. However, this +structure is not a real cache. The idea is to hold some control over +life and death of *libnetfs* nodes. The cache is usually a +doubly-linked list: each netnode contains a reference to the previous +node in the cache and a reference to the next one. When a new node is +created (for example, as a result of invocation of +*netfs_attempt_lookup*), it is registered in the cache and its number +of references is increased. It means that, by putting the node in the +cache, the translators gets hold of an extra reference to the +node. When in subsequent lookups the same nodes will be requested, the +translator can just reuse an already existing node. + +Of course, the cache is limited in size. When the cache gets +overgrown, the nodes located at the tail of the list are removed from +the cache and the references to them are dropped. This triggers their +destruction (undertaken by *libnetfs*). + +##What Files Are Usually Created + +If you take into a look at the sources *ftpfs* or *unionfs* you will +notice files with names similar to the following: + +* cache.{c,h} -- here the node implementation of the node cache + resides. + +* lib.{c,h}, dir.{c,h}, fs.{c,h} -- these contain the implementation + of some internals. For example, the function *dir_entriesget* + mentioned in the description of the process of listing directory + entries, will most probably reside in one of these files. + +* options.{c,h} -- here the option parsing mechanism is usually + placed. Argp parsers are implemented here. + +* <*translator_name*>.{c,h}, netfs.c -- the implementation of *netfs_\** + callbacks will most probably lie in these files. + +##What Netnodes and Light Nodes Usually Contain + +A **netnode** usually contains a reference to a light node, some flags +describing the state of the associated generic *libnetfs* node, and +the references to the previous and the next elements in the node +cache. + +A **light node** usually contains the name of the file associated with +this light node, the length of this name, some flags describing the +state of this light node. To make a light node fully usable in a +multithreaded program, a lock and a reference counter are almost +always incorporated in it. Since light nodes are organized in a +hierarchical way, they contain a reference to their parent, a +reference to their first child, and references to their siblings +(usually not very descriptively called *next* and *prevp*). + +##The End + +I very much hope this piece of text was at least a little +helpful. Here I tried to explain the things which I understood least +when I started learning *libnetfs* and which confused me most. Feel +free to complete this introduction :-) diff --git a/hurd/libpager.mdwn b/hurd/libpager.mdwn index 1261150c..99f28f2a 100644 --- a/hurd/libpager.mdwn +++ b/hurd/libpager.mdwn @@ -1,19 +1,13 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008, 2010 Free Software Foundation, +Inc."]] -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!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]]."]]"""]] Mach's [[microkernel/mach/external_pager_mechanism]]. @@ -21,3 +15,7 @@ Mach [[microkernel/mach/IPC]]'s [[microkernel/mach/ipc/sequence_numbering]]. [GNU Hurd Reference Manual: 4.2 Pager Library](http://www.gnu.org/software/hurd/doc/hurd_5.html#SEC32). + +# Open Issues + + * [[open_issues/linux_vmsig]] diff --git a/hurd/libports.mdwn b/hurd/libports.mdwn new file mode 100644 index 00000000..28274338 --- /dev/null +++ b/hurd/libports.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +*libports* is a convenience library for easier handling of [[Mach +ports|microkernel/mach/port]]. It is documented in the [[Reference_Manual]]. + +*libports* is not (at least, not for now) a generalization / abstraction of +Mach ports to the functionality the Hurd needs, that is, it is not meant to +provide an interface independently of the underlying [[microkernel]]. + +*libports* does not itself depend on *[[libthreads]]*, but the appropriate +threading hooks are used if present, that is if *[[libthreads]]* is used by +another component. diff --git a/hurd/libstore.mdwn b/hurd/libstore.mdwn new file mode 100644 index 00000000..8eac39fe --- /dev/null +++ b/hurd/libstore.mdwn @@ -0,0 +1,36 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +`libstore` is used to provide a generic interface to access data (read/write) +on backing stores. + +It more than just a thin layer between [[GNU Mach|microkernel/mach/gnumach]] +devices (`hd0` for example) and the device node below `/dev/`... + + +# Available Stores + +[[!map pages="*_store and !*/discussion" +show=title]] + +At <http://www.kataplop.net/pub/info/projets> you can find some effort to make +some crypto store. + +At <http://www.trek.eu.org/devel/hurd/crypt-trans-0.0.3.tgz>, another package +can be found. + + +# Examples + +[[!inline +pages="hurd/libstore/examples/* and !*/discussion" +show=0 +feeds=no]] diff --git a/hurd/libstore/bunzip2_store.mdwn b/hurd/libstore/bunzip2_store.mdwn new file mode 100644 index 00000000..bd5fc914 --- /dev/null +++ b/hurd/libstore/bunzip2_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="bunzip2 store: bunzip2 data on the fly"]] diff --git a/hurd/libstore/concat_store.mdwn b/hurd/libstore/concat_store.mdwn new file mode 100644 index 00000000..1d3a895a --- /dev/null +++ b/hurd/libstore/concat_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="concat store: concatenate"]] diff --git a/hurd/libstore/copy_store.mdwn b/hurd/libstore/copy_store.mdwn new file mode 100644 index 00000000..5df5d220 --- /dev/null +++ b/hurd/libstore/copy_store.mdwn @@ -0,0 +1,25 @@ +[[!meta copyright="Copyright © 2000, 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="copy store: copy-on-write; discard changes on termination"]] + +A *copy* store is meaningful only with respect to a child store. What a *copy* +store does is to read the child store's entire contents into memory at startup +time and then use that buffer as the contents of the store thereafter. (The +code for this is in `libstore/copy.c`.) + +Because of how the interfaces are specified, reading the entire contents of a +[[*zero* store|zero store]] in fact means just `vm_allocate`ing fresh memory. +So, a *copy* store based on a [[*zero* store|zero store]] is just what you'd +get from `vm_allocate`ing some memory and passing it into +`store_buffer_create`. + +See a [[ramdisk example|examples/ramdisk]]. diff --git a/hurd/libstore/device_store.mdwn b/hurd/libstore/device_store.mdwn new file mode 100644 index 00000000..4b97f8cc --- /dev/null +++ b/hurd/libstore/device_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="device store: Mach device access"]] diff --git a/hurd/libstore/examples/ramdisk.mdwn b/hurd/libstore/examples/ramdisk.mdwn new file mode 100644 index 00000000..33d33601 --- /dev/null +++ b/hurd/libstore/examples/ramdisk.mdwn @@ -0,0 +1,32 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + + $ settrans --create --active ramdisk0 /hurd/storeio -T copy zero:32M + $ mkfs.ext2 -F -b 4096 ramdisk0 + [...] + $ settrans --active --orphan ramdisk0 /hurd/ext2fs.static ramdisk0 + $ df -h ramdisk0/ + df: Warning: cannot read table of mounted file systems + Filesystem Size Used Avail Use% Mounted on + - 32M 1.1M 30M 4% /media/data/home/tschwinge/ramdisk0 + +This uses [[settrans]] and [[storeio]] to create a ramdisk of 32 MiB by routing +a thusly sized [[zero store]] through the [[copy store]], connecting +that to the `ramdisk0` node, create a `ext2` filesystem on it, and replace the +translator running on the `ramdisk0` node with a instance of the [[`ext2fs` +translator|translator/ext2fs]] running on the same node ([[translator +stacking|translator/stacking]]). + +It is a [[!taglink open_issue_hurd]] why this does only work with +`ext2fs.static`, but not the dynamically linked `ext2fs` (`settrans: +/hurd/ext2fs: Translator died`). + +A (better) alternative would be using the [[`tmpfs` +translator|translator/tmpfs]], but that one is broken at the moment. diff --git a/hurd/libstore/file_store.mdwn b/hurd/libstore/file_store.mdwn new file mode 100644 index 00000000..5e9f6822 --- /dev/null +++ b/hurd/libstore/file_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="file store: use a file as a kind of block device"]] diff --git a/hurd/libstore/gunzip_store.mdwn b/hurd/libstore/gunzip_store.mdwn new file mode 100644 index 00000000..25fca4bf --- /dev/null +++ b/hurd/libstore/gunzip_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="gunzip store: gunzip data on the fly"]] diff --git a/hurd/libstore/ileave_store.mdwn b/hurd/libstore/ileave_store.mdwn new file mode 100644 index 00000000..29b51b72 --- /dev/null +++ b/hurd/libstore/ileave_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="ileave store: interleave store (striping)"]] diff --git a/hurd/libstore/nbd_store.mdwn b/hurd/libstore/nbd_store.mdwn new file mode 100644 index 00000000..5874b162 --- /dev/null +++ b/hurd/libstore/nbd_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="nbd store: Linux-compatible network block device"]] diff --git a/hurd/libstore/part.mdwn b/hurd/libstore/part.mdwn new file mode 100644 index 00000000..5d727ad8 --- /dev/null +++ b/hurd/libstore/part.mdwn @@ -0,0 +1,26 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +[[!meta title="part store"]] + +`part.c` + +Written by Neal in 2001, 2002. + +Useful if the microkernel / [[DDE]] / [[microkernel/mach/gnumach/ports/Xen]] +doesn't export *partition devices*, but only *raw* devices. + +Neal: + +> The motivation was to be able to evict the partitioning logic from Mach. + +--- + +TODO: How to use, etc. diff --git a/hurd/libstore/query_store.mdwn b/hurd/libstore/query_store.mdwn new file mode 100644 index 00000000..9ebf8e47 --- /dev/null +++ b/hurd/libstore/query_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="query store"]] diff --git a/hurd/libstore/remap_store.mdwn b/hurd/libstore/remap_store.mdwn new file mode 100644 index 00000000..158ffe95 --- /dev/null +++ b/hurd/libstore/remap_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="remap store"]] diff --git a/hurd/libstore/task_store.mdwn b/hurd/libstore/task_store.mdwn new file mode 100644 index 00000000..e4426639 --- /dev/null +++ b/hurd/libstore/task_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="task store: Mach task store backend"]] diff --git a/hurd/libstore/typed_store.mdwn b/hurd/libstore/typed_store.mdwn new file mode 100644 index 00000000..e71ff67f --- /dev/null +++ b/hurd/libstore/typed_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="typed store: chainable stores"]] diff --git a/hurd/libstore/url_store.mdwn b/hurd/libstore/url_store.mdwn new file mode 100644 index 00000000..17a24e97 --- /dev/null +++ b/hurd/libstore/url_store.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="url store: typed store with URL syntax"]] diff --git a/hurd/libstore/zero_store.mdwn b/hurd/libstore/zero_store.mdwn new file mode 100644 index 00000000..4c53ab56 --- /dev/null +++ b/hurd/libstore/zero_store.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2000, 2007, 2008, 2009 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]]."]]"""]] + +[[!meta title="zero store: empty block device"]] + +A *zero* store is what `/dev/zero` is (always reads zeros), the setting on +`/dev/zero` gives no name (i.e. size) and the default size is the maximum +possible. The only meaning of the size of a *zero* is what `st_size` will +report and what offsets it will let you try to read or write from--there is +never any data associated with a *zero* store. (The code for this is in +`libstore/zero.c`.) diff --git a/hurd/libtrivfs.mdwn b/hurd/libtrivfs.mdwn new file mode 100644 index 00000000..b15aeabe --- /dev/null +++ b/hurd/libtrivfs.mdwn @@ -0,0 +1,31 @@ +[[!meta copyright="Copyright © 1994, 1996, 1998, 1999, 2000, 2001, 2002, 2003, +2004, 2005, 2007, 2008, 2009, 2010 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]]."]]"""]] + +Certain [[translator]]s do not need to be very complex, because they represent +a single file rather than an entire directory hierarchy. The *trivfs library*, +which is declared in `<hurd/trivfs.h>`, does most of the work of implementing +this kind of translator. This library requires the [[iohelp|libiohelp]] and +[[ports|libports]] libraries. + +Using `libtrivfs` is not the only way to implement such a single-file +translator, but is a convenient abstraction: the library hides a lot of +low-level stuff and you just have to provide a number of call-back functions +and symbols in order to get a functioning (for file I/O, etc.) node in the file +system. + + +# Further Reading + + * In the *[[The_GNU_Hurd_Reference_Manual|reference_manual]]*: + <http://www.gnu.org/software/hurd/doc/hurd_6.html#SEC48>. + + * In the *[[Hurd_Hacking_Guide]]*: + <http://www.gnu.org/software/hurd/hacking-guide/hhg.html#An-Example-using-trivfs>. diff --git a/hurd/logo.mdwn b/hurd/logo.mdwn new file mode 100644 index 00000000..467e6ba8 --- /dev/null +++ b/hurd/logo.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +[[!meta redir=/logo]] diff --git a/hurd/logo.png b/hurd/logo.png Binary files differdeleted file mode 100644 index a892b47d..00000000 --- a/hurd/logo.png +++ /dev/null diff --git a/hurd/neighborhurd.mdwn b/hurd/neighborhurd.mdwn index 5aee0a10..5a66f992 100644 --- a/hurd/neighborhurd.mdwn +++ b/hurd/neighborhurd.mdwn @@ -1,19 +1,12 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!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]]."]]"""]] It is possible to run multiple instances of the Hurd in parallel, on a single instance of Mach. Other than diff --git a/hurd/network.mdwn b/hurd/network.mdwn deleted file mode 100644 index 5786b01c..00000000 --- a/hurd/network.mdwn +++ /dev/null @@ -1,43 +0,0 @@ -How to setup networking in the Hurd. - -First, make sure that Mach recognizes your hardware. <!-- If it doesn't, you can -to recompile it in most cases. [ADD LINK TO INFO ON THIS] --> - -# The `pfinet` Translator - -To configure the network, the `pfinet` (*Protocol Family Internet*) translator -must be configured. This is done using the `settrans` command to attach a -translator to a given file system node. When programs access the node by, for -example, sending an RPC, the Hurd will transparently start the server to handle -the request. - - # settrans -fgap /servers/socket/2 /hurd/pfinet -i eth0 \ - -a 192.168.0.50 -g 192.168.0.1 -m 255.255.255.0 - -Here, `settrans` is passed several options: - -* `fg`, force any existing translator to go away. -* `ap`, make both active and passive translators. - -The active translator means that the operating system both starts the -translator immediately and passinve means that the settings are saved in the -file system node. The former also means that any error messages are sent to -`stderr`. - -The argument `/server/socket/2` is the node that the translator is to be -attached to. This is followed by the translator program to run and any -arguments to give it. - -`-a`, `-g` and `-m` are, quite obviously, the IP address, the gateway and -netmask. - -Help on settrans can be obtained by passing it the `--help` option. Help on a -specific translator can be gotten by invoking it from the command line with the -same argument, e.g.: - - # /hurd/pfinet --help - -As there can be a lot of output, consider piping this through a pager. - -Finally copy over your `/etc/resolv.conf` from GNU/Linux to allow your DNS to -resolve correctly. diff --git a/hurd/networking.mdwn b/hurd/networking.mdwn new file mode 100644 index 00000000..bdf9def2 --- /dev/null +++ b/hurd/networking.mdwn @@ -0,0 +1,33 @@ +[[!meta copyright="Copyright © 2000, 2008, 2010 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]]."]]"""]] + +For each supported `PF_*` protocol family, there is a file `/servers/socket/N` +where `N` is the numberic value fo the `PF_*` symbol. Right now +[[`PF_LOCAL`|translator/pflocal]] (a.k.a. `PF_UNIX`) and +[[`PF_INET`|translator/pfinet]] (together with +[[`PF_INET6`|translator/pfinet/ipv6]]) are supported. + +User programs open those files, and use the `socket_create` [[RPC]] to make a +new socket. With that socket, they can use the other `socket_*` RPCs and also +the `io_*` RPCs. The `socket_*` RPCs are essentially clones of the [[Unix]] +[[system call]]s in question. + +The only exception is `sockaddrs`, which are implemented as [[ports|libports]] +instead of the opaque data arrays they are in the system calls. You manipulate +`sockaddr` ports with the `socket_create_address`, `socket_fabricate_address`, +and `socket_whatis_address` calls. The `sockaddr` port is then used in socket +calls like `socket_connect` and `socket_accept`. + +`PF_INET` `sockaddr` ports are manipulated with `socket_create_address` from +the usual `struct sockaddr_in`. `PF_LOCAL` `sockaddr` ports are stored by +`S_IFSOCK` filesystem nodes; you find the address associated with a node with +`ifsock_getsockaddr`. The [[file_system_server|translator]] will get a +`sockaddr` to return with `socket_fabricate_address`. diff --git a/hurd/ng.mdwn b/hurd/ng.mdwn index 25677414..de33949d 100644 --- a/hurd/ng.mdwn +++ b/hurd/ng.mdwn @@ -1,34 +1,24 @@ -There is an effort to create a completely new system design (for now called -ngHurd, or Hurd-ng or HurdNG), which originated from the Hurd/L4 port. +Hurd-ng is an effort to build a new operating system that preserves +the main design goals of the Hurd while fixing some of the Hurd's +shortcomings. There is not yet an official roadmap or a concrete +specification; indeed, much of the work is research oriented. -The original Hurd/L4, which was meant to be mostly a direct port of the -existing Hurd design to a new microkernel, has been abandoned by it's main -developers, because some technical issues with the L4 Pistachio kernel turned -out to be very fundamental. While reeveluating the design (and upcoming new L4 -variants), the developers picked up some new ideas, and decided that now they -rather want to work on a completely different design, which combines some of -the original Hurd ideas with concepts from Jonathan Shapiro's high security -EROS and Coyotos systems. - -There has been numerous endless discussions on the -[[l4-hurd_mailing_list|mailinglists]] about these new ideas. This page tries to -sum up the major discussions. +These pages try to summarize the major discussions and ideas. # Why ngHurd This section explains the motivations behind the new design: -* [[IssuesWithMach]] -* [[IssuesWithL4Pistachio]] -* [[LimitationsOfOriginalHurdDesign]] + * [[Issues_with_L4_Pistachio]] + * [[Limitations_of_the_original_Hurd_design]] + + * History of the [[history/port_to_L4]] # Work already done -A [position -paper](http://walfield.org/papers/20070104-walfield-access-decomposition-policy-refinement.pdf) -by Marcus Brinkmann and Neal H. Walfield can be found. +A [[position_paper]] by Marcus Brinkmann and Neal H. Walfield can be found. A draft specification of the Hurd-NG interfaces has been, but is no longer, available. @@ -47,6 +37,7 @@ A [[critique]] of the original Hurd is available. ## Concepts +* [[security]] * [[CapabilityBasedMicrokernel]] * [[FirstClassReceiveBuffer]] * [[PowerBox]] @@ -72,7 +63,6 @@ A [[critique]] of the original Hurd is available. ## Implementation -* [[ChoiceOfMicrokernel]] * [[HurdInterafaces]] * [[PosixLayer]] * [[SystemStructure]] diff --git a/hurd/ng/cancellationforwarding.mdwn b/hurd/ng/cancellationforwarding.mdwn index 1b7776f2..6b2977c7 100644 --- a/hurd/ng/cancellationforwarding.mdwn +++ b/hurd/ng/cancellationforwarding.mdwn @@ -2,18 +2,18 @@ ## <a name="Rationale"> Rationale </a> -When a request to one or more servers is needed from a server to process a request from it's client, and the client cancels it's request, there will be at least temporary resource leakage in the chain of servers. +When a request to a chain of one or more servers is needed from a server to process a request from its client, and the client cancels its request, there will be at least temporary resource leakage in the chain of servers. -If the last server in the chain completes processing and gives a response to it's client, there will be unnecessary CPU and memory usage from all the servers. And if one of the servers never completes, there will be permanent memory leakage. +If the last server in the chain completes processing and gives a response to its client, there will be unnecessary CPU and memory usage from all the servers. And if one of the servers never completes, there will be permanent memory leakage. -Timeouts are a way to avoid the permament memory leakage, at the cost of rendering the whole communication impossible above some system load. They also only bring the duration of the memory leakage from infinite to some time. +Timeouts are a way to avoid the permament memory leakage, at the cost of rendering the whole communication impossible above some system load, hence opening a denial of service possibility. They also only bring the duration of the memory leakage from an infinite to an arbitrary finite time that may have no relation with the operations of the servers. -Cancellation forwarding is a mechanism that can be used to propagate, without additional overt communication, the information that initial request has been cancelled. +Cancellation forwarding is a mechanism that can be used to propagate, without additional overt communication, the information that initial request has been cancelled. It also bring the duration of the memory leakage to a finite time, but each server in the chain is able to use the protocol at key points of its operations (like before a costly operation), and because the protocol will not produce false positive results, it can be used at an arbitrary high frequency. The only tradeoff is between leakage time and checking overhead. ## <a name="Protocol"> Protocol </a> -* Each client that want to forward cancellation to it's server increment the protected payload of the FCRB for which a sender's capability has been given to the server, thus invalidating the capability. -* Each server that wants to notice cancellation forwarding will set up a watchdog, and ask the kernel to send heartbeats. At each heartbeat, the watchdog check that the reply capability to the FCRB of the client is not invalid, with a Discrim capability. +* Each client that want to forward cancellation to its server increment the protected payload of the FCRB for which a sender's capability has been given to the server, thus invalidating the capability. +* Each server that wants to notice cancellation forwarding will either set up a watchdog, and ask the kernel to send heartbeats, or decide for deterministic check points in its operations. At each heartbeat or check point, the server checks that the reply capability to the FCRB of the client is not invalid, with a Discrim capability. ## <a name="Example"> Example </a> @@ -33,16 +33,16 @@ Notation: ( T successfully treat the request, now goes completion ) * T invokes c2 -* S reads the answer, and increment the PP of the FCRB->S +* S reads the answer, and increments the PP of the FCRB->S * S invokes c1 -* C reads the answer, and increment the PP of the FCRB->C +* C reads the answer, and increments the PP of the FCRB->C ### <a name="Uncomplete_operation_"> Uncomplete operation: </a> * C invokes a cap to S, giving S a cap c1 to a FCRB->C -* S sets up a watchdog that check that discrim.classify(c1) != clVoid +* S sets up a watchdog that checks that discrim.classify(c1) != clVoid * S invokes a cap to T, giving T a cap c2 to a FCRB->S -* T sets up a watchdog that check that discrim.classify(c2) != clVoid +* T sets up a watchdog that checks that discrim.classify(c2) != clVoid ( for any reason, C decides to stop, now goes cancellation ) @@ -53,4 +53,4 @@ Notation: ---- --- [[Main/NowhereMan]] - 28 Apr 2006 +-- [[Main/NowhereMan]] — originally designed in April 2006 diff --git a/hurd/ng/choiceofmicrokernel.mdwn b/hurd/ng/choiceofmicrokernel.mdwn deleted file mode 100644 index 20ee6f05..00000000 --- a/hurd/ng/choiceofmicrokernel.mdwn +++ /dev/null @@ -1,4 +0,0 @@ -TBD - -* [[MicrokernelL4]] -* [[MicrokernelCoyotos]] diff --git a/hurd/ng/copyvsrevocablecopyvsmap.mdwn b/hurd/ng/copyvsrevocablecopyvsmap.mdwn index 9c99c0a1..0cda7e24 100644 --- a/hurd/ng/copyvsrevocablecopyvsmap.mdwn +++ b/hurd/ng/copyvsrevocablecopyvsmap.mdwn @@ -3,4 +3,4 @@ TBD, see: * <http://lists.gnu.org/archive/html/l4-hurd/2005-10/msg00274.html> * <http://lists.gnu.org/archive/html/l4-hurd/2005-10/msg00023.html> --- [[Main/TomBachmann]] - 20 Jun 2006 +-- [[TomBachmann]] - 20 Jun 2006 diff --git a/hurd/ng/designgoals.mdwn b/hurd/ng/designgoals.mdwn index 5dbd7018..d04007c2 100644 --- a/hurd/ng/designgoals.mdwn +++ b/hurd/ng/designgoals.mdwn @@ -2,7 +2,9 @@ ## <a name="The_Position_Paper"> The Position Paper </a> -_Improving Usability via Access Decomposition and Policy Refinement_ tries to capture technical objectives. As has been stated by Neal in [2], these are a number of scenarios we are interested in addressing: +The [[position_paper]] tries to capture technical objectives. As has been +stated by Neal in [2], these are a number of scenarios we are interested in +addressing: * security: programs are not users; they should be constrained according to the user's intents * resource management @@ -30,7 +32,7 @@ Extensibility has often been a strong argument to support the multiserver approa However, I do believe there are benefits in multiserver environments you cannot get in a monolithic one, namely enhanced security and stability through protection boundaries. Also, whilst wanting to become adopted as general purpose OS, ngHurd still strives to allow for research also, so even according to the above-referenced paper extensibility is to be one of its goals. -Therefore, I'd want to propose to weaken the impact of extensibility on the design, by lowering it to the category "Regular Goals". -- [[Main/TomBachmann]] - 13 Dec 2006 +Therefore, I'd want to propose to weaken the impact of extensibility on the design, by lowering it to the category "Regular Goals". -- [[TomBachmann]] - 13 Dec 2006 ## <a name="Regular_Goals"> Regular Goals </a> @@ -49,5 +51,3 @@ Therefore, I'd want to propose to weaken the impact of extensibility on the desi * [1] <http://lists.gnu.org/archive/html/l4-hurd/2005-11/msg00037.html> * [2] <http://lists.gnu.org/archive/html/l4-hurd/2007-01/msg00122.html> - --- [[Main/TomBachmann]] - 29 Apr 2006 diff --git a/hurd/ng/discussion.mdwn b/hurd/ng/discussion.mdwn new file mode 100644 index 00000000..d4632bd5 --- /dev/null +++ b/hurd/ng/discussion.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +To go beyond research project Hurd have to support thousands of various programs running on GNU/Linux nowadays. +It looks like ExoKernel approach http://pdos.csail.mit.edu/exo.html might be useful here. +Does somebody tried to look into something like Hurd exokernel + liblinux? diff --git a/hurd/ng/firstclassreceivebuffer.mdwn b/hurd/ng/firstclassreceivebuffer.mdwn index c3cc3142..30087bf2 100644 --- a/hurd/ng/firstclassreceivebuffer.mdwn +++ b/hurd/ng/firstclassreceivebuffer.mdwn @@ -1,3 +1,3 @@ TBD, see e.g. <http://coyotos.org/docs/ukernel/spec.html> and <http://www.coyotos.org/pipermail/coyotos-dev/2006-January/000391.html> --- [[Main/TomBachmann]] - 31 Aug 2006 +-- [[TomBachmann]] - 31 Aug 2006 diff --git a/hurd/ng/howmuchconfinementdowewant.mdwn b/hurd/ng/howmuchconfinementdowewant.mdwn index 663e5bbb..1963ae73 100644 --- a/hurd/ng/howmuchconfinementdowewant.mdwn +++ b/hurd/ng/howmuchconfinementdowewant.mdwn @@ -90,4 +90,4 @@ Marcus started a challenge [5] to find a use case for non-trivial confinement th * [4] <http://lists.gnu.org/archive/html/l4-hurd/2006-05/msg00012.html> * [5] <http://lists.gnu.org/archive/html/l4-hurd/2006-04/msg00407.html> --- [[Main/TomBachmann]] - 01 May 2006 +-- [[TomBachmann]] - 01 May 2006 diff --git a/hurd/ng/hurdishapplicationsforpersistence.mdwn b/hurd/ng/hurdishapplicationsforpersistence.mdwn index 12861ecb..d785694b 100644 --- a/hurd/ng/hurdishapplicationsforpersistence.mdwn +++ b/hurd/ng/hurdishapplicationsforpersistence.mdwn @@ -2,4 +2,4 @@ TBD, see: * <http://lists.gnu.org/archive/html/l4-hurd/2005-10/msg00081.html>; summary: passive translators started by the filesystem cannot be done right and persistence makes passive translators unnecessary --- [[Main/TomBachmann]] - 20 Jun 2006 +-- [[TomBachmann]] - 20 Jun 2006 diff --git a/hurd/ng/limitations_of_the_original_hurd_design.mdwn b/hurd/ng/limitations_of_the_original_hurd_design.mdwn new file mode 100644 index 00000000..96d8912b --- /dev/null +++ b/hurd/ng/limitations_of_the_original_hurd_design.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + + * [[Critique]] diff --git a/hurd/ng/microkernelcoyotos.mdwn b/hurd/ng/microkernelcoyotos.mdwn deleted file mode 100644 index 40fd6e9d..00000000 --- a/hurd/ng/microkernelcoyotos.mdwn +++ /dev/null @@ -1,9 +0,0 @@ -# <a name="The_Coyotos_microkernel"> The Coyotos microkernel </a> - -[Coyotos](http://www.coyotos.org/index.html) is a microkernel and OS and the successor of EROS, that itself is the successor of KeyKOS. A more complete history can be found [here](http://www.coyotos.org/history.html). It's main objectives are to correcte some shortcomings of EROS, demonstrate that an atomic kernel design scales well and to completely formally verify both the kernel and critical system components by writing them in a new language called bitc. - -Coyotos is an orthogonally persistent pure capability system. It uses continuation based unbuffered asynchronous IPC (actually it's synchronous IPC whith asynchronous syscalls). - -TODO: explain these terms and (more important) their consequences on system design. - -The coyotos microkernel specification can be found [here](http://www.coyotos.org/docs/ukernel/spec.html) diff --git a/hurd/ng/part2systemstructure.mdwn b/hurd/ng/part2systemstructure.mdwn index 4ce8026f..0f94ff2a 100644 --- a/hurd/ng/part2systemstructure.mdwn +++ b/hurd/ng/part2systemstructure.mdwn @@ -38,7 +38,12 @@ It is clear from this description that the child's existance is completely deter ## <a name="Canonical_Process_Destruction"> Canonical Process Destruction </a> -Process destruction can be done either cooperatively, or forcibly. The difference corresponds approximately to the difference between SIGTERM and SIGKILL in Unix. To destroy a process cooperatively, a request message is sent to a special capability implemented by the child process. The child can then begin to tear down the program, and at some time send a request back to the parent process to ask for forced process destruction. +Process destruction can be done either cooperatively, or forcibly. The +difference corresponds approximately to the difference between SIGTERM and +SIGKILL in [[Unix]]. To destroy a process cooperatively, a request message is +sent to a special capability implemented by the child process. The child can +then begin to tear down the program, and at some time send a request back to +the parent process to ask for forced process destruction. Forced process destruction can be done by the parent process without any cooperation by the child process. The parent process simply destroys the primary container of the child (this means that the parent process should retain the primary container capability). @@ -84,7 +89,13 @@ I will now describe some common applications that need to be supported, and how ## <a name="System_Services"> System Services </a> -Unix-style suid applications have been proposed as one application for alternative process construction mechanisms. However, suid applications in Unix are, from the perspective of the parent, not confined, only isolated. Thus, they are readily replaced by a system service that is created by the system software, and that runs as a sibling to any user process. Only the ability to invoke the system service needs to be given to the user, not the ability to instantiate it. +[[Unix]]-style suid applications have been proposed as one application for +alternative process construction mechanisms. However, suid applications in +Unix are, from the perspective of the parent, not confined, only isolated. +Thus, they are readily replaced by a system service that is created by the +system software, and that runs as a sibling to any user process. Only the +ability to invoke the system service needs to be given to the user, not the +ability to instantiate it. In fact, no gain can derived from letting the user instantiate system services. In Unix, system services run on durable resources, which the user can not revoke. Thus, the system service needs to acquire its resources from a container that is not derived from the user's primary container. diff --git a/hurd/ng/pathmax.mdwn b/hurd/ng/pathmax.mdwn index 1c792937..1ea337e9 100644 --- a/hurd/ng/pathmax.mdwn +++ b/hurd/ng/pathmax.mdwn @@ -1,3 +1,3 @@ TBD, see <http://lists.gnu.org/archive/html/l4-hurd/2005-11/msg00038.html> and [Vulnerabilities in Synchronous IPC Designs](http://citeseer.ist.psu.edu/shapiro03vulnerabilities.html) --- [[Main/TomBachmann]] - 20 Jun 2006 +-- [[TomBachmann]] - 20 Jun 2006 diff --git a/hurd/ng/permissionbits.mdwn b/hurd/ng/permissionbits.mdwn index 1e1493df..eac00057 100644 --- a/hurd/ng/permissionbits.mdwn +++ b/hurd/ng/permissionbits.mdwn @@ -1,3 +1,3 @@ TBD, see: <http://lists.gnu.org/archive/html/l4-hurd/2006-04/msg00231.html> --- [[Main/TomBachmann]] - 20 Jun 2006 +-- [[TomBachmann]] - 20 Jun 2006 diff --git a/hurd/ng/position_paper.mdwn b/hurd/ng/position_paper.mdwn new file mode 100644 index 00000000..abc781da --- /dev/null +++ b/hurd/ng/position_paper.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Neal Walfield and Marcus Brinkmann wrote a paper titled [*Improving Usability +via Access Decomposition and Policy +Refinement*](http://walfield.org/papers/20070104-walfield-access-decomposition-policy-refinement.pdf) +where they give an overview about how a future, subsequent system may be +architected. This is sometimes referred to as *the position paper*. diff --git a/hurd/ng/setuidvsconstructor.mdwn b/hurd/ng/setuidvsconstructor.mdwn index 44c5f7fa..87cce8df 100644 --- a/hurd/ng/setuidvsconstructor.mdwn +++ b/hurd/ng/setuidvsconstructor.mdwn @@ -3,4 +3,4 @@ TBD, see e.g.: * <http://lists.gnu.org/archive/html/l4-hurd/2005-10/msg00167.html> * <http://lists.gnu.org/archive/html/l4-hurd/2005-10/msg00203.html> --- [[Main/TomBachmann]] - 20 Jun 2006 +-- [[TomBachmann]] - 20 Jun 2006 diff --git a/hurd/ng/sharedlibraries.mdwn b/hurd/ng/sharedlibraries.mdwn index 01b85df8..d4969420 100644 --- a/hurd/ng/sharedlibraries.mdwn +++ b/hurd/ng/sharedlibraries.mdwn @@ -1,3 +1,3 @@ TBD, see <http://lists.gnu.org/archive/html/l4-hurd/2005-12/msg00034.html> --- [[Main/TomBachmann]] - 20 Jun 2006 +-- [[TomBachmann]] - 20 Jun 2006 diff --git a/hurd/ng/systemstructure.mdwn b/hurd/ng/systemstructure.mdwn index 8a9bdbe8..ef069edd 100644 --- a/hurd/ng/systemstructure.mdwn +++ b/hurd/ng/systemstructure.mdwn @@ -1,3 +1,3 @@ -TBD, see: <http://lists.gnu.org/archive/html/l4-hurd/2006-05/msg00324.html> (thread). Also, note that this is derived from [[Philosophy]]. See the interface spec and the position paper as well. - --- [[Main/TomBachmann]] - 31 Aug 2006 +TBD, see: <http://lists.gnu.org/archive/html/l4-hurd/2006-05/msg00324.html> +(thread). Also, note that this is derived from [[Philosophy]]. See the +interface spec and the [[position_paper]] as well. diff --git a/hurd/ng/thepolycastinterface.mdwn b/hurd/ng/thepolycastinterface.mdwn index 5d1fb8dc..702364cf 100644 --- a/hurd/ng/thepolycastinterface.mdwn +++ b/hurd/ng/thepolycastinterface.mdwn @@ -49,4 +49,4 @@ see also: * <http://lists.gnu.org/archive/html/l4-hurd/2006-02/msg00002.html> * <http://lists.gnu.org/archive/html/l4-hurd/2006-02/msg00003.html> --- [[Main/TomBachmann]] - 30 Apr 2006 +-- [[TomBachmann]] - 30 Apr 2006 diff --git a/hurd/ng/trivialconfinementvsconstructorvsfork.mdwn b/hurd/ng/trivialconfinementvsconstructorvsfork.mdwn index 4d221a8e..949895e7 100644 --- a/hurd/ng/trivialconfinementvsconstructorvsfork.mdwn +++ b/hurd/ng/trivialconfinementvsconstructorvsfork.mdwn @@ -6,10 +6,11 @@ This comparison is about a simple situation: there is a parent process P, which # <a name="Trivial_Confinement"> Trivial Confinement </a> -For trivial confinement, there is a system call to create a process from some memory pages. P performs the following steps: +For trivial confinement, there is a [[system call]] to create a process from +some memory pages. P performs the following steps: * Allocate some memory and put the code image of the child into that memory. This can be done by P, or for example by the file system which then gives the resulting memory (space bank) to P. -* Perform the system call on that memory. The result is a capability to C. +* Perform the [[system call]] on that memory. The result is a capability to C. * Send A to C using the returned capability. Note that it is up to the implementation of the system what happens with P's access to the memory which holds the child. For example, it is probably a good idea if it is at least unmapped, so it cannot accidentily write things in it. It could even be revoked, so that it can't write things in it, even if it wants to. @@ -32,7 +33,16 @@ This mechanism is targeted at a specific use pattern, namely that a process is c # <a name="POSIX_Fork"> </a> POSIX Fork -POSIX fork, or rather fork+exec, is how things are done on many current systems. It may be insightful to see it included in the comparison, especially for people who are new to the subject. There are two system calls, fork and exec. Fork will create a clone of the current process, including all the capabilities (that is, file descriptors) of the parent (except the ones which have explicitly been excluded). Exec is a system call which really goes to the filesystem, not the kernel (although on systems which use it, the filesystem usually resides in the kernel), and asks it to spawn a new process from the contents of a certain path in place of the caller. This passes all capabilities to the new process. The procedure is: +POSIX fork, or rather fork+exec, is how things are done on many current +systems. It may be insightful to see it included in the comparison, especially +for people who are new to the subject. There are two [[system call]]s, fork +and exec. Fork will create a clone of the current process, including all the +capabilities (that is, [[unix/file_descriptor]]s) of the parent (except the +ones which have explicitly been excluded). Exec is a [[system call]] which +really goes to the filesystem, not the kernel (although on systems which use +it, the filesystem usually resides in the kernel), and asks it to spawn a new +process from the contents of a certain path in place of the caller. This +passes all capabilities to the new process. The procedure is: * P calls fork(), creating P'. * P' drops B. @@ -52,7 +62,11 @@ In contrast, the other two options don't pass anything by default. If there is a The problem of fork+exec can be solved. It is if the default would be to not pass capabilities to the new process, but specify a list of capabilities that it should keep, or (like in the other cases) pass them over a new channel which is implicitly created during the fork. However, in that case the only difference with trivial confinement is that P' dies in the process (and thus must be created to prevent P from dying). Almost any use of exec is in practice preceded by a fork for this purpose. It would be easier to make trivial confinement the default operation and let P die directly after it in the rare case that it should. -The only reason for continuing to use fork+exec would be that it is what existing programs do. However, they break anyway if they need to specify which file descriptors to pass. So they need to be adapted. Therefore, it's better to make the usual spawning method the primitive one, and emulate the other. +The only reason for continuing to use fork+exec would be that it is what +existing programs do. However, they break anyway if they need to specify which +[[unix/file_descriptor]]s to pass. So they need to be adapted. Therefore, it's +better to make the usual spawning method the primitive one, and emulate the +other. # <a name="Trivial_Confinement_vs_Construct"> Trivial Confinement vs Constructor </a> @@ -67,7 +81,7 @@ Except for the control, there is really only one other difference, and that's ad What it doesn't do is protect the code image against bugs in P. In the constructor the trusted and well-tested constructor code is handling the image, for trivial confinement the (very possibly) buggy program P. In particular, when starting a program from a file system, with trivial confinement the operation is: * Ask the file system for the code, receive a capability to a space bank with a copy (on write) of it. -* Make the system call to turn it into a program. +* Make the [[system call]] to turn it into a program. Now this isn't much more complicated than the constructor which does: @@ -75,4 +89,4 @@ Now this isn't much more complicated than the constructor which does: Therefore I am not so convinced that we want a constructor. It gets in the way of debugging, for example, and it doesn't really give any gain. --- [[Main/BasWijnen]] - 13 Jun 2006 +-- [[BasWijnen]] - 13 Jun 2006 diff --git a/hurd/ng/usecaseprivatekeys.mdwn b/hurd/ng/usecaseprivatekeys.mdwn index 612a8f25..3cb65af2 100644 --- a/hurd/ng/usecaseprivatekeys.mdwn +++ b/hurd/ng/usecaseprivatekeys.mdwn @@ -1,6 +1,10 @@ _Private Keys_ as used by SSH servers, clients and generally by any cryptographic software need to be stored and manipulated securely. These may get replaced with smartcards soon, but in the mean time it appears to be an interesting use case. -All Unix systems that I am aware of do not allow secrets to be protected in a manner that I would feel is appropiate. A users compromised web browser could either read your private key file or talk to the very popular ssh-agent program and get your secrets out (not sure how popular distributions are configured, but it can be done). +All [[Unix]] systems that I am aware of do not allow secrets to be protected in +a manner that I would feel is appropiate. A users compromised web browser +could either read your private key file or talk to the very popular ssh-agent +program and get your secrets out (not sure how popular distributions are +configured, but it can be done). The requirements so far are: diff --git a/hurd/ng/usecaseuserfilesystem.mdwn b/hurd/ng/usecaseuserfilesystem.mdwn index 6dce5670..4e4fdf35 100644 --- a/hurd/ng/usecaseuserfilesystem.mdwn +++ b/hurd/ng/usecaseuserfilesystem.mdwn @@ -3,7 +3,7 @@ These appear as _translators_ in the current Hurd and something similar needs to appear in the next hurd. * The user should be able to dynamically add and remove translators -* For some reason it seems appropiate to have seperate namespaces (VFS's) for each user (this is quite a departure from Unix. [[SamMason]]) +* For some reason it seems appropiate to have seperate namespaces (VFS's) for each user (this is quite a departure from [[Unix]]. [[SamMason]]) * translators can be used to expose the structure of an archive file * translators can be provide access to remote file systems diff --git a/hurd/ng/whatisacapability.mdwn b/hurd/ng/whatisacapability.mdwn index a4ed5ed8..f3a42dd8 100644 --- a/hurd/ng/whatisacapability.mdwn +++ b/hurd/ng/whatisacapability.mdwn @@ -1,3 +1,3 @@ TBD, see e.g.: <http://www.eros-os.org/essays/capintro.html> --- [[Main/TomBachmann]] - 20 Jun 2006 +-- [[TomBachmann]] - 20 Jun 2006 diff --git a/hurd/ng/whatisaconstructor.mdwn b/hurd/ng/whatisaconstructor.mdwn index 3f05a37a..583babe9 100644 --- a/hurd/ng/whatisaconstructor.mdwn +++ b/hurd/ng/whatisaconstructor.mdwn @@ -3,4 +3,4 @@ TBD, see: * <http://lists.gnu.org/archive/html/l4-hurd/2005-10/msg00157.html> * <http://lists.gnu.org/archive/html/l4-hurd/2006-05/msg00056.html> --- [[Main/TomBachmann]] - 16 May 2006 +-- [[TomBachmann]] - 16 May 2006 diff --git a/hurd/ng/whatisaspacebank.mdwn b/hurd/ng/whatisaspacebank.mdwn index d7961210..607501db 100644 --- a/hurd/ng/whatisaspacebank.mdwn +++ b/hurd/ng/whatisaspacebank.mdwn @@ -1,3 +1,3 @@ TBD, see e.g. <http://eros-os.org/design-notes/SpaceBank.html> or <http://eros-os.org/papers/shap-thesis.ps> --- [[Main/TomBachmann]] - 31 Aug 2006 +-- [[TomBachmann]] - 31 Aug 2006 diff --git a/hurd/ng/whatsinagroup.mdwn b/hurd/ng/whatsinagroup.mdwn index 122f2012..219f4ed0 100644 --- a/hurd/ng/whatsinagroup.mdwn +++ b/hurd/ng/whatsinagroup.mdwn @@ -1,3 +1,3 @@ TBD, see <http://lists.gnu.org/archive/html/l4-hurd/2006-03/msg00001.html> --- [[Main/TomBachmann]] - 20 Jun 2006 +-- [[TomBachmann]] - 20 Jun 2006 diff --git a/hurd/porting.mdwn b/hurd/porting.mdwn new file mode 100644 index 00000000..c94572a4 --- /dev/null +++ b/hurd/porting.mdwn @@ -0,0 +1,14 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + + * [[Guidelines]] + * [[System_API_Limitations]] + + * Debian: [[running/debian/Porting]] diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn new file mode 100644 index 00000000..8dd27a52 --- /dev/null +++ b/hurd/porting/guidelines.mdwn @@ -0,0 +1,271 @@ +[[!meta copyright="Copyright © 2002, 2003, 2005, 2007, 2008, 2009 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 is a compilation of common porting problems and their solutions. + + +Additionally to this page, also see the section *General Porting Issues* of +<http://www.debian.org/ports/hurd/hurd-devel-debian><!-- TODO: merge these two +pages. -->, as well as further Debian-specific [[running/debian/porting]] +information. + +There is a separate page about [[System_API_Limitations]]. + +You may ask on the [[mailing lists/bug-hurd]] mailing list for details or +questions about fixing bugs. + + +## <a name="Undefined_bits_confname_h_tt_mac"> Undefined `bits/confname.h` macros (`PIPE_BUF`, ...) </a> + +If macro `XXX` is undefined, but macro `_SC_XXX` or `_PC_XXX` is defined in `bits/confname.h`, you probably need to use `sysconf`, `pathconf` or `fpathconf` to obtain it dynamicaly. + +The following macros have been found in this offending situation (add more if you find them): `PIPE_BUF` + +An example with `sysconf`: (when you find a `sysconf` offending macro, put a better example) + + #ifndef XXX + #define XXX sysconf(_SC_XXX) + #endif + /* offending code using XXX follows */ + +An example with `fpathconf`: + + #ifdef PIPE_BUF + read(fd, buff, PIPE_BUF - 1); + #else + read(fd, buff, fpathconf(fd, _PC_PIPE_BUF) - 1); + #endif + /* note we can't #define PIPE_BUF, because it depends + on the "fd" variable */ + +## <a name="Bad_File_Descriptor"> Bad File Descriptor </a> + +If you get Bad File Descriptor error when trying to read from a file (or accessing it at all), check the `open()` invocation. The second argument is the access method. If it is a hard coded number instead of a symbol defined in the standard header files, the code is screwed and should be fixed to either use `O_RDONLY`, `O_WRONLY` or `O_RDWR`. This bug was observed in the `fortunes` and `mtools` packages for example. + +## <a name="PATH_MAX_tt_MAX_PATH_tt_MAXPATHL"> `PATH_MAX` / `MAX_PATH` / `MAXPATHLEN` </a> + +Every unconditionalized use of `PATH_MAX`, `MAX_PATH` or `MAXPATHLEN` is a POSIX incompatibility. If there is no upper limit on the length of a path (as its the case for GNU), this symbol is not defined in any header file. Instead, you need to either use a different implementation that does not rely on the length of a string or use `sysconf()` to query the length at runtime. If `sysconf()` returns -1, you have to use `realloc()` to allocate the needed memory dynamically. Usually it is thus simpler to just use dynamic allocation. Sometimes the amount is actually known. Else, a geometrically growing loop can be used: for instance, see [Alioth patch](http://alioth.debian.org/tracker/download.php/30628/410472/303735/1575/cpulimit-path-max-fix.patch) or [Pulseaudio patch](http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=patch-pulse;att=1;bug=522100). Note that in some cases there are GNU extensions that just work fine: when the `__GLIBC__` macro is defined, `getcwd()` calls can be just replaced by `get_current_dir_name()` calls. + +## <a name="ARG_MAX"> `ARG_MAX` </a> + +Same rationale as `PATH_MAX`. There is no limit on the number of arguments. + +## <a name="IOV_MAX"> `IOV_MAX` </a> + +Same rationale as `PATH_MAX`. There is no limit on the number of iovec items. + +## <a name="MAXHOSTNAMELEN_tt_"> `MAXHOSTNAMELEN` </a> + +Same as `PATH_MAX`. When you find a `gethostname()` function, which acts on a static buffer, you can replace it with Neal's [xgethostname function](http://ftp.walfield.org/pub/people/neal/xgethostname/) which returns the hostname as a dynamic buffer. For example: + +Buggy code: + + char localhost[MAXHOSTNAMELEN]; + ... + gethostname(localhost, sizeof(localhost)); + +Fixed code: + + #include "xgethostname.h" + ... + char *localhost; + ... + localhost = xgethostname(); + if (! localhost) + { + perror ("xgethostname"); + return ERROR; + } + ... + /* use LOCALHOST. */ + free (localhost); + +## <a name="NOFILE_tt_"> `NOFILE` </a> + +Replace with `getrlimit(RLIMIT_NOFILE,...)` + +## <a name="GNU_specific_define_tt_"> </a> GNU specific `#define` + +If you need to include specific code for GNU/Hurd using `#if` ... `#endif`, then you can use the `__GNU__` symbol to do so. But think (at least) thrice! before doing so. In most situations, this is completely unnecessary and will create more problems than it may solve. Better ask on the mailing list how to do it right if you can't think of a better solution. + +## <a name="sys_errlist_tt_vs_strerror_tt_"> `sys_errlist[]` vs. `strerror()` </a> + +If a program has only support for `sys_errlist[]` you will have to do some work to make it compile on GNU, which has dropped support for it and does only provide `strerror()`. Steinar Hamre writes about `strerror()`: + +`strerror()` should be used because: + +* It is the modern, POSIX way. +* It is localized. +* It handles invalid signals/numbers out of range. (better errorhandling and not a buffer-overflow-candidate/security risk) + +`strerror()` should always be used if it is available. Unfortunaly there are still some old non-POSIX systems that do not have `strerror()`, only `sys_errlist[]`. + +Today, only supporting `strerror()` is far better than only supporting `sys_errlist[]`. The best (from a portability viewpoint), however is supporting both. For configure.in, you will need: + + AC_CHECK_FUNCS(strerror) + +To `config.h.in`, you need to add: + + #undef HAVE_STRERROR + +Then something like: + + #ifndef HAVE_STRERROR + static char * + private_strerror (errnum) + int errnum; + { + extern char *sys_errlist[]; + extern int sys_nerr; + + if (errnum > 0 && errnum <= sys_nerr) + return sys_errlist[errnum]; + + return "Unknown system error"; + } + #define strerror private_strerror + #endif /* HAVE_STRERROR */ + +You can for example look in the latest coreutils (the above is a simplified version of what I found there.) Patches should of course be sent to upstream maintainers, this is very useful even for systems with a working `sys_errlist[]`. + +Of course, if you don't care about broken systems (like MS-DOG) not supporting `strerror()` you can just replace `sys_errlist[]` directly (upstream might not accept your patch, but debian should have no problem) + +## <a name="C++_error_t"> C++, `error_t` and `E*` </a> + +On the Hurd, `error_t` is an enumeration of the `E*` constants. However, C++ +does not like `E*` integer macros being directly assigned to that enumeration. In short, replace + + error_t err = EINTR; + +by + + error_t err = error_t(EINTR); + +## <a name="Missing_termio_h_tt_"> Missing `termio.h` </a> + +Change it to use `termios.h` (check for it properly with autoconf `HAVE_TERMIOS_H` or the `__GLIBC__` macro) + +Also, change calls to `ioctl(fd, TCGETS, ...)` and `ioctl(fd, TCSETS, ...)` with `tcgetattr(fd, ...)` and `tcsetattr(fd, ...)`. + +## <a name="AC_HEADER_TERMIO_tt_"> `AC_HEADER_TERMIO` </a> + +The autoconf check for `AC_HEADER_TERMIO` tryes to check for termios, but it's only really checking for termio in `termios.h`. It is better to use `AC_CHECK_HEADERS(termio.h termios.h)` + +## <a name="_IOT"> missing `_IOT` </a> + +This comes from ioctls. Fixing this is easy if the structure members can be expressed by using the _IOT() macro, else it's simply impossible... See `bits/termios.h` for an instance: + +`#define _IOT_termios /* Hurd ioctl type field. */ \ + _IOT (_IOTS (tcflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)` + +The rationale behind is that on the Hurd ioctl numbers actually encode how the +data should be transferred via RPC: here `struct termios` holds 4 members of +type `tcflag_ts`, then `NCCS` members of type `cc_tsi` and finaly 2 members of +type `speed_ts`, so the RPC mecanism will know how to transfer them. + +As you can see, this limits the number of contiguous kinds of members to 3, and +in addition to that (see the bitfield described in `ioctls.h`), the third kind +of member is limited to 3 members. This is a design limitation, there is no way +to overcome it at the moment. + +Note: if a field member is a pointer, then the ioctl can't be expressed +this way, and that makes sense, since the server you're talking to +doesn't have direct access to your memory. Ways other than ioctls must +then be found. + +## <a name="SA_SIGINFO"> `SA_SIGINFO` </a> + +Not implemented, packages may be fixed for working around this: use void sighandler(int num) prototype and sa_handler field. + +## <a name="SOL_IP"> `SOL_IP` </a> + +Not implemented yet. + +## <a name="HZ"> `HZ` </a> + +Linuxish and doesn't even make sense since the value may vary according to the running kernel. Should use `sysconf(_SC_CLK_TCK)` or `CLK_TCK` instead. + +## <a name="SIOCDEVPRIVATE"> `SIOCDEVPRIVATE` </a> + +Oh, we should probably provide it. + +## <a name="MAP_NORESERVE"> `MAP_NORESERVE` </a> + +Not POSIX, but we could implement it. + +## <a name="O_DIRECT"> `O_DIRECT` </a> + +Long story to implement. + +## <a name="PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP"> `PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP` </a> + +We could easily provide it; + +## <a name="PTHREAD_STACK_MIN"> `PTHREAD_STACK_MIN` </a> + +We should actually provide it. + +## <a name="types"> `linux/types.h` or `asm/types.h` </a> + +These are not POSIX, `sys/types.h` and `stdint.h` should be used instead. + +## <a name="iopl"> `iopl` </a> + +Not supported. Try to replace with `ioperm(0, 65536, 1)` (conditionned with `__GNU__` as that will not work in Linux). + +## <a name="iopl"> `semget`, `sem_open` </a> + +Not implemented, will always fail. Use `sem_init()` instead if possible. + +## <a name="net/..."> `net/if_arp.h`, `net/ethernet.h`, etc. </a> + +Not implemented, not POSIX. Try to disable the feature in the package. + +## <a name="parport"> <linux/parport.h> <linux/ppdev.h> </a> + +There is no programming interface for the parallel port on GNU/Hurd yet. + +## <a name="errno"> `errno` values </a> + +When dealing with `errno`, you should always use the predefined error codes defined with the `E*` constants, instead of manually comparing/assigning/etc with their values. + +For example (C/C++): + + /* check whether it does not exist */ + if (errno == 2) + ... + +or Python: + + # check whether it does not exist + try: + ... + except OSError, err: + err.errno == 2: + ... + +This is wrong, as [the actual values of the `E*` are unspecified (per POSIX)](http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html#tag_02_03). You must always use the predefined constants for the possible errors. + +For example (C/C++): + + /* check whether it does not exist */ + if (errno == ENOENT) + ... + +With Python, you can use the [`errno` module](http://docs.python.org/library/errno.html) for the various constants: + + # check whether it does not exist + try: + ... + except OSError, err: + import errno + err.errno == errno.ENOENT: + ... diff --git a/hurd/porting/system_api_limitations.mdwn b/hurd/porting/system_api_limitations.mdwn new file mode 100644 index 00000000..2fac456e --- /dev/null +++ b/hurd/porting/system_api_limitations.mdwn @@ -0,0 +1,31 @@ +[[!meta copyright="Copyright © 2003, 2004, 2005, 2009, 2010 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]]."]]"""]] + +Sometimes building or running a program will fail due to bugs in the system API +implementation (in [[glibc]] and the [[Hurd]]). Make sure you check this list +and know them before porting, otherwise you'll end up debugging something just +to find out its an already known bug. + +Taken from the bug lists in [[running/Debian]] BTS. If you find more of them +(and it is clear in the bug log that it is a bug), please add them to the list +below. + +These are the known system API limits that have porting implications. + +**_[\#47998](http://bugs.debian.org/47998): `msgget` IPC not implemented_** + +**_[\#184565](http://bugs.debian.org/184565): libc0.3: missing shm\* functions (from `<sys/shm.h>`)_**<br />**breaks:** cdrtools<br />**error:** warning: shm\* is not implemented and will always fail + +**_[[nice() doesn't work|open_issues/nice_vs_mach_thread_priorities]]_**. + +**_[\#187391](http://bugs.debian.org/187391): libc0.3-dev: `sockaddr_un.sun_path` can't be assigned a `const char *` when compiling with g++_**<br />**breaks:** fam, gail<br />**status:** maybe this should be in [[PortingIssues]] (see _long_ bug log) + +**_[\#190367](http://bugs.debian.org/190367): libc0.3-dev: `fcntl` `F_GETLK` not implemented (`ENOSYS`)_**<br />**breaks:** gnome-session (and others) from running<br />**error:** misc lock-related errors diff --git a/hurd/reference_manual.mdwn b/hurd/reference_manual.mdwn new file mode 100644 index 00000000..9337b784 --- /dev/null +++ b/hurd/reference_manual.mdwn @@ -0,0 +1,18 @@ +[[!meta copyright="Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +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]]."]]"""]] + +*The GNU Hurd Reference Manual* documents the architecture, the usage and the +programming of the GNU Hurd. At the moment, the manual is quite incomplete. + + * [HTML version](http://www.gnu.org/software/hurd/doc/hurd_toc.html) for + browsing online, + * [PostScript version](http://www.gnu.org/software/hurd/doc/hurd.ps) + [1020KiB, 91 pages]. diff --git a/hurd/running.mdwn b/hurd/running.mdwn index f8a516bd..f0058625 100644 --- a/hurd/running.mdwn +++ b/hurd/running.mdwn @@ -1,24 +1,23 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008, 2009 Free Software Foundation, +Inc."]] -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.txt]]. +[[!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]]."]]"""]] -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +There are several different ways to run a GNU/Hurd system: * [[Distrib]] - Distributions based on the Hurd -* [[microkernel/mach/gnumach/Xen]] - In Xen -* [[LiveCD]] - Live CDs +* [[microkernel/mach/gnumach/ports/Xen]] - In Xen +* [[Live_CD]] * [[QEMU]] - In QEMU +* [[vmware]] (**non-free!**) * [[FlashHurd]] - From a flash stick +* [[FAQ]] + * [[Public_hurd_boxen]] diff --git a/hurd/running/arch_hurd.mdwn b/hurd/running/arch_hurd.mdwn new file mode 100644 index 00000000..9786d144 --- /dev/null +++ b/hurd/running/arch_hurd.mdwn @@ -0,0 +1,21 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +[[!meta title="Arch Hurd"]] + +Arch Hurd is a port of Arch Linux to the GNU Hurd, founded on 2010-01-04 by Michael Walker (Barrucadu) and, with input from a variety of people including Alan McRae (allan), Matthias Lanzinger (melpo), and Alexander Preisinger (giselher), the project has made excellent process. There is a livecd available on the Arch Hurd website, with which you can try or install Arch Hurd. + +### Links + +* Official Website: <http://www.archhurd.org> +* Installation Guide: <http://wiki.archhurd.org/wiki/Installation_Guide> +* Mailing Lists: <http://lists.archhurd.org> +* Forum: <http://bbs.archhurd.org> +* IRC: #archhurd on irc.freenode.net diff --git a/hurd/running/debian.mdwn b/hurd/running/debian.mdwn index 56b4fae2..97d35bd7 100644 --- a/hurd/running/debian.mdwn +++ b/hurd/running/debian.mdwn @@ -1,13 +1,28 @@ -[[img logo.png]] +[[!meta title="Debian GNU/Hurd"]] -- Debian [[FAQ]] -- Frequently Asked Questions -- [[After_install]] -- Do this to get networking, new console and X -- [Presentation](http://people.debian.org/~mbanck/talks/hurd_lt2004/html/) - *Debian GNU/Hurd* by [[MichaelBanck]], LinuxTag 2004 Karlsruhe -- [[Status]] +### Debian Resources - Official page about the Debian GNU/Hurd port: [Debian GNU/Hurd](http://www.debian.org/ports/hurd/) + +- Debian [[FAQ]] -- Frequently Asked Questions + +### 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 + +- [[Porting]] -- Helping with porting packages + * [[Patch_submission]] -- How to submit patches for build failures +- [[Creating_image_tarball]] + +### Additional Information + +- [Presentation](http://people.debian.org/~mbanck/talks/hurd_lt2004/html/) + *Debian GNU/Hurd* by [[MichaelBanck]], LinuxTag 2004 Karlsruhe +- [[Status]] - [Archive Qualification](http://wiki.debian.org/ArchiveQualification/hurd-i386) + diff --git a/hurd/running/debian/BtsFiling.mdwn b/hurd/running/debian/BtsFiling.mdwn deleted file mode 100644 index 90f451a8..00000000 --- a/hurd/running/debian/BtsFiling.mdwn +++ /dev/null @@ -1,52 +0,0 @@ -When you encounter any GNU/Hurd related bugs in a Debian package you can fix, please use the Debian BTS (Bug Tracking System) to report them. - -Managing Debian packages and using the BTS is quite simple. If you're new to Debian, here's a short guide: - -* first of all, check [http://bugs.debian.org/<package>](http://bugs.debian.org) to ensure the problem is not in the BTS already. This is possible for packages and bug numbers. [[TWiki/InterWikis]] is a shorthand way of linking to bugs and packages from this site. i.e. [[DebianBug]]:hurd [[DebianPackage]]:oskit -* you can fetch package sources with: - - apt-get source <package> - -note: this should unpack already - -* and unpack with: - - dpkg-source -x <package>x-y_z.dsc - -* then get all dependencies: - - apt-get -y build-dep <package> - -note: if some dependencies are missing, it most probably means you have to port them first. follow this instructions recursively until done - - :) - -* Debian packages have a makefile in debian/rules, with (at least) the following targets: <dl> - <dt> build</dt> - <dd> Yup, to build </dd> - <dt> binary</dt> - <dd> Generates deb files in <code>../</code></dd> - <dt> clean</dt> - <dd> Full clean </dd> -</dl> - -* when you have a patch, send it to the BTS using the reportbug utility (or manually as explained in <http://bugs.debian.org/)>. The following parameters should be used: - - Severity: important (when the package is unbuildable or uninstallable, lower otherwise.) - Tags: sid, patch - -* be nice to the maintainers. most are friendly and cooperative, and a few could annoy you for months before applying. Be patient. - -Read <http://bugs.debian.org/> for extensive documentation on the BTS. - --- [[Main/RobertMillan]] - 10 Jun 2002 - ----- - -Wikification & small changes. - --- [[Main/JoachimNilsson]] - 24 Jun 2002 - -Updates with the new [[TWiki/InterWikis]] rules. - --- [[Main/GrantBow]] - 15 Jan 2003 diff --git a/hurd/running/debian/CrossInstall.mdwn b/hurd/running/debian/CrossInstall.mdwn index 9a07424e..1cde150c 100644 --- a/hurd/running/debian/CrossInstall.mdwn +++ b/hurd/running/debian/CrossInstall.mdwn @@ -34,7 +34,7 @@ Now the program starts retrieving all the necessary base packages. ### <a name="Preparing_to_reboot"> Preparing to reboot </a> -When all packages have been extracted we must prepare [[GrubNotes]] for the Hurd when we reboot. Add the below entry to your `/boot/grub/menu.lst` file to boot the Hurd in single user mode (-s). Single user mode is needed only for the two reboots when running the Native Install. +When all packages have been extracted we must prepare [[GRUB]] for the Hurd when we reboot. Add the below entry to your `/boot/grub/menu.lst` file to boot the Hurd in single user mode (-s). Single user mode is needed only for the two reboots when running the Native Install. title GNU (kernel GNUmach 1.3) root (hd0,2) diff --git a/hurd/running/debian/DebianAptOffline.mdwn b/hurd/running/debian/DebianAptOffline.mdwn index 52313bf2..9596040d 100644 --- a/hurd/running/debian/DebianAptOffline.mdwn +++ b/hurd/running/debian/DebianAptOffline.mdwn @@ -1,18 +1,12 @@ -[[license text=""" -Copyright © 2005, 2007 Free Software Foundation, Inc. -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!meta copyright="Copyright © 2005, 2007, 2008 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]]."]]"""]] # How to Installing Packages without a Network Connection from your Hurd Installation diff --git a/hurd/running/debian/GnuDebianRelationship.mdwn b/hurd/running/debian/GnuDebianRelationship.mdwn index ede808c8..94fd6265 100644 --- a/hurd/running/debian/GnuDebianRelationship.mdwn +++ b/hurd/running/debian/GnuDebianRelationship.mdwn @@ -2,11 +2,11 @@ I have hesitated in starting this page due to the sensitive nature of this relat This is a work in progress. Please email me directly if you have comments or suggestions. -* Debian Advantages of Hurd [[Distrib/PortingIssues]] Efforts +* Debian Advantages of Hurd [[porting/guidelines]] Efforts * One of the first ports to non-Linux system along with \*BSD and win32. * Official GNU system distribution. -* Debian Disadvantages of Hurd [[Distrib/PortingIssues]] Efforts +* Debian Disadvantages of Hurd [porting/guidelines]] Efforts * Perceived zealous GNU and FSF promotion. * Hurd Port Advantages of Debian diff --git a/hurd/running/debian/MediaPressKitDiscuss.mdwn b/hurd/running/debian/MediaPressKitDiscuss.mdwn index e8b1cfff..2bd97290 100644 --- a/hurd/running/debian/MediaPressKitDiscuss.mdwn +++ b/hurd/running/debian/MediaPressKitDiscuss.mdwn @@ -1,5 +1,3 @@ -%TOC% - # <a name="Media_Press_Kit"> Media / Press Kit </a> ## <a name="Problem"> Problem </a> diff --git a/hurd/running/debian/after_install.mdwn b/hurd/running/debian/after_install.mdwn index 5c998c94..15ca9c83 100644 --- a/hurd/running/debian/after_install.mdwn +++ b/hurd/running/debian/after_install.mdwn @@ -5,7 +5,7 @@ mode? Time to get to work. -[[toc ]] +[[!toc]] ### Get Networking Running @@ -29,12 +29,13 @@ If the NIC was detected: # settrans -fgap /servers/socket/2 /hurd/pfinet -i eth0 -a 192.168.1.3 -g 192.168.1.1 -m 255.255.255.0 +In order to use DHCP, you need to install the `dhcp-client` package and run `dhclient eth0` etc. # Setup GRUB You surely want grub to have a nice menu entry able to boot GNU, instead of typing a boring arcane. There are Debian-specific scripts that may help -you. See the [[GrubNotes]] for this. +you. See [[GRUB]]'s page for this. # Setup `apt-get` @@ -44,47 +45,22 @@ put in `/etc/apt/sources.list` are (as of Jan 2007): deb http://mirrors.kernel.org/debian unstable main contrib deb-src http://mirrors.kernel.org/debian unstable main contrib - deb http://ftp.gnuab.org/debian unreleased main - deb-src http://ftp.gnuab.org/debian unreleased main + deb http://ftp.debian-ports.org/debian unreleased main + deb-src http://ftp.debian-ports.org/debian unreleased main `apt-get` update a couple of times if some file fails to download. -<!-- As long as I am around (which is as off February 2005) I never ever had to -do such following frobbing. Should we remove this? --[[tschwinge]] --> - -If when doing your first `apt-get`, `dpkg` complains of missing programs, [try -to cheat it this -way](http://lists.debian.org/debian-hurd/1999/05/msg00187.html): - - # ln -s /sbin/ldconfig /bin/ldconfig - # ln -s /bin/true /bin/update-rc.d - # ln -s /bin/true /bin/start-stop-daemon - # ln -s /bin/true /bin/install-info - # ln -s /bin/true /bin/update-alternatives +If when doing your first `apt-get`, `dpkg` complains of missing programs, get root in a login shell (`su -`). Installing packages without having a network connection is described [[Distrib/DebianAptOffline]]. - # [[translator/Random]] -You often need `scp` and `ssh`. Sadly the Debian GNU/Hurd does not yet come -with any default random translator package installed. See -[[translator/random]] for details, the following is just a quick recap. - - cd && mkdir tmp && cd tmp - wget http://kilobug.free.fr/hurd/random-64.tar.gz - tar xvfz random-64.tar.gz - cp random /hurd/ - - settrans -c /dev/random /hurd/random \ - --seed-file /var/run/random-seed --secure - settrans -c /dev/urandom /hurd/random \ - --seed-file /var/run/urandom-seed --fast - chmod 0644 /dev/random /dev/urandom - - apt-get install ssh +You often need `scp` and `ssh`. There is now a `random-egd` package available which uses +a random translator by Ryan Hunter and the entropy gathering daemon as entropy source. +See [[Translator/random]] for more information. # [[Console]] @@ -109,7 +85,7 @@ You first must have setup the virtual console. See above. Assuming you've installed WindowMaker and have tried running `startx` already: - [/etc/X11/XF86Config-4] + [/etc/xorg.conf] Section "Module" # Load "dri" @@ -130,9 +106,6 @@ Assuming you've installed WindowMaker and have tried running `startx` already: Make sure not to have the `Emulate3Buttons` and `ZAxisMapping` settings set, as they lead to problems with e.g. dragging windows around. - [/etc/profile] - LD_LIBRARY_PATH=/X11R6/lib:$LD_LIBRARY_PATH - # What about package XYZ? See if you can find a useful tip in [[package_troubleshooting]]. diff --git a/hurd/running/debian/creating_image_tarball.mdwn b/hurd/running/debian/creating_image_tarball.mdwn new file mode 100644 index 00000000..ac91dab4 --- /dev/null +++ b/hurd/running/debian/creating_image_tarball.mdwn @@ -0,0 +1,21 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + +The following [[anonftpsync-ports]] is used to create a local Debian GNU/Hurd +repo. You will need atleast 12G of disk space. Change the +"TO=/home/foo/rsync-debian-ports" to your desired target directory. + +Run it using: + + sudo sh anonftpsync-ports + +In /home/foo/rsync-debian-ports, you will find the following directories: + + base dists indices pool pool-hurd-i386 project diff --git a/hurd/running/debian/creating_image_tarball/anonftpsync-ports b/hurd/running/debian/creating_image_tarball/anonftpsync-ports new file mode 100644 index 00000000..0988dbde --- /dev/null +++ b/hurd/running/debian/creating_image_tarball/anonftpsync-ports @@ -0,0 +1,180 @@ +#! /bin/sh +set -e + +# This script originates from http://www.debian.org/mirror/anonftpsync +# modified by Martin Zobel-Helas <zobel@debian.org>, 2005-01-16 +# these modifications are published under the terms of the GNU GPL +# Modifications: +# + some more documentation about variables +# + added ARCH_EXCLUDE +# + mirror in a safe way, first /pool, then /dists and the rest +# modified by Aurelien Jarno <aurel32@debian.org>, 2007-12-02 +# these modifications are published under the terms of the GNU GPL +# + modifications to mirror debia,-ports.org +# Version: $Id: anonftpsync,v 1.18 2005/10/28 15:25:54 aba Exp $ + + +# Note: You MUST have rsync 2.0.16-1 or newer, which is available in slink +# and all newer Debian releases, or at http://rsync.samba.org/ + +# Set the variables below to fit your site. You can then use cron to have +# this script run daily to automatically update your copy of the archive. + +# Don't forget: +# chmod 744 anonftpsync + +# TO is the destination for the base of the Debian mirror directory +# (the dir that holds dists/ and ls-lR). +# (mandatory) + +TO=/home/foo/rsync-debian-ports + +# RSYNC_HOST is the site you have chosen from the mirrors file. +# (http://www.debian-ports.org/mirrors) +# (mandatory) + +RSYNC_HOST=rsync.debian-ports.org + +# RSYNC_DIR is the directory given in the "Packages over rsync:" line of +# the mirrors file for the site you have chosen to mirror. +# (mandatory) + +RSYNC_DIR=debian/ + +# LOGDIR is the directory where the logs will be written to +# (mandatory) + +LOGDIR=/var/log/rsync-debian-ports + +# ARCH_EXCLUDE can be used to exclude a complete architecture from +# mirrorring. Please use as space seperated list. +# Possible values are: +# armel hurd-i386 kfreebsd-amd64 kfreebsd-i386 +# +# There is one special value: source +# This is not an architecture but will exclude all source code in /pool +# +# eg. +# ARCH_EXCLUDE="hurd-i386" +# +# With a blank ARCH_EXCLUDE you will mirror all availible architectures +# (optional) + +ARCH_EXCLUDE="armel kfreebsd-amd64 kfreebsd-i386 m68k" + +# EXCLUDE is a list of parameters listing patterns that rsync will exclude. +# The following example would exclude mostly everything: +#EXCLUDE="\ +# --exclude binary-hurd-i386/ --exclude binary-kfreebsd-i386/ +# --exclude *_hurd-i386.deb --exclude *_knetbsd-i386.deb \ +# --exclude stable/ --exclude testing/ --exclude unstable/ \ +# --exclude source/ \ +# --exclude *.orig.tar.gz --exclude *.diff.gz --exclude *.dsc \ +# --exclude /base/ --exclude /bochs/ --exclude /obsolete/ \ +# " + +# With a blank EXCLUDE you will mirror the entire archive. +# (optional) + +EXCLUDE="--exclude binary-kfreebsd-i386/ --exclude *_knetbsd-i386.deb \ + --exclude source/ --exclude *.orig.tar.gz --exclude *.diff.gz \ + --exclude /bochs/ --exclude /obsolete/ \ + --exclude *kfreebsd* --exclude *m68* --exclude *sh* \ + " + +# MAILTO is the address to send logfiles to; +# if it is not defined, no mail will be sent +# (optional) + +MAILTO= + +# There should be no need to edit anything below this point, unless there +# are problems. + +#-----------------------------------------------------------------------------# + +# Check for some environment variables +if [ -z $TO ] || [ -z $RSYNC_HOST ] || [ -z $RSYNC_DIR ] || [ -z $LOGDIR ]; then + echo "One of the following variables seems to be empty:" + echo "TO, RSYNC_HOST, RSYNC_DIR or LOGDIR" + exit 2 +fi + +if ! [ -d ${TO}/project/trace/ ]; then + # we are running mirror script for the first time + mkdir -p ${TO}/project/trace +fi + +# Note: on some non-Debian systems, hostname doesn't accept -f option. +# If that's the case on your system, make sure hostname prints the full +# hostname, and remove the -f option. If there's no hostname command, +# explicitly replace `hostname -f` with the hostname. +HOSTNAME=`hostname -f` + +LOCK="${TO}/Archive-Update-in-Progress-${HOSTNAME}" + +# Exclude architectures defined in $ARCH_EXCLUDE +for ARCH in $ARCH_EXCLUDE; do + EXCLUDE=$EXCLUDE"\ + --exclude binary-$ARCH/ \ + --exclude disks-$ARCH/ \ + --exclude installer-$ARCH/ \ + --exclude Contents-$ARCH \ + --exclude Contents-$ARCH.gz \ + --exclude *_$ARCH.deb \ + --exclude *_$ARCH.udeb \ + --exclude pool-$ARCH/" + if [ "$ARCH" == "source" ]; then + SOURCE_EXCLUDE="\ + --exclude *.tar.gz \ + --exclude *.diff.gz \ + --exclude *.dsc " + fi +done + +# Logfile +LOGFILE=$LOGDIR/debian-mirror-ports.log + +# Get in the right directory and set the umask to be group writable +# +cd $HOME +umask 002 + +# Check to see if another sync is in progress +if lockfile -! -l 10800 -r 0 "$LOCK"; then + echo ${HOSTNAME} is unable to start rsync, lock file exists + exit 1 +fi +# Note: on some non-Debian systems, trap doesn't accept "exit" as signal +# specification. If that's the case on your system, try using "0". +trap "rm -f $LOCK > /dev/null 2>&1" exit + +set +e + +# First sync /pool-* +rsync --recursive --links --hard-links --times --verbose \ + $EXCLUDE $SOURCE_EXCLUDE \ + $RSYNC_HOST::$RSYNC_DIR/pool-* $TO >> $LOGFILE 2>&1 +result=$? + +if [ 0 = $result ]; then + # Now sync the remaining stuff + rsync --recursive --links --hard-links --times --verbose --delete-after \ + --exclude "Archive-Update-in-Progress-${HOSTNAME}" \ + --exclude "project/trace/" \ + --exclude "/pool-*/" \ + $EXCLUDE \ + $RSYNC_HOST::$RSYNC_DIR $TO >> $LOGFILE 2>&1 + + date -u > "${TO}/project/trace/${HOSTNAME}" +else + echo "ERROR: Help, something weird happened" | tee -a $LOGFILE + echo "mirroring /pool-* exited with exitcode" $result | tee -a $LOGFILE +fi + + +if ! [ -z $MAILTO ]; then + mail -s "debian ports archive synced" $MAILTO < $LOGFILE +fi + +savelog $LOGFILE diff --git a/hurd/running/debian/faq.mdwn b/hurd/running/debian/faq.mdwn index 1892d63f..8aaadf9c 100644 --- a/hurd/running/debian/faq.mdwn +++ b/hurd/running/debian/faq.mdwn @@ -1,137 +1,21 @@ -Debian GNU/Hurd FAQ. - -See also the [[Hurd_FAQ|hurd/FAQ]] and [[after_install]]. - -[[toc ]] - - -# `df` - -There is no `/etc/mtab`, so just running `df` will yield an error. Pass `df` a -path like `df /` or `df ./` to see the disk usage of that particular file -system. - - -# `sshd` - -You need to disable `PriviledgeSeperation` in `/etc/ssh/sshd\_options`. Also -make sure you have `/dev/random`, see below. - - -# `/dev/random` - -There is no random device by default as no secure implementation has been -finished yet. An easy (but very insecure) work-around is to copy a binary file -like `/bin/bash` to `/dev/random` and `/dev/urandom`. - - -# Hurd Console - -Edit `/etc/default/hurd-console` to configure the Hurd console and enable it on -bootup. See [[console]] for further information about the Hurd console. - - -# Swap - - -# 2 GiB Partition Limit - -The 2 GiB limit has been removed in Debian GNU/Hurd. - - -# Free Memory - -Run `vmstat` to see memory and swap usage. - - -# Translators - - -# 512 MiB RAM Limit - -GNU Mach does not cope well with lots of memory. Newer versions of the Debian -`gnumach` package will limit themselves to around 1 GiB of memory. If you have -an older version, or still experience problems with `vmstat` (see above) -reported much less memory than you have, the best is to limit the memory it can -see via GRUB's `upppermem` feature. Add `uppermem 786432` to GRUB's Hurd entry -in `menu.lst`. - -This should be fixed. - - -# `xserver-common` - -You need to run `dpkg-reconfigure xserver-common` and select `Anybody` for -starting X as there is no way to detect console users currently. - - -# Reporting Bugs - -Please try to reproduce bugs which are not obviously Hurd-specific on Debian -GNU/Linux and then file them there. - -If you find a genuine issue in Debian GNU/Hurd, please file it in our Alioth -bug tracker at -[http://alioth.debian.org/tracker/?atid=411594&group\_id=30628&func=browse](http://alioth.debian.org/tracker/?atid=411594&group_id=30628&func=browse) -If you find a bug in the Hurd or GNU Mach themselves, either file a bug against -the respective Debian packages, or directly at -<http://savannah.gnu.org/bugs/?group=hurd> - - -# `ps` Hangs - -If `ps` hangs, try `ps -M` which might still work. - - -# Porting Packages - - -# Debugging inside glibc - -To get [[debugging]] information for glibc, you need to install the -`libc0.3-dbg` package. At the place [[debugging/GDB]] looks for debugging -symbols by default (`/usr/lib/debug/lib/`), Debian's `libc0.3-dbg` stores only -frame unwind information. If you want to step into glibc while debugging, you -need to add `LD\_LIBRARY\_PATH=/usr/lib/debug` to GDB's environment. If that -still does not work, try `LD\_PRELOAD=/usr/lib/debug/libc.so.0.3` instead. You -can add to GDB's environment via `set env FOO bar` from the GDB command line. - -It seems that this is no longer needed with the Debian glibc 2.5 packages, but -I may as well be wrong. Have to check that again. - - -# Debugging Translators - -In order to [[debug|debugging]] translators and being able to step into glibc -during it, you need the `hurd-dbg` and `libc0.3-dbg` packages installed. Then -start the translator like `settrans -P /foo /usr/bin/env -LD\_LIBRARY\_PATH=/usr/lib/debug /hurd/foofs`. The `-P` option will make it -pause and you will be able to attach [[debugging/GDB]] to the process. - -Is starting the translator like this really needed? - - -# Other Repositories - -If you want to use the `apt-get source` facility, make sure that -`/etc/apt/sources.list` contains a line like - - deb-src http://ftp.de.debian.org/debian unstable main - -... replacing _de_ with your homeland's code. - - -# Kernel Logs - -The kernel logs are written to `/dev/klog`. Run `cat /dev/klog > foo` as root -and hit `ctrl+c` after a few seconds to catch the logs. You can do this only -once and do not do this in single-user mode (where `ctrl+c` does not work). - - -# `bad hypermeta data` - -If you get the error `bad hypermeta data` when trying to mount an ext3 -partition from GNU/Linux, that is usually because the file system has not been -unmounted cleanly (maybe GNU/Linux got suspended to disk) and the Hurd cannot -mount it as ext2 without checking. Either boot back into GNU/Linux and unmount -it or you can try to run `fsck.ext3` from GNU/Hurd directly. +[[!meta copyright="Copyright © 2007, 2009, 2010 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]]."]]"""]] + +[[!meta title="Debian GNU/Hurd FAQ"]] + +See also [[after_install]] instructions, and other [[/FAQ]]. + +[[!inline +pages="hurd/running/debian/faq/* and !*/discussion" +show=0 +feeds=no +actions=yes +rootpage="hurd/running/debian/faq" postformtext="Add a new item titled:"]] diff --git a/hurd/running/debian/faq/2_gib_partition_limit.mdwn b/hurd/running/debian/faq/2_gib_partition_limit.mdwn new file mode 100644 index 00000000..195191cb --- /dev/null +++ b/hurd/running/debian/faq/2_gib_partition_limit.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +[[!meta title="2 GiB Partition Limit"]] + +The 2 GiB limit has been removed in Debian GNU/Hurd. diff --git a/hurd/running/debian/faq/512_mib_ram_limit.mdwn b/hurd/running/debian/faq/512_mib_ram_limit.mdwn new file mode 100644 index 00000000..f89a5c01 --- /dev/null +++ b/hurd/running/debian/faq/512_mib_ram_limit.mdwn @@ -0,0 +1,21 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +[[!meta title="512 MiB RAM Limit"]] + +Just like any 32bit OS without bad tricks, GNU Mach does not cope well with lots +of memory. Newer versions of the Debian `gnumach` package will limit themselves +to around 1 GiB of memory. If you want more, you can twiddle the VM_MAX_ADDRESS +limit between kernelland and userland in i386/include/mach/i386/vm_param.h. + +If you have an older version, or still experience problems with `vmstat` (see +above) reported much less memory than you have, the best is to limit the memory +it can see via GRUB's `upppermem` feature. Add `uppermem 786432` to GRUB's Hurd +entry in `menu.lst`. diff --git a/hurd/running/debian/faq/apt_umount.mdwn b/hurd/running/debian/faq/apt_umount.mdwn new file mode 100644 index 00000000..db0dbfd1 --- /dev/null +++ b/hurd/running/debian/faq/apt_umount.mdwn @@ -0,0 +1,25 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +[[!meta title="apt: unmount cdroms"]] + +You can add a shell script umount so that apt can automatically unmount cdroms. + + #!/bin/sh + # Filename: /usr/bin/umount + + settrans -fg "$@" + +Give executable permission to the script. + + # chmod +x /usr/bin/umount + +In `/etc/fstab` add a trailing `/` after cdrom like `/cdrom/` since apt uses a +trailing `/`. diff --git a/hurd/running/debian/faq/bad_hypermeta_data.mdwn b/hurd/running/debian/faq/bad_hypermeta_data.mdwn new file mode 100644 index 00000000..bc960e30 --- /dev/null +++ b/hurd/running/debian/faq/bad_hypermeta_data.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +If you get the error `bad hypermeta data` when trying to mount an ext3 +partition from GNU/Linux, that is usually because the file system has not been +unmounted cleanly (maybe GNU/Linux got suspended to disk) and the Hurd cannot +mount it as ext2 without checking. Either boot back into GNU/Linux and unmount +it or you can try to run `fsck.ext3` from GNU/Hurd directly. diff --git a/hurd/running/debian/faq/debugging_inside_glibc.mdwn b/hurd/running/debian/faq/debugging_inside_glibc.mdwn new file mode 100644 index 00000000..91b71d64 --- /dev/null +++ b/hurd/running/debian/faq/debugging_inside_glibc.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +To get [[debugging]] information for glibc, you need to install the +`libc0.3-dbg` package. At the place [[debugging/GDB]] looks for debugging +symbols by default (`/usr/lib/debug/lib/`), Debian's `libc0.3-dbg` stores only +the frame unwind information used for backtracing. If you want to step into +glibc while debugging, you need to add `LD_LIBRARY_PATH=/usr/lib/debug` to +debugged program's environment (`set env VAR value` from the GDB command line). +If that still does not work, try `LD_PRELOAD=/usr/lib/debug/libc.so.0.3` +instead. diff --git a/hurd/running/debian/faq/debugging_translators.mdwn b/hurd/running/debian/faq/debugging_translators.mdwn new file mode 100644 index 00000000..b55484e1 --- /dev/null +++ b/hurd/running/debian/faq/debugging_translators.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +In order to [[debug|debugging]] translators and being able to step into glibc +during it, you need the `hurd-dbg` and `libc0.3-dbg` packages installed. If you need to debug the initialization of the translator, +start the translator like `settrans -P /foo /usr/bin/env +LD\_LIBRARY\_PATH=/usr/lib/debug /hurd/foofs`. The `-P` option will make it +pause and you will be able to attach [[debugging/GDB]] to the process. diff --git a/hurd/running/debian/faq/dev_random.mdwn b/hurd/running/debian/faq/dev_random.mdwn new file mode 100644 index 00000000..3b5fdffe --- /dev/null +++ b/hurd/running/debian/faq/dev_random.mdwn @@ -0,0 +1,17 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +[[!meta title="/dev/random"]] + +There is no random device by default as no secure implementation has been +finished yet. An easy (but very insecure) work-around is to copy a binary file +like `/bin/bash` to `/dev/random` and `/dev/urandom`. A slightly more secure +alternative is installing the `random-egd` from the `debian-ports` repository. + diff --git a/hurd/running/debian/faq/df.mdwn b/hurd/running/debian/faq/df.mdwn new file mode 100644 index 00000000..4de232da --- /dev/null +++ b/hurd/running/debian/faq/df.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2007, 2008 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 no `/etc/mtab`, so just running `df` will yield an error. Pass `df` a +path like `df /` or `df ./` to see the disk usage of that particular file +system. diff --git a/hurd/running/debian/faq/eata.mdwn b/hurd/running/debian/faq/eata.mdwn new file mode 100644 index 00000000..fa7dbdec --- /dev/null +++ b/hurd/running/debian/faq/eata.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +In some virtual machines (e.g. VirtualBox), "probing eata on XXX" may be +quite long. This is apparently due to poor efficiency of the virtualizer, not +Mach. There is no such issue on real hardware or using qemu/kvm. diff --git a/hurd/running/debian/faq/free_memory.mdwn b/hurd/running/debian/faq/free_memory.mdwn new file mode 100644 index 00000000..c1c0a83c --- /dev/null +++ b/hurd/running/debian/faq/free_memory.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Run `vmstat` to see memory and swap usage. diff --git a/hurd/running/debian/faq/hurd_console.mdwn b/hurd/running/debian/faq/hurd_console.mdwn new file mode 100644 index 00000000..c4a619a1 --- /dev/null +++ b/hurd/running/debian/faq/hurd_console.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Edit `/etc/default/hurd-console` to configure the Hurd console and enable it on +bootup. See [[console]] for further information about the Hurd console. diff --git a/hurd/running/debian/faq/kernel_logs.mdwn b/hurd/running/debian/faq/kernel_logs.mdwn new file mode 100644 index 00000000..ff14ce5f --- /dev/null +++ b/hurd/running/debian/faq/kernel_logs.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +The kernel logs are written to `/dev/klog`. Run `cat /dev/klog > foo` as root +and hit `ctrl+c` after a few seconds to catch the logs. You can do this only +once and do not do this in single-user mode (where `ctrl+c` does not work). diff --git a/hurd/running/debian/faq/other_repositories.mdwn b/hurd/running/debian/faq/other_repositories.mdwn new file mode 100644 index 00000000..88781d46 --- /dev/null +++ b/hurd/running/debian/faq/other_repositories.mdwn @@ -0,0 +1,16 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +If you want to use the `apt-get source` facility, make sure that +`/etc/apt/sources.list` contains a line like + + deb-src http://ftp.de.debian.org/debian unstable main + +... replacing _de_ with your homeland's code. diff --git a/hurd/running/debian/faq/ps_hangs.mdwn b/hurd/running/debian/faq/ps_hangs.mdwn new file mode 100644 index 00000000..febfeb59 --- /dev/null +++ b/hurd/running/debian/faq/ps_hangs.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +If `ps` hangs, try `ps -M` which might still work by not getting detailed +information from processes. diff --git a/hurd/running/debian/faq/reporting_bugs.mdwn b/hurd/running/debian/faq/reporting_bugs.mdwn new file mode 100644 index 00000000..40781ab0 --- /dev/null +++ b/hurd/running/debian/faq/reporting_bugs.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Please try to reproduce bugs which are not obviously Hurd-specific on Debian +GNU/Linux and then file them there. + +If you find a genuine issue in Debian GNU/Hurd, please file it in our Alioth +bug tracker at +<http://alioth.debian.org/tracker/?atid=411594&group_id=30628&func=browse> +If you find a bug in the Hurd or GNU Mach themselves, either file a bug against +the respective Debian packages, or directly at +<http://savannah.gnu.org/bugs/?group=hurd> diff --git a/hurd/running/debian/faq/sata_disk_drives.mdwn b/hurd/running/debian/faq/sata_disk_drives.mdwn new file mode 100644 index 00000000..dad10cb9 --- /dev/null +++ b/hurd/running/debian/faq/sata_disk_drives.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + +GNU Mach does not support SATA disk drives (/dev/sda etc. in GNU/Linux) natively, so using device:sd0s1 will not work, sd* devices are for SCSI drives only. The only way to get those drives to work is to put them into compatibility mode in the BIOS, if such an option exists. GNU Mach will then recognize them as hda etc. diff --git a/hurd/running/debian/faq/sshd_only_works_for_root_logins.mdwn b/hurd/running/debian/faq/sshd_only_works_for_root_logins.mdwn new file mode 100644 index 00000000..1a3c46e1 --- /dev/null +++ b/hurd/running/debian/faq/sshd_only_works_for_root_logins.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2007, 2008, 2010 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 isssue has been fixed in the Debian hurd / libc0.3 packages as of 2010-11. +Retire this item sometime after 2011. + +--- + +Privilege seperation does not work with Hurd currently. You need to explicitely +set `PrivilegeSeparation` to `no` in `/etc/ssh/sshd_options`, just commenting out +the entry will not work as it is on by default. Also make sure you have +`/dev/random`, see below. diff --git a/hurd/running/debian/faq/xserver-common.mdwn b/hurd/running/debian/faq/xserver-common.mdwn new file mode 100644 index 00000000..09fbc902 --- /dev/null +++ b/hurd/running/debian/faq/xserver-common.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +You need to run `dpkg-reconfigure xserver-common` and select `Anybody` for +starting X as there is no way to detect console users currently. diff --git a/hurd/running/debian/logo.png b/hurd/running/debian/logo.png Binary files differdeleted file mode 100644 index 068d9584..00000000 --- a/hurd/running/debian/logo.png +++ /dev/null diff --git a/hurd/running/debian/package_troubleshooting.mdwn b/hurd/running/debian/package_troubleshooting.mdwn index 829af8e3..c6236c2f 100644 --- a/hurd/running/debian/package_troubleshooting.mdwn +++ b/hurd/running/debian/package_troubleshooting.mdwn @@ -1,9 +1,5 @@ This page reports known Hurd-specific bugs, quirks and corresponding solutions and workarounds with Debian GNU/Hurd package installation and working. -## <a name="Table_of_Contents"> Table of Contents </a> - -%TOC% - ## <a name="Dpkg_wants_external_programs_"> Dpkg wants external programs? </a> It may be that dpkg wants external GNU/Linux-specific programs that it can't found or that just don't exist on the Hurd. You can trick dpkg by copying and running this script as root: @@ -21,7 +17,8 @@ You must set up the [[translator/random]] device first. ## <a name="An_X_package_hangs_at_startup_wi"> An X package hangs at startup without error messages </a> -Observed with GTK programs like xchat, synaptic, inkscape. It is an issue with libpthread that (as of 04 Feb 2007) is still unresolved. Sorry. +Observed with GTK programs like xchat, synaptic, inkscape. It is an issue with +[[libpthread]] that (as of 04 Feb 2007) is still unresolved. Sorry. ## <a name="Borked_fonts_on_GTK_app"> </a> Borked fonts on GTK app diff --git a/hurd/running/debian/patch_submission.mdwn b/hurd/running/debian/patch_submission.mdwn new file mode 100644 index 00000000..66348dd9 --- /dev/null +++ b/hurd/running/debian/patch_submission.mdwn @@ -0,0 +1,55 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +If you fixed a Debian package which *FTBFS* (fails to build from source), you +should submit the patch so that all users can profit from your work. + +If it is not a Debian-specific patch, you should strongly consider submitting +the patch upstream for inclusion. This applies even more so if it is a GNU +package, or otherwise frequently used package, or you know upstream anyway. + +If you had to change the code considerably and are not 100% sure you did not +introduce a regression, or are not very experienced with these kinds of code +changes, you should first submit your patch for review to the [Debian alioth +patch +tracker](http://alioth.debian.org/tracker/?atid=410472&group_id=30628&func=browse). + +If the patch is trivial, or one of the Debian porters approved your patch for +submission, submit the patch to the Debian BTS (bug tracking system). You can +either use the reportbug tool, or just simple mail. In any case, you should +follow these guidelines: + + * The submission address is <submit@bugs.debian.org>. + * The mail's subject (which will become the bug's title) should be + `SOURCE-PACKAGE: FTBFS on hurd-i386: REASON`. + * The first lines of the mail's body (the so-called *pseudo-header*): + * `Severity: important` -- not *serious*. + * `Version: VERSION` -- the version of the source package in unstable. + * `Tags: patch` -- as/if you include a ready-to-be-applied patch. + * `User: debian-hurd@lists.debian.org` + * `Usertags: hurd` + +In the bug description, mention that the package fails to build on hurd-i386 +and (if possible) quote the failure. If possible, point to the failing build +log from <http://buildd.debian-ports.org/build.php> or elsewhere. + +Then, explain the failure (Debian maintainers usually do not know much about +Hurd-specific failures), and attach the patch. + +The patch should be in unidiff form. + +If the package uses a patch system, it is preferable to submit the patch in a +ready-to-use form (e.g. as a *dpatch*), but this is not required. Also, try to +keep the patch small, e.g., do not submit a 100 KiB autotools diff for a +one-line change in `configure.in` or a `Makefile.am`, but in this case mention +that autotools need to be rerun and let the maintainer choose (you can suggest +you would file a complete diff if the maintainer prefers). + +Last but not least, try to be courteous. diff --git a/hurd/running/debian/porting.mdwn b/hurd/running/debian/porting.mdwn new file mode 100644 index 00000000..0eb15465 --- /dev/null +++ b/hurd/running/debian/porting.mdwn @@ -0,0 +1,54 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009, 2010 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]]."]]"""]] + +[[!meta title="Debian packages that need porting"]] + +More than half of the Debian archive has been compiled successfully on the +Hurd, however, many programs fail to build for various reasons. + +A [list of build failures including error +messages](http://unstable.buildd.net/buildd/hurd-i386_Failed.html) can be +found, as well as a [preliminary +analysis](http://lists.debian.org/debian-hurd/2007/07/msg00000.html) of them and [solutions](http://lists.debian.org/debian-hurd/2007/07/msg00001.html), and some more details in [[hurd/porting/guidelines]]. [Graphs and statistics](http://people.debian.org/~sthibault/) about the consequence in terms of build dependencies are available. + +There is a mailing list, +[debian-hurd-build-logs](http://lists.alioth.debian.org/mailman/listinfo/debian-hurd-build-logs), +where *builds logs from the Debian GNU/Hurd autobuilders* are posted. It is a +high-traffic and high-volume list, and for that reason *not* archived, so you +have to subscribe to see the messages. + +It might be a good idea to record your intention to port something either in +the list below or in the [Alioth task +tracker](http://alioth.debian.org/pm/task.php?group_project_id=34&group_id=30628&func=browse) +so other people do not do duplicated work. + +Also, the [[community/HurdFr]] guys maintain their own [liste des travaux de +packaging](http://wiki.hurdfr.org/index.php/Liste_des_travaux_de_packaging). + +Aside from the Alioth task tracker, here is a list of some packages (the +important ones, as they're, e.g., blocking other packages from being built) +that need someone to work on them. + +When you have a patch to submit, please adhere to the [[patch_submission]] +guidelines. + +There is also further information available about [[hurd/porting]]. + +[[!map +pages="tagged(open_issue_porting) and !tagged(fixed_in_debian) and !*/discussion" +show=title]] + +[[!inline +pages="tagged(open_issue_porting) and !tagged(fixed_in_debian) and !*/discussion" +show=0 +feeds=no +actions=yes +rootpage="open_issues" postformtext="Add a new item titled:"]] diff --git a/hurd/running/distrib.mdwn b/hurd/running/distrib.mdwn index a373062c..c197ad0e 100644 --- a/hurd/running/distrib.mdwn +++ b/hurd/running/distrib.mdwn @@ -1,8 +1,16 @@ +Working distributions of GNU/Hurd: + * [[Debian]] + +GNU/Hurd distributions in early stages of development: + +* [[Arch|arch_hurd]] (features a LiveCD) * [[Gentoo]] -* [[Bee]] * [[GNU]] +<!-- Bee GNU/Hurd doesn't seem to exist anymore. +* [[Bee]] +--> # Issues @@ -30,8 +38,8 @@ </dl> <dl> - <dt>[[GrubNotes]]</dt> - <dd> A quick reference and explanation. There's also a topic for the new [[GrubConf]]. </dd> + <dt>[[GRUB]]</dt> + <dd> A quick reference and explanation. </dd> </dl> <dl> @@ -64,11 +72,11 @@ about getting applications to work (if possible). <dl> <dt>[[SavannahProjects]]</dt> - <dd> Savannah is a CVS &amp; Bug system evolved from a free version of the code that powers <a href="http://sf.net" target="_top">sourceforge.net</a>. It has forked and been slightly modified for use by FSF, GNU and non-GNU projects. Actual Development takes place here. There is also a <a href="http://savannah.gnu.org/people/?group=hurd" target="_top">help wanted</a> list. </dd> + <dd> Savannah is a CVS & Bug system evolved from a free version of the code that powers <a href="http://sf.net" target="_top">sourceforge.net</a>. It has forked and been slightly modified for use by FSF, GNU and non-GNU projects. Actual Development takes place here. There is also a <a href="http://savannah.gnu.org/people/?group=hurd" target="_top">help wanted</a> list. </dd> </dl> <dl> - <dt>[[PortingIssues]] FAQ</dt> + <dt>[[porting/guidelines]] FAQ</dt> <dd> What does it take to move a piece of Debian packaged software to the GNU/Hurd port? </dd> </dl> @@ -78,8 +86,8 @@ about getting applications to work (if possible). </dl> <dl> - <dt> Debain Infrastructure</dt> - <dd> Testing is critical in helping the development effort. Bugs (defect reports) can be filed against the Debian software package in which they are found. [[BtsFiling]] tells how to file a Debian bug report. [[DebianPackages]] has some information about how Debian splits the software into packages and some references. There is a buildd autobuilder compiling the Debian Sid archive software for the GNU/Hurd port. [[BuilddStatus]] includes information on the buildd &amp; turtle efforts. </dd> + <dt> Debian Infrastructure</dt> + <dd> Testing is critical in helping the development effort. Bugs (defect reports) can be filed against the Debian software package in which they are found. [[debian/patch_submission]] tells how to file a Debian bug report. [[DebianPackages]] has some information about how Debian splits the software into packages and some references. There is a buildd autobuilder compiling the Debian Sid archive software for the GNU/Hurd port. [[BuilddStatus]] includes information on the buildd & turtle efforts. </dd> </dl> <dl> @@ -94,9 +102,8 @@ about getting applications to work (if possible). * GNU [Coding Standards](http://www.gnu.org/prep/standards.html) * [[TestSuites]] - Posix, Perl, results feedback, etc. -* [docs and papers](http://www.gnu.org/software/hurd/docs.html) -* [[SystemAPILimits]] -* [[Hurd/HurdSpecificGlibcApi]] +* [[Documentation]] +* [[System_API_Limitations]] * [[CodeAnnouncements]] - Recent coding projects related to the Hurd <dl> diff --git a/hurd/running/faq.mdwn b/hurd/running/faq.mdwn new file mode 100644 index 00000000..2746a20a --- /dev/null +++ b/hurd/running/faq.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2009, 2010 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]]."]]"""]] + +[[!meta title="General FAQ About Running GNU/Hurd"]] + +See also other [[/FAQ]]. + +[[!inline +pages="hurd/running/faq/* and !*/discussion" +show=0 +feeds=no +actions=yes +rootpage="hurd/running/faq" postformtext="Add a new item titled:"]] diff --git a/hurd/running/faq/native-install_doesnt_finish.mdwn b/hurd/running/faq/native-install_doesnt_finish.mdwn new file mode 100644 index 00000000..a852e1dd --- /dev/null +++ b/hurd/running/faq/native-install_doesnt_finish.mdwn @@ -0,0 +1,24 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +Copying baseGNU to the virtual disk works. Even booting got through but when I +try to run native-install it never gets to the very end. First time it froze on +*sed* package, the other time on *sysv-rc*. + +> How much memory did you configure for the [[QEMU]] system? It may simply be +> -- I've seen this myself -- that the system runs out of memory, as at the +> native-install stage (I think at least) swap is not yet configured and +> enabled. What I've been doing is: boot (with -s), MAKEDEV hdWHATEVER in +> /dev/ for the swap device, run /hurd/mach-defpager, followed by swapon +> /dev/hdWHATEVER. Does this help? + +>> Thank You very much, more memory solved the freezing. + +[[!tag open_issue_hurd]] diff --git a/hurd/running/gentoo.mdwn b/hurd/running/gentoo.mdwn index b49e5bcc..ef72bfad 100644 --- a/hurd/running/gentoo.mdwn +++ b/hurd/running/gentoo.mdwn @@ -1,8 +1,34 @@ -[Gentoo-Hurd](http://hurd.rustedhalo.net/) +* [Archived try at a Gentoo GNU/Hurd](http://www.mundurat.net/ggh/) Unofficial port to Gentoo and the portage system. It was [announced](http://forums.gentoo.org/viewtopic.php?t=41939&postdays=0&postorder=asc&start=0) -March 17, 2003 in the Gentoo forums. There's a #gentoo-irc channel similar to -[[IRC]]. At present (May 2005), there's no activity and Eric Olinger has not -the time to maintain this distri. +March 17, 2003 in the Gentoo forums. There's a #gentoo and a #gentoo-hurd IRC channel similar to +[[IRC]]. +### State of the GGH, 2009-05 + +> *Did you work a bit more on the Gentoo GNU/Hurd?* + +I tried to resume my work 3-4 months ago but I found some problems with +portage and python functions not implemented on Hurd so I stopped. I think +that back in 2006 with portage 2.0.54 those functiones weren't necessary. + +> *And do you have some information which might help others advance what you began?* + +I just have all the ebuilds and binary packages I merged online on +[http://www.mundurat.net/ggh/portage](http://www.mundurat.net/ggh/portage). + +To continue my work just take a Debian/Hurd and install portage by hand. + +Once there take the profile and start bootstraping portage and all the +ebuild it needs (patch, python, bzip2...). + +The major problems are: + +- combine the perfect gcc/binutils/glibc/gnumach/hurd and to be able to boot +- lack of development on gnumach/hurd and current 'degraded' status. + +I don't think I can help much right now, but if you have any other +question just write me. + +MiKeL diff --git a/hurd/running/gnu.mdwn b/hurd/running/gnu.mdwn index 6b94ed25..94012ef5 100644 --- a/hurd/running/gnu.mdwn +++ b/hurd/running/gnu.mdwn @@ -1,39 +1,51 @@ -[[img logo.png]] - # <a name="The_GNU_Operating_System"> </a> The GNU Operating System +The GNU Operating System, or GNU System as it is more commonly known, will be a +complete [[Unix]]-like operating system composed entirely of [free +software](http://www.gnu.org/philosophy/free-sw.html). The creation of the GNU +System is one of the goals of the [GNU Project](http://www.gnu.org/), which was +[launched in 1983](http://www.gnu.org/gnu/initial-announcement.html) by +[Richard Stallman](http://www.stallman.org/). + + + [[gnu/GNU]]. It is our wish and goal to establish a new direction for the GNU system distribution. To that end, this page will begin setting some direction. This was spawned by several discussions over a few days on the Hurd mailing lists and IRC. This is not intended to detract from Debian GNU/Hurd and we should help them where we can. -I really want this to be more of a community driven effort in the spirit of say Ubuntu. We all have different motivations and skill levels but we need a common goal to get this system going. +I really want this to be more of a community driven effort in the spirit of say, Ubuntu. We all have different motivations and skill levels but we need a common goal to get this system going. -These are just some quick notes I am making late at night. Lets clean this up. +These are just some quick notes I am making late at night. Let's clean this up. ## <a name="Motivations"> Motivations </a> 1. There is a possibility that Debian drops support for GNU/Hurd. 2. Other GNU/Linux distributions do not support the Hurd infrastructure well. -3. Benefitting from the Hurd design and using a microkernel. +3. Benefiting from the Hurd design and using a microkernel. 4. Freedom. ## <a name="Community"> Community </a> -1. Lets establish some ground rules. +1. Let's establish some ground rules. 2. We need infrastructure * Wiki for community documentation * Mailing lists like gnu-system-discuss exists for mostly technical items * IRC channels like #hug and ##hurd * Perhaps less formal and less intimidating channels and mailing lists would involve broader parts of the community 3. We need a community vision and direction. - * Lets work together for a common goal - * Lets establish goals and priorities and get resources on them. (More later) + * Let's work together for a common goal + * Let's establish goals and priorities and get resources on them. (More later) * Major goal to create a system making full use of Hurd features? * We should never hesitate to throw away existing stuff whenever it hinders us to make good use of Hurd features * However, we should try to reuse existing stuff (from Debian for example) as long as it doesn't limit our possibilities or impose considerable overhead - * Lets have fun. It's GNU and it's important but let's enjoy ourselves. + * Let's have fun. It's GNU and it's important but let's enjoy ourselves. + +## Download + + * Official GNU snapshot <http://www.update.uu.se/~ams/GNU> + * Extended GNU distribution <http://i-hug.sarovar.org/downloads/GNU/extended/> ## <a name="Tools"> Tools </a> @@ -49,6 +61,12 @@ These are just some quick notes I am making late at night. Lets clean this up. * Probably we should set up a Savannah project * How to handle experimental patches to the core packages (Hurd, Mach, libc etc.) that are not in official CVS yet? +## Resources + + * [[Universal_package_manager]] + * How to [[set_up_GNU|setup]] and archiver for GNU + * [[Create_an_image]] + ## <a name="Todo"> Todo </a> 1. AMS had made a GNU release. We can try it and test it to good use. We can fix broken things in it, and enhance it. diff --git a/hurd/running/gnu/create_an_image.mdwn b/hurd/running/gnu/create_an_image.mdwn new file mode 100644 index 00000000..c7a97a4e --- /dev/null +++ b/hurd/running/gnu/create_an_image.mdwn @@ -0,0 +1,97 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Creating a bootable qemu image from a root filesystem and bootloader + +1. Create a hard disk image + + qemu-img create -f qcow <imagename.img> <size>G + +2. Use a live CD (better to have a lighter OS like system rescue CD to make the + process faster) and the image created to boot. + + qemu -cdrom /dev/cdrom -hda <imagename.img> -boot d + +3. Once system is booted use a partition editing tool (like fdisk, cfdisk, + parted, gparted, qtparted ...) to partition the image. + + cfdisk + + create the necessary partitions (root and swap partitions boot, home ... if + required) + +4. Create a file system for the root partition + + mke2fs /dev/hda1 + +5. Mount the partition + + mkdir disk + mount /dev/hda1 disk + +6. Copy the file system from the host machine to the mounted directory (use a + compressed file system to make the copying faster) + + Grab the GNU snapshot from ams' site + <http://www.update.uu.se/~ams/home/slask/GNU/> + + scp <user>@<host>:<path to the compressed file system> disk + +7. Uncompress the files + + cd disk + tar -jxvf <compressed filesystem> + +8. Unmount the mounted partition + + cd .. + umount disk + +9. power off the guest OS. + + poweroff + +10. To make the file system bootable download a grub floppy image + + <http://hurd.in/pub/Hurd/HurdOnVMware/grub.img> + +11. Run qemu to boot into your brand new system + + qemu -hda <hard disk image.img> -fda grub.img -boot a + +Happy Hacking !! + + +Make your new system boot from the hard disk + +1. Mount your grub image + + mkdir floppy + mount -t ext2 -o loop grub.img floppy + +2. Use previous steps 2 and 5 to boot from a liveCD and mount the partition + + cd disk/boot + scp -r <user>@<host>:<path to mounted floppy image directory>/boot/grub + +3. Poweroff the guest + + poweroff + +4. Boot new system using floppy image previous step 11 + + use install to hard disk option if you used the above grub image + + or go to grub command line and type + + root (hd0,0) + setup (hd0) + + Now you have a bootable system image. Enjoy Maadi !! diff --git a/hurd/running/gnu/gnu.mdwn b/hurd/running/gnu/gnu.mdwn index 22bb5161..3ee5f657 100644 --- a/hurd/running/gnu/gnu.mdwn +++ b/hurd/running/gnu/gnu.mdwn @@ -1,8 +1,11 @@ -[[img logo.png]] - ## <a name="GNU_FSF_amp_RMS"> </a> GNU, FSF & RMS -GNU stands for GNU's Not Unix. It is a project announced in 1983 by [[RichardStallman]] (RMS). The Free Software Foundation ([FSF](http://www.fsf.org/fsf/fsf.html)) was founded in 1985 to act as a parent organization for GNU and many other projects. GNU and some non-GNU projects are now hosted on the [Savannah](http://savannah.gnu.org) platform similar to SourceForge.net. +GNU stands for GNU's Not [[Unix]]. It is a project announced in 1983 by +[[RichardStallman]] (RMS). The Free Software Foundation +([FSF](http://www.fsf.org/fsf/fsf.html)) was founded in 1985 to act as a parent +organization for GNU and many other projects. GNU and some non-GNU projects +are now hosted on the [Savannah](http://savannah.gnu.org) platform similar to +SourceForge.net. <dl> <dt>[[History]]</dt> diff --git a/hurd/running/gnu/logo.png b/hurd/running/gnu/logo.png Binary files differdeleted file mode 100644 index 50c392cf..00000000 --- a/hurd/running/gnu/logo.png +++ /dev/null diff --git a/hurd/running/gnu/names.mdwn b/hurd/running/gnu/names.mdwn index d470a632..fcab6a11 100644 --- a/hurd/running/gnu/names.mdwn +++ b/hurd/running/gnu/names.mdwn @@ -1,4 +1,4 @@ -The GNU stands for GNU's Not Unix. It is a project as described in [[GNU]]. +The GNU stands for GNU's Not [[Unix]]. It is a project as described in [[GNU]]. What can be confusing is the usage. GNU can stand for: diff --git a/hurd/running/gnu/setup.mdwn b/hurd/running/gnu/setup.mdwn new file mode 100644 index 00000000..2fb30c7b --- /dev/null +++ b/hurd/running/gnu/setup.mdwn @@ -0,0 +1,84 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Setup is very easy (You need a GNU/Linux system to install GNU, we are developing an installer for GNU and if you want to help us join us on [gnu-system-discuss](http://lists.gnu.org/mailman/listinfo/gnu-system-discuss)), just follow these steps ... + +## Step 1: Find a home for GNU + +create a partition with minimum of 800 MB (if you want to install programs later you might need to allocate more space) + +It comes with GNU Emacs 21.4, gcc 4.0, gdb 6.3, parted, wget and many more + +Note: 2GB limit for partitions is no more there, it is fixed + +## Step 2: Create GNU Hurd filesystem on the partition + + # mke2fs -o hurd /dev/hdd6 + +## Step 3: Grab a snapshot of the GNU + +from <http://www.update.uu.se/~ams/home/slask/GNU/> or Extended GNU from <http://i-hug.sarovar.org/downloads/GNU/extended/> + +## Step 4: Extract the snapshot to the newly created partition + + # mount /dev/hdd6 /mnt + # cd /mnt + # tar -jxvf <path to downloaded location>/GNU--2006-01-08.tar.bz2 + +Wait for the extraction to complete, depending on the system configuration the time varies. The compressed image is 178MB and it uncompresses to about 750MB + +## Step 5: Configure grub to boot GNU + +This can be tricky since the partition naming is different for linux, grub and hurd + +My configuration look like this ... + + title GNU (also known as GNU/Hurd)(Single user) + root (hd0,5) + kernel /boot/gnumach.gz root=device:hd3s6 -s + module /hurd/ext2fs.static --multiboot-command-line=${kernel-command-line} --host-priv-port=${host-port} --device-master-port=${device-port} --exec-server-task=${exec-task} -T typed ${root} $(task-create) $(task-resume) + module /lib/ld.so.1 /hurd/exec $(exec-task=task-create) + + title GNU (also known as GNU/Hurd)(Multi-user) + root (hd0,5) + kernel /boot/gnumach.gz root=device:hd3s6 + module /hurd/ext2fs.static --multiboot-command-line=${kernel-command-line} --host-priv-port=${host-port} --device-master-port=${device-port} --exec-server-task=${exec-task} -T typed ${root} $(task-create) $(task-resume) + module /lib/ld.so.1 /hurd/exec $(exec-task=task-create) + + grub linux hurd + hd0,5 hdd6 hd3s6 + +If you have only one harddisk it will be hd0 for grub wherever you connect it. +But linux and hurd names depend on whether you connect it as primary master +(hda or hd0), primary slave (hdb or hd1) [this is my cdrom drive], secondary + master (hdc or hd2) or secondary slave (hdd or hd3) [this is my precious +Maxtor 2GB hard disk]. + +The partition naming of hurd is similar to BSD slices. hda1 is hd0s1, hda2 is + hd0s2 ... + +In my case the root device is hd0s6 (hdd6) + +## Step 6: Now boot into your brand new GNU System. + +It will do some initial setup and you will get a prompt. +Now reboot into your configured GNU System. + + # reboot + +## Step 7: Start using your GNU system + +Here is the GNU/Hurd users guide. It starts from the basics. <http://www.gnu.org/software/hurd/users-guide/using_gnuhurd.html> + +*Warning! : It is not yet ready for normal use, it is a developer's release.* + +So when you encounter bugs report it to bug-hurd@gnu.org + +Join us on gnu-system-discuss <http://lists.gnu.org/mailman/listinfo/gnu-system-discuss> to help finish the GNU System. diff --git a/hurd/running/gnu/softwareprojects.mdwn b/hurd/running/gnu/softwareprojects.mdwn index 54a92030..4790c5c9 100644 --- a/hurd/running/gnu/softwareprojects.mdwn +++ b/hurd/running/gnu/softwareprojects.mdwn @@ -4,3 +4,5 @@ Some of the GNU software effects the Hurd development directly or indirectly. He <dt> GCC</dt> <dd> deb packages of gcc-{3.2,3.3} are available for testing from <a href="http://people.debian.org/~mbanck/hurd-gcc-4.0/" target="_top">http://people.debian.org/~mbanck/hurd-gcc-4.0/</a> ./ </dd> </dl> + +* [[Universal_package_manager]] and archiver for GNU diff --git a/hurd/running/gnu/universal_package_manager.mdwn b/hurd/running/gnu/universal_package_manager.mdwn new file mode 100644 index 00000000..e58a2058 --- /dev/null +++ b/hurd/running/gnu/universal_package_manager.mdwn @@ -0,0 +1,156 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +## Mission + +"To enable the GNU System to install packages of any format like rpm, deb, +ebuild... so that GNU System will be able to use softwares packaged by projects like Debian and Gentoo" + +## Features + +Basically all package management schemes follow similar approach, it will have a single binary archive containing the actual software and some metadata like packages it requires, what all it provides ... So when we install an rpm package this tool will help rpm tool to recognise the packages installed by stow and it will be stowed instead of the normal rpm way of installing in /usr. + +There can be both aproaches + + * Re-implement rpm, dpkg... to recognise stow as backend instead of its own data store. In that case we will have to re-implement, apt-rpm, yum ... + * Implement a translator which reads stow and show it as an rpm data store for yum, deb data store for apt-get ... + +One goal is obviously choice of packaging and hence availability of more packages. Also this gives maintainers a choice to continue building packages for GNU in the format they are already familiar with. The second goal is to demonstrate the flexibility GNU offers in implementing functionality in filesystems (open/read/write interface). + +## Why? + + * The GNU Hurd provides a lot of advanced features and functionalities. We aim to exploit those features. + * Combining translators with UnionFS gives a very exciting package manager. + * We could use the good features of existing packaging systems like deb, rpm, ebuilds, ports ... plus unionfs and hurd translator is a compelling combination. + +With the increased flexibility in implementing filesystems as per the requirements, we can implement the functionality similar to apt-get, emerge or yum... (dependency tracking, versions tracking...) in the filesystem itself. + +## What? + + * Have a basic filesystem based package manager + * Write translators to convert between GNU's packaging format and the existing one's like rpm, deb ... + +## How? + + * Installation of a package is just drag the package (be it a tgz, rpm, deb or an exe) and drop it to the package manager. + + * apt-cache search vim --> ls -al /packages/meta/ |grep vim + * apt-get install vim --> install vim + +Just a sample script. + + $ cd /packages/meta/vim/current/depends + $ for i in `ls *` + $ do + $ if [ -f /packages/binary/$i ] + $ then + $ echo "$i is installed" + $ else + $ install $i + $ fi + $ done + +The same can be achieved using any of the languages or front ends or even manual copying. + +If all the dependencies are there + + $ cp -r /ftp/ftp.gnu.org/packages/binary/vim/7.0 /packages/binary/vim/7.0 + +## Implementation Details + +Lets take the example of rpm, it is simply a cpio archive with software and +meta data as its contents. Just extract it to stow directory with a name +package-version. When apt-get or yum asks for information about already +installed packages read the stow tree and return back the requested data. + +Same case for ebuild. We can provide these details to any packaging system +in the way it wants using a translator. So support for a new format is +just writing the new translator. + +## Initial idea + +A bit more complex than the earlier scheme but it is more exciting and we can look at this scheme seriously once we have the simple scheme working. + +All packages are installed at +`/packages/binary/<packagename>/<packageversion>`. + +For example vim 6.4 version can be installed from source like + + # cd vim64 + # ./configure --prefix=/packages/binary/vim/6.4 + # make + # make install + +Now if you have another vim version, say 7.0 then just follow the steps + + # cd /packages/source/vim + # CP /<pathtovimtarball>/vim-7.0.tar.bz2 + # tar -jxvf vim-7.0.tar.bz2 + # mv vim70 7.0 + # ./configure --prefix=/packages/binary/vim/7.0 + # make + # make install + +You have 2 versions of vim and how can you specify which one is the current version? You can symlink the current version to select the version you would like to see as default + + # ln -s /packages/binary/vim/7.0 /packages/vim/current + +## Metadata: /packages/meta + +Dependency information is stored as a symbolic link to the required packages in a subdirectory called depends. + +## Requirement + +We will require unionfs support if we chose to go through path 2 (which is what I like because we can really show off with translators.) + + * Developing status - planning + * Near term goal - implement stow backend for dpkg + * High priority task - make unionfs work on boot. Mail from AMS to gnu-system-discuss on problem statement <http://www.mail-archive.com/gnu-system-discuss@gnu.org/msg00198.html> + +## Developer Guidelines. + + * GNU coding standards <http://www.gnu.org/prep/standards/> + + +## FAQ - Frequently asked questions + + 1. How can I join this project? + +OK. I will give you steps. + +i. Install a GNU System by folowing [[these_instructions|setup]] + +ii. Read about GNU Design: [[Towards_a_New_Strategy_of_OS_Design|hurd-paper]] + +iii. Read about translators <http://www.debian.org/ports/hurd/hurd-doc-translator> + +iv. Try out these cool [[translator_examples|translator/examples]] + +v. Add your name below and give a shout in the list. + + +## Comments?? + +Add your comments here + +## Interested? + +To join the project just list your name below. + + 1. PraveenA + 2. IsaacPraveen + 3. VikramVincent + 4. MaheshM + 5. Nidhin Raghavan + 6. Ajish.B + 7. Ambili.B + 8. Abhradip Mukherjee + 9. Ermenegildo Fiorito diff --git a/hurd/running/live_cd.mdwn b/hurd/running/live_cd.mdwn new file mode 100644 index 00000000..42d85c5b --- /dev/null +++ b/hurd/running/live_cd.mdwn @@ -0,0 +1,25 @@ +You can download a gzipped iso of a Hurd Live CD at +<http://www.superunprivileged.org/hurd/live-cd/>. + +The Superunpriveleged crew also offers a tiny Hurd Live CD that is under 10 +MiB: <http://www.superunprivileged.org/hurd/tiny-cd/> + +Use it like this: + + $ qemu -cdrom hurd-tiny-cd-20060722.iso + +A more recent Live CD can be found at <http://teythoon.cryptobitch.de/hurd/livecd/hurd-live-install-1273300101.iso.xz>. + +It can be run with qemu via + + $ wget http://teythoon.cryptobitch.de/hurd/livecd/hurd-live-install-1273300101.iso.xz + $ xz -d hurd-live-install-1273300101.iso.xz + $ qemu -cdrom hurd-live-install-1273300101.iso + +These [[!wikipedia LiveCD]]s should be useful for those who want to try out the +Hurd before they commit to installing it on their hard disks. In addition to +that, the bootable Hurd CDs should enable us to have a native installer instead +of relying on Linux. + +* [[RequirementsForLiveCD]] +* [[BuildingHurdLiveCD]] diff --git a/hurd/running/qemu.mdwn b/hurd/running/qemu.mdwn index f40d71d8..6989cf72 100644 --- a/hurd/running/qemu.mdwn +++ b/hurd/running/qemu.mdwn @@ -1,39 +1,68 @@ +This page discusses things for [[Unix]] systems, there is a separate page for +[[Microsoft_Windows]] systems. + + # Readily Available Images -(!) Note that these are unofficial images: they have been prepared by +To try out the Hurd you can use the image of the Debian GNU/Hurd: + +* [Official Debian GNU/Hurd QEMU image](http://ftp.debian-ports.org/debian-cd/K16/debian-hurd-k16-qemu.img.tar.gz) + +(!) Note that the following are unofficial images: they have been prepared by volunteers and may not have been tested extensively. -* [Disk image](http://www.numenor.art.pl/balrog/hurd/) with an installation of - [[Debian_GNU/Hurd|running/debian]]. -* [Announcement](http://lists.debian.org/debian-hurd/2007/09/msg00000.html) of - another image. +<!--* [Disk image](http://www.numenor.art.pl/balrog/hurd/) with an installation of + [[Debian_GNU/Hurd|running/debian]].--> + +* [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*'. + It should work without any of the configuration below. If you want to know what you can do + 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/]]. -# What is Needed +<!--* [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. //--> -1. First thing is to install [[QEMU]]. -2. A [grub](http://www.gnu.org/software/grub/) boot disk for the floppy disk image needed for booting. The [0\.97 version](ftp://alpha.gnu.org/gnu/grub/grub-0.97-i386-pc.ext2fs) works fine. I downloaded it an renamed to `floppy.img`. -3. You will need a [Debian/Hurd installation CD](http://www.debian.org/ports/hurd/hurd-cd). K14 works fine. + +# What is Needed to create a QEMU image + +1. First thing is to install [[/QEMU]]. +2. A [[grub]] boot disk for the floppy disk image needed for booting. The [0\.97 version](ftp://alpha.gnu.org/gnu/grub/grub-0.97-i386-pc.ext2fs) works fine. I downloaded it and renamed to `floppy.img`. Alternatively, the Debian grub-disk package (up till version 0.97-28) is fine as well. +3. You will need a [Debian/Hurd installation CD](http://www.debian.org/ports/hurd/hurd-cd). K16 works fine. # Installing Debian/Hurd with QEMU -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. +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). $ qemu-img create hd0.img 2G 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. - $ qemu -hda hd0.img -cdrom debian-K14-hurd-i386-CD1.iso -fda floppy.img -boot d + $ qemu -hda hd0.img -cdrom debian-K16-hurd-i386-CD1.iso -fda floppy.img -boot d 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. 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): + + $ cd /dev/ + $ MAKEDEV hd0s2 + $ /hurd/mach-defpager + $ swapon /dev/hd0s2 **Important:** Older versions on gnumach needed that the `-M isapc` was passed to qemu. This is not needed anymore. +Also see another text about how to [[gnu/create_an_image]] for the +[[GNU_system|gnu]]. + + +# Transferring Files -# Mounting Disk Image on Host +## Mounting Disk Image on Host You may wish to mount your disk image on your host system to transfer files. To do this you will first need to find the offset of the partition you wish to mount. @@ -50,18 +79,42 @@ Now take the number of sectors for the beginning of the partition and multiply i # 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). + +QEMU has a facility to create FAT file systems on-the-fly: + + qemu [...] -hdc fat:[somewhere] + +The Hurd [[`fatfs`_translator|translator/fatfs]] currently is read-only, but +for testing executables (etc.) that is enough. And it is much easier than +loop-mounting the file systems images. (Also you don't need `root' rights.) + +However, note that there is a bug in [[translator/fatfs]]: [[!GNU_Savannah_bug +25961]]. + # Networking in QEMU +Some further notes about [[networking]] and home hints about +[[networking/sharing_files]]. + ## Internet Access If you just want to access the internet from within QEMU, you can setup pfinet for QEMU's user-networking: # 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 -(See also <http://fabrice.bellard.free.fr/qemu/qemu-doc.html#SEC30>.) +(See also <http://www.nongnu.org/qemu/qemu-doc.html#SEC32>.) -Outgoing internet connections should just work then, although you might have to setup nameservers in `/etc/resolv.conf` as well. +Outgoing internet connections should just work then. +Testing it can be difficult with a minimal installation, +but `apt-get update` should work after you have filled out +`/etc/apt/sources.list`. +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. @@ -117,6 +170,8 @@ system after installation. [[Image_for_L4]] -- a QEMU image for the Hurd/L4 project. +<http://eyeside.net/hurd/Hurd-on-QEMU.html> + # TODO @@ -143,3 +198,4 @@ system after installation. <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/babhurd_image.mdwn b/hurd/running/qemu/babhurd_image.mdwn new file mode 100644 index 00000000..c0952fcf --- /dev/null +++ b/hurd/running/qemu/babhurd_image.mdwn @@ -0,0 +1,67 @@ +What this little Hurd image can do +---------------------------------- + +### About this text + +This is the README file accompanying a +[disk\_image](http://draketo.de/dateien/hurd/bab-hurd-qemu-2008-10-29.img.tar.bz2) for +[[running_the_GNU/Hurd_via_qemu|hurd/running/qemu]]. To run the disk image, just use *'qemu +disk_image.img'*. + +You can find the custom *.bashrc* used to tell the user about it as well as this text itself +in the Mercurial repository [hurd_intro](http://bitbucket.org/ArneBab/hurd_intro). + +### Intro + +The Hurd has some unique capabilities, and we created this simple image +to enable you to easily try two of them: + +* The simplest of translators: Hello World! +* Transparent FTP + +### Hello World + +To try out the simplest of translators, you can go the following simple steps: + + $ cat hello + $ setrans hello /hurd/hello + $ cat hello + "Hello World!" + $ settrans -g hello + $ cat hello + +What you do with these steps is first verifying that the file "hello" is empty. + +Then you setup the translator /hurd/hello in the file/node hello. + +After that you check the contents of the file, and the translator returns "Hello World!". + +To finish it, you tell the translator to go away from the file "hello" via "settrans -g hello" and verify that now the file is empty again. + +### Transparent FTP + +We already setup a a transparent FTP translator for you at /ftp: + +With it you can easily access public FTP via the file system, for example the one from the GNU project: + + $ ls /ftp://ftp.gnu.org/ + +But you can also do this very easily yourself: + + $ # Setup the translator on the node ftp: + $ settrans -c ftp: /hurd/hostmux /hurd/ftpfs / + +and you can access FTP sites via the pseudo-directory ftp:, for example with + + $ ls ftp://ftp.gnu.org/ + +What you do here is setting up the translator /hurd/hostmux on ftp: and passing it the translator /hurd/ftpfs to use for resolving accesses as well as / as additional path component. + + +These were only two basic usages of translators on the Hurd. We're sure you'll quickly see many other ways to use this. + +As a last comment: You can setup a translator on any node you have access to, so you can for example mount any filesystems as normal user. + +You might currently be logged in as root, but you could just as well do the same as normal user. + +Why don't you try it out? diff --git a/hurd/running/qemu/microsoft_windows.mdwn b/hurd/running/qemu/microsoft_windows.mdwn new file mode 100644 index 00000000..832b4bef --- /dev/null +++ b/hurd/running/qemu/microsoft_windows.mdwn @@ -0,0 +1,52 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Welcome, This document is for getting you started in a few minutes. + +1. Install Qemu for Windows + + The executable can be downloaded from + <http://free.oszoo.org/ftp/qemu/win32/release/> Doble click on the + installer and follow the instructions. + +2. Obtain Qemu image + + * Debian GNU/Hurd qemu image can be downloaded from + <http://www.numenor.art.pl/balrog/hurd/>, but also see the main + [[QEMU]] page. + * Uncompress the image and rename it to debian-hurd-for-qemu.img (.img is + the only thing that matters, you can chose any name) Note: .img is for + QEMUMenu.bat, which saves you from remembering the command line options + of qemu and helps you change the settings (like chosing different + images, allocating RAM for the guest OS ...) interactivly. + * Copy this file to the directory where you installed Qemu. + +3. Start Qemu + + Double click the QEMUMenu.bat and enter the number to chose between images. + +4. Qemu short cuts + + * ctrl alt - to exit grab from qemu, get mouse cursor out from the qemu + window + * ctrl alt f - full screen + * ctrl alt 2 - qemu contrl console, use this to change devices + (eg. changing cdrom), send keys to the guest (for example if you want + to send ctrl alt del to the guest type "sendkey ctrl-alt-del" ... type + "help" for a listing of all the options. + * ctrl alt 1 - Hurd login console + +## QEmu Image Hangs on Boot +The Debian GNU/Hurd K16 QEmu image hangs during the boot process. You may have better luck by converting the image to qcow format + + ..\qemu-0.9.0-x86\qemu-img.exe convert debian-hurd-k16-qemu.img -O + qcow debian-hurd-k16-qemu.qcow + ..\qemu-0.9.0-x86\qemu.exe -L ..\qemu-0.9.0-x86 -m 512 -hda + debian-hurd-k16-qemu.qcow -localtime -M pc diff --git a/hurd/running/qemu/networking.mdwn b/hurd/running/qemu/networking.mdwn new file mode 100644 index 00000000..71daa576 --- /dev/null +++ b/hurd/running/qemu/networking.mdwn @@ -0,0 +1,43 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +## User mode network + +This is the default networking option for qemu. This does not require root +previleges. If you have DHCP running it will take the ip as 10.0.2.15 + +You can setup an ip 10.0.2.* +Gateway is 10.0.2.2 +Name server is 10.0.2.3 +Netmask is 255.255.255.0 + +You can setup the pfinet translator with the command + + $ settrans -fgap /servers/socket/2 /hurd/pfinet -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0 + +Configure nameserver in /etc/resolve.conf + + nameserver 10.0.2.3 + +Setup a proxy with the command + + $ export http_proxy="http://<proxy.com>:<port>" + +Note: you can add this to your /etc/profile file so that every time you don't +have to setup this. + +If you are using a direct connection to internet install a proxy server on the +host os and use this. (I was not able to use it without proxy) + +You might be able to do it using iptables, some clues +<http://sujith-h.livejournal.com/9520.html> + +Use scp,ftp... to transfer files (also see +[[hurd/running/debian/faq#index2h1]]), read about [[sharing_files]]. diff --git a/hurd/running/qemu/networking/sharing_files.mdwn b/hurd/running/qemu/networking/sharing_files.mdwn new file mode 100644 index 00000000..5bdec5f1 --- /dev/null +++ b/hurd/running/qemu/networking/sharing_files.mdwn @@ -0,0 +1,38 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +# SCP + +Setup OpenSSH server on host system. + +* Copying files from Guest to Host + + $ scp <file> <user>@<host>: + +* Copying files from Host to Guest. + + $ scp <user>@<host>:<file> + +Use scp -r for copying directories. + + +# FTP + +Setup ftp server (like proftpd) on the host. + +* Use ftp client from GNU inetutils + + $ ftp <host> + + Use mget to copy files from host and mput to copy files to the host. + +* The GNU way - setup an ftp translator + + $ settrans -ac ftp/<host> /hurd/ftpfs <username>:<password>@<host>:<path> diff --git a/hurd/running/vmware.mdwn b/hurd/running/vmware.mdwn new file mode 100644 index 00000000..1f99e247 --- /dev/null +++ b/hurd/running/vmware.mdwn @@ -0,0 +1,56 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +## Installation + +Use <http://www.easyvmx.com/> web based tool to create vmx configuration files +which can be used with VMware player (which is a freeware). If you have a +VMware workstation or server you don't have to do this step. + +Note: I have tried it with K10 version of Debian GNU/Hurd on VMware running on +a Debian GNU/Linux machine. + +You can get more information about obtaining Debain GNU/Hurd CDROMS from +<http://www.us.debian.org/ports/hurd/hurd-cd>. + +Insert the first cdrom and proceed with the installation as per the +installation guide <http://www.us.debian.org/ports/hurd/hurd-install>. + +## VMware specific notes: + +You will need a grub floppy image to boot GNU/Hurd. I have attached a copy of +it with this document. You can also download it from here +<http://www.update.uu.se/~ams/home/slask/GNU/grub.img>. + +When you reboot the machine after the base tar ball is extracted (first reboot) +press 'Esc' key while VMware start up and set removable devices as the fisrt +boot device. + +Select "GNU (Also known as GNU/Hurd)" ie, the first option and press 'e' to +edit the grub menu and go to second line and press 'e' again to change +/boot/gnumach to /boot/gnumach.gz. + +Add a link to /boot/gnumach from /boot/gnumach.gz so that you don't have to +edit grub every time you boot. + + # ln -s /boot/gnumach.gz /boot/gnumach + +Or mount the floppy image and change it. + + # mkdir /media/floppy + # mount -o loop <path-to-grub.img> /media/floppy + +Edit /media/floppy/boot/grub/menu.lst with your favorite text editor and change +/boot/gnumach to /boot/gnumach.gz. + +## After install tweaks + +Start using GNU, here is +<http://www.gnu.org/software/hurd/users-guide/using_gnuhurd.html>. diff --git a/hurd/running/vmware/discussion.mdwn b/hurd/running/vmware/discussion.mdwn new file mode 100644 index 00000000..2db08654 --- /dev/null +++ b/hurd/running/vmware/discussion.mdwn @@ -0,0 +1,18 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +I find that this is all quite quick to try and that I can run through the +./native-install and reboot cycle twice OK. However, at that point the +installed Hurd boots up but fails to display a login prompt. This is the case +for both K10 and K14 using VMware Workstation 5.0.0 under Windows XP. Maybe +I'm doing something wrong but it is hard to see what. I'd be interested to +know more precisely what other people find does work. + +--IanMiller - 01 Apr 2007 diff --git a/hurd/settrans.mdwn b/hurd/settrans.mdwn new file mode 100644 index 00000000..5b381090 --- /dev/null +++ b/hurd/settrans.mdwn @@ -0,0 +1,37 @@ +[[!meta copyright="Copyright © 2002, 2004, 2005, 2007, 2008 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]]."]]"""]] + +The `settrans` command is used to attach a [[translator]] (server) to a given +[[file_system_node|virtual_file_system]]. + +`settrans` is commonly used like this: + + $ settrans -fgap *NODE* *TRANSLATOR SETTING* + + * `fg`, **f**orce any existing translator to **g**o away from that node. + * `ap`, start an ***a**ctive translator*, and also establish a ***p**assive + translator* setting. + +*Active translator* means that the operating system starts the translator +immediately and *passive translator* in turn means that the settings are +instead saved in the file system node, and then, when programs access the node +by, for example, sending an [[RPC]], the Hurd will transparently start the +server to handle the request. + + +Help on settrans can be obtained by passing it the `--help` option. + +Likewise, help on a specific translator can be gotten by invoking it from the +command line with the same argument, e.g.: + + $ /hurd/pfinet --help + +As there can be a lot of output, consider piping this through a pager. diff --git a/hurd/status.mdwn b/hurd/status.mdwn new file mode 100644 index 00000000..721cdeda --- /dev/null +++ b/hurd/status.mdwn @@ -0,0 +1,108 @@ +[[!meta copyright="Copyright © 2001, 2002, 2007, 2008, 2009, 2010 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]]."]]"""]] + +The Hurd, together with the GNU Mach microkernel, the GNU C Library +and the other GNU and non-GNU programs in the GNU system, provide a +rather complete and usable operating system today. It may not be ready +for production use, as there are still many bugs and missing features. +However, it should be a good base for further development and +non-critical application usage. + +[[!img hurd-fvwm-screenshot-2009-11-12.png size=300x +alt="FVWM and Gnumeric running on GNU/Hurd" +title="FVWM and Gnumeric running on GNU/Hurd" +align="right" + +]] The GNU system (also called GNU/Hurd) is completely self-contained +(you can compile all parts of it using GNU itself). You can run +several instances of the Hurd in parallel, and debug even critical +servers in one Hurd instance with gdb running on another Hurd +instance. You can run the X window system, applications that use it, +and advanced server applications like the Apache webserver. + + +On the negative side, the support for character devices (like sound +cards) and other hardware is mostly missing. Although the POSIX +interface is provided, some additional interfaces like POSIX shared +memory or semaphores are still under development. + +All this applies to the current development version, and not to the +last release (0.2). We encourage everybody who is interested to try +out the latest development version, and send feedback to the Hurd +developers. + + +The Hurd team doesn't create Hurd-only releases, but instead relies +on a distribution done by folks from *Debian*. + +That Debian version closely tracks the progress of the Hurd +(and often includes many new features), +so little would be gained by creating an official pure Hurd release. + +The Debian GNU/Hurd [[distribution|running/debian]] offers *LiveCDs and QEMU images* +to test-drive the Hurd in a real life system with access to about +65% of the Debian software archive. + +The most recent version of the Debian port at the time of writing +is *Debian GNU/Hurd L1*. + + +That said, the last official release of the Hurd +without the Debian parts was 0.2 done in 1997. + +New official releases will be done, as soon as +the Hurd is sufficently stable and feature +complete. If an official release of the Hurd were made +now, people would try the Hurd and be disappointed. People +already expect delays; to disappoint them in this way as +well would be unfortunate. Moreover, it would lessen the +possibility that they would want to try the Hurd again in the future. + + +## Usability Reports + +### Olaf Buddenhagen, 2009-06-09 + +> I have been using the Hurd for most of my everyday work for some two +> years now. Most of the time it's pretty OK, but occasionally programs +> crash, or the screen session dies, or even the whole system. Also, +> various programs simply don't work at all, or don't work in certain +> situations. +> +> While I have learned to work around many of these issues, I don't +> believe I would be able to use it as my primary system, without having a +> GNU/Linux system running in parallel, as a fallback for all the stuff +> that doesn't work on the Hurd. +> +> My everyday work includes reading/writing email and other texts, preparing and giving +> presentations, text-mode web browsing, viewing pictures, IRC, reading +> PDF documents, programming, and various other random stuff... +> +> [...] +> +> One particular problem for desktop use is the fact that while X does +> work, it works very poorly -- it's not only slow and jerky all the time, +> but also tends to lock up completely. (At least with the local socket +> transport... Haven't tried whether forcing TCP works better.) +> +> Note that while many of the stability problems are simply bugs to fix, +> the system will still be very fragile in the absence of these -- a +> simple port leak is sufficient to kill it within seconds. This is +> something that can't be easily solved. Properly fixing this will require +> a sound resource accounting framework, i.e. very fundamental changes to +> the system... Though I tend to believe that it could be improved at +> least partially, at the expense of flexibility, by enforcing certain +> fixed limits on users, processes etc. like other UNIX systems do. +> +> [...] +> +> [But] unlike a few years back [...] the system is stable enough under +> load nowadays [...]. diff --git a/hurd/status/hurd-fvwm-screenshot-2009-11-12.png b/hurd/status/hurd-fvwm-screenshot-2009-11-12.png Binary files differnew file mode 100644 index 00000000..445abf32 --- /dev/null +++ b/hurd/status/hurd-fvwm-screenshot-2009-11-12.png diff --git a/hurd/subhurd.mdwn b/hurd/subhurd.mdwn index 5256a70b..84372dd1 100644 --- a/hurd/subhurd.mdwn +++ b/hurd/subhurd.mdwn @@ -1,19 +1,13 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. - -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!meta copyright="Copyright © 2007, 2008, 2010 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]]."]]"""]] A sub-Hurd is like a [[neighbor_Hurd|neighborhurd]], however, makes use of some resources provided by another Hurd. For instance, backing store and the @@ -24,7 +18,8 @@ attach to them with gdb from the parent ([[debugging_via_subhurds|debugging/subhurd]]). This avoids deadlock, e.g., when the instance of gdb stops the server but requires its use. (Note: it is possible to use [[debugging/gdb/noninvasive_debugging]], but this is less -flexible.) +flexible.) Vice versa, it is also possible to use a subhurd to debug the +*main* Hurd system, for example, the latter's root file system. # Howto @@ -112,9 +107,9 @@ inside the subhurd, or to `ssh` directly into the subhurd. If you want to access the subhurd processes from the outside, e.g. for [[debugging_purposes|debugging/subhurd]] (or to get rid of a subhurd that -didn't exit cleanly...), you need to find out how main Hurd PIDs correspond to +didn't exit cleanly...), you need to find out how main Hurd [[PID]]s correspond to subhurd processes: the subhurd processes appear in the main Hurd (e.g. if doing -`ps -e`) as unknown processes, and vice versa, but the PIDs are different! To +`ps -e`) as unknown processes, and vice versa, but the [[PID]]s are different! To find out which process is which, you can simply compare the order -- while the numbers are different, the order should usually match. Often it also helps to look at the number of threads (e.g. using `ps -l`), as many servers have very @@ -125,5 +120,21 @@ characteristic thread counts. Read about using a subhurd for [[debugging_purposes|debugging/subhurd]]. -Roland's [tutorial](http://www.gnu.org/software/hurd/howto/subhurd.html) on -setting up sub-hurds. +Roland's tutorial about [[running_a_subhurd]]. + + +# Use Cases + +## Debugging the *Main* Hurd System + +A subhurd can be used for debugging the *main* Hurd system. This works as long +as the subhurd doesn't use any services provided by the main Hurd. For +example, if you already have a subhurd running at the time it happens, you can +use that one to debug a deadlocked [[translator/ext2fs]] root file system in +the *main* Hurd. + +For this, you need to get a handle to the main Hurd's [[ext2fs +translator|translator/ext2fs]]'s [[PID]], but this is no problem, as currently +[[PID]]s are visible across subhurd boundaries. (It is a [[!taglink +open_issue_hurd]] whether this is the right thing to do in +[[open_issues/virtualization]] contexts, but that's how it currently is.) diff --git a/hurd/subhurd/running_a_subhurd.mdwn b/hurd/subhurd/running_a_subhurd.mdwn new file mode 100644 index 00000000..f337108e --- /dev/null +++ b/hurd/subhurd/running_a_subhurd.mdwn @@ -0,0 +1,42 @@ +[[!meta copyright="Copyright © 1998, 1999, 2007, 2008 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]]."]]"""]] + +[[!meta title="Running a Subhurd"]] + +By Roland McGrath. + +The most useful thing you can do when trying to troubleshoot the boot +sequence of the Hurd is try to run your the system in a +sub-hurd, while watching it using ps and gdb from the working hurd. Since +the sub-hurd is never going to make it all the way up, you don't even +really need to make a separate filesystem for it; you can just boot the +sub-hurd read-only on your main root filesystem if you like. + +The way to boot the sub-hurd is with `boot`. I would suggest something +like this: + + boot -d -I -Tdevice /boot/servers.boot hd0s6 + +The -d says to pause before the start-up of each server and wait for you to +hit return, which gives you time to go attach gdb to the task before it +starts running. The -I says to leave the terminal signals normal, so +hitting C-z will suspend boot rather than sending a C-z to the virtual +console device of the sub-hurd. (Note that suspending boot does not +suspend the sub-hurd, just boot itself; boot acts as the server for device +access from the sub-hurd, so the sub-hurd's attempts to write to its +console or open devices block while boot is suspended.) + +When you do `ps -A` on the main hurd, the sub-hurd tasks will appear as +unknown processes. You can figure out which is which just by looking at +the order of unknown processes that appear with higher PIDs than the boot +process. They appear in the order you see in the "bootstrap: ..." +messages, i.e. the first unknown after boot will be ext2fs.static, the +second exec, then init, then proc. diff --git a/hurd/syncfs.mdwn b/hurd/syncfs.mdwn new file mode 100644 index 00000000..7099a68d --- /dev/null +++ b/hurd/syncfs.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +`syncfs` is a tiny wrapper around the [[`file_syncfs` +RPC|interface/file_syncfs]]. + +Its functionality should me merged into GNU coreutils' `sync` program, see +[[!GNU_Savannah_task 6614]][[!tag open_issue_hurd open_issue_porting]]. diff --git a/hurd/todo.mdwn b/hurd/todo.mdwn deleted file mode 100644 index 2d65f0c8..00000000 --- a/hurd/todo.mdwn +++ /dev/null @@ -1,115 +0,0 @@ -For how best to contribte, see [[contributing]]. - -This todo is primarily targetted at the Hurd proper -and applications that rely on the Hurd interfaces. - -The canonical TODOs from the CVS archive: - -* [TODO file](http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/hurd/hurd/TODO?rev=HEAD&content-type=text/plain) -* [Task file](http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/hurd/hurd/tasks?rev=HEAD&content-type=text/plain) - -* psmisc - -The tools provided by the psmisc package are linux centric. Killall and pstree, for instance, require Linux's proc file system but could just as easily use Hurd's libps. - -* tmpfs -* ppp -* unionfs/stowfs -* supermount translator - -Related: [[KnownHurdLimits]] - -From Marcus, 2002: - -* xkb driver for console (for international users) -* kbd leds in console (well, in general, Roland's new driver in oskit for that crap) -* fixing fakeroot (it's buggy) -* fixing tmpfs (it's buggy, Neal says it's Mach's fault) -* adding posix shared memory (requires the io\_close call to be implemented) -* adding posix file locking (requires the io\_close call to be implemented) -* testing - * find + various filesystems (are inode numbers for . and .. sane?) - * ext2fs with other block sizes than 4096 - * --help and --version and --usage in all programs - * I have seen ^V in some --help output, might be argp bug - * Verify that all options are documented clearly, and that no unimplemented options appear - * Is the short and long description in the help output correct? - * Is the return value of all programs correct (eg, does main() return a sane value) - * Is the suid bit correctly set for all installed programs? - * Translators - * Does settrans -g work? -fg? - * Does fsysopts work? Does setting options with fsysopts work? - * Does stat() work on all translated nodes and give proper data? - * What about chown, chmod (some translators should pass this through to the underlying node, esp in /dev!) - * Does statfs give correct data? - * Are all inode numbers and link counts correct? -* We also should have a "make check" test suite. We can add this once Jeff finished his automake patches -* pick up the other things - * pthread, definitely. Now that we are so close - * new console is basically done - * needs integration of course - * X switching support -* there is certainly more to do ... - -Wolfgang list of [Easy tasks](http://mail.gnu.org/pipermail/help-hurd/2002-July/006413.html) on July 28, 2002: - -<table border="1" cellpadding="1" cellspacing="0"> - <tr> - <th bgcolor="#99CCCC"><strong>Difficulty</strong></th> - <th bgcolor="#99CCCC"><strong>Task</strong></th> - </tr> - <tr> - <td> 0 </td> - <td> Check if all programs handle options (at least --help, --version and --usage; don't forget about the shell scripts) </td> - </tr> - <tr> - <td> 1 </td> - <td> Check if all translators handle fsysopts </td> - </tr> - <tr> - <td> 1 </td> - <td> Check if all translators respond to "settrans -g" </td> - </tr> - <tr> - <td> 1 </td> - <td> More tests of this kind </td> - </tr> - <tr> - <td> 2 </td> - <td> Fix those of the above who don't work as intended </td> - </tr> - <tr> - <td> 2 </td> - <td> Document (in doc/hurd.texi) all undocumented programs (translators as well as programs in utils/ and sutils/ and some others) </td> - </tr> - <tr> - <td> 1 </td> - <td> Find a POSIX test suite, run it on GNU/Hurd, report the results </td> - </tr> - <tr> - <td> 1 </td> - <td> Find more useful test suites to run </td> - </tr> - <tr> - <td> 3 </td> - <td> Update INSTALL-cross </td> - </tr> - <tr> - <td> 2 </td> - <td> Check if all the store classes in libstore work (we have many of them, look into the Makefile) </td> - </tr> - <tr> - <td> 4 </td> - <td> Fix those who don't work </td> - </tr> - <tr> - <td> 2 </td> - <td> Document all still undocumented store classes </td> - </tr> - <tr> - <td> 2 </td> - <td> The console is pretty new code, it told me it wants to get tested </td> - </tr> -</table> - -Where difficulty 0 means trivial and 4 means tricky; the difficulty has nothing to do with the importance. diff --git a/hurd/toolchain.mdwn b/hurd/toolchain.mdwn new file mode 100644 index 00000000..91d49b2c --- /dev/null +++ b/hurd/toolchain.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +[[!meta redir=/toolchain]] diff --git a/hurd/translator.mdwn b/hurd/translator.mdwn index 645f05ca..9e109a28 100644 --- a/hurd/translator.mdwn +++ b/hurd/translator.mdwn @@ -1,19 +1,13 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. - -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!meta copyright="Copyright © 2007, 2008, 2009, 2010 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]]."]]"""]] A translator is simply a normal program acting as an object server and participating in the Hurd's @@ -24,21 +18,128 @@ and [[pfinet]]) and thus translates object invocations into calls appropriate for the backing store (e.g., ext2 file system, nfs server, etc.). +Another way of putting it is that it translates from one representation of a +data structure into another representation, for example from the on-disk +[[ext2|ext2fs]] data layout to a traditional file system hierarchy, or from a +XML file to a virtual hierarchical manifestation. This translation can be a +bidirectional process, but it need not be. + +A translator is usually registered with a specific file system node by using +the [[`settrans`|settrans]] command. + Translators do not require any special privilege to run. The privilege they require is simply that to access the indiviudal resources they use. This is primarily the [[backing_store]] and the node they attach to. Typically, a translator can only be attached to a node by the node's owner. -On Unix this is not possible because file systems +On [[Unix]] this is not possible because file systems and the virtual file system are implemented in the kernel and thus have absolute access to the machine. As the protocols do not require any special privilege to implement, this is not an issue on the Hurd. -<!-- Browse through a [[list_of_Hurd_translators|translators]]. --> -<!-- Doesn't exist yet. Perhaps one of the old pages could be used? --tschwinge --> +In Mach parlance, a *translator* is what they name a *server*: a process that +participates in [[RPC]] interactions. In the Hurd, a translator is a server +that is additionally attached to a filesystem node. Thus, it is quite common, +even in the Hurd context, to speak about *server*s if you're stressing the RPC +part, and on the other hand about *translator*s if you're stressing the +filesystem part: a translator implements the [[interface/fs]] and +[[interface/io]] interfaces. For example: *the [[pfinet]] server implements +the socket API calls (which are mapped by [[glibc]] to equivalent RPC calls)*, +compared to *a [[libdiskfs]]-based translator implements a filesystem, based on +a backing store*. To learn how to write a translator, read the code! It is well documented, in particular, the header files. The [[Hurd_Hacking_Guide]] also has a tutorial. + +Also there is an [[writing/example]] about how to write a simple translator. + +See some [[examples]] about how to use translators. + +Marcus Brinkmann has written a document about [[documentation/translators]]. + +Here are some [[hints_about_debugging_translators|debugging/translator]] +available. + +Read about translator [[short-circuiting]]. + + +# Existing Translators + +* [[auth]] +* [[exec]] +* [[pfinet]] +* [[pflocal]] +* [[hostmux]] +* [[storeio]] +* [[ext2fs]] +* [[fatfs]] +* [[magic]] +* [[unionfs]] +* [[nfs]] +* ... + + +# Translators Being Under Development + +* [[random]] +* [[emailfs]] -- email as a filesystem +* [[cvsfs]] +* [[tmpfs]] +* [[procfs]] +* [[nsmux]] +* [[netio]] +* [[tarfs]] +* [[gopherfs]] +* ... + +# Translators (only) in Hurdextras + +*These Translators are available in the [hurdextras repository](http://savannah.nongnu.org/cvs/?group=hurdextras) but not yet described on this website. They are in varying stages of Development.* + +* [jfs](http://www.nongnu.org/hurdextras/#jfs) +* [httpfs](http://www.nongnu.org/hurdextras/#httpfs) +* [gopherfs](http://www.nongnu.org/hurdextras/#cvsfs) +* [memfs](http://www.nongnu.org/hurdextras/#gopherfs) +* [notice](http://www.nongnu.org/hurdextras/#notice) +* [pith](http://www.nongnu.org/hurdextras/#pith) +* [pptop](http://www.nongnu.org/hurdextras/#pptop) +* [run](http://www.nongnu.org/hurdextras/#run) +* [smbfs](http://www.nongnu.org/hurdextras/#smbfs) +* [xmlfs](http://www.nongnu.org/hurdextras/#xmlfs) +* [mboxfs](http://www.nongnu.org/hurdextras/#mboxfs) + + +# Translator Wishlists + + * [[wishlist_1]] + * [[wishlist_2]] + * [[open_issues/network_file_system_by_just_forwarding_RPCs]] + * [[libguestfs]] + + +# Internally + +## `*_demuxer` Functions + + * IRC, unknown channel, unknown date + + <jim-crow> what is a main idea of _demuxer functions in translators? + <neal> jim-crow: Think of a web server. + <neal> jim-crow: A typical web server must process many different requests. + <neal> jim-crow: There are different types of requests. + <neal> jim-crow: For instance, static pages and dynamically gnereated content. + <neal> the static pages are processed by one function + <neal> and the dynamic pages by another + <neal> the thing that makes the decision which of these functions to pass the request to is the demuxer. + <jim-crow> neal: ok, I see + <jim-crow> but what is actually it doing in trivfs_demuxer? + <neal> it looks at the message id and calls the right server stub + <jim-crow> for example it calls trivfs_io_server function, but I can't find its implementation + <jim-crow> that's my main question :-) + <neal> look at the files mig generates + <jim-crow> neal: ok, thanks + <jim-crow> neal: is this functions where actually stubs are called? + <neal> I think so. diff --git a/hurd/translator/auth.mdwn b/hurd/translator/auth.mdwn new file mode 100644 index 00000000..d9e70ec2 --- /dev/null +++ b/hurd/translator/auth.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + +[[*The_Authentication_Server*|documentation/auth]], the transcript of a talk +about the details of the authentication mechanisms in the Hurd by Wolfgang +Jährling. diff --git a/hurd/translator/cvsfs.mdwn b/hurd/translator/cvsfs.mdwn new file mode 100644 index 00000000..f5f1a9e0 --- /dev/null +++ b/hurd/translator/cvsfs.mdwn @@ -0,0 +1,52 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +## Setting up cvsfs on GNU/Hurd - A step by step process + +### Description of cvsfs + +cvsfs is a virtual ([[libnetfs]] based) filesystem allowing you to mount +remotely located CVS modules into your local filesystem. The version +controlled files will appear to you just like regular ones. If you just want +to view one file (or a small bunch) you furthermore save a lot of network +bandwidth since only these files will be downloaded. The usual way to do so +would be to check out the whole tree and deleting it after using. + +## Step by Step process in installing cvsfs + +Download and prepare the source files from the CVS repositiory and build them. + + $ cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/hurdextras co cvsfs + $ cd cvsfs/ + $ autoreconf -i + $ ./configure + $ make + $ make install + +Set up the translator and start grazing. + + $ mkdir -p cvsfs_test + $ settrans -a cvsfs_test /hurd/cvsfs cvs.sourceforge.net /cvsroot/projectname modulename + +Example to mount the cvsfs module on hurdextras to a local directory. + + $ mkdir cvs.d + $ settrans -ac cvs.d/cvsfs /hurd/cvsfs cvs.savannah.nongnu.org sources/hurdextras cvsfs + +Now change to that directory and start using ls, emacs, and whatever you feel +like. :-) + +Happy Hacking. + + +## References + + * <http://www.nongnu.org/hurdextras/> + * <http://cvs.sv.nongnu.org/viewcvs/*checkout*/cvsfs/README?root=hurdextras> diff --git a/hurd/translator/devfs.mdwn b/hurd/translator/devfs.mdwn new file mode 100644 index 00000000..27df23aa --- /dev/null +++ b/hurd/translator/devfs.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +`devfs` is a translator sitting on `/dev` and providing what is to be provided +in there in a dynamic fashion -- as compared to static passive translator +settings as they're used now. + +`devfs` has not yet been written. + +--- + +If applicable, it has to be taken care that all code concerning the page-in +path is resident at all times. diff --git a/hurd/translator/emailfs.mdwn b/hurd/translator/emailfs.mdwn new file mode 100644 index 00000000..80e2b150 --- /dev/null +++ b/hurd/translator/emailfs.mdwn @@ -0,0 +1,287 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +# How cool it would be if the email becomes similar to snail mail? + +## Let see how the snail mail works + +* You write the letter with a pen and paper +* You write the "To" address +* Post it -> Put it in a Post Box + +## How Email works + +* You have your email client (and there comes the limitation, you can't use + your favourite editor) +* Fill in destination email address +* Send it (May be a send button or a keyboard shortcut) + +## What are the problems + +If you want to use a wordprocessor for sending email, it should implement a +feature like mail merge, suppose it doesn't have such a feature then? You copy +and paste it to your email client and if it doesn't support HTML? Well you have +work arounds for all these, but how cool it would be if you have something like +this: + +* You create a file, use any wordprocessor or text editor. +* Right click and see the properties +* Set the "To" field +* Drag it to the Post Box icon on your panel next to Trash + +## How can we implement it? + +An SMTP translator which uses extended atributes + +## Comments + +IRC Logs about the discussion on #hurd + +<!-- That smileys are rendered the wrong way below is a ikiwiki bug. --> + +>>>>>>> 5384ccd0a47e900fbdae993143110538248517a2:emailfs.mdwn + + <manuel>j4v4m4n: isn't the HHG a good enough libtrivfs tutorial? + <manuel> the problem I have with mail, blog, ..., translators is that you want to save mails before sending them, so you can't edit directly into the translator + <j4v4m4n> manuel, may be we want a simpler one, all of us are beginners except AB + <manuel> they're not stream-based so unless you save it into memory and wait for "sync" to send mails, it doesn't seem well suited + <manuel> who's AB? + <j4v4m4n> manuel, create any file with your favourite editor and copy it to the directory where SMTP translator is sitting + <j4v4m4n> manuel, Anand Babu + <manuel> sure, but how is that better than sending it via the "mail" command then? + <manuel> except it's less hype, of course. + <j4v4m4n> manuel, http://savannah.gnu.org/users/ab + <j4v4m4n> manuel, it would be cool :-) + <manuel> still not convinced :) + * schlesix (n=thomas@xdsl-81-173-230-219.netcologne.de) has joined #hurd + <j4v4m4n> manuel, set up SMTP translator on the desktop and may be add it next to the Trash :-) + <j4v4m4n> manuel, have a nice postbox icon + <j4v4m4n> manuel, drag your files to it + <j4v4m4n> manuel, it would be closer to the real world and snail mail + <bvk> j4v4m4n: To whom do they go? + <manuel> bvk: the file must be preformatted, probably + <j4v4m4n> bvk, in snail mail you will write to address on top of the envelop, right? + <manuel> j4v4m4n: yeah well, it could make sense in a desktop envronment + <j4v4m4n> bvk, here we can have it as the first line of the file + <manuel> not sure + <bvk> j4v4m4n: i never used snail :( + <j4v4m4n> manuel, that is what I have in mind + * j4v4m4n like snail mail that email + <manuel> bvk: you never sent a mail via snail mail?! :) + * j4v4m4n like snail mail more than email + <bvk> manuel: nope :( whats that btw? + <j4v4m4n> manuel, or why not have it as the file property itself?? + <bvk> manuel: you know its first time i hear it *snail mail* :(( + <j4v4m4n> bvk, the normal mails which a postman delivers :-) + <j4v4m4n> manuel, you create a file text, open document or whatver format + <manuel> j4v4m4n: I'm quite sure it'd make things more complicated in the end, using file properties, dragging files etc. + <j4v4m4n> manuel, righ click and see properties and set the to field + <bvk> Oh, these english words... :X + <j4v4m4n> manuel, we can use the xtended atributes + <j4v4m4n> manuel, which really showcase the power of hurd + <j4v4m4n> manuel, it becomes closer to the real world + <bvk> actually, is X working on hurd? + <j4v4m4n> bvk, well it used to work and the new Xorg release has som + <j4v4m4n> bvk, well it used to work and the new Xorg release has some broken packages + <j4v4m4n> bvk, if you use an old snapshot repository it will work (xorg 6.9) + * marco_g (n=marco@gnu/the-hurd/marco) has joined #hurd + <marco_g> hi + <j4v4m4n> marco_g, hi + * bvk watching MIT lecture video on 'structure and interpretation of computer programs' + <manuel> bvk: yeah, X was ported on GNU/Hurd five-six years ago or so + <j4v4m4n> manuel, see http://hurd.in/bin/view/Main/EmailFS + <j4v4m4n> manuel, add your comments, if you like + <manuel> j4v4m4n: how would you convert the .odt to a mail? + <j4v4m4n> manuel, attachment + <manuel> with an empty mail? + <manuel> that won't get through *most* spam filters :) + <j4v4m4n> manuel, or may be convert it to HTML + <manuel> well converting it to text or HTML would require a set of rules to convert from any format to text/HTML, like a2ps has (some sort of mailcap file) + <j4v4m4n> manuel, it can be flexible, a parameter to the translator as to what should be done with each formats + <manuel> and there's no convenient way to convert ODT to text AFAIK, you need to use ooffice with a batch program, which you need to provide too + <manuel> well that's really complex + <j4v4m4n> manuel, well how will you send me a CD by post? + <j4v4m4n> manuel, or say a bed? + <j4v4m4n> manuel, courier or parcel, right? so attachment is fine + <manuel> sure but you'll add a note saying "this is a bed from Praveen" + <ness> why not add a note to such a mail + <ness> you could even move multiple files simultaneously to the mail translator + <manuel> hm + <manuel> so how is the translator supposed to know that all the files I move are to be sent in a single mail and not on separate mails? + <manuel> and how'll you be able to add a note to such a mail? I mean, of course you can set it on the xattr but that's quite strange (the attachment is supposed to be an attr of the mail, not the other way) and not convenient at all + <manuel> I'm quite sure using a MUA is still easier + <ness> you could move a complete directory to the mail trans + <ness> (and the desktop icon can do this transparently) + <manuel> hmm so you have to create a directory, write a text file on it (with a special filename, I guess, since you could also have text files as attachments) and add the attachments to the directory + <manuel> and then drag & drop it + * manuel thinks things are getting more and more complicated :) + <ness> the special file name or attribute thing is right + <ness> but you not necisirily need to create a dir + <ness> s/necisirily/necessarily/ + <ness> you just drag 'n' drop multiple files to the icon + <manuel> and how is the translator supposed to know they are dragged at the same time and not one after the other? + <ness> I do not know if it is viable + * antrik (n=olaf@port-212-202-210-130.dynamic.qsc.de) has joined #hurd + <manuel> AFACS, dragging multiple files just make the desktop issue multiple rename() + <moritz> manuel: however the desktop handles that - it would be a rather easy thing to fix, i guess. + * schlesix has quit (Remote closed the connection) + <manuel> moritz: how is the desktop supposed to handle that? + <moritz> if this mail translator approach, is primarily to be used in desktop environments, one could implement the whole thing on the desktop environment layer, not with Hurd translators. + <moritz> manuel: i think it would be rather easy for the desktop to distinguish between actions like "ONE file is dragged" and "MULTIPLE files are dragged". + * schlesix (n=schlesix@xdsl-81-173-230-219.netcologne.de) has joined #hurd + <manuel> oh yeah, but then you loose the transparency, and there's no point in making it a translator. I think we agree on that :) + <moritz> i see rather little point in making it a translator anyway, since only god knows wether we have similar concept to translators in hurd-ng. + <manuel> yeah sure, but praveen wasn't planning it for HurdNG AIUI + <moritz> in that case it would probably be toy project. fine. + <moritz> i need to do some maths. see you. + <manuel> hmm well, you can't write anything else than toy projects, then + <ness> moritz: you shouldn't be too sure about success of ngHurg + <ness> it is an experiment + <antrik> sdschulze: ping + * antrik has quit (Remote closed the connection) + * antrik (n=olaf@port-212-202-210-130.dynamic.qsc.de) has joined #hurd + * bddebian (n=bdefrees@71.224.172.103) has joined #hurd + <j4v4m4n> manuel, This is a lot of input, let me sink these all first :-) + <bddebian> Heya folks + <schlesix> heya bddebian! + <j4v4m4n> it is ofcoures a "nice to have" feature. + <j4v4m4n> These are quite intersting inputs as well + <bddebian> Hi schlesix + <j4v4m4n> manual in the real wprld how will you send multiple things, say you want to send a CD and a bed + <j4v4m4n> manuel, you will package it (files) and then one parcel containing all these things (folder) + <manuel> j4v4m4n: well you want to make sending emails easier than sending real mails :-) + <j4v4m4n> manuel, it won't substitute MUAs + <j4v4m4n> manuel, we need it as the backend + <diocles> geekoe: You asked about GFS yesterday; well, glibc compiled. :) I've not done much more after that. + <antrik> regarding mail translator: take a look at Plan9, they have been doing it for years + <j4v4m4n> manuel, sorry not MUA I meant MTA + * syamajala (n=syamajal@c-24-147-61-120.hsd1.ma.comcast.net) has joined #hurd + <manuel> ah yes sure, but MUA will still be easier to use afaics + <j4v4m4n> manuel, people who are used to Windows say GNU/Linux is tough to use + <j4v4m4n> manuel, but when they start with GNOME or KDE they don't have any issues + <j4v4m4n> antrik, that is a great info I will look into it + <j4v4m4n> manuel, sorry not MUA I meant MTA + * syamajala (n=syamajal@c-24-147-61-120.hsd1.ma.comcast.net) has joined #hurd + <manuel> ah yes sure, but MUA will still be easier to use afaics + <j4v4m4n> manuel, people who are used to Windows say GNU/Linux is tough to use + <j4v4m4n> manuel, but when they start with GNOME or KDE they don't have any issues + <j4v4m4n> antrik, that is a great info I will look into it + <ness> j4v4m4n: they do it quite differently + <manuel> this doesn't answer to the basic question: how is it better than what we have now + <j4v4m4n> manuel, it is different, better is always debatable + <j4v4m4n> manuel, GNOME might work for but some doesn't use X at all + <j4v4m4n> manuel, whether it is good will be depending on the implemetation + <Jeroen> people who used to GNU/Linux say Windows is tough to use + <Jeroen> +are + <unlink> GNU/Linux is at least tougher to say + <Jeroen> no, people have less experience with GNU/Linux + <manuel> "to say", Jeroen + <j4v4m4n> manuel, better and easier are always relative + <j4v4m4n> manuel, there a lot of people still using mutt when you have thunderbird + <manuel> well because they have reasons to say mutt is easier than thunderbird + <Jeroen> the only thing is that you've to learn a few shortcuts when you want to use mutt, you can't just click around + <j4v4m4n> manuel, exactly + <j4v4m4n> manuel, consider this, you want to send a document across to someone + * Blackmore has quit (Read error: 104 (Connection reset by peer)) + * koollman has quit (Remote closed the connection) + <j4v4m4n> manuel, now you open a MUA add the attachment send it + * koollman (n=samson_t@gsv95-1-82-233-13-27.fbx.proxad.net) has joined #hurd + <j4v4m4n> manuel, if you just have to drag it to an icon, would that be easier? + * Casanova (n=prash@unaffiliated/casanova) has joined #hurd + <j4v4m4n> manuel, chmod +to:manuel@somehost doc.pdf ; cp doc.pdf postbox/ + <Jeroen> yeah + <Jeroen> chmod is for setting permissions... + <j4v4m4n> manuel, I am not sure how to set xattr + <manuel> well, setfattr + <Jeroen> well + <j4v4m4n> manuel, ok + <Jeroen> how do you type your subject? + <Jeroen> and there message itself? + <Jeroen> s/there/the/ + <Jeroen> how do you encrypt+sign it with pgp? + <manuel> j4v4m4n: well the problem is still the same you know. OK for to/subject : they'd be extended attributes. but how do you type the message itself? + <antrik> I don't think using xattr for such stuff is a good idea + <antrik> after all, it's not a property of the document + <j4v4m4n> antrik, we can use it only on a particular directory on which our translator sit + <j4v4m4n> manuel, create a folder + <manuel> that'd mean mkdir message; ln -s doc.pdf message/; cat >message/message <<EOF; setfattr -n to -v mmenal@hurdfr.org; setfattr -n subject -v document; mv message postbox + <antrik> the reason why having translators for such stuff is that this way you have a generic service for sending mail, whether you use it through a special UI (MUA), directly with file commands, from a script, or from some other program that just sends mails as a side functionality + * mheath has quit (Connection reset by peer) + <j4v4m4n> manuel, that looks scary :-( + <manuel> not sure it's easier than "mutt; m; mmenal@hurdfr.org; document; >typing the message<; a; doc.pdf; y" + <antrik> manuel: it is easier in some situations + <antrik> (and again, I would not use xattr for such stuff) + <j4v4m4n> manuel, now how do you use mutt on GNOME? + <antrik> in fact, Plan9 explicitely does *not* have any xattr and stuff + <manuel> antrik: well xattr on the directory that represents the message is not illogical + * mheath (n=mheath@c-67-182-231-23.hsd1.co.comcast.net) has joined #hurd + <j4v4m4n> antrik, may be we can think of some other way if you don't wanna xattr + <manuel> j4v4m4n: well I just used the CLI because it's easier to describe, but try to explain the steps in a GUI and you'll see it's the same problem + <j4v4m4n> manuel, right click on desktop -> create folder -> drag the files to the folder -> set attributes to the folder-> drag it to postbox + <j4v4m4n> manuel, it is quite logical step + <manuel> sure, but how is it easier than click on the MUA icon -> create mail -> drag the files to the mail window ; type the attrbutes + contents ; click on send mail + <manuel> looks quite similar to me :-) + <j4v4m4n> manuel, or if you already have the folder just drag it + <kilobug> a POP or IMAP translator would be more useful IMHO (but well, I didn't read all the backlog, so I may be off topic) + <j4v4m4n> manuel, you don't have a MUA here :-) just files and folders + <kilobug> to read mails, I mean + <j4v4m4n> kilobug, that is even easier IMAP->mabox and then mboxfs + <manuel> j4v4m4n: well you have a MUA : that's the translator + <j4v4m4n> kilobug, mboxfs is already available + <j4v4m4n> kilobug, I think someone already wrote IMAP to mbox as well but couldn't find it + <kilobug> j4v4m4n: well, imapfs could work both way, writing changes on the imap server too ;) + <antrik> manuel: the difference is not how it is used; the difference is how it is implemented + <antrik> manuel: if you have a generic mail translator, you have most functionality already there with the file manager; all you need to add is some scripts for better comfort + <antrik> j4v4m4n: the way I would do it (and I guess Plan9 does, though I haven't checked) is either having a file in the mail directory with the headers, or a subdirectory with a single file for each header (probably the latter) + <j4v4m4n> antrik, that would make it too complicated IMHO, it would be close to how it is for snail mail + <antrik> j4v4m4n: I don't see how this would be more complicated than xattr + <j4v4m4n> manuel, you can write your own scripts to automate it for whatver way you want + * azor (n=azor@62-43-135-201.user.ono.com) has joined #hurd + <manuel> antrik: having the functionality in the filesystem is useful because programs can use this functionality without patching; the protocol to use the mail translator is so specific that you either need to be a real user (but then a MUA is a lot more useful) or have a patched program (but then you could use a lib) + <j4v4m4n> antrik, right clicking a file and setting u p to and subject seems easier that creating more files + <antrik> j4v4m4n: I don't think so. maybe it is in gnome, but than I'd consider it a shortcoming of gnome + <antrik> j4v4m4n: in shell "cat foo@example.invalid headers/to" is about as simple as you can get + <manuel> > + <antrik> erm... I mean echo + <antrik> and >, yes + <antrik> sorry + * yoj (n=jao@200.163.8.72) has joined #hurd + <manuel> "echo foo@example.invalid > headers/to" is not easier than "setfattr -n to -v foo@example.invalid" AFAICS. + <antrik> echo foo@example.invalid >headers/to + * yoj (n=jao@200.163.8.72) has left #hurd + * yoj (n=jao@200.163.8.72) has joined #hurd + <kilobug> manuel: it is a tiny bit if your "foo@example.invalid" is the output of a command, mycomplexcommand > headers/to is a bit easier than setfattr -n to -v `mycomplexcommand` + <kilobug> manuel: but it's the same for a value you type directly + <antrik> manuel: objectively it is not simpler, but it uses a generic mechanism users now well, instead of obscure xattr stuff + <antrik> know well + <j4v4m4n> antrik, ok we can think of that, but how about a desktop user? + abeaumont andar antrik arnau azeem azor + <j4v4m4n> antrik, he has to use more clicks and more head aches + <j4v4m4n> antrik, just right click and add to address and subject just you write on the envelop + <kilobug> j4v4m4n: that's good ! it makes him buy more medicine, drug corporations will sponsor you then ! + * kilobug runs away + * j4v4m4n chases kilobug + <j4v4m4n> kilobug, better way would be making outlook run on GNU :-) + <marco_g> Or GNU on outlook \o/ + * yoj (n=jao@200.163.8.72) has left #hurd + <kilobug> this channel is becoming insnae :p + <j4v4m4n> kilobug, or is it the members ?? :-) + <marco_g> I agree with kilobug, we should stop those weirdos here :-/ + * whr` (i=whr@acy238.neoplus.adsl.tpnet.pl) has joined #hurd + <antrik> hm... anyone have the marcus quote at hand? + <j4v4m4n> i got to go as well + <j4v4m4n> bye + <kilobug> bye j4v4m4n + +## Interesting?? + +Join the project -- Add yourself to the list below + +* [[Praveen A]] diff --git a/hurd/translator/examples.mdwn b/hurd/translator/examples.mdwn new file mode 100644 index 00000000..ee766fbf --- /dev/null +++ b/hurd/translator/examples.mdwn @@ -0,0 +1,93 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +## Setting up translators - HowTo + +Translators can be got from hurd-extras <http://www.nongnu.org/hurdextras/> + + cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/hurdextras co <modulename> + +* httpfs translator + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -a tmp/ /hurd/httpfs www.hurd-project.com/ + +or + + $ settrans -a tmp/ /hurd/httpfs www.hurd-project.com/ --proxy=<proxy> --port=<port> + $ cd tmp/ + $ ls -l + +* ftpfs translator + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -cgap ftp /hurd/hostmux /hurd/ftpfs / + $ cd ftp + ftp$ ls + ftp$ cd ftp.fr.debian.org + ftp/ftp.fr.debian.org $ ls + +* tarfs translator (needs uatime fix, 2010-08-25 → [git repo](http://github.com/giselher/tarfs)) + +You can use tarfs to mount (almost) any tar file (currently broken, 2010-08-25): + + $ settrans -ca a /hurd/tarfs -z myfile.tar.gz + $ settrans -ca b /hurd/tarfs -y myfile.tar.bz2 + $ settrans -ca c /hurd/tarfs myfile.tar + +You can even use it to create new tar files: + + $ settrans -ca new /hurd/tarfs -cz newfile.tar.gz + $ cp -r all my files new/ + $ syncfs new + +This is not as fast as `tar czvf newfile.tar.gz all my files`, but at least it's more original. ;) + +* cvsfs translator + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -ac cvsfs_testing /hurd/cvsfs cvs.savannah.nongnu.org /sources/hurdextras + $ cd cvsfs_testing + +* pfinet translator -- configuring your network interface + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -fgca /servers/socket/2 /hurd/pfinet -i <interface> -a <ip address> -m <subnet mask> -g <gateway ip> + +* Console translator -- setting up virtual consoles + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ console -d vga -d pc_mouse -d pc_kbd -d generic_speaker /dev/vcs + +* iso9660fs translator -- 'mounting' your cdrom + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -ac /cdrom /hurd/iso9660fs /dev/<cdrom device file> + +* ext2fs translator -- 'mounting' an ext2fs partition + +<!-- Prevent ikiwiki / Markdown rendering bug. --> + + $ settrans -ac /linux /hurd/ext2fs /dev/<partition device file> + +* unionfs translator + +To join "foo/" "bar/" and "baz/" in the directory "quux/", just do: + + $ settrans -capfg quux/ /hurd/unionfs foo/ bar/ baz/ + +If you want to join even quux/ contents in the union itself, add -u as a translator argument. +You can add filesystems at run-time with the fsysopts command. diff --git a/hurd/translator/exec.mdwn b/hurd/translator/exec.mdwn new file mode 100644 index 00000000..d5b6bfbc --- /dev/null +++ b/hurd/translator/exec.mdwn @@ -0,0 +1,12 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +The *exec* server, listening on `/servers/exec`, is responsible for +preparing the execution of processes. diff --git a/hurd/translator/ext2fs.mdwn b/hurd/translator/ext2fs.mdwn new file mode 100644 index 00000000..305576b8 --- /dev/null +++ b/hurd/translator/ext2fs.mdwn @@ -0,0 +1,37 @@ +[[!meta copyright="Copyright © 2007, 2008, 2010 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]]."]]"""]] + +# Large Stores + +The `ext2fs` translator from the upstream Hurd code base can only handle file +systems with sizes of less than roughly 2 GiB. + +[[!tag open_issue_hurd]] + +## Ognyan's Work + + * Ognyan Kulev, [[*Supporting Large ext2 File Systems in the + Hurd*|ogi-fosdem2005.mgp]], 2005, at FOSDEM + + * Ognyan Kulev, [[large_stores]] + + * <http://kerneltrap.org/node/4429> + +Ognyan's patch lifts this limitation (and is being used in the +[[Debian_GNU/Hurd_distribution|running/debian]]), but it introduces another +incompatibility: `ext2fs` then only supports block sizes of 4096 bytes. +Smaller block sizes are commonly automatically selected by `mke2fs` when using +small backend stores, like floppy devices. + + +# Documentation + +<http://www.nongnu.org/ext2-doc/> diff --git a/hurd/translator/ext2fs/large_stores.txt b/hurd/translator/ext2fs/large_stores.txt new file mode 100644 index 00000000..6e7ffc6f --- /dev/null +++ b/hurd/translator/ext2fs/large_stores.txt @@ -0,0 +1,520 @@ +[[!meta copyright="Copyright © 2005, 2010 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 is -*- mode: outline -*- + +* Introduction + +Here is a try to describe the ext2fs patch for the Hurd. This patch +allows using partitions/stores larger that approximately 1.5G by not +memory mapping the whole store to address space. + +As a guideline, the changelog of RC1 (Release Candidate 1) is +followed, so I hope nothing is missed. During writing of this text, +some questions arised and they are marked with XXX. An effort will be +made to fix all these for RC2. + + Ognyan Kulev <ogi@fmi.uni-sofia.bg> + +* The block layer and its purpose + +The basic unit of ext2 filesystem is "block". All filesystem +operation work on blocks which are read, and sometimes modified and +written back. Possible block sizes are 1K, 2K and 4K, but current +implementation works reliably only on 4K blocks (= page size of i386). + +So the two basic operations on blocks are "reading" block and +"writing" block. + +* Current implementation + +** Reading + +Currently, the whole store is memory mapped into address space of +ext2fs process. The is called "disk image", although "store image" +would be more accurate. The address of the start of the disk image is +stored in pager.c:disk_image. So "reading" block is easy: just +calculate byte offset of block and add it to disk_image. The resulting +address points to the start of the desired block. + +The macro ext2fs.h:bptr has exactly this purpose: given block number, +it returns pointer to block. Sometimes we have pointer somewhere in +the block, and we want the block number. This is calculated by +ext2fs.h:bptr_block. + +There is another set of macros that use byte offsets instead of block +numbers. These are boffs_ptr (store offset -> memory pointer) and +bptr_offs (memory pointer -> store offset). + +Converting between store offset and block number is easy with macros +boffs (block -> offset) and boffs_block (offset -> block). Other +useful macros are trunc_block and round_block. + +** Writing + +Modifying block and saving it is not that straight-forward as +reading. For writing, you need to use "pokel" ("poked elements"). +Pokel interface is in ext2fs.h. Implementation is in pokel.c. + +The problem is that generally multiple blocks are modified and we want +all these changes to hit disk at relatively same time. So we can't +just change block and leave decision when it's going to be written to +the microkernel. + +So there is a pokel for each set of changes and each change should be +reported to the pokel by calling pokel_add. When this set of changes +is completed, pokel_sync of pokel_flush is called. (The latter is +used to ignore changes.) + +In practice, there is one indir_pokel for each ext2fs.h:disknode, +which is used for indirect blocks of ext2fs. The only other pokel +used is ext2fs.h:global_pokel, where all other changes to metadata are +registered. + +* Proposed implementation + +First one must realize that the idea of mapping the whole store is to +be thrown away. So only parts of the store should be mapped. These +currently mapped parts of store are collectively called "cache". + +In the proposed implementation, the cache has fixed size of +ext2fs.h:DISK_CACHE_BLOCKS. In RC1, it's 100, but this is only to +easily catch bugs. In practice, it can be, for example, 512M, or +(512*1024/4) blocks of 4K. pager.c:disk_cache_size and +pager.c:disk_cache_blocks are additional variables about that +information. + +The cached blocks are mapped in ext2fs.h:disk_cache and span +disk_cache_size bytes (= disk_cache_blocks blocks). As in the +original implementation, this part of address space is handled by +custom pager. + +** Data structures + +Blocks in cache aren't consecutive, so we need data structure to hold +which part of address space represents what block. This is the +purpose of pager.c:disk_cache_info. Index in this array is "cached +block index". But this array doesn't help in finding if specific +block is mapped, and where. This is the purpose of the +pager.c:disk_cache_bptr ihash which finds cached block index from +given block number. Both data structures are guarded by +pager.c:disk_cache_lock. + +** Public interface + +"Public" interface to the cache are functions disk_cache_block_ref, +disk_cache_block_ref_ptr, disk_cache_block_deref, +disk_cache_block_is_ref. disk_cache_block_ref takes block number and +return pointer to block content. Reference count of this cached block +is incremented. After finishing work with block, +disk_cache_block_deref should be called. + +In converting original ext2fs code to use this functions, usually call +to bptr is turned into call to disk_cache_block_ref. In addition, +after pointer to block content is not used anymore, +disk_cache_block_deref is called. This simple scheme is only for +reading from block. For modifying block, see about pokels below. + +disk_cache_block_ref_ptr just increments reference count of specified +block. It's used when we give pointer to block content to somebody +else that will dereference it (e.g. pokel) and we want to continue to +use this content. + +disk_cache_block_is_ref checks if specified block has reference count +greater than zero. It's used in assert:s. + +*** bptr* and boffs* macros + +These macros continue to work as before, but they don't deal with +reference counting and this should be taken into consideration. In +addition, bptr_index returns cached block index from given pointer to +block content. (This function is used internally.) + +*** Pokels + +When pokel_add is called with pointer to block content, this +"consumes" reference of block. It's not consumed (decremented by 1) +immediately, but when pokel_sync or pokel_flush is called. (Reference +is consumed immediately if the block is already in the pokel. The +important thing is that you always lose one reference of the block.) + +So we have the following code when we read from block: + + char *bh = disk_cache_block_ref (block); + ... + disk_cache_block_deref (bh); + +And the following code when we modify block: + + char *bh = disk_cache_block_ref (block); + ... + pokel_add (pokel, bh, block_size); + +**** Indirect calls to pokel_add + +Some functions indirectly call pokel_add, so this should be taken into +consideration. These are: + + * record_global_poke + * record_indir_poke + +So these functions should be treated in the same scheme as pokel_add. +For example: + + char *bh = disk_cache_block_ref (block); + ... + record_indir_poke (node, bh); + +**** Modifying SBLOCK in diskfs_set_hypermetadata + +SBLOCK is global variable that points to superblock content. There is +one reference count for superblock, so before we call +record_global_poke (which consumes reference), +disk_cache_block_ref_ptr is called. + +**** Modifying GDP + +When group descriptor is wanted, usuall group_desc is called and +result is stored in local variable GDP. After modifying GDP, +record_global_poke is called. But because record_global_poke is used, +we need call to disk_cache_block_ref_ptr: + + gdp = group_desc (i); + ... + disk_cache_block_ref_ptr (gdp); + record_global_poke (gdp); + +*** More complex use of pointer to block content + +In ext2_new_block and ext2_alloc_inode functions, we have local +pointer variable BH that sometimes points to block content and +sometimes points to nothing. In order to reduce possible errors, when +BH points to nothing it's always 0. In some points (goto labels), +there is assertion if BH is what's expected (pointer to nothing or +pointer to something). + +*** dino + +dino function return pointer to struct ext2_inode for given ino_t. +This uses reference, so corresponding disk_cache_block_deref should be +called after finishing work with ext2_inode. For convenience, dino is +renamed to dino_ref, and dino_deref just calls disk_cache_block_deref. + + struct ext2_inode *di = dino_ref (np->cache_id); + ... + dino_deref (di); + +Or + + struct ext2_inode *di = dino_ref (np->cache_id); + ... + sync_global_ptr (di, 1); + dino_deref (di); + +Or + + struct ext2_inode *di = dino_ref (np->cache_id); + ... + record_global_poke (di); + +* Internals of the proposed implementation + +As said earlier, instead of mapping the whole store of filesystem to +address space, only part of it is mapped. This part is called "cache" +or "disk cache" (although "store cache" would be more appropriate). +Currently, the cache is contiguous area in address space that starts +at disk_cache. Its size is disk_cache_size which is disk_cache_blocks +number of blocks of size block_size. + +Mapped blocks in disk cache are not fixed -- each block in the cache +can be replaced at any time with another block. So we need to know +which blocks are cached currently and where. Information about each +cached block is stored in disk_cache_info[]. Index is from 0 to +disk_cache_blocks-1. In this information the block number is stored +(among some other things, discussed later). The reverse direction, +getting the index of cached block from block number, is achieved by +using disk_cache_bptr ihash. Both these data structures are guarded +by disk_cache_lock. + +** Requesting a block + +When ext2 code requests block, it calls disk_cache_block_ref. First, +this block is search with disk_cache_bptr. If its there, the +reference count is incremented and pointer to block content is +returned. In this case, there is a call to disk_cache_wait_remapping, +which is explained a bit later. + +It's more interesting when block is not found in disk_cache_bptr. In +this case, disk_cache_map is called. Again, disk_cache_bptr is +consulted, because in the meantime another could already have mapped +this block. If this is the case, the code is essentially the same as +those in disk_cache_block_ref. + +When it's assured that block is not in the cache, we have no choice +but throw away an already mapped/cached block and put our block in its +place. Such block has to meet the following conditions: + +- Its reference count being 0 +- Not in the core +- Not being remapped (explained later) +- Not being forbidden to be remapped ("fixed", explained later) + +The last three conditions are actually flags in disk_cache_info: +DC_INCORE, DC_REMAPPING and DC_FIXED. DC_DONT_REUSE collectively +gives the condition in which block is not suitable for +reusing/remapping. + +Searching suitable place in cache is linear. As an optimisation, this +search doesn't start from the beginning, but starts from where last +time it has ended. This last index is stored in disk_cache_hint. So +new candidate blocks for replacement are searched "circular". + +If suitable place is found, the old mapping is removed, and the new +mapping is initialized. But we are still not ready to return pointer +to block content, because this content is not available yet. We mark +the block as DC_REMAPPING, which makes disk_cache_block_ref for that +block in other threads to wait until page is completely remapped. + +In both cases, when we have found place and when suitable place is not +found, disk_cache_hint is updated so that next disk_cache_map +continues searching from where we ended. + +When not suitable place is found, we have to use force. First all +pages in disk cache are touched. This is workaround because of some +bug in GNU Mach. The patch relies on "precious page" features of +Mach. Marking a page as precious instructs Mach to always inform us +about evicting this page. If page is modified, it seems that we are +always informed. But if page is unmodified and page is evicted, +sometimes Mach forgets to tell us. It's true that with large disk +cache, e.g. 512M, this potentially will re-read the whole cache from +disk. But if we reach this point, the microkernel is telling us that +all is already read :-) + +This is preparation for following calls to pager_return_some. This +libpager function is called only on cached blocks that has reference +count of 0. These are the potential candidates for replacement -- +there is no sense in calling pager_return_some when reference count is +1 or more. One final case is when there is no cached block that has +reference count of 0. This is bad and we can't do anything about it. +In this case, we just wait one second hoping that some other thread +will drop reference count of block to 0. (XXX Currently (in RC1) +sleep(1) is always executed. It should be executed only when disk +cache is starving. There is some rationale behind calling sleep(1) even when +disk cache is not starving. Although pager_return_some(,,,1) +guarantees that upon return of this function the page is returned, I'm +not sure that it's guaranteed that pager_notify_pageout is called. +This is because pager_return_some and +libpager/data-return.c:_pager_do_write_request are executed in +different threads and pager_return_some is confirmed before calling +pager_notify_pageout. This issue is open.) + +So, after forcibly evicting all pages (blocks) that can potentially be +reused, disk_cache_map is called again. + +In the case when suitable place is found and all data structures +(disk_cache_info and disk_cache_bptr) are changed accordingly, +pager_return_some(,,,1) is called and we wait for pager_read_page to +clear DC_REMAPPING. The purpose of this flag (DC_REMAPPING) is solely +this: to forbid any use of this block until we are absolutely sure +that this page contains exactly the wanted block. If NDEBUG is not +defined (so we include debug code), flags of the blocks are checked if +DC_REMAPPING is really cleared. + +Is DC_REMAPPING really needed? Is there possibility that between last +"mutex_unlock (&disk_cache_lock)" and "return bptr" something could go +wrong? Actually, disk cache just follows protocol set by +pager_notify_pageout: that between pager_return_some and changing +internal structures for the remapping no thread may touch the page. +This is achieved by marking the page as DC_REMAPPING. For +convenience, function disk_cache_wait_remapping is defined which waits +for cached block while it's marked as DC_REMAPPING. + +XXX XXX: Actually, the sequence used in RC1 is: remap block and +pager_return_some. The latter seems redundant, as only blocks that +are evicted are candidates for remapping. I'll try to fix that for +RC2. + +** Modifying blocks and pokels + +After block is modified, it should be registered with pokel_add to +some pokel. Pokel contains list of ranges of cached blocks. All this +blocks should have reference count at least 1. In pokel_flush and +pokel_sync, this reference is consumed. + +So in pokel_add if added blocks are already in the pokel, their +references are consumed, because only 1 reference is consumed in +pokel_{sync,flush}. It's checked if pokel is for disk_cache, because +pokels are used in file access too, where disk cache layer is not +used. + +pokel_{flush,sync} both use _pokel_exec, so this is the place where +block references are consumed. (XXX: In RC1, they are consumed +always, but it's better to check if these pages are in disk_cache. +Although calling disk_cache_block_deref on non-disk_cache page does no +harm.) + +*** Indirect use of pokel_add + +record_global_poke and record_indir_poke use indirectly pokel_add. +These functions are slightly changed to use public interface of +disk_cache. Only new precondition is added for them: caller should +supply "reference" that will be consumed later by pokel_{flush,sync}. + +*** Modifying block without using pokels + +sync_global_ptr synchronizes given block immediately. No reference is +consumed. (XXX: This should be changed in RC2 to consuming reference. +This will make the function similar in use to +record_{global,indir}_poke and will make the code more nice-looking.) + +** Initialization + +*** The superblock + +To create disk cache, we need the block size of the filesystem. This +information is in superblock, so we need to read superblock without +using disk cache. For this purpose get_hypermetadata is changed to +read the superblock with store_read instead of old bptr. New function +map_hypermetadata is created that sets sblock global variable to point +to the already mapped superblock. So to get behavior of old +get_hypermetadata, first new get_hypermetadata should be called, and +then map_hypermetadata. + +In ext2fs.c:main, instead of calling get_hypermetadata, +map_hypermetadata is called. The call to get_hypermetadata is in +pager.c:create_disk_pager. + +In ext2fs.c:diskfs_reload_global_state, along with get_hypermetada, +map_hypermetadata is called. + +*** disk_cache + +Disk cache data structures are initialized in +pager.c:create_disk_pager called from ext2fs.c:main. Disk pager is +still initialized with diskfs_start_disk_pager, but due to block_size +variable we call get_hypermetadata. Basic parameters of disk cache +like disk_cache_blocks and disk_cache_size are initialized here. The +rest of the initialization process is delegated to disk_cache_init. + +disk_cache_init initializes the rest of disk cache data structures: +disk_cache_lock, disk_cache_remapping, disk_cache_bptr, +disk_cache_info and disk_cache_hint. After that superblock and group +descriptors are mapped into the cached and are marked as DC_FIXED. +This forbids reusing those blocks, because Hurd's ext2 code relies on +these blocks being mapped into fixed location in address space. + +** Pager callbacks + +disk_pager_read_page and disk_pager_write_page just use disk cache +data structures to get the right pointers to blocks. +disk_pager_read_page requests notification of page-out and updates +DC_INCORE and DC_REMAPPING too. DC_INCORE is set and DC_REMAPPING is +cleared (because reading the new block finishes its remapping). + +disk_pager_notify_pageout just clears DC_INCORE, making that page +available for remapping. + +* libpager changes + +Here memory_object_data_ prefix is shorten to m_o_d_. And when it's +talked about m_o_d_function Mach function, usually its libpager +handler is meant. + +** Notification on eviction + +The most important change that is wanted from libpager is supporting +notification when page is evicted. Mach already has partial support +for notification on eviction by argument "kcopy" of m_o_d_return. If +kcopy is 0, then Mach doesn't have copy of this page anymore, so the +page is "evicted". The problem is that m_o_d_return is usually called +only when page is modified, and if it's not modified, it's silently +dropped. + +The solutions is marking page as "precious". This has the exact +semantics we need: when page is evicted, m_o_d_return callback is +always called with kcopy=0. + +*** Implementation details + +New argument is added to user callback pager_read_page: +notify_on_pageout. If it's non-zero and the page is evicted, user +callback pager_notify_pageout(pager,page) is called. This change ABI +requires all libpager clients in the Hurd to be changed according to +the new API. + +m_o_d_request stores notify_on_pageout as flag PM_NOTIFY_PAGEOUT. + +m_o_d_return no longer just skips non-dirty pages. Local array +notified[] is build and at the end of the function, +pager_notify_pageout is called for all pages that are evicted +(kcopy=0). + +** Avoiding libpager optimization + +Unfortunately, there is one more problem, this time specific to +libpager, not Mach. There is an optimization in m_o_d_request when +page is being paged out. In the beginning of m_o_d_return, all pages +being return are marked as PM_PAGINGOUT. This mark is cleared after +m_o_d_supply (which supplies page content to Mach) is called. If +m_o_d_request is called on page that is marked as PM_PAGINGOUT, this +page is marked with PM_PAGEINWAIT, and m_o_d_supply inside +m_o_d_return is not called for this page. This is possible because +neither of these functions hold pager->interlock during the whole +execution of function. This lock is temporarily unlocked during call +to user callbacks pager_read_page and pager_write_page. + +So what is the implication of this optimization to our page eviction +notification? When page is paged out, we get notified and we can +decide to reuse it. After arranging disk_cache_info, etc, page is +touched, but if this happens fast enough, the optimization is +triggered and we get the old content! Reading the page is "optimized" +and pager_read_page is not called, but instead the content of old +block is used. + +This is solved by marking flushed and synced pages (via +pager_{flush,sync}{,_some} with PM_FORCEREAD. (These functions call +lock-object.c:_pager_lock_object which marks pages with PM_FORCEREAD +if they are already marked with PM_NOTIFY_PAGEOUT.) In handling +m_o_d_request, pages marked as PM_FORCEREAD are not optimized in this +way. XXX: Currently, this fine-grained logic is disabled (with #if), +as it needs more testing. Probably RC2 will use it. For now, all +pages are considered PM_FORCEREAD and this particular optimization +never happens. + +*** Technical details + +As said above, we need guarantee that after pager_{sync,flush}*, +pager_read_page callback is called. The most convenient place to mark +these pages as being forced to re-read is +lock-object.c:_pager_lock_object, because this function is used by all +pager_{sync,flush}* functions. So there we just mark page as +PM_FORCEREAD if it's already marked as PM_NOTIFY_PAGEOUT. + +First, this mark influences behaviour of m_o_d_request. If page is +marked with PM_FORCEREAD and PM_PAGINGOUT, then we set PM_PAGEINWAIT +and wait until related m_o_d_return finishes (unmarks PM_PAGEINWAIT). +Then we continue with pager_read_page, etc. If page is not marked +with PM_FORCEREAD and is marked with PM_PAGINGOUT, then old logic is +used and pager_read_page is not called (because m_o_d_return handler +will call m_o_d_supply instead of us). (XXX: Again, this logic is +inside #if 0. Currently, all pages are considered as marked with +PM_FORCEREAD.) + +The other place where PM_FORCEREAD is taken into consideration is +handler of m_o_d_return. The original code checks if page is marked +with PM_PAGEINWAIT, and if it is, m_o_d_supply is called for the just +written page. PM_PAGEINWAIT is used as "delegator" of the +m_o_d_supply call to Mach. + +In patched libpager, there is one more condition for when to call +m_o_d_supply. It's called when page is marked as PM_PAGEINWAIT and +not marked as PM_FORCEREAD. If it's marked as PM_FORCEREAD, then we +leave m_o_d_supply to m_o_d_request handler which gets notified by +condition pager->wakeup. diff --git a/hurd/translator/ext2fs/ogi-fosdem2005.mgp b/hurd/translator/ext2fs/ogi-fosdem2005.mgp new file mode 100644 index 00000000..27b5077c --- /dev/null +++ b/hurd/translator/ext2fs/ogi-fosdem2005.mgp @@ -0,0 +1,165 @@ +# "Supporting Larger ext2 File Systems in the Hurd" +# Written by Ognyan Kulev for presentation at FOSDEM 2005. +# Content of this file is in public domain. +%include "default.mgp" +%page +%nodefault +%center, font "thick", size 5 + + + + +Supporting Larger ext2 File Systems in the Hurd + + + +%font "standard", size 4 +Ognyan Kulev +%size 3 +<ogi@fmi.uni-sofia.bg> + + +%size 4 +FOSDEM 2005 + +%page + +Need for supporting larger file systems + + Active development during 1995-1997 + + Hurd 0.2 was released in 1997 and it was very buggy + + Many bugs are fixed since then + + The 2G limit for ext2 file systems becomes more and more annoying + +%page + +Timeline + + 2002: Time for graduating, fixing the 2G limit in Hurd's ext2fs and implementing ext3fs were chosen for MSc thesis + + 2003: First alfa quality patch + + 2004: Graduation, ext2fs patch in Debian, but ext3fs is unstable + +%page + +User pager in GNU Mach + + Address space + memory_object_data_supply + memory_object_data_return + Memory object (Mach concept) + pager_read_page + pager_write_page + User-supplied backstore (libpager concept) + +%page + +Current ext2fs + + Memory mapping of the whole store + + Applies only for metadata! + + bptr (block -> data pointer) + = image pointer + block * block_size + + Inode and group descriptor tables are used as if they are continous in memory + +%page + +Patched ext2fs, part one + + Address space region + mapping + Array of buffers + association + Store + + Association of buffers changes (reassocation) + + It's important reassociation to occur on buffers that are not in core + +%page + +Patched ext2fs, part two + + Always use buffer guarded by + disk_cache_block_ref (block -> buffer) + disk_cache_block_deref (release buffer) + + Buffer = data + reference count + flags (e.g. INCORE) + + Calling some functions implies releasing buffer: + pokel_add (pokels are list of dirty buffers) + record_global_poke (use pokel_add) + sync_global_ptr (sync immediately) + record_indir_poke (use pokel_add) + + Use ihash for mapping block to buffer + +%page + +When unassociated block is requested + + +%font "typewriter", size 4, cont +retry: + i = hint; + while (buffers[i] is referenced or in core) { + i = (i + 1) % nbuffers; + if (i == hint) { + return_unreferenced_buffers (); + goto retry; + } + } + hint = i + 1; + + deassociate (buffers[i]); + associate (buffers[i], block); + + return buffers[i]; + +%page + +Notification for evicted pages + + Notification is essential for optimal reassociation + + Precious pages in Mach + + Slight change to API and ABI of libpager is required + + Mach sometimes doesn't notify! + +%page + +Pager optimization + +1. Mach returns page to pager without leaving it in core + +2. Pager becomes unlocked because of calling callback pager_write_page + +3. User task touches the page + +4. Mach requests the same page from pager + +5. XXX Pager supplies the page that was returned by Mach, instead of calling callback pager_read_page + +%page + +Future directions + + Committing in the Hurd :-) + Block sizes of 1K and 2K + Run-time option for buffer array size (?) + Compile-time option for memory-mapping the whole store + Upgrade of UFS + Extended attributes (EAs) and Access control lists (ACLs) + +# Local Variables: +# mgp-options: "-g 640x480" +# End: diff --git a/hurd/translator/fatfs.mdwn b/hurd/translator/fatfs.mdwn new file mode 100644 index 00000000..006fac0b --- /dev/null +++ b/hurd/translator/fatfs.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +The current `fatfs` translator is read-only, and it has a severe bug: +[[!GNU_Savannah_bug 25961]]. diff --git a/hurd/translator/gopherfs.mdwn b/hurd/translator/gopherfs.mdwn new file mode 100644 index 00000000..6c32430f --- /dev/null +++ b/hurd/translator/gopherfs.mdwn @@ -0,0 +1,16 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +`gopherfs` is a virtual filesystem allowing you to access Gopher sites. + + +# Source + +incubator, gopherfs/master diff --git a/hurd/translator/hostmux.mdwn b/hurd/translator/hostmux.mdwn new file mode 100644 index 00000000..5fab2dc5 --- /dev/null +++ b/hurd/translator/hostmux.mdwn @@ -0,0 +1,31 @@ +Multiplexes arbitrary host names, making access to many differnt host fast and easy. + +For each host accessed via a directory an new translator is started with the hostname as option. Say, /hostmuxdemo should let you access your favourite host with your translator mytranslatorfs. + +<code>**ls /hostmuxdemo/mybox/**</code> would give the result of mytranslatorfs applied to host mybox. + +## <a name="Usage"> Usage </a> + +Hostmux takes translator options as argument and (in the easiest case ) starts the translator with the given arguments and the hostname as the last argument. + +### <a name="ftpfs"> ftpfs </a> + +ftpfs is a good example, that is even very usefull. With hostmux and ftpfs you can access anonymous ftp via the filesystem, sparing out complicate use of a ftp client. + +We assume you want to access the ftp root at all servers. The example host is ftp.yourbox.com. + +Usermux is called via <code>**settrans -fgap /ftp /hurd/hostmux /hurd/ftpfs /**</code> . + +* <code>**-fg**</code> makes settrans try hard to remove an existing old translator from <code>**/ftp**</code> +* <code>**ap**</code> sets an active translator (starts the translator) and a passive translator (stores translator information in the filesystem with which an active translator can be started on access of this node) +* <code>**/ftp**</code> is where we want to set the translator +* <code>**/hurd/hostmux**</code> is obviously our hostmux translator that will be started at <code>**/ftp**</code> and handle filesystem operations on <code>**/ftp**</code> and everything below (like <code>**/ftp/ftp.yourbox.com/pub/**</code>) +* <code>**/hurd/ftpfs /**</code> is the argument to hostmux. + +When <code>**/ftp**</code> is accessed, the first directory is interpreted as hostname and a new translator is set up with the <code>**hostmux**</code> arguments: + +<code>**ls /ftp/ftp.yourhost.com/pub/**</code> lets hostmux start a new traslator <code>**/hurd/ftpfs / ftp.yourhost.com**</code> and serve it via <code>**/ftp/ftp.yourhos t.com/**</code> as directory. Subsequent the directory <code>**pub/**</code> on <code>**/ftp.yourhost.com/**</code> can be accessed via the new created translator. + +You can see the new created translator in the process list: <code>**ps ax | grep ftpsfs**</code> . You shoud see <code>**/hurd/ftpfs / ftp.yourhost.com**</code> . + +-- [[Main/PatrickStrasser]] - 13 Jul 2004 diff --git a/hurd/translator/libguestfs.mdwn b/hurd/translator/libguestfs.mdwn new file mode 100644 index 00000000..649b31f5 --- /dev/null +++ b/hurd/translator/libguestfs.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2010 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]] + +[libguestfs](http://libguestfs.org/) is said to be able to access a lot +of different filesystem types -- can we use it to build GNU Hurd +[[translator]]s? (There is a [[FUSE]] module, too.) diff --git a/hurd/translator/magic.mdwn b/hurd/translator/magic.mdwn new file mode 100644 index 00000000..84bacdfb --- /dev/null +++ b/hurd/translator/magic.mdwn @@ -0,0 +1,22 @@ +[[!meta copyright="Copyright © 2006, 2007, 2008, 2010 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]]."]]"""]] + +The magic translator provides `/dev/fd`. + + $ showtrans /dev/fd + /hurd/magic --directory fd + +The `/dev/fd` directory holds the open [[unix/file_descriptor]]s for your +current process. You can't see them with `ls -l /dev/fd/` but you can see them +individually like this: + + $ ls -l /dev/fd/0 + crw--w---- 1 bing tty 0, 0 Nov 19 18:00 /dev/fd/0 diff --git a/hurd/translator/mboxfs.mdwn b/hurd/translator/mboxfs.mdwn new file mode 100644 index 00000000..e357294f --- /dev/null +++ b/hurd/translator/mboxfs.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + +<http://www.nongnu.org/hurdextras/#mboxfs> diff --git a/hurd/translator/netio.mdwn b/hurd/translator/netio.mdwn new file mode 100644 index 00000000..aca9cd69 --- /dev/null +++ b/hurd/translator/netio.mdwn @@ -0,0 +1,17 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +`netio` is a translator designed for creating socket ports through the +filesystem. + + +# Source + +incubator, netio/master diff --git a/hurd/translator/nsmux.mdwn b/hurd/translator/nsmux.mdwn new file mode 100644 index 00000000..d156772b --- /dev/null +++ b/hurd/translator/nsmux.mdwn @@ -0,0 +1,121 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +# nsmux + +`nsmux` implements the simplest use-case of namespace-based translator +selection (see below). + +To use `nsmux` do the following: + + $ settrans -a <node> nsmux <directory> + +After this operation `<node>` will be a mirror of `<directory>` with +namespace-based translator selection functionality enabled. + +Please note that due to some details `nsmux` may complain a lot when +run as a normal user. This matter is the most urgent on the TODO +list. + +## Source + +`nsmux` translator can be obtained with the following series of +commands: + + $ git clone git://git.sv.gnu.org/hurd/incubator.git nsmux + $ cd nsmux/ + $ git checkout -b nsmux origin/nsmux + +`filter` translator can be obtained with the following series of +commands: + + $ git clone git://git.sv.gnu.org/hurd/incubator.git filter + $ cd filter/ + $ git checkout -b filter origin/filter + +The filter is not yet working. + +## Namespace-based Translator Selection + +Namespace-based translator selection is the special technique of using +"magic" filenames for both accessing the file and setting translators +on it. + +A "magic" filename is a filename which contains an unescaped sequence +of two commas: ",,". This sequence can be escaped by adding another +comma: ",,,". In the magic filename the part up to the first double +commas is interpreted as the filename itself; the remaining segments +into which the string is split by occurrences of ",," are treated as +names of translators located under `/hurd/`. + +The simplest advantage before traditional way of setting +translators is shown in the following examples. Compare this + + $ settrans -a file translator1 + $ settrans -a file translator2 + $ cat file + +to this: + + $ cat file,,translator1,,translator2 + +One simple command versus three more lengthy ones is an obvious +improvement. However, this advantage is not the only one and, +probably, not even the most important. + +What is a good candidate for the most important advantage is that +translators requested via "magic" filenames are session-bound. In +other words, by running `cat file,,translator` we set a translator +visible *only* to `cat`, while the original file remains untranslated. +Such session-specific translators are called **dynamic** and there is +no (theoretical) way for a client to get a port to a dynamic +translator requested by another client. + +Obviously, dynamic translators can be stacked, similarly to static +translators. Also, dynamic translator stacks may reside on top of +static translator stacks. + +An important operation of namespace-based translator selection is +*filtering*. Filtering basically consists in looking up a translator +by name in the stack and ignoring translators located on top of it. +Note that filtering does not mean dropping some translators: in the +current implementation a filter is expected to be a normal dynamic +translator, included in the dynamic translator stack similarly to +other translators. + +An important detail is that filtering is not limited to dynamic +translator stacks: a filter should be able to descend into static +translator stacks as well. + +Although the concept of filtering may seem purely abstract in the +simplest use-case of setting dynamic translators on top of files, the +situation changes greatly when dynamic translator stacks on top of +directories are considered. In this case, the implementation of +namespace-based translator selection is expected to be able to +propagate the dynamic translators associated with the directory down +the directory structure. That is, all files located under a directory +opened with magic syntax, are expected to be translated by the same +set of translators. In this case having the possibility to +specifically discard some of the translators set up on top of certain +files is very useful. + +Note that the implementation of propagation of dynamic translators +down directories is not fully conceived at the moment. The +fundamental problem is distinguishing between situations when the +dynamic translators are to be set on the underlying files of the +directory or on the directory itself. + +## Currently Implemented + +Currently there a working (though not heavily tested) implementation +of the simplest use-case of namespace-based translator selection in +the form of translator `nsmux`. The filter is partially implemented +and this is the immediate goal. Propagating translators down +directories is the next objective. diff --git a/hurd/translator/pfinet.mdwn b/hurd/translator/pfinet.mdwn new file mode 100644 index 00000000..cbe50b48 --- /dev/null +++ b/hurd/translator/pfinet.mdwn @@ -0,0 +1,35 @@ +[[!meta copyright="Copyright © 2002, 2004, 2005, 2007, 2008 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]]."]]"""]] + +To configure Internet connectivity, the `pfinet` (*Protocol Family Internet*) +[[translator]] must be configured. This is done using the +[[`settrans`|settrans]] command, for example like this: + + # settrans -fgap /servers/socket/2 /hurd/pfinet ↩ + -i eth0 -a 192.168.0.50 -g 192.168.0.1 -m 255.255.255.0 + +The argument `/server/socket/2` is the node that the translator is to be +attached to. This is followed by the translator program to run and any +arguments to give it. + +There, `-i`, `-a`, `-g` and `-m` are, quite obviously, the (Mach) device to +use, the IP address, the gateway and netmask. + +--- + +To make DNS lookups work, you'll also have to properly configure the +`/etc/resolv.conf` file, for example by copying it over from your GNU/Linux +installation. + +--- + + * [[Implementation]]. + * [[IPv6]]. diff --git a/hurd/translator/pfinet/implementation.mdwn b/hurd/translator/pfinet/implementation.mdwn new file mode 100644 index 00000000..50b5dfc2 --- /dev/null +++ b/hurd/translator/pfinet/implementation.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2000, 2008 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]]."]]"""]] + +The `pfinet` server is a hacked Linux internet implementation with a glue layer +translating between the Hurd [[RPC]]s and the middle layer of the Linux +implementation. diff --git a/hurd/translator/pfinet/ipv6.mdwn b/hurd/translator/pfinet/ipv6.mdwn new file mode 100644 index 00000000..5afee0c6 --- /dev/null +++ b/hurd/translator/pfinet/ipv6.mdwn @@ -0,0 +1,57 @@ +[[!meta copyright="Copyright © 2007, 2008, 2010 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]]."]]"""]] + +[[Stefan_Siegl|stesie]] has added IPv6 support to the pfinet [[translator]]. +This was [Savannah task #5470](http://savannah.gnu.org/task/?5470). + + +# Implementation + +Because the IPv4 and IPv6 protocols are +quite related to each other (think of mapped IPv4 addresses, etc.), there is no +separate [[server|translator]] for IPv6 but support for the latter has been +incorporated into the common pfinet. Unfortunately it's a little bit clumsy +now to set the [[translator]] up, since it has to be bound to +*/servers/socket/2* (like before) as well as */servers/socket/26* (for IPv6). + +To achieve this, you can tell pfinet to install [[active_translators|active]] +on specified nodes, using **-4** and **-6** options. This is, you have to +install a [[passive_translator|passive]] on */servers/socket/2* that also binds +the IPv6 port and vice versa. + + +# Examples + +Normal IPv4 network setup, address 192.168.7.23/24 and gateway 192.168.7.1. +IPv6 address shall be assigned using IPv6 auto-configuration. + + settrans -fgp /servers/socket/2 ↩ + /hurd/pfinet -6 /servers/socket/26 ↩ + -i eth0 -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1 + settrans -fgp /servers/socket/26 ↩ + /hurd/pfinet -4 /servers/socket/2 ↩ + -i eth0 -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1 + +Quite the same, but with static IPv6 address assignment: + + settrans -fgp /servers/socket/2 ↩ + /hurd/pfinet -6 /servers/socket/26 ↩ + -i eth0 -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1 ↩ + -A 2001:4b88:10e4:0:216:3eff:feff:4223/64 -G 2001:4b88:10e4::1 + settrans -fgp /servers/socket/26 ↩ + /hurd/pfinet -4 /servers/socket/2 ↩ + -i eth0 -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1 ↩ + -A 2001:4b88:10e4:0:216:3eff:feff:4223/64 -G 2001:4b88:10e4::1 + + +# Missing Functionality + +Amongst other things, support for [[IOCTL]]s is missing. diff --git a/hurd/translator/pflocal.mdwn b/hurd/translator/pflocal.mdwn new file mode 100644 index 00000000..dc2434dc --- /dev/null +++ b/hurd/translator/pflocal.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2000, 2008 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]]."]]"""]] + +The implementation of the `pflocal` server is in the `pflocal` directory, and +uses [[`libpipe`|libpipe]] (shared code with the [[named_pipe|fifo]] +implementation). diff --git a/hurd/translator/procfs.mdwn b/hurd/translator/procfs.mdwn new file mode 100644 index 00000000..70448e94 --- /dev/null +++ b/hurd/translator/procfs.mdwn @@ -0,0 +1,35 @@ +[[!meta copyright="Copyright © 2008, 2009, 2010 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]]."]]"""]] + +Although there is no standard (POSIX or other) for the layout of the `/proc` +pseudo-filesystem, it turned out a very useful facility in GNU/Linux and other +systems, and many tools concerned with process management use it. (`ps`, `top`, +`htop`, `gtop`, `killall`, `pkill`, ...) + +Instead of porting all these tools to use [[libps]] (Hurd's official method for +accessing process information), they could be made to run out of the box, by +implementing a Linux-compatible `/proc` filesystem for the Hurd. + +The goal is to implement all `/proc` functionality needed for the various process +management tools to work. (On Linux, the `/proc` filesystem is used also for +debugging purposes; but this is highly system-specific anyways, so there is +probably no point in trying to duplicate this functionality as well...) + +*Status*: Madhusudan.C.S has implemented a new, fully functional [[procfs|madhusudancs]] for +[[GSoC 2008|community/gsoc/2008]]. + + +# [[New Implementation by Jérémie Koenig|jkoenig]] + + +# Old Implementation from [[open_issues/HurdExtras]] + +<http://www.nongnu.org/hurdextras/#procfs> diff --git a/hurd/translator/procfs/jkoenig.mdwn b/hurd/translator/procfs/jkoenig.mdwn new file mode 100644 index 00000000..1275ce52 --- /dev/null +++ b/hurd/translator/procfs/jkoenig.mdwn @@ -0,0 +1,76 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +In August 2010, Jérémie Koenig [published another, new +version](http://lists.gnu.org/archive/html/bug-hurd/2010-08/msg00165.html). +This can be found in <http://git.savannah.gnu.org/cgit/hurd/procfs.git/>, +branch *jkoenig/master*. + +Testing it is as simple as this: + + $ git clone git://git.savannah.gnu.org/hurd/procfs.git + $ cd procfs/ + $ git checkout jkoenig/master + $ 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/random.mdwn b/hurd/translator/random.mdwn index 294531d1..afb76953 100644 --- a/hurd/translator/random.mdwn +++ b/hurd/translator/random.mdwn @@ -46,6 +46,11 @@ but they are not yet in the default installation. for GNU Mach](http://download.ibofobi.dk/hurd-entropy/gnumach-entropy.diff.bz2). +* Quick and dirty way: + + sudo cp /bin/bash /dev/random + sudo ln -s random /dev/urandom + --- # Setup Tips diff --git a/hurd/translator/short-circuiting.mdwn b/hurd/translator/short-circuiting.mdwn new file mode 100644 index 00000000..9de9f7b8 --- /dev/null +++ b/hurd/translator/short-circuiting.mdwn @@ -0,0 +1,88 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +In traditional [[Unix]], file systems contain special files. These are: +symbolic links, character devices, block devices, named pipes, and +named sockets. Naturally the Hurd also support these. + +However, if you take a look at `hurd/io.defs` and `hurd/fs.defs`, you'll +find that there are no [[RPC]]s that deal specifically with these types. +Sure, you can get the type of the file through `io_stat` (among other +things), but there are none that e.g. lets you create a symbolic link. + +If you take a look at how [[glibc]] implements `symlink`, you'll notice +that all it does is create a new file and set its passive translator to +`/hurd/symlink DEST`. You can verify this yourself by creating a symlink +with `ln -s foo bar` and print its passive translator setting with `showtrans +bar`. + +This is how the other special files are implemented as well. The header +`hurd/paths.h` contains a list of paths that are used to implement +special files: + + * `/hurd/symlink` + * `/hurd/chrdev` + * `/hurd/blkdev` + * `/hurd/fifo` + * `/hurd/ifsock` + +So all special files are implemented through special-purpose translators, +right? Not quite, instead the translators of this list are often +implemented in their underlying filesystem through *translator +short-circuiting*. In fact, `chrdev` and `blkdev` aren't even implemented +as translators at all. + +Translator short-circuiting is when a file system server implements the +functionality of a passive translator itself, instead of actually starting +it. For instance, all the [[`symlink`|symlink]] translator does is return +a `FS_RETRY_*` reply to the caller. So instead of starting it, the file +system server can simply continue the file name look-up internally by +appending the target of the symbolic link to the path being looked-up. + +This way, we can skip starting the `symlink` translator, skip retrying +the look-up on the newly started translator, and we might also skip a +retry to the same file system server again, if the target of the symbolic +link is in it. + +In fact, the list's translators that actually are implemented (`symlink`, +`fifo`, `ifsock`) are only used as a default implementation if the underlying +file system's translator does not implement the functionality itself, i.e., if +it doesn't short-circuit it. + +To make sure that you use one of these translators, there by bypassing the +short-circuiting mechanism, you can either start it as +an active translator, or use a different path from the one in +`hurd/path.h`, e.g. `settrans bar /hurd/./symlink foo`. + +The best example of how short-circuiting is implemented can be found +in [[`libdiskfs`|libdiskfs]]. Notice how it detects if a translator to store +is a special file in `diskfs_S_file_set_translator` and instead +of storing a real passive translator setting on the disk, stores it as a +symlink node (using `diskfs_create_symlink_hook` or a generic implementation). + +In later look-ups to the node, it checks the node's `stat` structure in +`diskfs_S_file_get_translator`, or +`diskfs_S_dir_lookup` and handles special file types appropriately. + +Doing this translator short-circuiting has disadvantages: code duplication, or +in general adding code complexity that isn't needed for implementing the same +functionality, but it also has advantages: using functionality that the file +system's data structures nevertheless already provide -- storing symbolic links +in `ext2fs`' inodes instead of storing passive translator settings -- and thus +staying compatible with other operating systems mounting that file system. + +Also, this short-circuiting does preserve system resources, as it's no longer +required to start a `symlink` translator for resolving each symbolic link, as +well as it does reduce the [[RPC]] overhead. + +It can also confuse users who expect the passive translator to start. +For instance, if a user notices that [[`symlink`|symlink]]'s code is +lacking some functionality, but that it unexpectedly works when the user +tries to run it. diff --git a/hurd/translator/storeio.mdwn b/hurd/translator/storeio.mdwn new file mode 100644 index 00000000..8e26a959 --- /dev/null +++ b/hurd/translator/storeio.mdwn @@ -0,0 +1,30 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +`storeio` is a *translator for devices and other stores*. + +It relies heavily on [[libstore]]. + + +# Examples + +You can make a file's content available as some block device (where `foo` is +the name of the file to map): + + settrans -ca node /hurd/storeio -T file foo + +You can even `ungzip` files on the fly (`bunzip2` is available as well): + + settrans -ca node /hurd/storeio -T gunzip foo.gz + +You can use the *typed store*, to create filter chains (of course this example +is kind of useless since you could use the `gunzip` store directly): + + settrans -ca node /hurd/storeio -T typed gunzip:file:foo.gz diff --git a/hurd/translator/stowfs.mdwn b/hurd/translator/stowfs.mdwn new file mode 100644 index 00000000..9c88f1a3 --- /dev/null +++ b/hurd/translator/stowfs.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + +[[!meta redir=unionfs#stowfs]] diff --git a/hurd/translator/tarfs.mdwn b/hurd/translator/tarfs.mdwn new file mode 100644 index 00000000..e25e3255 --- /dev/null +++ b/hurd/translator/tarfs.mdwn @@ -0,0 +1,25 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +`tarfs` is a translator aimed at providing access to tar files through the +filesystem. This way you don't have to extract files from the archive to +access them. It supports compressed archives (bzip2 and gzip) through +[[libstore]]. + + +# Status + +Works fine on most cases, occasional corruptions when writing using bzip2/gzip +stores. + + +# Source + +incubator, tarfs/master diff --git a/hurd/translator/tmpfs.mdwn b/hurd/translator/tmpfs.mdwn new file mode 100644 index 00000000..0179ad6c --- /dev/null +++ b/hurd/translator/tmpfs.mdwn @@ -0,0 +1,29 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +`tmpfs` is a file system server for temporary data storage without using a real +(permanent) [[backing_store]]. + +It is based on [[libdiskfs]]. + +Even though there are other possibilities of creating a +[[libstore/examples/ramdisk]] and running a regular, for example, [[`ext2` file +system|ext2fs]] on it, having a real `tmpfs` is better, as it need not deal +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/notes_bing.mdwn b/hurd/translator/tmpfs/notes_bing.mdwn new file mode 100644 index 00000000..fa3eeac2 --- /dev/null +++ b/hurd/translator/tmpfs/notes_bing.mdwn @@ -0,0 +1,101 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]] + +1. to run tmpfs as a regular user, /servers/default-pager must be executable by + that user. by default it seems to be set to read/write. + + $ sudo chmod ugo+x /servers/default-pager + + Then I get this error: + + tmpfs: /build/mbanck/hurd-20060825/build-tree/hurd/tmpfs/dir.c:62: diskfs_get_directs: Assertion `__builtin_offsetof (struct tmpfs_dirent, name) >= __builtin_offsetof (struct dirent, d_name)' failed. + +2. i rearranged the struct tempfs_dirent in tmpfs.h to line up with the struct + dirent. now the assert passes at line 62 of dir.c passes. + + struct tmpfs_dirent + { + struct tmpfs_dirent *next; + struct disknode *dn; + + char padding[3]; + uint8_t namelen; + char name[0]; + }; + + now ls works on an empty directory. + you can touch files, and run `ls' on them. + mkdir, rmdir works too. + fsysopts works + df works + +3. creating a symlink fails. + + old patch to get symlinks working: + + http://www.mail-archive.com/bug-hurd@gnu.org/msg11844.html + --- node.c.orig 2005-07-24 09:56:39.000000000 -0400 + +++ node.c 2005-07-24 09:55:46.000000000 -0400 + @@ -330,6 +330,7 @@ + create_symlink_hook (struct node *np, const char *target) + { + assert (np->dn->u.lnk == 0); + + np->dn_stat.st_size = strlen (target); + if (np->dn_stat.st_size > 0) + { + const size_t size = np->dn_stat.st_size + 1; + @@ -337,6 +338,7 @@ + if (np->dn->u.lnk == 0) + return ENOSPC; + memcpy (np->dn->u.lnk, target, size); + + np->dn->type = DT_LNK; + adjust_used (size); + recompute_blocks (np); + } + @@ -380,8 +382,6 @@ + error_t + diskfs_truncate (struct node *np, off_t size) + { + - if (np->allocsize <= size) + - return 0; + + if (np->dn->type == DT_LNK) + { + @@ -392,6 +392,9 @@ + return 0; + } + + + if (np->allocsize <= size) + + return 0; + + + assert (np->dn->type == DT_REG); + + if (default_pager == MACH_PORT_NULL) + + now symlinks work. + +4. can't write data to a file + + +--- + +miscellaneous notes: + +`diskfs_disk_name` could be `NULL`, but it is `"swap"` + +using `default_pager_object_set_size (np->dn->u.reg.memobj, size);` to truncate and grow. + +why are our blocks 512? shouldn't it something else? or at least settable? +or does [[libdiskfs]] demand this? + +`diskfs_get_filemap_pager_struct (struct node *np)` returns null. +shouldn't it return `default_pager`? diff --git a/hurd/translator/tmpfs/notes_various.mdwn b/hurd/translator/tmpfs/notes_various.mdwn new file mode 100644 index 00000000..5e4e991c --- /dev/null +++ b/hurd/translator/tmpfs/notes_various.mdwn @@ -0,0 +1,218 @@ +[[!meta copyright="Copyright © 2005, 2006, 2007, 2008, 2009 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]] + + <antrik> hde: what's the status on tmpfs? + <hde> Broke + <hde> k0ro traced the errors like the assert show above to a pager problem. + See the pager cannot handle request from multiple ports and tmpfs sends + request using two differ ports, so to fix it the pager needs to be hacked + to support multiple requests. + <hde> You can enable debugging in the pager by changing a line from dprintf + to ddprintf I can tell you how if you want. + <antrik> and changing tmpfs to use a single port isn't possible?... + <hde> antrik, I am not sure. + <hde> IIRC k0ro was saying it cannot be changed and I cannot recall his + reasons why. + <sdschulze> antrik: Doing it the quick&dirty way, I'd just use an N-ary + tree for representing the directory structure and mmap one new page (or + more) for each file. + <hde> sdschulze, What are you talking about? + <sdschulze> hde: about how I would implement tmpfs + <hde> O + <azeem> sdschulze: you don't need to reimplement it, just fix it :) + <sdschulze> azeem: Well, it seems a bit more difficult than I considered. + <sdschulze> I had assumed it was implemented the way I described. + <hde> O and the assert above gets triggered if you don't have a + default-pager setup on /servers/default-pager + <hde> the dir.c:62 assert that is. + <azeem> hde: you sure? I think I have one + <hde> I am almost sure. + <azeem> mbanck@beethoven:~$ showtrans /servers/default-pager + <azeem> /hurd/proxy-defpager + <azeem> isn't that enough? + <hde> It is suppose to be. + <hde> Try it as root + <hde> I was experiecing alot of bugs as a normal user, but according to + marcus it is suppose to work as root, but I was getting alot of hangs. + <azeem> hde: same issue, sudo doesn't work + <hde> sucky, well then there are alot of bugs. =) + <azeem> eh, no + <azeem> I still get the dir.c assert + <sdschulze> me too + <sdschulze> Without it, I already get an error message trying to set tmpfs + as an active translator. + +--- + + <hde> I think I found the colprit. + <hde> default_pager_object_set_size --> This is were tmpfs is hanging. + <hde> mmm Hangs on the message to the default-pager. + +--- + + <hde> Well it looks like tmpfs is sending a message to the default-pager, + the default-pager then receives the message and, checks the seqno. I + checked the mig gen code and noticed that the seqno is the reply port, it + this does not check out then the default pager is put into a what it + seems infinte condition_wait hoping to get the correct seqno. + <hde> Now I am figuring out how to fix it, and debugging some more. + +--- + + <marco_g> hde: Still working on tmpfs? + <hde> Yea + <marco_g> Did you fix a lot already? + <hde> No, just trying to narrow down the reason why we cannot write file + greater then 4.5K. + <marco_g> ahh + <marco_g> What did you figure out so far? + <hde> I used the quick marcus fix for the reading assert. + <marco_g> reading assert? + <hde> Yea you know ls asserted. + <marco_g> oh? :) + <hde> Because, the offsets changed in sturct dirent in libc. + <hde> They added 64 bit checks. + <hde> So marcus suggested a while ago on bug-hurd to just add some padding + arrays to the struct tmpfs_dirent. + <hde> And low and behold it works. + <marco_g> Oh, that fix. + <hde> Yup + <hde> marco_g, I have figured out that tmpfs sends a message to the + default-pager, the default-pager does receive the message, but then + checks the seqno(The reply port) and if it is not the same as the + default-pagers structure->seqno then she waits hoping to get the correct + one. Unfortantly it puts the pager into a infinite lock and never come + out of it. + <marco_g> hde: That sucks... + <marco_g> But at least you know what the problem is. + <hde> marco_g, Yea, now I am figuring out how to fix it. + <hde> Which requires more debugging lol. + <hde> There is also another bug, default_pager_object_set_size in + <hde> mach-defpager does never return when called and makes tmpfs hang. I + <hde> will have a closer look at this later this week. + +--- + + <hde> Cool, now that I have two pagers running, hopefully I will have less + system crashes. + <marcus> running more than one pager sounds like trouble to me, but maybe + hde means something different than I think + <hde> Well the other pager is only for tmpfs to use. + <hde> So I can debug the pager without messing with the entire system. + <hde> marcus, I am trying ti figure out why diskfs_object_set_size waits + forever. This way when the pager becomes locked forever I can turn it + off and restart it. When I was doing this with only one mach-defpager + running the system would crash. + <marcus> hde: how were you able to start two default pagers?? + <hde> Well you most likely will not think my way of doing it was correct, + and I am also not sure if it is lol. I made my hacked version not stop + working if one is alreay started. + +--- + + <hde> See, the default-pager has a function called + default_pager_object_set_size this sets the size for a memory object, + well it checks the seqno for each object if it is wrong it goes into a + condition_wait, and waits for another thread to give it a correct seqno, + well this never happens. + <hde> Thus, you get a hung tmpfs and default-pager. + <hde> pager_memcpy (pager=0x0, memobj=33, offset=4096, other=0x20740, + size=0x129df54, prot=3) at pager-memcpy.c:43 + <hde> bddebian, See the problem? + <bddebian> pager=0x0? + <hde> Yup + <hde> Now wtf is the deal, I must debug. + <hde> -- Function: struct pager * diskfs_get_filemap_pager_struct + <hde> (struct node *NP) + <hde> Return a `struct pager *' that refers to the pager returned by + <hde> diskfs_get_filemap for locked node NP, suitable for use as an + <hde> argument to `pager_memcpy'. + <hde> That is failing. + <hde> If it is not one thing it is another. + <bddebian> All of Mach fails ;-) + <hde> It is alot of work to make a test program that uses libdiskfs. + +--- + + <bing> to run tmpfs as a regular user, /servers/default-pager must be + executable by that user. by default it seems to be set to read/write. + <bing> $ sudo chmod ugo+x /servers/default-pager + <bing> you can see the O_EXEC in tmpfs.c + <bing> maybe this is just a debian packaging problem + <bing> it's probably a fix to native-install i'd guess + +--- + + <bing> tmpfs is failing on default_pager_object_create with -308, which + means server died + <bing> i'm running it as a regular user, so it gets it's pager from + /servers/default-pager + <bing> and showtrans /servers/default-pager shows /hurd/proxy-defpager + <bing> so i'm guessing that's the server that died + +--- + + <bing> this is about /hurd/tmpfs + <bing> a filesystem in memory + <bing> such that each file is it's own memory object + <andar> what does that mean exactly? it differs from a "ramdisk"? + <bing> instead of the whole fs being a memory object + <andar> it only allocates memory as needed? + <bing> each file is it's own + <bing> andar: yeah + <bing> it's not ext2 or anything + <andar> yea + <bing> it's tmpfs :-) + <bing> first off, echo "this" > that + <bing> fails + <bing> with a hang + <bing> on default_pager_object_create + <andar> so writing to the memory object fails + <bing> well, it's on the create + <andar> ah + <bing> and it returns -308 + <bing> which is server died + <bing> in mig-speak + <bing> but if i run it as root + <bing> things behave differently + <bing> it gets passed the create + <bing> but then i don't know what + <bing> i want to make it work for the regular user + <bing> it doesn't work as root either, it hangs elsewhere + <andar> but it at least creates the memory object + <bing> that's the braindump + <bing> but it's great for symlinks! + <andar> do you know if it creates it? + <bing> i could do stowfs in it + +--- + + <antrik> bing: k0ro (I think) analized the tmpfs problem some two years ago + or so, remember?... + <antrik> it turns out that it broke due to some change in other stuff + (glibc I think) + <antrik> problem was something like getting RPCs to same port from two + different sources or so + <antrik> and the fix to that is non-trivial + <antrik> I don't remember in what situations it broke exactly, maybe when + writing larger files? + <bing> antrik: yeah i never understood the explanation + <bing> antrik: right now it doesn't write any files + <bing> the change in glibc was to struct dirent + <antrik> seems something more broke in the meantime :-( + <antrik> ah, right... but I the main problem was some other change + <antrik> (or maybe it never really worked, not sure anymore) + +--- + +[[!GNU_Savannah_bug 26751]] diff --git a/hurd/translator/tmpfs/tmpfs_vs_defpager.mdwn b/hurd/translator/tmpfs/tmpfs_vs_defpager.mdwn new file mode 100644 index 00000000..ef041a23 --- /dev/null +++ b/hurd/translator/tmpfs/tmpfs_vs_defpager.mdwn @@ -0,0 +1,73 @@ +[[!meta copyright="Copyright © 2010 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]]."]]"""]] + +\#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 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 + <slpz> slopez@slp-hurd:~$ echo "foo" > tmp/bar + <slpz> slopez@slp-hurd:~$ cat tmp/bar + <slpz> foo + <slpz> slopez@slp-hurd:~$ + <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> 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: 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> 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 + <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 + <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. + <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 + <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") + <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> 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> (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: 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> 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> 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> this is not really important, but worth noting ;-) diff --git a/hurd/translator/unionfs.mdwn b/hurd/translator/unionfs.mdwn new file mode 100644 index 00000000..2b692cf9 --- /dev/null +++ b/hurd/translator/unionfs.mdwn @@ -0,0 +1,160 @@ +[[!meta copyright="Copyright © 2008, 2009, 2010 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]]."]]"""]] + +# `unionfs` + +*Unionfs allows you to simply union one directory or translator into another one, so you see the files of both of them side by side.* + +Source repository: <http://git.savannah.gnu.org/cgit/hurd/unionfs.git/> + +Right now there are some problems with syncing, so please be aware +that it might not work as expected. + +<a name="unionmount"></a> +# `unionmount` + +... is a special mode of `unionfs`. + +## Project Idea + +When setting a translator on Hurd -- similar to mounting a file system on UNIX +-- the new node(s) exported by the translator are obscuring the original node +where the translator is set, and any nodes below it in the directory tree. The +translator itself can access the underlying node (which is a very nice feature, +as it allows translators presenting the contents of the node in a different +format); but it's no longer accessible from the "outside". + +Plan9 has a feature where a file system can be mounted in union mode: the new +file system doesn't obscure the mount point in this case, but instead the +contents are combined. (This feature has also been under discussion in Linux +for a couple of years now, under the label "VFS-based union mounts".) + +This kind of union mounts is generally useful, as it's sometimes more +convenient than unioning existing filesystem locations with unionfs -- it's not +necessary to mount a file system that is to be unioned at some external +location first: just union-mount it directly at the target location. + +But union mounts also allow creating passive translator hierarchies: If there +is a passive translator on a parent node, and further passive translators on +child nodes, the union mount allows the child nodes with the further translator +settings still to be visible after the parent translator has started. + +This could be useful for device nodes for example: let's say we have an +ethernet multiplexer at /dev/veth. Now the virtual subnodes could all be +directly under /dev, i.e. /dev/veth0, /dev/veth1 etc., and explicitely refer to +the main /dev/veth node in the translator command line. It would be more +elegant however to store the virtual nodes direcly below the main multiplexer +node -- /dev/veth/0, /dev/veth/1 etc. + +There are two possible approaches how union mounts could be implemented in the +Hurd. The first one is to let the various translators handle union mounts +internally, i.e. let them present the underlying nodes to the clients in +addition to the actual nodes they export themselfs. This probably can be +implemented as some kind of extension to the existing netfs and diskfs +libraries. + +The other possible apporach is less efficient and probably more tricky, but +probably also more generic: create a special unionmount translator, which +serves as a kind of proxy: setting the union-mounted translator on some +internal node; and at the actual mount location, presenting a union of the +nodes exported by this translator, and the nodes from the underlying file +system. + +The goal of this project is implementing union mounts using either of the +approaches described above. (Though it might be useful initially to prototype +both for comparision.) The ethernet multiplexer shall serve as an example use +case -- any changes necessary to allow using it with the union mount +functionality are also to be considered part of the task. + +[[Sergiu Ivanov|scolobb]] has been working on this as a [[Google Summer of Code +2009 project|community/gsoc/2009]]. + +## Implementation + +### Source + +Union mounts are currently implemented as two additional command line +options of the `unionfs` translator. This implementation resides in +the master-unionmount branch of the unionfs git repository. To +checkout the code, do the following: + + $ git clone git://git.sv.gnu.org/hurd/unionfs.git + $ cd unionfs + $ git checkout -b master-unionmount + $ git pull origin master-unionmount + +You can skip the checkout step if you don't mind that the +`master-unionmount` branch gets merged into the `master` branch. + +### Short Documentation + +The `unionmount` project adds options "--mount" and "--no-mount" to +`unionfs` (short versions: "-t" and "-n" correspondingly). Both +options are used to implement union-mounting, but the first option +will create a *transparent* union mount, while the second option will +create a *nontransparent* union mount. + +One can create a transparent union mount with the following command: + + $ settrans -a <node> unionfs --underlying --mount=<translator> + +When running + + $ fsysopts <node> + +one will see the information about the `<translator>`, not the +`unionfs` translator. Although this might seem the only natural way +to do union mounts, one must keep in mind that such transparency +deprives one of the possibility to modify the unioned virtual +filesystem exported by `unionfs` at run-time (via `fsysopts`). + +One can create a nontransparent union mount with the following command: + + $ settrans -a <node> unionfs --underlying --no-mount=<translator> + +When running + + $ fsysopts <node> + +one will see the information about the `unionfs` translator. Although +this way allows modifying the contents of the unioned filesystem +exported by `unionfs` at runtime, the access to `<translator>` is +blocked. + +The filesystem exported by the *mountee* (`<translator>`) is actually +treated like a normal filesystem within `unionfs`, which means that +one can assign priorities to the *mountee* to achieve the desired +order of layering of the unioned directories. The following will make +`unionfs` query the underlying filesystem first and then the +*mountee*: + + $ settrans -a <node> unionfs --priority=2 --underlying --priority=1 --mount=<translator> + +Note that the same functionality can also be achieved by assigning +priority 1 to the underlying filesystem and keeping the priority of +the *mountee* at 0. + +<a name="stowfs"></a> +# `stowfs` + +... is a special mode of `unionfs`. + +# External Links + + * [*Unioning file systems for Linux*](http://valerieaurora.org/union/) + + * [FUSE page about + `unionfs`](http://sourceforge.net/apps/mediawiki/fuse/index.php?title=UnionFileSystems) + + * [Linux' overlay file system proposal, + 2010-09-20](http://thread.gmane.org/gmane.linux.kernel/1038413) + + How is this different? diff --git a/hurd/translator/unionmount.mdwn b/hurd/translator/unionmount.mdwn new file mode 100644 index 00000000..7384afc7 --- /dev/null +++ b/hurd/translator/unionmount.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2009 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]]."]]"""]] + +[[!meta redir=unionfs#unionmount]] diff --git a/hurd/translator/wishlist_1.mdwn b/hurd/translator/wishlist_1.mdwn new file mode 100644 index 00000000..36290883 --- /dev/null +++ b/hurd/translator/wishlist_1.mdwn @@ -0,0 +1,129 @@ +[[!meta copyright="Copyright © 2007, 2008, 2009 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]]."]]"""]] + +* [[devfs]] + +* FUSE(fuse.sourceforge.net/) compatilbility library. : just modify FUSE apps a and compile little to work as translator :-) + +* File Finder. (uses find, grep, a combination or a custom command (htdig, mp3 info) + * Files found will be available under one directory and then can be used like a normal directory + * usefull to generate Albums, Share only resulting files over the et, etc.. + * The filefinder can be scheduled or can be connected over some ipc like dbus to the VFS system if any to keep a watch for new files. + +* GNOKII, BitPim and openobex as translators + * grep through your SMSs! + * share your addressbook! + * "Attach" that funny SMS/MMS to your email. + * "svn commit" your joke collection :-D + +* Real Language Translator [[br]] + * cat /usr/translator/de-en/usr/share/doc/something.txt should take /usr/share/doc/something.txt , submit it to google's website and bring back results. + +* Mozilla Bookmarks = del.ici.ous + * Need more explanation ? ;-) + +* <http://hnb.sf.net> + * having a directory structure for a file can allow to "svn commit" the hnb document in a more "node-safe" manner, thus allowing multiple people to work on the same hnb document. + * This must be fairly easy as HNB can already export to XML and XMLfs already exists. + +* DavFS + * Just setup a 'WebDav share' as a directory. The implimentation of the protocol is already available in nautilus and konqueror. + +* Compiled form of your project + * you have your project in /somedir/project with source in /somedir/project/src .. /somedir/project/bin should always have the compiled version.. is it possible? + * The source has to have a MakeFile. + * creating /somedir/project/bin-somearch should aotomatically crosscompile + * Seems feasible for a small project. + +* Report generation FrameWork - an idea to be hugged by app developers..not kernel developers. + * You have financial data in some Spreadsheet like format in /yourFinance directory + * You add report templates to /yourFinance/repTemplates + * Once you save data in /yourFinance the next cat /yourFinance/reports/areportname will give you an uptodate report. + * This will be usefull for any purpose including serving by static page web servers, sharing over samba/nfs/ftp etc.! + * The advantage is any save to the spreadsheet will update the report.. not just from one software. + +* SVN (Subversion suite) + * like [[cvsfs]]. /svndir/version/version-no should automatically have subversion + * I think it is nice to write a generalised version control system framework library which will help in writing version control translators and other tools easily. + +* Flexi-acls + * First of all - Can this be done? : A translator bound to a directory must be able to access the contents of the directory which would have been accessible in the absence of the translator.. + * This will enable to wirte translators that can implement custom "Access Control Lists". Just imagine having advanced ACLs even if underlying FileSystem is dumb! Imagine changing the type of ACLs implemented with Just two commands - one to unattach previous translator and the next to attach a different ACL translator! The ACLs themselves may be stored in a different directory + +* The translator manager! + * Some translators will need to be inserted automatically - like for eg: hardware drivers .. + * Each hardware translator will pubish its capabilities. + * The "top" translator will query the capabilities of different hardware and match capabilities with the "slave" translators. That is it's only Job. + * The control is then handed over to the slave translator. + * The ranking not only looks who can handle the "most" capabilites of the hardware. If it finds that multiple translators can handle the same hardware, It will use other parameters to choose between them.. like may be the size in memory? The revision date? Stability (inferred from version number)? And to go to the extreme, the profiling data of the driver ;-P + * Advantage : The best driver wins! + +* An eg. Skip it if you understood the above :-): + * You have a driver that can handle VGA + SVGA + Super3d acceleration + Particle graphics + Works for nvidea card. + * You have a driver that can handle SVGA + VGA . + * You have a driver that can handle VGA. + * Case 1: Your card: A VGA card with some extra fonts.. + * First the VGA driver will be quireied .. ok can handle essential capability. + * Next SVGA driver: can handle but has extra module.. unnecassary weight . + * The Nvidia driver: can handle , but again unnecassary weight : ruled out. + * Winner : VGA driver: + * Case 2: Your card An SVGA card: + * First the VGA driver will be quireied .. ok can handle one essential capability. + * Next SVGA driver: can handle essential and one extra capability no extra weight.. + * The Nvidia driver: can handle , but unnecassary weight : ruled out. + * Winner : SVGA driver.. + * Case 3 : You have an VGA .. but no VGA driver .. then the SVGA driver would win. + +* Sound Server + * /ahsa - stands for Advanced HURD sound architecture :-) Just a temporary name .. for fun. + * /ahsa/out - directory wich will hold "plug"s where apllications come and join the server .. see below. + * /ahsa/out/mixer - main mixer + * /ahsa/out/nextfree - the file when "cat"ed gives the number of the next free plug + * /ahsa/plugins/ - info about available plugins + * /ahsa/out/[1..n]/ - dynamically generated directories for applications to plug on.. + * /ahsa/out/[1..n]/data this is where you should do a "cat somerawsoundfile>/ahsa/out/`cat /ahsa/nextfree`/data" + * /ahsa/out/[1..n]/plugins - the plugin stack .. volume is also a plugin.. + * /ahsa/out/[1..n]/plugins/[1..m]/ - echo "plugin param1 param2 param3" > /ahsa/out/[1..n]/plugins/`cat /ahsa/out/[1..n]/plugins/nextfree`/add + * /ahsa/out/[1..n]/plugins/[1..m]/params/{param1.. paramn} + * /ahsa/out/[1..n]/data.out - can be catted to get data processed through the server + * /ahsa/in - similar to /ahsa/out .. with except for an extra file to choose input devices. + * /ahsa/devs/{1..n} - devices detected .. can be dynamic .. there are usb soundcards and and midi devices. + * /ahsa/out/[1..n]/plugins/[1..m]/0/params/dev + * Dont get tempted for :/ahsa/out/[1..n]/params/{rate, channels, and other stuff} + * that goes into /ahsa/out/[1..n]/plugins/0/params if /ahsa/out/[1..n]/plugins/0/detected == "headerless audio" + * There are a lot more things I can continue about the "sound server" .. The Ideas simply dont seem to exhaust.. + * Some features/advantages + * set output's translator plugin as ordinary text -- have text to speech conversion done by sound server! + * Create and apply plugin presets by simply copying directories! + * Me getting dizzy thinking of the zillion more advantages. + * If you are really doing some ordinary output , all you need to do is "cat" data into next free "plug" and everything will be autodetected including the format of the data and sent to the final sound "merge"r + * Dizzy ... + +* /usr/share/menu !!!! extension for package management idea .. + * cat mymenuitem.menu >> /usr/share/menu/menu + * cat /usr/share/menu/debian/kde ... :-) + +* Spam/Malware Control + * /usr/antimalware/ - put your mail here.. it will automatically be scanned. when finished it will vanish from here .. + * /usr/antimalware/clean - ... and pop out from here + * /usr/antimalware/malware - or here. + +* NetDevice + * !JustImagine(tm)... settrans -ac /netdevices /hurd/netdevfs - [ host | net ] + * One can access device files remotely + * This could be acheived by allowing translators talk to one another over a network + * This will need translators to catch and handle ioctls (if there is such a thing in HURD). + * The device server which will listen to requests from the translators can be run even on a Linux machine!!! + * !JustImagine(tm)... accessing the crwriter/webcam on that GNU/Linux machine on the network using cdrecord of your local hurd machine! + * !JustImagine(tm)... running GNU/HURD on a minimalistic GNU/Linux(but with all the drivers) through a specially modified and optimised Qemu. The device server runs on the host machine, and the client translators access over the virtual network created by Qemu. You got most of the drivers for free! + +* Emacs File VFS + * I came to know from my Emacs loving friend that there are lots of VFS handlers in Emacs.. I was wondering if there can be translator which can tap into these Emacs VFS handlers. diff --git a/hurd/translator/wishlist_2.mdwn b/hurd/translator/wishlist_2.mdwn new file mode 100644 index 00000000..77f39644 --- /dev/null +++ b/hurd/translator/wishlist_2.mdwn @@ -0,0 +1,201 @@ +## <a name="Introduction"> Introduction </a> + +The idea behind file system translators is a powerful concept which hasn't recieved much attention in the mainstream computing world. So here is a list of interesting translators I've been able to dream up. I'm sure there are many more ideas floating around out there, so add them to the list! + +The [ferris project](http://witme.sourceforge.net/libferris.web/features.html) has some great ideas and code in the area of userspace dynamic filesystems, as has the [FUSE project](http://fuse.sourceforge.net/). + +## <a name="Audio_cdfs"> Audio\_cdfs </a> + +A translator which produces a directory of \*.wav files when you have an audio CD in the drive. + +## <a name="Ogg"> Ogg </a> + +This translator could be a sub-directory of the Audio\_cdfs translator and it would translate the \*.wav files into Ogg Vorbis/MP3 format. + +## <a name="CDDB"> </a> CDDB + +Of course it would be a lot nicer if the above two translators didn't name their files something worthless like track001.ogg. So we would want a translator which would hook up with a database on the web and produce meaningful file names. + +## <a name="Crypto"> Crypto </a> + +A cryptographic/steganographic seem like a nice match with the concept of user-land file systems. I like the idea of something like `settrans -a /secure stegfs --mpeg file001.mpg` + +## <a name="Revision_control"> Revision control </a> + +All of the empty space on your drive is now being wasted. Why not have a revision control translator which tracks changes to your documents? See also [this guy](http://www.linuxjournal.com/article.php?sid=5976). And then you'd do something like `cd /time-machine/2003/sept/14/` to see what your system looked like on the 14th of septempber 2003. + +## <a name="CVSFS"> </a> CVSFS + +See [cvsFS for Linux](http://cvsfs.sourceforge.net/). This provides a package which presents the CVS contents as mountable file system. It allows to view the versioned files as like they were ordinary files on a disk. There is also a possibility to check in/out some files for editing. A read-only version has been written by Stefan Siegl and is available at [Berlios](http://cvs.berlios.de/cgi-bin/viewcvs.cgi/cvsfs4hurd/cvsfs/). + +## <a name="tar_and_gzip"> tar and gzip </a> + +Rumor has it that they are on the way. Actually, a tar + gzip/bzip2 translator does exist (although it hasn't been used much...) : see [the Hurdextras project](http://savannah.nongnu.org/projects/hurdextras/) on Savannah. + +## <a name="ROM"> </a> ROM + +How about a translator which makes it look like you can write to read only media (like CDs), or change files which I don't have permission to change. This translator would make it seem like you could copy files to places where you normally couldn't. Think about combining this translator with the ftp translator and the tar and gzip translators. (cd /ftp/gnu.org/gnome.tar.gz/writes\_allowed; make install). It could be that unionfs does this very thing. + +## <a name="Super_FIFO"> Super\_FIFO </a> + +It's like a named pipe which is smart enough to start a process everytime something new tries to read from it. For example, let's say I have a script that reads in a JPEG image and spits out a smaller thumbnail \*.jpg to STDOUT. With a standard fifo (`mknod -p fifo`) this would almost works (`script big.jpg > fifo`). But what if there are two processes trying to read the fifo at once? Ick. And of course the standard way only works once without rerunning the command. I'm not quite sure what the syntax should look like, but I'm sure someone out there has a great idea waiting to happen. + +## <a name="Perl"> Perl </a> + +Perl is a wonderful language for hacking together something useful in a short amount of time. No concept is complete without being able to use it in a perl one-liner. And that goes for Hurd translators too. Right? + + #!/usr/bin/perl + use Hurd::translator; + + #file named "two" can produce an endless supply of twos, etc. (a la /dev/zero) + my $i=0; + for $filename ([zero one two three four]) + { + $libtrivfsread_codehash{$filename}= + sub{ $num_bytes=shift; my $data=$i; return chr($data) x $num_bytes; }; + #that's a hash of references to closures + $i++; + } + translator_startup(); + +A Perl translator has been started by [John Edwin Tobey](http://john-edwin-tobey.org/Hurd/) (pith). + +## <a name="Source_code"> Source code </a> + +Here's a crazy thought. How about a translator for source code. You have a C source file like `hello.c` which is your normal everyday file. But there's a translator sitting underneath, so when you `cd hello.c` you get a directory with files like `main()` which represent the subroutines in `hello.c`. And of course you should be able to edit/remove those and have it modify the original source. + +## <a name="Libraries"> Libraries </a> + +Here's an [idea](http://www.circlemud.org/~jelson/software/fusd/docs/node13.html) from the people making [userspace drivers in Linux](http://www.circlemud.org/~jelson/software/fusd/): + +* "One particularly interesting application of FUSD that we've found very useful is as a way to let regular user-space libraries export device file APIs. For example, imagine you had a library which factored large composite numbers. Typically, it might have a C interface--say, a function called `int *factorize(int bignum)`. With FUSD, it's possible to create a device file interface--say, a device called `/dev/factorize` to which clients can `write(2)` a big number, then `read(2)` back its factors. + +* This may sound strange, but device file APIs have at least three advantages + over a typical library API. First, it becomes much more language + independent--any language that can make [[system call]]s can access the + factorization library. Second, the factorization code is running in a + different address space; if it crashes, it won't crash or corrupt the + caller. Third, and most interestingly, it is possible to use `select(2)` to + wait for the factorization to complete. `select(2)` would make it easy for a + client to factor a large number while remaining responsive to other events + that might happen in the meantime. In other words, FUSD allows normal + user-space libraries to integrate seamlessly with UNIX's existing, + POSIX-standard event notification interface: `select(2)`." + +## <a name="Mail"> Mail </a> + +Am I off my rocker, or does an IMAP/POP translator sound like a good idea? It would make your remote mail servers look like local ones. Or what about a translator that makes a mbox format mail spool look like a directory. Can anyone think of a good use for an SMTP translator? + +*Definitely: Copy my email in there to send it.* -- [[ArneBab|community/weblogs/ArneBab]] + +## <a name="UUEncode"> </a> UUEncode + +How about a UUEncode translator for those places you can only store ASCII. Combine this with a NNTP translator and store your data in someone's Usenet archive. Or since, (as far as I know), there are no size limitations on file names in the Hurd, why not have a filesystem translator whose underlying store is a file name. (Now ls becomes cat). + +## <a name="Computation"> Computation </a> + +This is from the revenge of the command-line department. Make a directory translator whose contents are a result of the computation specified in the directory name. Here's an example... + + $ settrans -a /comp /hurd/computationfs + $ cd "/comp/3+4" + $ ls -l + total 0 + -rw-r--r-- 1 nobody users 0 Oct 16 11:41 7 + $ + $ cd "/comp/sqrt(2)" + $ ls -l + total 0 + -rw-r--r-- 1 nobody users 0 Oct 16 11:42 1.4142135623731 + $ + +...etc. Now think about your favorite GUI HTML editor and using File->Open on the following directory name, ``"/comp/for i in $( find / -name *.html ); do ln -s $i `basename $i`;done"`` Which would produce a directory listing with soft links to all of the \*.html files on your system. You could have all of the comforts of the shell from within that little File->Open dialog box. + +## <a name="Other"> Other </a> + +Just found Wolfgang J�hrling's translator [wishlist](http://www.8ung.at/shell/trans.html). + +## <a name="Bochs"> Bochs </a> + +A translator which works with [Bochs](http://bochs.sourceforge.net/) disk images would be nice. + +## <a name="Rollover"> Rollover </a> + +A translator that uses a circular buffer to store log files. The translated node only contains the last N (mega,kilo)bytes. + +## <a name="Birthday"> Birthday </a> + +A translator that provides an interface into the birthday program. + +You can cat your calendar, eg. bd/calendar/today bd/calendar/this-week or bd/calendar/this-month. + +And you could write new events into files located in bd/events/DATE/event-name. + +DATE is of the format the birthday expects DD/MM/YYYY. + +The contents of the file are any or none of the following birthday options: ann (An anniversary), bd (A birthday), ev (Some other event), wN (Warn N days in advance of date), toDATE (Event lasts until this DATE), forDAYS (Event runs for DAYS). + +You can optionally just edit the bd/birthdays file if you want to edit the configuration file by hand. It might make sense to write changes from bd/birthdays into ~/.birthdays. + + $ settrans -c bd /hurd/birthday -f ~/.birthdays + $ ls bd/ + birthdays calendar events + $ find bd -print + bd + bd/calendar + bd/calendar/daily + bd/calendar/this-week + bd/calendar/this-month + bd/events + bd/birthdays + $ + +## <a name="LVM"> </a> LVM + +A translator to access block devices from Linux's [Logical Volume Management](http://www.tldp.org/HOWTO/LVM-HOWTO/) would be an useful addition. + + # settrans -cap /dev/VolumeGroup0 /hurd/lvm /dev/PhysicalVolume0 /dev/PhysicalVolume1 ... + # ls /dev/VolumeGroup0/ + home + var + # settrans -cap /home /hurd/ext2fs /dev/VolumeGroup0/home + # settrans -cap /var /hurd/ext2fs /dev/VolumeGroup0/var + +Probably both [LVM2](http://sourceware.org/lvm2/) and the [Device-mapper](http://sourceware.org/dm/) need to be ported. + +## <a name="bridging_translator"> bridging translator </a> + +A [bridging](http://bridge.sourceforge.net/faq.html) translator could improve the Hurd's networking facilities. + + # settrans -cap /dev/br0 /hurd/bridge -i eth0 -i eth1 ... + # settrans -cap /servers/socket/2 /hurd/pfinet -i /dev/br0 -a ... -g ... -m ... + +Perhaps Linux's bridging code and [utilities](http://bridge.sourceforge.net/) can be ported (or glued in) or code from one of the BSDs. + +## <a name="SSH_translator"> </a> SSH translator + +Presenting remote file systems through SSH similar to what gnome-vfs does. + +## <a name="SMB_translator"> </a> SMB translator + +Presenting remote file systems through Samba similar to what gnome-vfs does. Guiseppe Scrivano has worked on this and smbfs is available at [hurdextras](http://savannah.nongnu.org/cgi-bin/viewcvs/hurdextras/smbfs/). + +## <a name="Crontab_translator"> Crontab translator </a> + +Presenting a user's crontab in a filesystem where cron entries are files. + +## <a name="globlink"> globlink </a> + +Firmlink to a file according to a filename matching pattern. When a file goes away, the next file that is matched is automatically linked to. + + $ settrans -ac libfoo.so /hurd/globlink '/lib/libfoo*' + +## <a name="alphabetfs"> alphabetfs </a> + +Organize a large group of files by their first letter. Present one subdirectory for each letter in the alphabet. + +## <a name="fsysoptsctl"> fsysoptsctl </a> + +Send an fsysopts command to a set of translators. When you have a directory full of translators and you want to send each of them the same runtime option, this translator can do it for you. + + $ settrans -ac all /hurd/fsysoptsctl '/tmp/mystuff/*' + $ fsysopts all --update diff --git a/hurd/translator/writing/example.mdwn b/hurd/translator/writing/example.mdwn new file mode 100644 index 00000000..0a3be4df --- /dev/null +++ b/hurd/translator/writing/example.mdwn @@ -0,0 +1,303 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +## Data User-Server Translator Example + +The code examples were written by Anand Babu. + +We have a data.h header file, a data.defs file, a data-user.c, data-server.c +sources files and a Makefile. + +data.h: +------- + + #ifndef _data_user_ + #define _data_user_ + + /* Module data */ + + #include <mach/kern_return.h> + #include <mach/port.h> + #include <mach/message.h> + + #include <mach/std_types.h> + #include <mach/mach_types.h> + #include <device/device_types.h> + #include <device/net_status.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/statfs.h> + #include <sys/resource.h> + #include <sys/utsname.h> + #include <hurd/hurd_types.h> + + /* Routine data_set_value */ + #ifdef mig_external + mig_external + #else + extern + #endif + kern_return_t S_data_set_value + #if defined(LINTLIBRARY) + (data_port, value) + mach_port_t data_port; + int value; + { return S_data_set_value(data_port, value); } + #else + ( + mach_port_t data_port, + int value + ); + #endif + + /* Routine data_get_value */ + #ifdef mig_external + mig_external + #else + extern + #endif + kern_return_t S_data_get_value + #if defined(LINTLIBRARY) + (data_port, value) + mach_port_t data_port; + int *value; + { return S_data_get_value(data_port, value); } + #else + ( + mach_port_t data_port, + int *value + ); + #endif + + #endif /* not defined(_data_user_) */ + +data.defs: +---------- + + /* Definitions for data interface + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + The GNU Hurd is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the GNU Hurd; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + subsystem data 45000; + + #include <hurd/hurd_types.defs> + + #ifdef STACK_IMPORTS + STACK_IMPORTS + #endif + + /* intr-rpc.defs defines the INTR_INTERFACE macro to make the generated RPC + stubs send-interruptible, and to prefix them with `hurd_intr_rpc_'. */ + INTR_INTERFACE + + /* set integer value to data */ + routine data_set_value ( + data_port: mach_port_t; + value: int); + + /* get integer value from data */ + routine data_get_value ( + data_port: mach_port_t; + out value: int); + +data-user.c: +------------ + + #include <stdio.h> + #include <hurd.h> + #include <hurd/hurd_types.h> + #include "data.h" + + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #endif + + int + main(int argc, char *argv[]) + { + int value=0; + mach_port_t data_server_port; + + data_server_port = file_name_lookup ("/tmp/trans", 0, 0); + printf ("data_server_port [%u]\n", data_server_port); + S_data_set_value (data_server_port, 99); + S_data_get_value (data_server_port, &value); + printf ("data->get_value: [%d]\n", value); + + return 0; + } + +data-server.c: +-------------- + + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #endif + + #include <stdio.h> + #include <getopt.h> + #include <errno.h> + #include <sys/stat.h> + #include <error.h> + + #include <hurd/ports.h> + #include <hurd/hurd_types.h> + #include <hurd/trivfs.h> + + #include "data.h" + + extern boolean_t S_data_server + (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); + + int trivfs_fstype = FSTYPE_MISC; + int trivfs_fsid = 0; + int trivfs_support_read = 0; + int trivfs_support_write = 0; + int trivfs_support_exec = 0; + int trivfs_allow_open = 0x00; + int trivfs_protid_nportclasses = 0; + int trivfs_cntl_nportclasses = 0; + + int data_value; + + int demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp) + { + return (S_data_server(inp,outp)||trivfs_demuxer(inp,outp)); + } + + void trivfs_modify_stat (struct trivfs_protid *cred, io_statbuf_t *st) + { + } + error_t trivfs_goaway (struct trivfs_control *fsys, int flags) + { + exit (0); + } + + kern_return_t S_data_set_value (mach_port_t data_port, int value) + { + data_value = value; + return 0; + } + + kern_return_t S_data_get_value (mach_port_t data_port, int *value) + { + *value = data_value; + return 0; + } + + int + main(int argc, char *argv[]) + { + int err; + mach_port_t bootstrap; + struct trivfs_control *fsys; + + if (argc > 1) + { + fprintf(stderr, "Usage: settrans [opts] node %s\n", program_invocation_name); + exit (1); + } + + task_get_bootstrap_port (mach_task_self (), &bootstrap); + if (bootstrap == MACH_PORT_NULL) + error(2, 0, "Must be started as a translator"); + + /* Reply to our parent */ + err = trivfs_startup (bootstrap, 0, 0, 0, 0, 0,&fsys); + mach_port_deallocate (mach_task_self (), bootstrap); + if (err) { + return (0); + } + + ports_manage_port_operations_one_thread (fsys->pi.bucket, demuxer, 0); + + return 0; + } + +Makefile: +--------- + + CC = gcc + MIG = mig + CFLAGS = -Wall -g -D_GNU_SOURCE + LDFLAGS = -lthreads -lports -ltrivfs -lfshelp -lshouldbeinlibc + INCLUDES = -I. + LCHDRS = + MIGCOMSFLAGS = -prefix S_ + OBJS = $(SRCS:.c=.o) + TAGS = etags.emacs21 + + all: data-server data-user + tags: + $(TAGS) $(SRCS) $(LCHDRS) + + stubs: data.defs + $(MIG) $(MIGCOMSFLAGS) -server dataServer.c -user dataUser.c $^ + data-server: data-server.c dataServer.c + $(CC) $^ $(CFLAGS) $(INCLUDES) $(LDFLAGS) -o $@ + data-user: data-user.c dataUser.c + $(CC) $^ $(CFLAGS) $(INCLUDES) -o $@ + clean: + rm -f *.o data-server data-user + + start: data-server data-user + settrans -ac /tmp/trans data-server + ps -x | grep data-server + end: + settrans -fg /tmp/trans + +Building +-------- + +Do + + make stubs + +to create the dataUser.c and dataServer.c files generated by mig. Create the +executables using: + + make all + +Testing +------- + +Start the data-server translator using: + + settrans -ac /tmp/trans data-server + +You can check if it is running using + + ps -x | grep data-server + +Run the data-user executable to get the resultant output. + +You can remove the translator using: + + settrans -fg /tmp/trans + +To remove the built files use: + + make clean + +Happy Hacking! diff --git a/hurd/translator/xmlfs.mdwn b/hurd/translator/xmlfs.mdwn new file mode 100644 index 00000000..769c43ce --- /dev/null +++ b/hurd/translator/xmlfs.mdwn @@ -0,0 +1,11 @@ +[[!meta copyright="Copyright © 2008 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]]."]]"""]] + +<http://www.nongnu.org/hurdextras/#xmlfs> diff --git a/hurd/virtual_file_system.mdwn b/hurd/virtual_file_system.mdwn index 33e4f8a7..b62a5e4c 100644 --- a/hurd/virtual_file_system.mdwn +++ b/hurd/virtual_file_system.mdwn @@ -1,26 +1,19 @@ -[[license text=""" -Copyright © 2007 Free Software Foundation, Inc. +[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] -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.txt]]. - -By contributing to this page, you agree to assign copyright for your -contribution to the Free Software Foundation. The Free Software Foundation -promises to always use either a verbatim copying license or a free -documentation license when publishing your contribution. We grant you back all -your rights under copyright, including the rights to copy, modify, and -redistribute your contributions. -"""]] +[[!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]]."]]"""]] Path names are resolved using a distributed protocol. No single entity is responsible for the resolution of path names. A file system server (a [[translator]]) attaches to translators (`fs.defs:file_set_translator`). -When a process resolves an aboslute path, it queries +When a process resolves an absolute path, it queries its root file system server by invoking the `fs.defs:dir_lookup` method in the capability in its root directory slot. The file system server resolves as much as it knows about locally diff --git a/hurd/virtualization.mdwn b/hurd/virtualization.mdwn new file mode 100644 index 00000000..42f83f77 --- /dev/null +++ b/hurd/virtualization.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2007, 2008 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]]."]]"""]] + +Olaf Buddenhagen has written a text about how [[/virtualization]] is applicable +within Hurd systems: +<http://tri-ceps.blogspot.com/2007/10/advanced-lightweight-virtualization.html> diff --git a/hurd/what_is_the_gnu_hurd.mdwn b/hurd/what_is_the_gnu_hurd.mdwn new file mode 100644 index 00000000..7a7f3d43 --- /dev/null +++ b/hurd/what_is_the_gnu_hurd.mdwn @@ -0,0 +1,51 @@ +[[!meta copyright="Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +2010 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]]."]]"""]] + +[[!meta title="What Is the GNU Hurd?"]] + +The Hurd is the GNU project's replacement for [[UNIX]], a popular operating +system [[kernel]]. + +The Hurd is firstly a collection of protocols formalizing how different +components may interact. The protocols are designed to reduce the mutual +[[trust]] requirements of the actors thereby permitting a more +[[extensible|extensibility]] system. These include interface definitions to +manipulate files and directories and to resolve path names. This allows any +process to implement a file system. The only requirement is that it have +access to its backing store and that the [[principal]] that started it own the +file system node to which it connects. + +The Hurd is also a set of [[servers|translator]] that implement these +protocols. They include file systems, network protocols and authentication. +The servers run on top of the [[microkernel/Mach]] [[microkernel]] and use +Mach's [[microkernel/mach/IPC]] mechanism to transfer information. + +The Hurd provides a compatibility layer such that compiling higher level +programs is essentially transparent; that is, by means of the [[glibc]], it +provides the same standard interfaces known from other [[UNIX]]-like systems. +Thus, for a typical user, the Hurd is intended to silently work in the +background providing the services and infrastructure which the [[microkernel]] +itself has no business implementing, but that are required for higher level +programs and libraries to operate. + +The Hurd supplies the last major software component needed for a complete +[[GNU_operating_system|running/gnu]] as originally conceived by Richard +M. Stallman (RMS) in 1983. The GNU vision directly drove the creation and has +guided the evolution of the [Free Software Foundation](http://fsf.org/), the +organization that is the home of the [GNU project](http://gnu.org/gnu/). + +The Hurd development effort is a somewhat separate project from the +[[Debian_GNU/Hurd|hurd/running/debian]] port. + + +Read about what the GNU Hurd is [[gramatically_speaking]]. + +Read about the [[origin_of_the_name]]. diff --git a/hurd/what_is_the_gnu_hurd/gramatically_speaking.mdwn b/hurd/what_is_the_gnu_hurd/gramatically_speaking.mdwn new file mode 100644 index 00000000..5905a19b --- /dev/null +++ b/hurd/what_is_the_gnu_hurd/gramatically_speaking.mdwn @@ -0,0 +1,54 @@ +[[!meta copyright="Copyright © 2001, 2002, 2003, 2004, 2005, 2008 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]]."]]"""]] + +[[!meta title="Grammatically speaking..."]] + +> [[It's_time_to_explain|origin_of_the_name]] the meaning of *Hurd*. +> +> *Hurd* stands for *Hird of [[Unix]]-Replacing Daemons*. +> And, then, *Hird* stands for *Hurd of Interfaces Representing Depth*. + +The Hurd has its share of linguistic debate. The subject of proper usage comes +up quite often. + +Although [[Thomas_Bushnell_states|origin_of_the_name]] that the word *Hurd* is +an acronym; we do not treat it as such, but rather as a concrete noun. We +treat *Hurd* as a title rather than as a proper name: it requires an article, +as in *the Hurd*. For instance: *The ext2 filesystem is provided by the Hurd, +not by Mach.* Note that all of the following are incorrect: *Hurd*, *HURD*, +*H.U.R.D.*, *The HURD*, and *the hurd*. + +Since the Hurd is part of the GNU Project, we also refer to it as *GNU Hurd* +which is treated as a proper noun. We write *the GNU Hurd* instead of *the +Hurd* when we want to emphasize that the Hurd is a GNU package. Once this has +been made clear, we usually use the shorter form, without *GNU*. + +The whole operating system includes not only the kernel and the system servers, +but also many more programs. This system is called *GNU*, or *the GNU +operating system*. The GNU programs can also run on other operating system +kernels. We say *GNU/Hurd* when we want to put emphasis on the fact that this +is the GNU system running on top of the Hurd, and to contrast it with the +GNU/Linux system which is GNU using Linux as the kernel. + +Finally, there is *Debian GNU/Hurd*. This refers to the distribution of the GNU +system as created by the Debian developers. For example: *What do you run on +your laptop? Debian GNU/Hurd, of course.* + +The French generally write *le Hurd*--that is, they treat the name as masculine +singular, capitalized as in English. + +When we are referring to the microkernel, we say *Mach* and use it as a proper +noun. For example: *Mach uses the device drivers found in version 2.0.x of +Linux.* We sometimes say *the Mach microkernel* instead of just *Mach*. + + +To pronounce the word *Hurd*, you should say the English word *herd*. This is +pronounced as *hɚd* using the International Phonetic Alphabet. diff --git a/hurd/what_is_the_gnu_hurd/origin_of_the_name.mdwn b/hurd/what_is_the_gnu_hurd/origin_of_the_name.mdwn new file mode 100644 index 00000000..51857e21 --- /dev/null +++ b/hurd/what_is_the_gnu_hurd/origin_of_the_name.mdwn @@ -0,0 +1,50 @@ +[[!meta copyright="Copyright © 1996, 1997, 1998, 2002, 2003, 2004, 2007, 2008 +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]]."]]"""]] + +[[!meta title="Origin of the Name"]] + +[According to Thomas +Bushnell](http://web.cecs.pdx.edu/~trent/gnu/hurd/hurd-name), the primary +architect of the Hurd: + +> It's time to explain the meaning of *Hurd*. +> +> *Hurd* stands for *Hird of [[Unix]]-Replacing Daemons*. +> And, then, *Hird* stands for *Hurd of Interfaces Representing Depth*. +> +> We have here, to my knowledge, the first software to be named by a +> pair of mutually recursive acronyms. + +[Quoting](http://mail.gnu.org/archive/html/help-hurd/2002-10/msg00099.html) +him further: + +> The name *Hurd* was invented by me, as an alternate spelling for the English +> word *herd*. *Hird* is just another alternate spelling for the same word. +> By the [[normal_rules_of_English_orthography|gramatically_speaking]], they +> all have the same pronunciations. + + +--- + +<!-- TODO. Source? Or remove? --> + +In other contexts: + +One contributor from Norway described two other uses of Hird. + + * "the kings men", a name given to the men accompanying the Norwegian kings at about + year 1000 and on. + + This was later coined by V. Quisling when he formed a party with + nationalistic traits to denote a set of helpers promoting his agenda of + national and Nordic ideas. + + * a symbol of collaboration with the (German) enemy used in World War II. |