diff --color -Nuar 10.1-orig/chapter01/askforhelp.xml 10.1-mips/chapter01/askforhelp.xml
--- 10.1-orig/chapter01/askforhelp.xml	2021-03-10 19:46:38.155773938 +0800
+++ 10.1-mips/chapter01/askforhelp.xml	2021-03-10 13:15:46.055236275 +0800
@@ -10,6 +10,16 @@
 
   <title>Help</title>
 
+  <warning>
+    <para>
+      The MIPS64 EL port is highly experimental and
+      <emphasis role="bold">absolutely not</emphasis> supported.
+      That being said, you can still request for help but you should
+      explicitly emphasize the fact you are building on MIPS64 EL,
+      in your mail or other message.
+    </para>
+  </warning>
+
   <para>If an issue or a question is encountered while working through
   this book, please check the FAQ page at <ulink url="&faq-root;#generalfaq"/>.
   Questions are often already answered there. If your question is not
diff --color -Nuar 10.1-orig/chapter01/changelog.xml 10.1-mips/chapter01/changelog.xml
--- 10.1-orig/chapter01/changelog.xml	2021-03-10 19:46:38.155773938 +0800
+++ 10.1-mips/chapter01/changelog.xml	2021-03-10 13:11:06.991041273 +0800
@@ -44,6 +44,15 @@
     -->
 
     <listitem>
+      <para>2021-03-10</para>
+      <itemizedlist>
+        <listitem>
+          <para>[xry111] - LFS-10.1-mips64el released.</para>
+        </listitem>
+      </itemizedlist>
+    </listitem>
+
+    <listitem>
       <para>2021-03-01</para>
       <itemizedlist>
         <listitem>
diff --color -Nuar 10.1-orig/chapter03/packages.xml 10.1-mips/chapter03/packages.xml
--- 10.1-orig/chapter03/packages.xml	2021-03-10 19:46:38.141799378 +0800
+++ 10.1-mips/chapter03/packages.xml	2021-03-10 13:17:09.058230905 +0800
@@ -300,7 +300,7 @@
         <para>MD5 sum: <literal>&groff-md5;</literal></para>
       </listitem>
     </varlistentry>
-
+<!--
     <varlistentry>
       <term>GRUB (&grub-version;) - <token>&grub-size;</token>:</term>
       <listitem>
@@ -309,7 +309,7 @@
         <para>MD5 sum: <literal>&grub-md5;</literal></para>
       </listitem>
     </varlistentry>
-
+-->
     <varlistentry>
       <term>Gzip (&gzip-version;) - <token>&gzip-size;</token>:</term>
       <listitem>
diff --color -Nuar 10.1-orig/chapter04/abouttestsuites.xml 10.1-mips/chapter04/abouttestsuites.xml
--- 10.1-orig/chapter04/abouttestsuites.xml	2021-03-10 19:46:38.142797561 +0800
+++ 10.1-mips/chapter04/abouttestsuites.xml	2021-03-10 13:28:54.690709949 +0800
@@ -40,8 +40,6 @@
   <ulink url="&lfs-root;lfs/faq.html#no-ptys"/>.</para>
 
   <para>Sometimes package test suites will fail, but for reasons which the
-  developers are aware of and have deemed non-critical. Consult the logs located
-  at <ulink url="&test-results;"/> to verify whether or not these failures are
-  expected. This site is valid for all tests throughout this book.</para>
+  developers are aware of and have deemed non-critical.</para>
 
 </sect1>
diff --color -Nuar 10.1-orig/chapter04/addinguser.xml 10.1-mips/chapter04/addinguser.xml
--- 10.1-orig/chapter04/addinguser.xml	2021-03-10 19:46:38.142797561 +0800
+++ 10.1-mips/chapter04/addinguser.xml	2021-03-10 13:17:51.712814471 +0800
@@ -80,10 +80,7 @@
   all directories under <filename class="directory">$LFS</filename> by making
   <systemitem class="username">lfs</systemitem> the directory owner:</para>
 
-<screen><userinput>chown -v lfs $LFS/{usr,lib,var,etc,bin,sbin,tools}
-case $(uname -m) in
-  x86_64) chown -v lfs $LFS/lib64 ;;
-esac</userinput></screen>
+<screen><userinput>chown -v lfs $LFS/{usr,lib,lib64,var,etc,bin,sbin,tools}</userinput></screen>
 
   <para>If a separate working directory was created as suggested, give
   user <systemitem class="username">lfs</systemitem> ownership of this
diff --color -Nuar 10.1-orig/chapter04/creatingminlayout.xml 10.1-mips/chapter04/creatingminlayout.xml
--- 10.1-orig/chapter04/creatingminlayout.xml	2021-03-10 19:46:38.142797561 +0800
+++ 10.1-mips/chapter04/creatingminlayout.xml	2021-03-10 13:17:33.183973295 +0800
@@ -19,10 +19,7 @@
   <para>Create the required directory layout by running the following as
   <systemitem class="username">root</systemitem>:</para>
 
