1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
---
title: "Hurd"
date: 2025-03-03T15:34:41+08:00
lastmod: 2025-03-03T23:28:46+08:00
---
{{< mono >}}
[TODOS](/notes/hurd/todos)
{{< /mono >}}
## links
{{< mono >}}
| name | link |
| --- | --- |
| kernel-list-archive | <https://lists.gnu.org/archive/html/bug-hurd/> |
| debian-list-archive | <https://lists.debian.org/debian-hurd/> |
| irc-archive | <https://logs.guix.gnu.org/hurd/> |
| kernel-home | <https://www.gnu.org/software/hurd/index.html> |
| debian-home | <https://www.debian.org/ports/hurd/> |
{{< /mono >}}
refs:
{{< mono >}}
| name | link |
| --- | --- |
| c | <https://en.cppreference.com/w/c> |
| posix latest | <https://pubs.opengroup.org/onlinepubs/9799919799/> |
| posix 2013 | <https://pubs.opengroup.org/onlinepubs/9699919799.2013edition/> |
| posix 2008 | <https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/> |
| glibc | <https://sourceware.org/glibc/manual/2.41/html_mono/libc.html> |
{{< /mono >}}
## cheatsheet
### Mirrors
The mirror has to be `debian-ports` not `debian`, and many mirror sites do not
provide it. Following is aliyun mirror.
```txt
/etc/apt/sources.list
---
deb https://mirrors.aliyun.com/debian-ports/ unstable main
deb https://mirrors.aliyun.com/debian-ports/ unreleased main
deb-src https://mirrors.aliyun.com/debian/ unstable main
```
### Use QEMU Virtual Machine
For i386, use
```bash-session
# qemu-system-x86_64 -enable-kvm -m 4G \
> -net nic -net user,hostfwd=tcp::3222-:22 \
> -vga vmware -drive cache=writeback,file=[...]
```
For x86_64, use
```bash-session
# qemu-system-x86_64 -enable-kvm -m 8G -machine q35 \
> -net nic -net user,hostfwd=tcp::3223-:22 \
> -vga vmware -drive cache=writeback,file=[...]
```
GRUB in the image seems to use hard-coded path of `/dev/*` block file as the
root partition in the kernel command line rather than GUID, so if the hard disk
bus is changed in QEMU and the path is changed accordingly, the system can't
boot on.
QEMU cli arguments `-machine q35` enables AHCI and SATA, and is **required for
official x86_64 image to boot**. As for i386, I haven't checked now.
### Inside Hurd
Configure/Setup network
```sh
settrans -fgap /servers/socket/2 /hurd/pfinet \
-i /dev/eth0 -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0
fsysopts /servers/socket/2 /hurd/pfinet \
-i /dev/eth0 -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0
fsysopts /server/socket/2 -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0
```
Setup apt
```sh
apt-get --allow-unauthenticated --allow-insecure-repositories update
apt-get --allow-unauthenticated upgrade
```
## mailing lists / irc
{{< mono >}}
| name | address |
| --- | --- |
| hurd | <bug-hurd@gnu.org> |
| debian | <debian-hurd@lists.debian.org> |
| irc | librechat #hurd |
{{< /mono >}}
## *_MAX patch
See [this](posts/c-func-ext.md)
## git repos
Clone all at once:
```sh
# glibc is too big, so not clone here.
for repo in hurd gnumach mig web; do
if [ ! -d $repo ]; then
git clone "https://crupest.life/git/hurd/$repo.git"
pushd $repo
git remote add upstream "https://git.savannah.gnu.org/git/hurd/$repo.git"
popd
fi
done
```
{{< link-group >}}
hurd
cru: <https://crupest.life/git/hurd/hurd.git>
upstream: <https://git.savannah.gnu.org/git/hurd/hurd.git>
debian: <https://salsa.debian.org/hurd-team/hurd>
{{< /link-group >}}
{{< link-group >}}
gnumach
cru: <https://crupest.life/git/hurd/gnumach.git>
upstream: <https://git.savannah.gnu.org/git/hurd/gnumach.git>
debian: <https://salsa.debian.org/hurd-team/gnumach>
{{< /link-group >}}
{{< link-group >}}
mig
cru: <https://crupest.life/git/hurd/mig.git>
upstream: <https://git.savannah.gnu.org/git/hurd/mig.git>
debian: <https://salsa.debian.org/hurd-team/mig>
{{< /link-group >}}
{{< link-group >}}
glibc
cru: <https://crupest.life/git/hurd/glibc.git>
upstream: <git://sourceware.org/git/glibc.git>
debian: <https://salsa.debian.org/glibc-team/glibc>
mirror: <https://mirrors.tuna.tsinghua.edu.cn/git/glibc.git>
{{< /link-group >}}
{{< link-group >}}
web
cru: <https://crupest.life/git/hurd/web.git>
upstream: <https://git.savannah.gnu.org/git/hurd/web.git>
{{< /link-group >}}
|