Re: Developer environment setup problem

Almudena Garcia <[email protected]> Sun, 22 Jun 2025 18:12:30 +0200
Newsgroups gmane.os.hurd.general,gmane.os.hurd.bugs
Message-ID <CA+vQsMifPU27nAKoX8maOPf0b1DLKO=c_84JOTVCc=8QetyRPw@mail.gmail.com>
--0000000000005abddf06382b5db8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi:

I read your explaination. The script
https://github.com/AlmuHS/gnumach_dev_scripts/blob/main/compile_scratch.sh
is mine, and it's designed to compile a gnumach-smp kernel, with APIC and
rumpdisk enabled, from Linux.
So, if you try to boot the gnumach compiled with this script, you have to
be sure that the /etc/fstab name the disk devices like wd0 or similar. If
the disk is named like hd0, you have to rename it to wd0. In other case,
rumpdisk will not be able to detect the disk.

In the repository there are more scripts to generate the VM and run it in
Qemu, and these scripts allows some arguments to customize the process.
Now I will have to update the download URL to the latest image. Read the
README to know more about these scripts.

Thanks



El dom, 22 jun 2025 a las 17:55, Milos Nikic (<[email protected]>)
escribi=C3=B3:

> Thank you Samuel,
>
> I did post the configs already (but I guess they just got lost in the
> emails) here they are again:
>
> https://justpaste.it/gg2af is config log from Debian Hurd
>
> In the meantime I got development from Qemu working thanks to your guys
> suggestions. (I already submitted a few small patches). Thanks for that.
>
> Cross compiling I haven't tried again. The log from that day is here:
> https://justpaste.it/fya16
>
> Thanks again for all you do!
>
>
> On Sun, Jun 22, 2025, 7:27=E2=80=AFAM Samuel Thibault <samuel.thibault@gn=
u.org>
> wrote:
>
>> Hello,
>>
>> Milos Nikic, le dim. 15 juin 2025 17:16:54 -0700, a ecrit:
>> > I am developing inside qemu (on Arch linux) with debian
>> > image debian-hurd-20230608.img.
>>
>> That image is quite old actually. Perhaps better use a more up-to-date
>> image, I have now uploaded 20250622.
>>
>> > When i ".configure" and then make gnumach it passes.
>> > However when i copy it to my /boot/ and then point GRUB to it, i get
>> kernel
>> > panic on next reboot:.
>> >
>> > "Kernel page fault at address 0xc1000000, eip =3D 0xc10a73f6
>> > Kernel Page fault trap, eip 0xc10a73f6
>> > kernel trap, type 14, code =3D 3
>> > Dump of i386_saved_state c11dbe98:
>> > EAX fffffffc EBX c008993c ECX 3fc22677 EDX 00008000
>> > ESI c0ff6e28 EDI c0fffffe EBP c07a3010 ESP 00000004
>> > CS 0008 SS 0000 DS 0010 ES 0010 FS 0010 GS 0010
>> > v86:            DS 000c ES 0000 FS c037 GS c037
>> > EIP c10a73f6 EFLAGS 00010016
>> > trapno 14: Page fault, error 00000003
>> > panic i386/i386/trap.c:347: kernel_trap: trap"
>>
>> Possibly the newer gnumach code has build troubles with the older
>> compiler from 2023.
>>
>> > Is a cross compiling route recommended instead?
>>
>> No, it's more hairy to set up.
>>
>> [email protected], le lun. 16 juin 2025 20:36:28 +0000, a ecrit:
>> > I think that way is fairly easy-ish.  And it
>> > makes it easy to apply the Debian specific patches, which you WILL WAN=
T
>> to do.
>>
>> The gnumach package does not have any important debian-specific patch.
>> The hurd package does have some, but you don't want to install hurd by
>> hand anyway. Like glibc and other such thing deeply integrated into the
>> distribution, it won't easily work except for simple cases such as
>> the ext2fs translator and such. The rest (configuration files, MAKEDEV
>> etc.) always remains quite distribution-specific, so for working on them
>> you'd indeed rather work on the debian package.
>>
>> > And apply the Debian specific patches.  These are patches that mostly
>> work,
>> > but are NOT quite polished enough
>> >
>> >  via ... I forget the command it's something like
>> >
>> > COMMAND_NAME -a
>>
>> dh_quilt_patch is simplest.
>>
>> > That applies all of the debian specific commands.  Make your changes,
>> then
>> > just running make will make GNU Mach.   I think 'make install' should
>> > install your changed kernel.
>>
>> But also headers and whatnot. Simpler to just copy over the kernel into
>> /boot/
>>
>> Milos Nikic, le lun. 16 juin 2025 21:25:21 -0700, a ecrit:
>> > Yes I used the pristine gnumach and mig. Just cloned and pulled again
>> today.
>> >
>> > I compiled gnumach on my Linux Arch (cross compiled?).  With a script
>> from [1]
>> > compile-scratch.sh
>> > Then I ran
>> > $ make tests/test-task.iso (from my build directory).
>> > The thing didn't even compile correctly:
>> >
>> > /usr/bin/ld: /tmp/ccYq0CRM.o: in function `test_task':
>> >
>> /home/user/Projects/hurd/gnumach/build/../tests/test-task.c:57:(.text+0x=
27e):
>> > undefined reference to `__stack_chk_fail_local'
>>
>> As I already mentioned, please post your config.log. Apparently gnumach
>> doesn't manage to disable the stack protection feature (not supported in
>> kernel mode), we need to determine why that fails on your host while it
>> does work on our hosts.
>>
>> > Lots of errors, such as:
>> > ../tests/test-task.c:28:10: fatal error: gnumach.user.h: No such file =
or
>> > directory
>> >    28 | #include <gnumach.user.h>
>> >
>>
>> Diego Nieto Cid, le mar. 17 juin 2025 13:38:53 +0100, a ecrit:
>> > On Mon, Jun 16, 2025 at 09:25:21PM -0700, Milos Nikic wrote:
>> > > $ cd gnumach
>> > > $ git fetch origin
>> > > $ git reset --hard origin/master
>> > > $ autoreconf -i
>> > > $ mkdir build
>> > > $ cd build
>> > > $ ../configure --host=3Di686-gnu CC=3D'gcc -m32'
>> >
>> > I usually call configure without parameters and let it
>> > find the host triplet by itself (which usually is the same
>> > as the running system).
>>
>> If you happen to *need* these options to get things working, that's a
>> bug and we *need* to fix it rather than work around it. Again, posting
>> your config.log would allow us to actually understand what is happening
>> in your case, otherwise we will remain clueless.
>>
>> Diego Nieto Cid, le jeu. 19 juin 2025 01:16:20 +0100, a ecrit:
>> > On Tue, Jun 17, 2025 at 05:18:30PM -0700, Milos Nikic wrote:
>> > >
>> > > As far as that "n", I have no idea where that is coming from. It's n=
ot
>> > > happening when I try on the  Host, only inside Hurd.
>> > > I see in the Makefile there is a line such as:
>> > > MIGCOM =3D $(MIG) -n -cc cat - /dev/null
>> > >
>> >
>> > It's USER_MIG that is missing. For some reason, on i386, gnumach's
>> configure
>> > doesn't set it.
>>
>> It does get set here.
>>
>> *Again*, posting config.log would allow us to determine why that doesn't
>> happen on that host.
>>
>> Diego Nieto Cid, le jeu. 19 juin 2025 01:42:28 +0100, a ecrit:
>> > On Thu, Jun 19, 2025 at 01:16:20AM +0100, Diego Nieto Cid wrote:
>> > >
>> > > You can also test by installing mig from the Debian repository
>> instead of
>> > > building it from source.
>> > >
>> >
>> > If you go that route you would need:
>> >
>> >     sudo apt install mig-i686-gnu
>> >
>> > Or maybe the test makefiles need some fixing, not sure.
>>
>> Makefiles should be able to whatever is available on the system, yes.
>>
>> But we need config.log to determine how it's going wrong here.
>>
>> Samuel
>>
>