-<screen><userinput>mkdir -pv $LFS/{bin,etc,lib,sbin,usr,var}
-case $(uname -m) in
-  x86_64) mkdir -pv $LFS/lib64 ;;
-esac</userinput></screen>
+<screen><userinput>mkdir -pv $LFS/{bin,etc,lib,lib64,sbin,usr,var}</userinput></screen>
 
   <para>Programs in <xref linkend="chapter-temporary-tools"/> will be compiled
   with a cross-compiler (more details in section <xref
diff --color -Nuar 10.1-orig/chapter04/settingenviron.xml 10.1-mips/chapter04/settingenviron.xml
--- 10.1-orig/chapter04/settingenviron.xml	2021-03-10 19:46:38.142797561 +0800
+++ 10.1-mips/chapter04/settingenviron.xml	2021-03-10 15:40:12.098133574 +0800
@@ -42,14 +42,29 @@
 umask 022
 LFS=/mnt/lfs
 LC_ALL=POSIX
-LFS_TGT=$(uname -m)-lfs-linux-gnu
+LFS_TGT=mips64el-lfs-linux-gnuabi64
 PATH=/usr/bin
 if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
 PATH=$LFS/tools/bin:$PATH
 CONFIG_SITE=$LFS/usr/share/config.site
-export LFS LC_ALL LFS_TGT PATH CONFIG_SITE</literal>
+export LFS LC_ALL LFS_TGT PATH CONFIG_SITE
+export LFS_MIPS_GCC_EXTRA_OPTIONS=""</literal>
 EOF</userinput></screen>
 
+  <warning>
+    <para>
+		Customize <envar>LFS_MIPS_GCC_EXTRA_OPTIONS</envar> for your system.
+      For example, the FPU of Loongson 3A4000 uses IEEE 754-2008 NaN
+      encoding so
+      <literal>LFS_MIPS_GCC_EXTRA_OPTIONS="--with-arch=mips64r2 --with-nan=2008"</literal>
+      should be used, theoratically.  Without this, a lot of Glibc tests
+      will fail on Loongson 3A4000.  However, this breaks the ABI
+      compatibilty with <quote>old</quote> binaries.  If you
+      copy a binary from the host distribution (which was built without
+      2008 NaN), it won't run on LFS built with 2008 NaN.
+    </para>
+  </warning>
+
   <variablelist>
     <title>The meaning of the settings in <filename>.bashrc</filename></title>
 
@@ -101,7 +116,7 @@
     </varlistentry>
 
     <varlistentry>
-      <term><parameter>LFS_TGT=(uname -m)-lfs-linux-gnu</parameter></term>
+      <term><parameter>LFS_TGT=mips64el-lfs-linux-gnuabi64</parameter></term>
       <listitem>
   <para>The <envar>LFS_TGT</envar> variable sets a non-default, but compatible machine
   description for use when building our cross compiler and linker and when cross
diff --color -Nuar 10.1-orig/chapter05/gcc-pass1.xml 10.1-mips/chapter05/gcc-pass1.xml
--- 10.1-orig/chapter05/gcc-pass1.xml	2021-03-10 19:46:38.157770304 +0800
+++ 10.1-mips/chapter05/gcc-pass1.xml	2021-03-10 15:54:32.406922807 +0800
@@ -62,15 +62,22 @@
 tar -xf ../mpc-&mpc-version;.tar.gz
 mv -v mpc-&mpc-version; mpc</userinput></screen>
 
-    <para>On x86_64 hosts, set the default directory name for
+    <para>On 64-bit hosts, set the default directory name for
     64-bit libraries to <quote>lib</quote>:</para>
 
-<screen><userinput remap="pre">case $(uname -m) in
-  x86_64)
-    sed -e '/m64=/s/lib64/lib/' \
-        -i.orig gcc/config/i386/t-linux64
- ;;
-esac</userinput></screen>
+<screen><userinput remap="pre">sed -e 's/lib64/lib/g' \
+       -i.orig $(find gcc/config -name t-linux64)</userinput></screen>
+
+    <para>On 64-bit MIPS, set the default directory name for
+    core C runtime objects to <quote>lib</quote>:</para>
+
+<screen><userinput remap="pre">sed -e 's/lib64/lib/g' \
+       -i.orig gcc/config/mips/mips.h</userinput></screen>
+
+    <para>Fix an issue on MIPS:</para>
+
+<screen><userinput remap="pre">sed -e '2384 s/MSA/mode != MAX_MACHINE_MODE \&amp;\&amp; &amp;/' \
+     -i gcc/config/mips/mips.c</userinput></screen>
 
     <para>The GCC documentation recommends building GCC 
     in a dedicated build directory:</para>
@@ -99,7 +106,9 @@
     --disable-libssp                               \
     --disable-libvtv                               \
     --disable-libstdcxx                            \
-    --enable-languages=c,c++</userinput></screen>
+    --enable-languages=c,c++                       \
+    --with-abi=64                                  \
+    $LFS_MIPS_GCC_EXTRA_OPTIONS</userinput></screen>
     <variablelist>
       <title>The meaning of the configure options:</title>
 
@@ -152,8 +161,8 @@
       <varlistentry>
         <term><parameter>--disable-multilib</parameter></term>
         <listitem>
-          <para>On x86_64, LFS does not support a multilib configuration.
-          This switch is harmless for x86.</para>
+          <para>On 64-bit architectures, LFS does not support a multilib
+          configuration.</para>
         </listitem>
       </varlistentry>
 
@@ -179,6 +188,14 @@
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><parameter>--with-abi=64</parameter></term>
+        <listitem>
+          <para>On 64-bit MIPS, GCC defaults to generate object code for
+          32-bit ABI. This option overrides it.</para>
+        </listitem>
+      </varlistentry>
+
     </variablelist>
 
     <para>Compile GCC by running:</para>
diff --color -Nuar 10.1-orig/chapter05/glibc.xml 10.1-mips/chapter05/glibc.xml
--- 10.1-orig/chapter05/glibc.xml	2021-03-10 19:46:38.157770304 +0800
+++ 10.1-mips/chapter05/glibc.xml	2021-03-10 19:24:28.356570557 +0800
@@ -43,15 +43,13 @@
   <sect2 role="installation">
     <title>Installation of Glibc</title>
 
-    <para>First, create a symbolic link for LSB compliance. Additionally,
-    for x86_64, create a compatibility symbolic link required for proper
+    <para>First, create a compatibility symbolic link required for proper
     operation of the dynamic library loader:</para>
 
-<screen><userinput remap="pre">case $(uname -m) in
-    i?86)   ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
+<screen><userinput remap="pre">case $(echo __mips_nan2008 | $LFS_TGT-gcc -E -nostdinc - | tail -n 1) in
+    1) ln -sfv ../lib/ld-linux-mipsn8.so.1 $LFS/lib64
     ;;
-    x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
-            ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
+    *) ln -sfv ../lib/ld.so.1 $LFS/lib64
     ;;
 esac</userinput></screen>
 
@@ -119,7 +117,7 @@
           of the default /lib64 on 64 bit machines.</para>
         </listitem>
       </varlistentry>
-
+<!--
       <varlistentry>
         <term><option>libc_cv_include_x86_isa_level=no</option></term>
         <listitem>
@@ -130,7 +128,7 @@
           breaking it.</para>
         </listitem>
       </varlistentry>
-
+-->
     </variablelist>
 
     <para>During this stage the following warning might appear:</para>
@@ -191,15 +189,16 @@
 
 <screen><userinput>echo 'int main(){}' &gt; dummy.c
 $LFS_TGT-gcc dummy.c
-readelf -l a.out | grep '/ld-linux'</userinput></screen>
+readelf -l a.out | grep '/ld'</userinput></screen>
 
       <para>If everything is working correctly, there should be no errors,
       and the output of the last command will be of the form:</para>
 
-<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
+<screen><computeroutput>[Requesting program interpreter: /lib64/ld.so.1]</computeroutput></screen>
 
-      <para>Note that for 32-bit machines, the interpreter name will be
-      <filename>/lib/ld-linux.so.2</filename>.</para>
+      <para>Note that for systems with IEEE 754-2008 style NaN, the
+      interpreter name will be
+      <filename>/lib64/ld-linux-mipsn8.so.1</filename>.</para>
 
       <para>If the output is not shown as above or there was no output at all,
       then something is wrong. Investigate and retrace the steps to find out
diff --color -Nuar 10.1-orig/chapter06/gcc-pass2.xml 10.1-mips/chapter06/gcc-pass2.xml
--- 10.1-orig/chapter06/gcc-pass2.xml	2021-03-10 19:46:38.157770304 +0800
+++ 10.1-mips/chapter06/gcc-pass2.xml	2021-03-10 13:49:22.572391478 +0800
@@ -54,14 +54,23 @@
 tar -xf ../mpc-&mpc-version;.tar.gz
 mv -v mpc-&mpc-version; mpc</userinput></screen>
 
