summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'hurd')
-rw-r--r--hurd/console.mdwn85
-rw-r--r--hurd/dde/guide.mdwn2
-rw-r--r--hurd/io_path.mdwn6
-rw-r--r--hurd/libpager.mdwn16
-rw-r--r--hurd/libports.mdwn19
-rw-r--r--hurd/libthreads.mdwn28
-rw-r--r--hurd/porting/guidelines.mdwn8
-rw-r--r--hurd/translator.mdwn1
-rw-r--r--hurd/translator/hello.mdwn14
9 files changed, 171 insertions, 8 deletions
diff --git a/hurd/console.mdwn b/hurd/console.mdwn
index 4f976efd..f7230011 100644
--- a/hurd/console.mdwn
+++ b/hurd/console.mdwn
@@ -1,3 +1,88 @@
+[[!meta copyright="Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011
+Free Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+The Hurd console's implementation is broken into two pieces each running on
+it's own process, the console client and server.
+
+The console client is also split into modules (input driver, display driver,
+speaker, ...) but they all run in the same process.
+
+The console server puts itself as a translator on top of `/dev/vcs` folder
+presenting the following hierarchy:
+
+ + /dev/vcs
+ \
+ +- 1
+ \
+ +- console
+ +- input
+ +- display
+ +- ..
+ +- n
+
+where the numbered nodes represent virtual consoles and their contents are all
+alike.
+
+As the following graph shows, the console, input and display nodes are the
+interfaces used by the terminal server, input driver and display drivers
+respectively.
+
+ +------------------+ +-----------------+
+ | Input driver | | Terminal Server |
+ | | | |
+ | pc-kbd | | |
+ +------------------+ +-----------------+
+ | _cons_vcons_input |
+ | writes to reads |
+ | vcs/i/input vcs/i/console |
+ | +-----------------+ |
+ | | Console Server | |
+ | | /hurd/console | |
+ | input_enqueue | --------------- | input_dequeue |
+ +--------------->| Input Queue |>---------------+
+ | --------------- |
+ +--------------->| Output Buffer |>---------------+
+ | +-----------------+ |
+ | |
+ | writes reads |
+ | vcs/i/console vcs/i/display |
+ | |
+ +----------------+ +-----------------+
+ | Teminal Server | | Display driver |
+ | | | |
+ | /hurd/term | | vga |
+ +----------------+ +-----------------+
+
+The input driver takes scancodes from the in-kernel kbd queue, translates them
+into characters and writes them to the input node. Then the terminal server
+reads the console node taking the characters out of the console server.
+
+Each of theese actions is actually an RPC handled by the translator on
+`/dev/vcs`. Writes to input nodes are handled by calling `input_enqueue` to
+put the character into a queue. And reads from console nodes are handled by
+calling `input_dequeue` which takes out charecters from the queue and gives
+them to the reader.
+
+It's important to note here that both `input_enqueue` and `input_dequeue` are
+blocking operations and a blocked `input_dequeue` necessarily needs an
+`input_enqueue` call to continue.
+
+[[RPC]]s are handled by the console server with the help of [[hurd/libports]]'
+`ports_manage_multithreaded` API.
+
+
+---
+
+/!\ old content; [[!taglink open_issue_documentation]]: cleanup needed.
+
The below is a reworked version of Marcus Brinkmann's [letter to the debian-hurd list](http://lists.debian.org/debian-hurd/2002/debian-hurd-200209/msg00054.html). It describes how to setup the new console server for the Hurd. I am testing this right now, so this document is a work in progress.
-- [[Main/JoachimNilsson]] - 21 Jan 2003
diff --git a/hurd/dde/guide.mdwn b/hurd/dde/guide.mdwn
index a3c08754..6a83519c 100644
--- a/hurd/dde/guide.mdwn
+++ b/hurd/dde/guide.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2010,2011 Free Software Foundation, Inc."]]
+[[!meta copyright="Copyright © 2010, 2011 Free Software Foundation, Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
diff --git a/hurd/io_path.mdwn b/hurd/io_path.mdwn
index 492edffe..c47b5dca 100644
--- a/hurd/io_path.mdwn
+++ b/hurd/io_path.mdwn
@@ -46,9 +46,9 @@ Back in `_Xio_read`.
If the 2048 byte buffer is not decided to be used (out-of-line case or bigger
than 2048 bytes case; server decides to instead provide a new memory region),
-the [[`dealloc`|microkernel/mach/mig/dealloc]] flag is being set, which causes
-Mach to unmap that memory region from the server's address space, i.e., doing a
-memory *move* from the server to the client.
+the [[`dealloc`|microkernel/mach/mig/documentation/dealloc]] flag is being set,
+which causes Mach to unmap that memory region from the server's address space,
+i.e., doing a memory *move* from the server to the client.
Leave server-side RPC stub `_Xio_read`.
diff --git a/hurd/libpager.mdwn b/hurd/libpager.mdwn
index 99f28f2a..d844743d 100644
--- a/hurd/libpager.mdwn
+++ b/hurd/libpager.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2007, 2008, 2010 Free Software Foundation,
+[[!meta copyright="Copyright © 2007, 2008, 2010, 2011 Free Software Foundation,
Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
@@ -6,8 +6,8 @@ id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
Mach's [[microkernel/mach/external_pager_mechanism]].
@@ -16,6 +16,16 @@ 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).
+
+# Writeback: Writing Out Dirty Pages
+
+
+## Related
+
+ * LWN, Jonathan Corbet, [*No-I/O dirty
+ throttling*](http://lwn.net/Articles/456904/), 2011-08-31.
+
+
# Open Issues
* [[open_issues/linux_vmsig]]
diff --git a/hurd/libports.mdwn b/hurd/libports.mdwn
index 28274338..6f2cd46d 100644
--- a/hurd/libports.mdwn
+++ b/hurd/libports.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]]
+[[!meta copyright="Copyright © 2010, 2011 Free Software Foundation, Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
@@ -18,3 +18,20 @@ 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.
+
+
+# Message Processing
+
+## `ports_manage_multithreaded`
+
+When a message is recieved, the thread acting as receiver checks if any other
+thread is also waiting for requests. If there is none, a new thread is
+spawned. Thus, the current thread continues processing the message while the
+newly created thread starts listening for new ones. ([[!taglink
+open_issue_hurd]]: [[open_issues/multithreading]].)
+
+Also, there are configurable timeouts for [[translator]]s who want to go away
+when they are not used. ([[!taglink open_issue_hurd]]: there used to be bugs
+in this area, [[!message-id "87hev152we.fsf@becket.becket.net"]], but it may be
+fixed as of [[!message-id "20111030210045.GA4983@myhost"]],
+[[!GNU_Savannah_Git_hurd_hurd 9b5429e834cde56f73b8ff605e36afc7d9bb6e1b]].)
diff --git a/hurd/libthreads.mdwn b/hurd/libthreads.mdwn
new file mode 100644
index 00000000..8b1a97e6
--- /dev/null
+++ b/hurd/libthreads.mdwn
@@ -0,0 +1,28 @@
+[[!meta copyright="Copyright © 2011 Free Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+`libthreads` a.k.a. C threads.
+
+
+# Internals
+
+
+## Threads' Death
+
+C threads death doesn't actually free the thread's stack (and maybe not the
+associated Mach ports either). That's because there's no way to free the stack
+after the thread dies (because the thread of control is gone); the stack needs
+to be freed by something else, and there's nothing convenient to do it. There
+are many ways to make it work.
+
+However, it isn't really a leak, because the unfreed resources do get used for
+the next thread. So the issue is that the shrinkage of resource consumption
+never happens, but it doesn't grow without bounds; it just stays at the maximum
+even if the current number of threads is lower.
diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn
index efc8982a..03ce9e19 100644
--- a/hurd/porting/guidelines.mdwn
+++ b/hurd/porting/guidelines.mdwn
@@ -306,6 +306,14 @@ Not implemented, not POSIX. Try to disable the feature in the package.
There is no programming interface for the parallel port on GNU/Hurd yet.
+## <a name="cdrom"> <linux/cdrom.h> </a>
+
+Use <sys/cdrom.h> instead.
+
+## <a name="baud"> CBAUD </a>
+
+This is not actually standard; cfsetspeed, cfsetispeed, or cfsetospeed should be used instead.
+
## <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.
diff --git a/hurd/translator.mdwn b/hurd/translator.mdwn
index bf7af3ce..3527267f 100644
--- a/hurd/translator.mdwn
+++ b/hurd/translator.mdwn
@@ -80,6 +80,7 @@ The [[concept|concepts]] of translators creates its own problems, too:
# Existing Translators
+* [[hello]]
* [[auth]]
* [[exec]]
* [[pfinet]]
diff --git a/hurd/translator/hello.mdwn b/hurd/translator/hello.mdwn
new file mode 100644
index 00000000..bd56cd76
--- /dev/null
+++ b/hurd/translator/hello.mdwn
@@ -0,0 +1,14 @@
+[[!meta copyright="Copyright © 2011 Free Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+The *hello* translator is an example of a simple [[libtrivfs]]-based one-node
+[[translator]]. It is shipped as part of the [[Hurd source code
+repository|source_repositories]], and exists in a single-threaded and a
+multi-threaded variant.