--0000000000005abddf06382b5db8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi:</div><div><br></div><div>I read your explaination=
. The script <a href=3D"https://github.com/AlmuHS/gnumach_dev_scripts/blob/=
main/compile_scratch.sh">https://github.com/AlmuHS/gnumach_dev_scripts/blob=
/main/compile_scratch.sh </a>is mine, and it&#39;s designed to compile a gn=
umach-smp kernel, with APIC and rumpdisk enabled, from Linux.<br></div><div=
>So, if you try to boot the gnumach compiled with this script, you have to =
be sure that the /etc/fstab name the disk devices like wd0 or similar. If t=
he disk is named like hd0, you have to rename it to wd0. In other case, rum=
pdisk will not be able to detect the disk.</div><div><br></div><div>In the =
repository there are more scripts to generate the VM and run it in Qemu, an=
d these scripts allows some arguments to customize the process.<br></div><d=
iv>Now I will have to update the download URL to the latest image. Read the=
 README to know more about these scripts.</div><div><br></div><div>Thanks<b=
r></div><div><br></div><div><br></div></div><br><div class=3D"gmail_quote g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">El dom, 22 jun =
2025 a las 17:55, Milos Nikic (&lt;<a href=3D"mailto:[email protected]"=
>[email protected]</a>&gt;) escribi=C3=B3:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex"><div dir=3D"auto">Thank you Samuel,<div di=
r=3D"auto"><br></div><div dir=3D"auto">I did post the configs already (but =
I guess they just got lost in the emails) here they are again:</div><div di=
r=3D"auto"><br></div><div dir=3D"auto"><a href=3D"https://justpaste.it/gg2a=
f" rel=3D"noreferrer" target=3D"_blank">https://justpaste.it/gg2af</a> is c=
onfig log from Debian Hurd=C2=A0</div><div dir=3D"auto"><br></div><div dir=
=3D"auto">In the meantime I got development from Qemu working thanks to you=
r guys suggestions. (I already submitted a few small patches). Thanks for t=
hat.</div><div dir=3D"auto"><br></div><div dir=3D"auto">Cross compiling I h=
aven&#39;t tried again. The log from that day is here:</div><div dir=3D"aut=
o"><a href=3D"https://justpaste.it/fya16" target=3D"_blank">https://justpas=
te.it/fya16</a></div><div dir=3D"auto"><br></div><div dir=3D"auto">Thanks a=
gain for all you do!</div><div dir=3D"auto"><br></div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, Jun 22, 2025=
, 7:27=E2=80=AFAM Samuel Thibault &lt;<a href=3D"mailto:samuel.thibault@gnu=
.org" rel=3D"noreferrer" target=3D"_blank">[email protected]</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br=
>
<br>
Milos Nikic, le dim. 15 juin 2025 17:16:54 -0700, a ecrit:<br>
&gt; I am developing inside qemu (on Arch linux) with debian<br>
&gt; image=C2=A0debian-hurd-20230608.img.<br>
<br>
That image is quite old actually. Perhaps better use a more up-to-date<br>
image, I have now uploaded 20250622.<br>
<br>
&gt; When i &quot;.configure&quot; and then make gnumach it passes.<br>
&gt; However when i copy it to my /boot/ and then point GRUB to it, i get k=
ernel<br>
&gt; panic on next reboot:.<br>
&gt; <br>
&gt; &quot;Kernel page fault at address 0xc1000000, eip =3D 0xc10a73f6<br>
&gt; Kernel Page fault trap, eip 0xc10a73f6<br>
&gt; kernel trap, type 14, code =3D 3<br>
&gt; Dump of i386_saved_state c11dbe98:<br>
&gt; EAX fffffffc EBX c008993c ECX 3fc22677 EDX 00008000<br>
&gt; ESI c0ff6e28 EDI c0fffffe EBP c07a3010 ESP 00000004<br>
&gt; CS 0008 SS 0000 DS 0010 ES 0010 FS 0010 GS 0010<br>
&gt; v86: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DS 000c ES 0000 FS c037 =
GS c037<br>
&gt; EIP c10a73f6 EFLAGS 00010016<br>
&gt; trapno 14: Page fault, error 00000003<br>
&gt; panic i386/i386/trap.c:347: kernel_trap: trap&quot;<br>
<br>
Possibly the newer gnumach code has build troubles with the older<br>
compiler from 2023.<br>
<br>
&gt; Is a cross compiling=C2=A0route recommended instead?<br>
<br>
No, it&#39;s more hairy to set up.<br>
<br>
<a href=3D"mailto:[email protected]" rel=3D"noreferrer noreferrer" target=
=3D"_blank">[email protected]</a>, le lun. 16 juin 2025 20:36:28 +0000, a =
ecrit:<br>
&gt; I think that way is fairly easy-ish.=C2=A0 And it<br>
&gt; makes it easy to apply the Debian specific patches, which you WILL WAN=
T to do.<br>
<br>
The gnumach package does not have any important debian-specific patch.<br>
The hurd package does have some, but you don&#39;t want to install hurd by<=
br>
hand anyway. Like glibc and other such thing deeply integrated into the<br>
distribution, it won&#39;t easily work except for simple cases such as<br>
the ext2fs translator and such. The rest (configuration files, MAKEDEV<br>
etc.) always remains quite distribution-specific, so for working on them<br=
>
you&#39;d indeed rather work on the debian package.<br>
<br>
&gt; And apply the Debian specific patches.=C2=A0 These are patches that mo=
stly work,<br>
&gt; but are NOT quite polished enough <br>
&gt; <br>
&gt;=C2=A0 via ... I forget the command it&#39;s something like<br>
&gt; <br>
&gt; COMMAND_NAME -a<br>
<br>
dh_quilt_patch is simplest.<br>
<br>
&gt; That applies all of the debian specific commands.=C2=A0 Make your chan=
ges, then <br>
&gt; just running make will make GNU Mach.=C2=A0 =C2=A0I think &#39;make in=
stall&#39; should<br>
&gt; install your changed kernel.<br>
<br>
But also headers and whatnot. Simpler to just copy over the kernel into<br>
/boot/<br>
<br>
Milos Nikic, le lun. 16 juin 2025 21:25:21 -0700, a ecrit:<br>
&gt; Yes I used the pristine gnumach and mig. Just cloned and pulled=C2=A0a=
gain today.<br>
&gt; <br>
&gt; I compiled gnumach on my Linux Arch (cross compiled?).=C2=A0 With a sc=
ript from=C2=A0[1]<br>
&gt; compile-scratch.sh<br>
&gt; Then I ran=C2=A0<br>
&gt; $ make tests/test-task.iso (from my build directory).<br>
&gt; The thing didn&#39;t even compile correctly:<br>
&gt; <br>
&gt; /usr/bin/ld: /tmp/ccYq0CRM.o: in function `test_task&#39;:<br>
&gt; /home/user/Projects/hurd/gnumach/build/../tests/test-task.c:57:(.text+=
0x27e):<br>
&gt; undefined reference to `__stack_chk_fail_local&#39;<br>
<br>
As I already mentioned, please post your config.log. Apparently gnumach<br>
doesn&#39;t manage to disable the stack protection feature (not supported i=
n<br>
kernel mode), we need to determine why that fails on your host while it<br>
does work on our hosts.<br>
<br>
&gt; Lots of errors, such as:<br>
&gt; ../tests/test-task.c:28:10: fatal error: gnumach.user.h: No such file =
or<br>
&gt; directory<br>
&gt; =C2=A0 =C2=A028 | #include &lt;gnumach.user.h&gt;<br>
&gt; <br>
<br>
Diego Nieto Cid, le mar. 17 juin 2025 13:38:53 +0100, a ecrit:<br>
&gt; On Mon, Jun 16, 2025 at 09:25:21PM -0700, Milos Nikic wrote:<br>
&gt; &gt; $ cd gnumach<br>
&gt; &gt; $ git fetch origin<br>
&gt; &gt; $ git reset --hard origin/master<br>
&gt; &gt; $ autoreconf -i<br>
&gt; &gt; $ mkdir build<br>
&gt; &gt; $ cd build<br>
&gt; &gt; $ ../configure --host=3Di686-gnu CC=3D&#39;gcc -m32&#39;<br>
&gt; <br>
&gt; I usually call configure without parameters and let it<br>
&gt; find the host triplet by itself (which usually is the same<br>
&gt; as the running system).<br>
<br>
If you happen to *need* these options to get things working, that&#39;s a<b=
r>
bug and we *need* to fix it rather than work around it. Again, posting<br>
your config.log would allow us to actually understand what is happening<br>
in your case, otherwise we will remain clueless.<br>
<br>
Diego Nieto Cid, le jeu. 19 juin 2025 01:16:20 +0100, a ecrit:<br>
&gt; On Tue, Jun 17, 2025 at 05:18:30PM -0700, Milos Nikic wrote:<br>
&gt; &gt; <br>
&gt; &gt; As far as that &quot;n&quot;, I have no idea where that is coming=
 from. It&#39;s not<br>