-    <para>If building on x86_64, change the default directory name for 64-bit
-    libraries to <quote>lib</quote>:</para>
+    <para>On 64-bit hosts, set the default directory name for
+    64-bit libraries to <quote>lib</quote>:</para>
+
+<screen><userinput remap="pre">sed -e 's/lib64/lib/g' \
+       -i.orig $(find gcc/config -name t-linux64)</userinput></screen>
+
+    <para>On 64-bit MIPS, set the default directory name for
+    core C runtime objects to <quote>lib</quote>:</para>
+
+<screen><userinput remap="pre">sed -e 's/lib64/lib/g' \
+       -i.orig gcc/config/mips/mips.h</userinput></screen>
+
+    <para>Fix an issue on MIPS:</para>
+
+<screen><userinput remap="pre">sed -e '2384 s/MSA/mode != MAX_MACHINE_MODE \&amp;\&amp; &amp;/' \
+     -i gcc/config/mips/mips.c</userinput></screen>
 
-<screen><userinput remap="pre">case $(uname -m) in
-  x86_64)
-    sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
-  ;;
-esac</userinput></screen>
 <!--
     <para>Fix an issue with GCC-10.1 when building with a cross
     compiler:</para>
@@ -100,7 +109,9 @@
     --disable-libssp                               \
     --disable-libvtv                               \
     --disable-libstdcxx                            \
-    --enable-languages=c,c++</userinput></screen>
+    --enable-languages=c,c++                       \
+    --with-abi=64                                  \
+    $LFS_MIPS_GCC_EXTRA_OPTIONS</userinput></screen>
 
     <variablelist>
       <title>The meaning of the new configure options:</title><!-- WIP -->
@@ -122,7 +133,7 @@
         <term><parameter>--enable-initfini-array</parameter></term>
         <listitem>
           <para>This option is automatically enabled when building a native
-          compiler with a native compiler on x86. But here, we build with
+          compiler with a native compiler on Linux. But here, we build with
           a cross compiler, so we need to explicitly set this option.</para>
         </listitem>
       </varlistentry>
diff --color -Nuar 10.1-orig/chapter07/changingowner.xml 10.1-mips/chapter07/changingowner.xml
--- 10.1-orig/chapter07/changingowner.xml	2021-03-10 19:46:38.141799378 +0800
+++ 10.1-mips/chapter07/changingowner.xml	2021-03-10 13:48:38.482679698 +0800
@@ -33,9 +33,6 @@
   user <systemitem class="username">root</systemitem> by running the following
   command:</para>
 
-<screen><userinput>chown -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools}
-case $(uname -m) in
-  x86_64) chown -R root:root $LFS/lib64 ;;
-esac</userinput></screen>
+<screen><userinput>chown -R root:root $LFS/{usr,lib,lib64,var,etc,bin,sbin,tools}</userinput></screen>
 
 </sect1>
diff --color -Nuar 10.1-orig/chapter07/chroot.xml 10.1-mips/chapter07/chroot.xml
--- 10.1-orig/chapter07/chroot.xml	2021-03-10 19:46:38.141799378 +0800
+++ 10.1-mips/chapter07/chroot.xml	2021-03-10 15:00:40.236323638 +0800
@@ -23,6 +23,7 @@
     TERM="$TERM"                \
     PS1='(lfs chroot) \u:\w\$ ' \
     PATH=/bin:/usr/bin:/sbin:/usr/sbin \
+    LFS_MIPS_GCC_EXTRA_OPTIONS="$LFS_MIPS_GCC_EXTRA_OPTIONS" \
     /bin/bash --login +h</userinput></screen>
 
   <para>The <parameter>-i</parameter> option given to the <command>env</command>
diff --color -Nuar 10.1-orig/chapter07/libstdc++-pass2.xml 10.1-mips/chapter07/libstdc++-pass2.xml
--- 10.1-orig/chapter07/libstdc++-pass2.xml	2021-03-10 19:46:38.141799378 +0800
+++ 10.1-mips/chapter07/libstdc++-pass2.xml	2021-03-10 13:52:13.740908786 +0800
@@ -62,12 +62,12 @@
 
     <para>Prepare libstdc++ for compilation:</para>
 
-<screen><userinput remap="configure">../libstdc++-v3/configure            \
-    CXXFLAGS="-g -O2 -D_GNU_SOURCE"  \
-    --prefix=/usr                    \
-    --disable-multilib               \
-    --disable-nls                    \
-    --host=$(uname -m)-lfs-linux-gnu \
+<screen><userinput remap="configure">../libstdc++-v3/configure              \
+    CXXFLAGS="-g -O2 -D_GNU_SOURCE"    \
+    --prefix=/usr                      \
+    --disable-multilib                 \
+    --disable-nls                      \
+    --host=mips64el-lfs-linux-gnuabi64 \
     --disable-libstdcxx-pch</userinput></screen>
 
     <variablelist>
@@ -82,7 +82,7 @@
       </varlistentry>
 
       <varlistentry>
-        <term><parameter>--host=$(uname -m)-lfs-linux-gnu</parameter></term>
+        <term><parameter>--host=mips64el-lfs-linux-gnuabi64</parameter></term>
         <listitem>
           <para>We have to mimic what would happen if this package were built
           as part of a full compiler build. This switch would be passed to
diff --color -Nuar 10.1-orig/chapter08/adjusting.xml 10.1-mips/chapter08/adjusting.xml
--- 10.1-orig/chapter08/adjusting.xml	2021-03-10 19:46:38.156772121 +0800
+++ 10.1-mips/chapter08/adjusting.xml	2021-03-10 16:12:55.610487631 +0800
@@ -52,14 +52,14 @@
   and the output of the last command will be (allowing for
   platform-specific differences in the dynamic linker name):</para>
 
-<screen os="c"><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
+<screen os="c"><computeroutput>[Requesting program interpreter: /lib64/ld.so.1]</computeroutput></screen>
 
   <para>Note that on 64-bit systems <filename class="directory">/lib</filename> is
   the location of our dynamic linker, but is accessed via a symbolic link
   in /lib64.</para>
 
-  <note><para>On 32-bit systems the interpreter should be
-  /lib/ld-linux.so.2.</para></note>
+  <note><para>On systems with IEEE 754-2008 NaN encoding, the interpreter
+  should be /lib64/ld-linux-mipsn8.so.1.</para></note>
 
   <para os="d">Now make sure that we're setup to use the correct start files:</para>
 
@@ -111,7 +111,7 @@
   <para os="r">The output of the last command should be (allowing for
   platform-specific differences in dynamic linker name):</para>
 
-<screen os="s"><computeroutput>found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2</computeroutput></screen>
+<screen os="s"><computeroutput>found ld.so.1 at /lib/ld.so.1</computeroutput></screen>
 
   <para os="t">If the output does not appear as shown above or is not received
   at all, then something is seriously wrong. Investigate and retrace the
diff --color -Nuar 10.1-orig/chapter08/chapter08.xml 10.1-mips/chapter08/chapter08.xml
--- 10.1-orig/chapter08/chapter08.xml	2021-03-10 19:46:38.156772121 +0800
+++ 10.1-mips/chapter08/chapter08.xml	2021-03-10 14:15:47.099573529 +0800
@@ -70,7 +70,7 @@
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="groff.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub.xml"/>
+  <!--xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub.xml"/-->
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="less.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iproute2.xml"/>
diff --color -Nuar 10.1-orig/chapter08/gcc.xml 10.1-mips/chapter08/gcc.xml
--- 10.1-orig/chapter08/gcc.xml	2021-03-10 19:46:38.156772121 +0800
+++ 10.1-mips/chapter08/gcc.xml	2021-03-10 14:09:10.261252109 +0800
@@ -41,15 +41,22 @@
   <sect2 role="installation">
     <title>Installation of GCC</title>
 
-    <para>If building on x86_64, change the default directory name for 64-bit
-    libraries to <quote>lib</quote>:</para>
+    <para>On 64-bit hosts, set the default directory name for
+    64-bit libraries to <quote>lib</quote>:</para>
 
-<screen><userinput remap="pre">case $(uname -m) in
-  x86_64)
-    sed -e '/m64=/s/lib64/lib/' \
-        -i.orig gcc/config/i386/t-linux64
-  ;;
-esac</userinput></screen>
+<screen><userinput remap="pre">sed -e 's/lib64/lib/g' \
+       -i.orig $(find gcc/config -name t-linux64)</userinput></screen>
+
+    <para>On 64-bit MIPS, set the default directory name for
+    core C runtime objects to <quote>lib</quote>:</para>
+
+<screen><userinput remap="pre">sed -e 's/lib64/lib/g' \
+       -i.orig gcc/config/mips/mips.h</userinput></screen>
+
+    <para>Fix an issue on MIPS:</para>
+
+<screen><userinput remap="pre">sed -e '2384 s/MSA/mode != MAX_MACHINE_MODE \&amp;\&amp; &amp;/' \
+     -i gcc/config/mips/mips.c</userinput></screen>
 
     <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
 
@@ -63,7 +70,9 @@
              --enable-languages=c,c++ \
              --disable-multilib       \
              --disable-bootstrap      \
-             --with-system-zlib</userinput></screen>
+             --with-system-zlib       \
+             --with-abi=64            \
+             $LFS_MIPS_GCC_EXTRA_OPTIONS</userinput></screen>
 
     <para>Note that for other programming languages there are some prerequisites that
     are not yet available. See the
@@ -158,7 +167,7 @@
     <systemitem class="username">root</systemitem> user and group:</para>
 
 <screen><userinput remap="install">chown -v -R root:root \
-    /usr/lib/gcc/*linux-gnu/&gcc-version;/include{,-fixed}</userinput></screen>
+    /usr/lib/gcc/*linux-gnu*/&gcc-version;/include{,-fixed}</userinput></screen>
 
     <para>Create a symlink required by the <ulink
     url="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s09.html">FHS</ulink>
@@ -205,9 +214,9 @@
     href="adjusting.xml"
     xpointer="xpointer(//*[@os='f'])"/>
 
-<screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded
-/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
-/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
+<screen><computeroutput>/usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/../../../../lib/crt1.o succeeded
+/usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/../../../../lib/crti.o succeeded
+/usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
 
   <para>Depending on your machine architecture, the above may differ slightly.
   The difference will be the name of the directory
@@ -227,9 +236,9 @@
     xpointer="xpointer(//*[@os='h'])"/>
 
 <screen><computeroutput>#include &lt;...&gt; search starts here:
- /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include
+ /usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/include
  /usr/local/include
- /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed
+ /usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/include-fixed
  /usr/include</computeroutput></screen>
 
    <para>Again, the directory named after your target triplet may be
@@ -247,23 +256,11 @@
     href="adjusting.xml"
     xpointer="xpointer(//*[@os='k'])"/>
 
-<screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
+<screen><computeroutput>SEARCH_DIR("/usr/mips64el-unknown-linux-gnuabi64/lib64")
 SEARCH_DIR("/usr/local/lib64")
 SEARCH_DIR("/lib64")
 SEARCH_DIR("/usr/lib64")
-SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
-SEARCH_DIR("/usr/local/lib")
-SEARCH_DIR("/lib")
-SEARCH_DIR("/usr/lib");</computeroutput></screen>
-
-   <para>A 32-bit system may see a few different directories. For example, here
-   is the output from an i686 machine:</para>
-
-<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32")
-SEARCH_DIR("/usr/local/lib32")
-SEARCH_DIR("/lib32")
-SEARCH_DIR("/usr/lib32")
-SEARCH_DIR("/usr/i686-pc-linux-gnu/lib")
+SEARCH_DIR("/usr/mips64el-unknown-linux-gnuabi64/lib")
 SEARCH_DIR("/usr/local/lib")
 SEARCH_DIR("/lib")
 SEARCH_DIR("/usr/lib");</computeroutput></screen>
diff --color -Nuar 10.1-orig/chapter08/gmp.xml 10.1-mips/chapter08/gmp.xml
--- 10.1-orig/chapter08/gmp.xml	2021-03-10 19:46:38.156772121 +0800
+++ 10.1-mips/chapter08/gmp.xml	2021-03-10 13:58:16.172919454 +0800
@@ -40,7 +40,7 @@
 
   <sect2 role="installation">
     <title>Installation of GMP</title>
-
+<!--
     <note>
       <para>If you are building for 32-bit x86, but you have a CPU which is
       capable of running 64-bit code <emphasis>and</emphasis> you have specified
@@ -49,7 +49,7 @@
       Avoid this by invoking the configure command below with
 <screen role="nodump"><userinput><parameter>ABI=32</parameter> ./configure ...</userinput></screen></para>
     </note>
-
+-->
     <note>
       <para>The default settings of GMP produce libraries optimized for
       the host processor.  If libraries suitable for processors less
@@ -63,6 +63,7 @@
     <para>Prepare GMP for compilation:</para>
 
 <screen><userinput remap="configure">./configure --prefix=/usr    \
+            ABI=64           \
             --enable-cxx     \
             --disable-static \
             --docdir=/usr/share/doc/gmp-&gmp-version;</userinput></screen>
@@ -71,6 +72,14 @@
       <title>The meaning of the new configure options:</title>
 
       <varlistentry>
+        <term><parameter>ABI=64</parameter></term>
+        <listitem>
+          <para>On 64-bit MIPS, GMP defaults to build for N32 ABI.
+          This option overrides it.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term><parameter>--enable-cxx</parameter></term>
         <listitem>
           <para>This parameter enables C++ support</para>
diff --color -Nuar 10.1-orig/chapter08/introduction.xml 10.1-mips/chapter08/introduction.xml
--- 10.1-orig/chapter08/introduction.xml	2021-03-10 19:46:38.156772121 +0800
+++ 10.1-mips/chapter08/introduction.xml	2021-03-10 16:24:40.688172928 +0800
@@ -35,6 +35,12 @@
   optimizations. The subsequent system will still run very fast and be stable
   at the same time.</para>
 
+  <para>That being said, MIPS (and other RISC architectures) may need
+  compiler optimization more aggressive than default for appropriate
+  performance.  You can try some custom compiler optimizations during build,
+  if you understand how to diagnostic the issues may be caused by them.
+  </para>
+
   <para>Before the installation instructions, each installation page provides
   information about the package, including a concise description of what it
   contains, approximately how long it will take to build, and how much disk