&gt; &gt; happening when I try on the=C2=A0 Host, only inside Hurd.<br>
&gt; &gt; I see in the Makefile there is a line such as:<br>
&gt; &gt; MIGCOM =3D $(MIG) -n -cc cat - /dev/null<br>
&gt; &gt;<br>
&gt; <br>
&gt; It&#39;s USER_MIG that is missing. For some reason, on i386, gnumach&#=
39;s configure<br>
&gt; doesn&#39;t set it.<br>
<br>
It does get set here.<br>
<br>
*Again*, posting config.log would allow us to determine why that doesn&#39;=
t<br>
happen on that host.<br>
<br>
Diego Nieto Cid, le jeu. 19 juin 2025 01:42:28 +0100, a ecrit:<br>
&gt; On Thu, Jun 19, 2025 at 01:16:20AM +0100, Diego Nieto Cid wrote:<br>
&gt; &gt; <br>
&gt; &gt; You can also test by installing mig from the Debian repository in=
stead of<br>
&gt; &gt; building it from source.<br>
&gt; &gt; <br>
&gt; <br>
&gt; If you go that route you would need:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0sudo apt install mig-i686-gnu<br>
&gt; <br>
&gt; Or maybe the test makefiles need some fixing, not sure.<br>
<br>
Makefiles should be able to whatever is available on the system, yes.<br>
<br>
But we need config.log to determine how it&#39;s going wrong here.<br>
<br>
Samuel<br>
</blockquote></div>
</blockquote></div>

--0000000000005abddf06382b5db8--