diff --color -Nuar 10.1-orig/chapter08/libffi.xml 10.1-mips/chapter08/libffi.xml
--- 10.1-orig/chapter08/libffi.xml	2021-03-10 19:46:38.155773938 +0800
+++ 10.1-mips/chapter08/libffi.xml	2021-03-10 16:05:47.907216857 +0800
@@ -66,8 +66,8 @@
           will be copied from the native system to a less capable 
           system, use the less capable system as a parameter. For details 
           about alternative system types, see <ulink 
-          url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/x86-Options.html'>
-          the x86 options in the GCC manual</ulink>.</para>
+          url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/MIPS-Options.html'>
+          the MIPS options in the GCC manual</ulink>.</para>
         </listitem>
       </varlistentry>
 
diff --color -Nuar 10.1-orig/chapter08/openssl.xml 10.1-mips/chapter08/openssl.xml
--- 10.1-orig/chapter08/openssl.xml	2021-03-10 19:46:38.156772121 +0800
+++ 10.1-mips/chapter08/openssl.xml	2021-03-10 14:14:54.393911413 +0800
@@ -43,13 +43,18 @@
   <sect2 role="installation">
     <title>Installation of OpenSSL</title>
 
+    <para>Workaround an issue in the building system:</para>
+
+<screen><userinput remap="pre">sed '/-mips3/d' -i Configure</userinput></screen>
+
     <para>Prepare OpenSSL for compilation:</para>
 
-<screen><userinput remap="configure">./config --prefix=/usr         \
-         --openssldir=/etc/ssl \
-         --libdir=lib          \
-         shared                \
-         zlib-dynamic</userinput></screen>
+<screen><userinput remap="configure">./Configure linux64-mips64        \
+            --prefix=/usr         \
+            --openssldir=/etc/ssl \
+            --libdir=lib          \
+            shared                \
+            zlib-dynamic</userinput></screen>
 
     <para>Compile the package:</para>
 
diff --color -Nuar 10.1-orig/chapter08/tcl.xml 10.1-mips/chapter08/tcl.xml
--- 10.1-orig/chapter08/tcl.xml	2021-03-10 19:46:38.156772121 +0800
+++ 10.1-mips/chapter08/tcl.xml	2021-03-10 13:54:12.793861443 +0800
@@ -63,25 +63,24 @@
 <screen><userinput remap="configure">SRCDIR=$(pwd)
 cd unix
 ./configure --prefix=/usr           \
-            --mandir=/usr/share/man \
-            $([ "$(uname -m)" = x86_64 ] &amp;&amp; echo --enable-64bit)</userinput></screen>
-
+            --mandir=/usr/share/man</userinput></screen>
+<!--
     <variablelist>
       <title>The meaning of the configure options:</title>
 
       <varlistentry>
-        <term><parameter>$([ "$(uname -m)" = x86_64 ] &amp;&amp; echo --enable-64bit)</parameter></term>
+        <term><parameter>$([ "$(uname -m)" = x86_64 ] &amp;&amp; echo - -enable-64bit)</parameter></term>
         <listitem>
           <para>The construct <parameter>$(&lt;shell command&gt;)</parameter>
           is replaced by the output of the shell command.  Here this output is
           empty if running on a 32 bit machine, and is
-          <parameter>--enable-64bit</parameter> if running on a 64 bit machine.
+          <parameter>- -enable-64bit</parameter> if running on a 64 bit machine.
           </para>
         </listitem>
       </varlistentry>
 
     </variablelist>
-
+-->
     <para>Build the package:</para>
 
 <screen><userinput remap="make">make
diff --color -Nuar 10.1-orig/chapter08/util-linux.xml 10.1-mips/chapter08/util-linux.xml
--- 10.1-orig/chapter08/util-linux.xml	2021-03-10 19:46:38.156772121 +0800
+++ 10.1-mips/chapter08/util-linux.xml	2021-03-10 18:50:05.711282672 +0800
@@ -115,15 +115,15 @@
         chmem, choom, chrt, col, colcrt, colrm, column, ctrlaltdel, delpart, dmesg,
         eject, fallocate, fdformat, fdisk, fincore, findfs, findmnt, flock, fsck,
         fsck.cramfs, fsck.minix, fsfreeze, fstrim, getopt, hexdump, hwclock,
-        i386, ionice, ipcmk, ipcrm, ipcs, isosize, kill, last, lastb (link to
+        ionice, ipcmk, ipcrm, ipcs, isosize, kill, last, lastb (link to
         last), ldattach, linux32, linux64, logger, look, losetup, lsblk, lscpu,
-        lsipc, lslocks, lslogins, lsmem, lsns, mcookie, mesg, mkfs, mkfs.bfs, mkfs.cramfs, mkfs.minix, mkswap,
+        lsipc, lslocks, lslogins, lsmem, lsns, mcookie, mesg, mips, mips32, mips64, mkfs, mkfs.bfs, mkfs.cramfs, mkfs.minix, mkswap,
         more, mount, mountpoint, namei, nsenter, partx, pivot_root, prlimit, raw,
         readprofile, rename, renice, resizepart, rev, rfkill, rtcwake, script,
         scriptreplay, setarch, setsid, setterm, sfdisk, sulogin, swaplabel,
         swapoff (link to swapon), swapon, switch_root, taskset, ul,
         umount, uname26, unshare, utmpdump, uuidd, uuidgen, uuidparse, wall, wdctl, whereis,
-        wipefs, x86_64, and zramctl</seg>
+        wipefs, and zramctl</seg>
         <seg>libblkid.so, libfdisk.so, libmount.so, 
         libsmartcols.so, and libuuid.so</seg>
         <seg>/usr/include/blkid, 
@@ -336,6 +336,36 @@
         </listitem>
       </varlistentry>
 
+      <varlistentry id="mips">
+        <term><command>mips</command></term>
+        <listitem>
+          <para>A symbolic link to setarch</para>
+          <indexterm zone="ch-system-util-linux mips">
+            <primary sortas="b-mips">mips</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="mips32">
+        <term><command>mips32</command></term>
+        <listitem>
+          <para>A symbolic link to setarch</para>
+          <indexterm zone="ch-system-util-linux mips32">
+            <primary sortas="b-mips32">mips32</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="mips64">
+        <term><command>mips64</command></term>
+        <listitem>
+          <para>A symbolic link to setarch</para>
+          <indexterm zone="ch-system-util-linux mips64">
+            <primary sortas="b-mips64">mips64</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
       <varlistentry id="eject">
         <term><command>eject</command></term>
         <listitem>
@@ -505,16 +535,6 @@
         </listitem>
       </varlistentry>
 
-      <varlistentry id="i386">
-        <term><command>i386</command></term>
-        <listitem>
-          <para>A symbolic link to setarch</para>
-          <indexterm zone="ch-system-util-linux i386">
-            <primary sortas="b-i386">i386</primary>
-          </indexterm>
-        </listitem>
-      </varlistentry>
-
       <varlistentry id="ionice">
         <term><command>ionice</command></term>
         <listitem>
@@ -1232,16 +1252,6 @@
           </indexterm>
         </listitem>
       </varlistentry>
-
-      <varlistentry id="x86_64">
-        <term><command>x86_64</command></term>
-        <listitem>
-          <para>A symbolic link to setarch</para>
-          <indexterm zone="ch-system-util-linux x86_64">
-            <primary sortas="b-x86_64">x86_64</primary>
-          </indexterm>
-        </listitem>
-      </varlistentry>
 
       <varlistentry id="zramctl">
         <term><command>zramctl</command></term>
diff --color -Nuar 10.1-orig/chapter10/grub.xml 10.1-mips/chapter10/grub.xml
--- 10.1-orig/chapter10/grub.xml	2021-03-10 19:46:38.142797561 +0800
+++ 10.1-mips/chapter10/grub.xml	2021-03-10 14:58:54.282819470 +0800
@@ -14,157 +14,46 @@
     <address>&grub-url;</address>
   </sect1info>
 
-  <title>Using GRUB to Set Up the Boot Process</title>
+  <title>Set Up the Boot Process</title>
 
   <sect2>
     <title>Introduction</title>
 
-    <warning><para>Configuring GRUB incorrectly can render your system
+    <para>Configuring the bootloaders incorrectly can render your system
     inoperable without an alternate boot device such as a CD-ROM or bootable
-    USB drive. This section is not required to boot your LFS system.  You may
-    just want to modify your current boot loader, e.g. Grub-Legacy, GRUB2, or
-    LILO.</para></warning>
-
-    <para> Ensure that an emergency boot disk is ready to <quote>rescue</quote>
-    the computer if the computer becomes unusable (un-bootable).  If you do not
-    already have a boot device, you can create one.  In order for the procedure
-    below to work, you need to jump ahead to BLFS and install
-    <userinput>xorriso</userinput> from the <ulink
-    url="&blfs-book;multimedia/libisoburn.html">
-    libisoburn</ulink> package.</para>
-
-<screen role="nodump"><userinput>cd /tmp 
-grub-mkrescue --output=grub-img.iso 
-xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso</userinput></screen>
-
-    <note>
-      <para>
-        To boot LFS on host systems that have UEFI enabled, the kernel needs to
-        have been built with the CONFIG_EFI_STUB capability described in the
-        previous section.  However, LFS can be booted using GRUB2 without such
-        an addition. To do this, the UEFI Mode and Secure Boot capabilities in
-        the host system's BIOS need to be turned off.  For details, see <ulink
-        url="&hints-root;lfs-uefi.txt">
-        the lfs-uefi.txt hint</ulink> at
-        &hints-root;lfs-uefi.txt.
-      </para>
-    </note>
+    USB drive. And, the booting process of MIPS boards is not standardized
+    like the PC systems.  So it's recommended to modify your current boot
+    loader, e.g. GRUB2, or Pmon, to boot up the LFS system.</para>
+
+    <para>Ensure that an emergency boot disk is ready to <quote>rescue</quote>
+    the computer if the computer becomes unusable (un-bootable).  For example,
+    a Live CD of Live USB of your host distribution.</para>
 
   </sect2>
 
-  <sect2>
-    <title>GRUB Naming Conventions</title>
-
-    <para>GRUB uses its own naming structure for drives and partitions in
-    the form of <emphasis>(hdn,m)</emphasis>, where <emphasis>n</emphasis>
-    is the hard drive number and <emphasis>m</emphasis> is the partition
-    number. The hard drive number starts from zero, but the partition number
-    starts from one for normal partitions and five for extended partitions.
-    Note that this is different from earlier versions where
-    both numbers started from zero. For example, partition <filename
-    class="partition">sda1</filename> is <emphasis>(hd0,1)</emphasis> to
-    GRUB and <filename class="partition">sdb3</filename> is
-    <emphasis>(hd1,3)</emphasis>. In contrast to Linux, GRUB does not
-    consider CD-ROM drives to be hard drives. For example, if using a CD
-    on <filename class="partition">hdb</filename> and a second hard drive
-    on <filename class="partition">hdc</filename>, that second hard drive
-    would still be <emphasis>(hd1)</emphasis>.</para>
-
-  </sect2>
-
-  <sect2>
-    <title>Setting Up the Configuration</title>
-
-    <para>GRUB works by writing data to the first physical track of the
-    hard disk.  This area is not part of any file system.  The programs
-    there access GRUB modules in the boot partition.  The default location
-    is /boot/grub/.</para>
-
-    <para>The location of the boot partition is a choice of the user that
-    affects the configuration.  One recommendation is to have a separate small
-    (suggested size is 200 MB) partition just for boot information.  That way
-    each build, whether LFS or some commercial distro, can access the same boot
-    files and access can be made from any booted system.  If you choose to do
-    this, you will need to mount the separate partition, move all files in the
-    current <filename class="directory">/boot</filename> directory (e.g. the
-    linux kernel you just built in the previous section) to the new partition.
-    You will then need to unmount the partition and remount it as <filename
-    class="directory">/boot</filename>.  If you do this, be sure to update
-    <filename>/etc/fstab</filename>.</para>
-
-    <para>Using the current lfs partition will also work, but configuration
-    for multiple systems is more difficult.</para>
-
-    <para>Using the above information, determine the appropriate
-    designator for the root partition (or boot partition, if a separate
-    one is used). For the following example, it is assumed that the root
-    (or separate boot) partition is <filename
-    class="partition">sda2</filename>.</para>
-
-    <para>Install the GRUB files into <filename
-    class="directory">/boot/grub</filename> and set up the boot track:</para>
-
-    <warning>
-      <para>The following command will overwrite the current boot loader. Do not
-      run the command if this is not desired, for example, if using a third party
-      boot manager to manage the Master Boot Record (MBR).</para>
-    </warning>
-
-<screen role="nodump"><userinput>grub-install /dev/sda</userinput></screen>
-
-    <note>
-      <para>If the system has been booted using UEFI,
-      <command>grub-install</command> will try to install files for the
-      <emphasis>x86_64-efi</emphasis> target, but those files
-      have not been installed in chapter 6. If this is the case, add
-      <option>--target i386-pc</option> to the command above.</para>
-    </note>
-
-<!-- This does not seem to be true any more
-    <note><para><application>grub-install</application> is a script and calls another
-    program, grub-probe, that may fail with a message "cannot stat `/dev/root'".
-    If so, create a temporary symbolic link from your root partition to /dev/root:</para>
-
-<screen role="nodump"><userinput>ln -sv /dev/sda2 /dev/root</userinput></screen>
-
-    <para>The symbolic link will only be present until the system is rebooted.
-    The link is only needed for the installation procedure.
-    </para></note>
--->
-  </sect2>
-
   <sect2 id="grub-cfg">
     <title>Creating the GRUB Configuration File</title>
 
-    <para>Generate <filename>/boot/grub/grub.cfg</filename>:</para>
-
-    <screen revision="sysv"><userinput>cat &gt; /boot/grub/grub.cfg &lt;&lt; "EOF"
-<literal># Begin /boot/grub/grub.cfg
-set default=0
-set timeout=5
-
-insmod ext2
-set root=(hd0,2)
+    <para><emphasis role="bold">For example</emphasis>, on a Loongson
+    3A4000 board whose <quote>official</quote> distribution boots with an
+    UEFI-like firmware and GRUB2, create
+    <filename>/boot/efi/EFI/BOOT/custom.cfg</filename>,
+    to add the entry for LFS into GRUB boot menu:</para>
 
+    <screen revision="sysv"><userinput>cat &gt; /boot/efi/EFI/BOOT/custom.cfg &lt;&lt; "EOF"
+<literal># Begin custom.cfg
 menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" {
         linux   /boot/vmlinuz-&linux-version;-lfs-&version; root=/dev/sda2 ro
 }</literal>
 EOF</userinput></screen>
 
-    <screen revision="systemd"><userinput>cat &gt; /boot/grub/grub.cfg &lt;&lt; "EOF"
-<literal># Begin /boot/grub/grub.cfg
-set default=0
-set timeout=5
-
-insmod ext2
-set root=(hd0,2)
-
+    <screen revision="systemd"><userinput>cat &gt; /boot/efi/EFI/BOOT/custom.cfg &lt;&lt; "EOF"
+<literal># Begin custom.cfg
 menuentry "GNU/Linux, Linux &linux-version;-lfs-&versiond;" {
         linux   /boot/vmlinuz-&linux-version;-lfs-&versiond; root=/dev/sda2 ro
 }</literal>
 EOF</userinput></screen>
 
-
     <note><para>From <application>GRUB</application>'s perspective, the
     kernel files are relative to the partition used.  If you
     used a separate /boot partition, remove /boot from the above
@@ -172,19 +61,6 @@
     <emphasis>set root</emphasis> line to point to the boot partition.
     </para></note>
 
-    <para>GRUB is an extremely powerful program and it provides a tremendous
-    number of options for booting from a wide variety of devices, operating
-    systems, and partition types.  There are also many options for customization
-    such as graphical splash screens, playing sounds, mouse input, etc.  The
-    details of these options are beyond the scope of this introduction.</para>
-
-    <caution><para>There is a command, <application>grub-mkconfig</application>, that
-    can write a configuration file automatically.  It uses a set of scripts in
-    /etc/grub.d/ and will destroy any customizations that you make.  These scripts
-    are designed primarily for non-source distributions and are not recommended for
-    LFS.  If you install a commercial Linux distribution, there is a good chance
-    that this program will be run.  Be sure to back up your grub.cfg file.</para></caution>
-
    </sect2>
 
 </sect1>
diff --color -Nuar 10.1-orig/chapter10/kernel.xml 10.1-mips/chapter10/kernel.xml
--- 10.1-orig/chapter10/kernel.xml	2021-03-10 19:46:38.142797561 +0800
+++ 10.1-mips/chapter10/kernel.xml	2021-03-10 16:04:14.677913897 +0800
@@ -40,6 +40,16 @@
   <sect2 role="installation">
     <title>Installation of the kernel</title>
 
+    <warning>
+      <para>
+        Vanilla kernel may not support some hardware on your MIPS64 EL
+        board.  It's possible that the vanilla kernel won't even boot.
+        You may need to get a tarball of customized kernel source, or a
+        series of kernel patches, from either the vendor of your board
+        or the community.
+      </para>
+    </warning>
+
     <para>Building the kernel involves a few steps&mdash;configuration,
     compilation, and installation. Read the <filename>README</filename> file
     in the kernel source tree for alternative methods to the way this book
@@ -106,12 +116,16 @@
       <para>Be sure to enable/disable/set the following features or the system might
       not work correctly or boot at all:</para>
 
-      <screen role="nodump" revision="sysv">Device Drivers  ---&gt;
+      <screen role="nodump" revision="sysv">Kernel type  ---&gt;
+  [ ] 48 bits virtual memory
+Device Drivers  ---&gt;
   Generic Driver Options  ---&gt;
    [ ] Support for uevent helper [CONFIG_UEVENT_HELPER]
    [*] Maintain a devtmpfs filesystem to mount at /dev [CONFIG_DEVTMPFS]</screen>
 
-      <screen role="nodump" revision="systemd">General setup -->
+      <screen role="nodump" revision="systemd">Kernel type  ---&gt;
+  [ ] 48 bits virtual memory
+General setup -->
    [ ] Auditing Support [CONFIG_AUDIT]
    [*] Control Group support [CONFIG_CGROUPS]
    [ ] Enable deprecated sysfs features to support old userspace tools [CONFIG_SYSFS_DEPRECATED]
@@ -147,7 +161,7 @@
     url="&lfs-root;blfs/view/&short-version;/longindex.html#kernel-config-index">BLFS
     Index of Kernel Settings</ulink>
     (&lfs-root;blfs/view/&short-version;/longindex.html#kernel-config-index).</para>
-
+<!--
     <note>
       <para>If your host hardware is using UEFI, then the 'make defconfig'
       above should automatically add in some EFI-related kernel options.</para>
@@ -156,7 +170,7 @@
       host's UEFI boot environment, your kernel must have this option
       selected:</para>
 
-<screen role="nodump">Processor type and features  ---&gt;
+<screen role="nodump">Processor type and features  - - -&gt;
    [*]   EFI stub support  [CONFIG_EFI_STUB]</screen>
 
       <para>A fuller description of managing UEFI environments from within LFS
@@ -165,11 +179,19 @@
         url="&hints-root;lfs-uefi.txt"/>.
       </para>
     </note>
-
+-->
     <variablelist>
       <title>The rationale for the above configuration items:</title>
 
       <varlistentry>
+        <term><parameter>48 bits virtual memory</parameter></term>
+        <listitem>
+          <para>On 64-bit MIPS, Having this option set may break some BLFS
+          packages (for example, JS78).</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term><parameter>Support for uevent helper</parameter></term>
         <listitem>
           <para>Having this option set may interfere with device
@@ -235,11 +257,11 @@
     used. The filename below can be changed to suit your taste, but the stem of
     the filename should be <emphasis>vmlinuz</emphasis> to be compatible with
     the automatic setup of the boot process described in the next section.  The
-    following command assumes an x86 architecture:</para>
+    following command assumes a MIPS architecture:</para>
 
-<screen revision="sysv"><userinput remap="install">cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen>
+<screen revision="sysv"><userinput remap="install">cp -iv vmlinuz /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen>
 
-<screen revision="systemd"><userinput remap="install">cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&versiond;</userinput></screen>
+<screen revision="systemd"><userinput remap="install">cp -iv vmlinuz /boot/vmlinuz-&linux-version;-lfs-&versiond;</userinput></screen>
 
     <para><filename>System.map</filename> is a symbol file for the kernel.
     It maps the function entry points of every function in the kernel API,
diff --color -Nuar 10.1-orig/chapter11/whatnow.xml 10.1-mips/chapter11/whatnow.xml
--- 10.1-orig/chapter11/whatnow.xml	2021-03-10 19:46:38.155773938 +0800
+++ 10.1-mips/chapter11/whatnow.xml	2021-03-10 14:37:58.838012182 +0800
@@ -58,6 +58,12 @@
       <para>The Beyond Linux From Scratch book covers installation
       procedures for a wide range of software beyond the scope of the LFS
       Book. The BLFS project is located at <ulink url="&blfs-book;"/>.</para>
+      <warning>
+	<para>
+	  BLFS have no MIPS64 EL port, so you need to improvise if some
+	  BLFS package fails to build from source on MIPS64 EL.
+        </para>
+      </warning>
     </listitem>
 
     <listitem>
diff --color -Nuar 10.1-orig/general.ent 10.1-mips/general.ent
--- 10.1-orig/general.ent	2021-03-10 19:46:38.155773938 +0800
+++ 10.1-mips/general.ent	2021-03-10 13:01:57.675490438 +0800
@@ -1,13 +1,13 @@
-<!ENTITY version         "10.1">
+<!ENTITY version         "10.1-mips64el">
 <!ENTITY short-version   "10.1">  <!-- Used below in &blfs-book; 
                                       Change to x.y for release but not -rc releases -->
-<!ENTITY generic-version "10.1"> <!-- Use "development"  or "x.y[-pre{x}]" -->
+<!ENTITY generic-version "10.1-mips64el"> <!-- Use "development"  or "x.y[-pre{x}]" -->
 
-<!ENTITY versiond        "10.1-systemd">
+<!ENTITY versiond        "10.1-mips64el-systemd">
 <!ENTITY short-versiond  "systemd">
 <!ENTITY generic-versiond "systemd"> 
 
-<!ENTITY releasedate     "March 1st, 2021">
+<!ENTITY releasedate     "March 10th, 2021">
 
 <!ENTITY copyrightdate   "1999-2021"><!-- jhalfs needs a literal dash, not &ndash; -->
 
diff --color -Nuar 10.1-orig/part3intro/toolchaintechnotes.xml 10.1-mips/part3intro/toolchaintechnotes.xml
--- 10.1-orig/part3intro/toolchaintechnotes.xml	2021-03-10 19:46:38.142797561 +0800
+++ 10.1-mips/part3intro/toolchaintechnotes.xml	2021-03-10 13:28:54.690709949 +0800
@@ -149,16 +149,18 @@
       sources and run the script: <userinput>./config.guess</userinput> and note
       the output. For example, for a 32-bit Intel processor the
       output will be <emphasis>i686-pc-linux-gnu</emphasis>. On a 64-bit
-      system it will be <emphasis>x86_64-pc-linux-gnu</emphasis>.</para>
+      MIPS64 EL system it will be
+      <emphasis>mips64el-unknown-linux-gnuabi64</emphasis>.</para>
 
       <para>Also be aware of the name of the platform's dynamic linker, often
       referred to as the dynamic loader (not to be confused with the standard
       linker <command>ld</command> that is part of binutils). The dynamic linker
       provided by Glibc finds and loads the shared libraries needed by a
       program, prepares the program to run, and then runs it. The name of the
-      dynamic linker for a 32-bit Intel machine will be <filename
-      class="libraryfile">ld-linux.so.2</filename> (<filename
-      class="libraryfile">ld-linux-x86-64.so.2</filename> for 64-bit systems). A
+      dynamic linker for a MIPS64 EL machine will be <filename
+      class="libraryfile">ld.so.1</filename> or
+      <filename class="libraryfile">ld-linux-mipsn8.so.1</filename>,
+      depending on the NaN encoding of the FPU of the processor. A
       sure-fire way to determine the name of the dynamic linker is to inspect a
       random binary from the host system by running: <userinput>readelf -l
       &lt;name of binary&gt; | grep interpreter</userinput> and noting the
diff --color -Nuar 10.1-orig/prologue/architecture.xml 10.1-mips/prologue/architecture.xml
--- 10.1-orig/prologue/architecture.xml	2021-03-10 19:46:38.144793927 +0800
+++ 10.1-mips/prologue/architecture.xml	2021-03-10 13:08:00.752066675 +0800
@@ -10,40 +10,23 @@
 
   <title>LFS Target Architectures</title>
 
-<para>The primary target architectures of LFS are the AMD/Intel x86 (32-bit)
-and x86_64 (64-bit) CPUs.  On the other hand, the instructions in this book are
-also known to work, with some modifications, with the Power PC and ARM CPUs. To
+<para>This book is a highly experimental port of LFS to 64-bit little-endian
+MIPS (MIPS64 EL) architecture.  The instructions are only tested on a
+Loongson-3A4000 based board. On the other hand, the instructions in this
+book should work on other MIPS64 EL CPUs, with some modifications. To
 build a system that utilizes one of these CPUs, the main prerequisite, in
 addition to those on the next page, is an existing Linux system such as an
-earlier LFS installation, Ubuntu, Red Hat/Fedora, SuSE, or other distribution
-that targets the architecture that you have. Also note that a 32-bit
-distribution can be installed and used as a host system on a 64-bit AMD/Intel
-computer.</para>
+earlier LFS installation, Fedora, or other distribution
+that targets the architecture that you have.</para>
 
-<para>For building LFS, the gain of building on a 64-bit system
-compared to a 32-bit system is minimal.
-For example, in a test build of LFS-9.1 on a Core i7-4790 CPU based system,
-using 4 cores, the following statistics were measured:</para>
-
-<screen><computeroutput>Architecture Build Time     Build Size
-32-bit       239.9 minutes  3.6 GB
-64-bit       233.2 minutes  4.4 GB</computeroutput></screen>
-
-<para>As you can see, on the same hardware, the 64-bit build is only 3% faster
-and is 22% larger than the 32-bit build. If you plan to use LFS as a LAMP
-server, or a firewall, a 32-bit CPU may be largely sufficient. On the other
-hand, several packages in BLFS now need more than 4GB of RAM to be built
-and/or to run, so that if you plan to use LFS as a desktop, the LFS authors
-recommend building on a 64-bit system.</para>
-
-<para>The default 64-bit build that results from LFS is considered a
+<para>The build that results from the book is considered a
 <quote>pure</quote> 64-bit system. That is, it supports 64-bit executables
 only. Building a <quote>multi-lib</quote> system requires compiling many
 applications twice, once for a 32-bit system and once for a 64-bit system.
 This is not directly supported in LFS because it would interfere with the
 educational objective of providing the instructions needed for a
 straightforward base Linux system. Some LFS/BLFS editors maintain a fork
-of LFS for multilib, which is accessible at <ulink
+of LFS for multilib on AMD64, which is accessible at <ulink
 url="http://www.linuxfromscratch.org/~thomas/multilib/index.html"/>. But it
 is an advanced topic.</para>
 
diff --color -Nuar 10.1-orig/prologue/why.xml 10.1-mips/prologue/why.xml
--- 10.1-orig/prologue/why.xml	2021-03-10 19:46:38.144793927 +0800
+++ 10.1-mips/prologue/why.xml	2021-03-10 13:09:20.668443571 +0800
@@ -249,7 +249,7 @@
         <para>This package contains programs for processing and formatting text.
         One important function of these programs is to format man pages.</para>
       </listitem>
-
+<!--
       <listitem>
         <para>GRUB</para>
 
@@ -257,7 +257,7 @@
         of several boot loaders available, but is the most flexible.
         </para>
       </listitem>
-
+-->
       <listitem>
         <para>Gzip</para>
 
