All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] multiboot2: Allow running autogen.sh
@ 2020-04-16 15:09 Hans Ulrich Niedermann
  2020-04-16 15:09 ` [PATCH 2/3] multiboot2: Use .gitignore files Hans Ulrich Niedermann
  2020-04-16 15:09 ` [PATCH 3/3] multiboot2: Make example kernel build at least for i386 Hans Ulrich Niedermann
  0 siblings, 2 replies; 4+ messages in thread
From: Hans Ulrich Niedermann @ 2020-04-16 15:09 UTC (permalink / raw)
  To: grub-devel; +Cc: Hans Ulrich Niedermann

Current gnulib's gnulib-tool only runs if configure.ac contains
AC_PREREQ(2.63).

As Autoconf 2.63 has been released in 2008-09, this should not
affect too many systems in 2020.

Signed-off-by: Hans Ulrich Niedermann <hun@n-dimensional.de>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 585b37a36..8f21b1852 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@ dnl "AS IS" CONDITION.  THE FREE SOFTWARE FOUNDATION DISCLAIMS ANY
 dnl LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
 dnl USE OF THIS SOFTWARE.
 
-AC_PREREQ(2.59)
+AC_PREREQ(2.63)
 AC_INIT([Multiboot], [2.0], [bug-grub@gnu.org])
 AC_CONFIG_SRCDIR([doc/multiboot.texi])
 AC_CONFIG_HEADER([config.h])
-- 
2.25.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] multiboot2: Use .gitignore files
  2020-04-16 15:09 [PATCH 1/3] multiboot2: Allow running autogen.sh Hans Ulrich Niedermann
@ 2020-04-16 15:09 ` Hans Ulrich Niedermann
  2020-04-16 16:45   ` [PATCH v2 " Hans Ulrich Niedermann
  2020-04-16 15:09 ` [PATCH 3/3] multiboot2: Make example kernel build at least for i386 Hans Ulrich Niedermann
  1 sibling, 1 reply; 4+ messages in thread
From: Hans Ulrich Niedermann @ 2020-04-16 15:09 UTC (permalink / raw)
  To: grub-devel; +Cc: Hans Ulrich Niedermann

Add /.gitignore file and remove the /.bzrignore file.

The /doc/.gitignore file is generated by gnulib-tool so we keep
that file in addition to the top-level /.gitignore file which
covers everything else in subdirectories as well.

Signed-off-by: Hans Ulrich Niedermann <hun@n-dimensional.de>
---
 .bzrignore     | 30 ------------------------------
 .gitignore     | 41 +++++++++++++++++++++++++++++++++++++++++
 doc/.gitignore |  2 ++
 3 files changed, 43 insertions(+), 30 deletions(-)
 delete mode 100644 .bzrignore
 create mode 100644 .gitignore
 create mode 100644 doc/.gitignore

diff --git a/.bzrignore b/.bzrignore
deleted file mode 100644
index fda459816..000000000
--- a/.bzrignore
+++ /dev/null
@@ -1,30 +0,0 @@
-gendocs.sh
-lib
-m4
-.deps
-Makefile
-autom4te.cache
-config.cache
-config.h
-config.log
-config.status
-stamp-h
-stamp-h1
-doc/Makefile
-doc/*.info*
-doc/.deps
-doc/gendocs_template
-doc/mdate-sh
-doc/Makefile.in
-doc/boot.S.texi
-doc/kernel
-doc/kernel.c.texi
-doc/multiboot.h.texi
-doc/texinfo.tex
-Makefile.in
-aclocal.m4
-config.h.in
-configure
-depcomp
-install-sh
-missing
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..a2e66c27a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,41 @@
+# Generated by autogen.sh
+/gendocs.sh
+/lib/
+/m4/
+
+/NEWS
+/README
+
+/aclocal.m4
+/autom4te.cache/
+/compile
+/config.h.in
+/configure
+/depcomp
+/doc/mdate-sh
+/doc/texinfo.tex
+/install-sh
+/INSTALL
+/missing
+
+Makefile.in
+
+# Generated by configure
+Makefile
+.deps/
+
+/config.h
+/config.log
+/config.status
+/stamp-h1
+
+# Generated by make
+/doc/*.c.texi
+/doc/*.h.texi
+/doc/*.S.texi
+/doc/multiboot.info*
+/doc/stamp-vti
+/doc/version.texi
+
+*.o
+/doc/kernel
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 000000000..847f66f4d
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,2 @@
+/gendocs_template
+/gendocs_template_min
-- 
2.25.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] multiboot2: Make example kernel build at least for i386
  2020-04-16 15:09 [PATCH 1/3] multiboot2: Allow running autogen.sh Hans Ulrich Niedermann
  2020-04-16 15:09 ` [PATCH 2/3] multiboot2: Use .gitignore files Hans Ulrich Niedermann
@ 2020-04-16 15:09 ` Hans Ulrich Niedermann
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Ulrich Niedermann @ 2020-04-16 15:09 UTC (permalink / raw)
  To: grub-devel; +Cc: Hans Ulrich Niedermann

Document both boot_i386.S and boot_mips.S, and build
at least boot_i386.S.

Building a mips kernel if a mips compiler is actually
available still needs some work.

Signed-off-by: Hans Ulrich Niedermann <hun@n-dimensional.de>
---
 .gitignore                  |  2 ++
 configure.ac                | 29 ++++++++++++++----
 doc/Makefile.am             |  9 +++---
 doc/{boot.S => boot_i386.S} |  4 +--
 doc/multiboot.texi          | 59 +++++++++++++++++++++++--------------
 5 files changed, 70 insertions(+), 33 deletions(-)
 rename doc/{boot.S => boot_i386.S} (94%)

diff --git a/.gitignore b/.gitignore
index a2e66c27a..bd387ea77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,7 +9,9 @@
 /aclocal.m4
 /autom4te.cache/
 /compile
+/config.guess
 /config.h.in
+/config.sub
 /configure
 /depcomp
 /doc/mdate-sh
diff --git a/configure.ac b/configure.ac
index 8f21b1852..ee648f52a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,11 +32,30 @@ dnl Because recent automake complains about AS, set it here.
 CCAS="$CC"
 AC_SUBST(CCAS)
 
-dnl Build the example Multiboot kernel.
-AC_ARG_ENABLE(example-kernel,
-  [  --enable-example-kernel
-                          build the example Multiboot kernel])
-AM_CONDITIONAL(BUILD_EXAMPLE_KERNEL, test "x$enable_example_kernel" = xyes)
+dnl Build the example Multiboot kernel (if possible on this host)
+AC_CANONICAL_HOST
+case "$host" in #(
+  i[3456]86-*) kernel_boot_arch=i386
+               ;; #(
+  x86_64-*)    kernel_boot_arch=i386
+               kernel_ccasflags="-m32"
+               kernel_cflags="-m32"
+	       ;; #(
+  mips-*)      kernel_boot_arch=mips
+               ;; #(
+  *)           kernel_boot_arch=unsupported
+               ;;
+esac
+AC_SUBST([kernel_boot_arch])
+AC_SUBST([kernel_ccasflags])
+AC_SUBST([kernel_cflags])
+
+AC_ARG_ENABLE([example-kernel], [dnl
+AS_HELP_STRING([--enable-example-kernel],
+               [build the example Multiboot2 kernel])])
+
+AM_CONDITIONAL([BUILD_EXAMPLE_KERNEL],
+               [test "x$enable_example_kernel" = xyes && test "x$kernel_boot_arch" != "xunsupported"])
 
 dnl Because recent automake complains about CCASFLAGS, set it here.
 CCASFLAGS='$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)'
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 2a5afd95d..0d896fe10 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,6 @@
 info_TEXINFOS = multiboot.texi
-EXAMPLES = boot_mips.S kernel.c multiboot2.h
-multiboot_TEXINFOS = boot.S.texi kernel.c.texi multiboot2.h.texi
+EXAMPLES = boot_i386.S boot_mips.S kernel.c multiboot2.h
+multiboot_TEXINFOS = boot_i386.S.texi boot_mips.S.texi kernel.c.texi multiboot2.h.texi
 SRC2TEXI = src2texi
 noinst_SCRIPTS = $(SRC2TEXI)
 EXTRA_PROGRAMS = kernel
@@ -9,8 +9,9 @@ pkginclude_HEADERS = multiboot2.h
 # The example kernel is built if you specify --enable-example-kernel.
 if BUILD_EXAMPLE_KERNEL
 noinst_PROGRAMS = kernel
-kernel_SOURCES = $(EXAMPLES)
-kernel_CFLAGS = -fno-builtin -nostdinc -O -g -Wall \
+kernel_SOURCES = boot_$(kernel_boot_arch).S kernel.c multiboot2.h
+kernel_CCASFLAGS = $(kernel_ccasflags)
+kernel_CFLAGS = $(kernel_cflags) -fno-builtin -nostdinc -O -g -Wall \
 	-imacros $(top_builddir)/config.h
 kernel_LDFLAGS = -nostdlib -Wl,-N -Wl,-Ttext -Wl,80100000 -Wl,--build-id=none
 
diff --git a/doc/boot.S b/doc/boot_i386.S
similarity index 94%
rename from doc/boot.S
rename to doc/boot_i386.S
index 8f6f66fcc..9ab016612 100644
--- a/doc/boot.S
+++ b/doc/boot_i386.S
@@ -50,11 +50,11 @@ multiboot_header:
 	/* magic */
 	.long	MULTIBOOT2_HEADER_MAGIC
 	/* ISA: i386 */
-	.long   GRUB_MULTIBOOT_ARCHITECTURE_I386
+	.long   MULTIBOOT_ARCHITECTURE_I386
 	/* Header length.  */
 	.long	multiboot_header_end - multiboot_header
 	/* checksum */
-	.long	-(MULTIBOOT2_HEADER_MAGIC + GRUB_MULTIBOOT_ARCHITECTURE_I386 + (multiboot_header_end - multiboot_header))
+	.long	-(MULTIBOOT2_HEADER_MAGIC + MULTIBOOT_ARCHITECTURE_I386 + (multiboot_header_end - multiboot_header))
 #ifndef __ELF__
 address_tag_start:	
 	.short MULTIBOOT_HEADER_TAG_ADDRESS
diff --git a/doc/multiboot.texi b/doc/multiboot.texi
index df8a0d056..c70d9239e 100644
--- a/doc/multiboot.texi
+++ b/doc/multiboot.texi
@@ -1553,26 +1553,31 @@ Multiboot2-compliant boot loader and for reference to how to implement a
 Multiboot2 kernel. The source files can be found under the directory
 @file{doc} in the Multiboot2 source distribution.
 
-The kernel @file{kernel} consists of only three files: @file{boot.S},
-@file{kernel.c} and @file{multiboot2.h}. The assembly source
-@file{boot.S} is written in GAS (@pxref{Top, , GNU assembler, as.info,
-The GNU assembler}), and contains the Multiboot2 information structure to
-comply with the specification. When a Multiboot2-compliant boot loader
-loads and execute it, it initialize the stack pointer and @code{EFLAGS},
-and then call the function @code{cmain} defined in @file{kernel.c}. If
-@code{cmain} returns to the callee, then it shows a message to inform
-the user of the halt state and stops forever until you push the reset
-key. The file @file{kernel.c} contains the function @code{cmain},
-which checks if the magic number passed by the boot loader is valid and
-so on, and some functions to print messages on the screen. The file
-@file{multiboot2.h} defines some macros, such as the magic number for the
-Multiboot2 header, the Multiboot2 header structure and the Multiboot2
-information structure.
+The kernel @file{kernel} consists of only three files:
+@file{boot_i386.S} or @file{boot_mips.S} (depending on the kernel
+architecture), @file{kernel.c}, and @file{multiboot2.h}. The assembly
+sources @file{boot_i386.S} and @file{boot_mips.S} are written in GAS
+(@pxref{Top, , GNU assembler, as.info, The GNU assembler}) and
+contain the Multiboot2 information structure to comply with the
+specification. When a Multiboot2-compliant boot loader loads and
+executes @file{boot_*.S}, it initializes the stack pointer and
+@code{EFLAGS}, and then calls the function @code{cmain} defined in
+@file{kernel.c}.
+
+If @code{cmain} returns to the callee, then it shows a message to
+inform the user of the halt state and stops forever until you push the
+reset key. The file @file{kernel.c} contains the function
+@code{cmain}, which checks if the magic number passed by the boot
+loader is valid and so on, and some functions to print messages on the
+screen. The file @file{multiboot2.h} defines some macros, such as the
+magic number for the Multiboot2 header, the Multiboot2 header
+structure and the Multiboot2 information structure.
 
 @menu
-* multiboot2.h::                 
-* boot.S::                      
-* kernel.c::                    
+* multiboot2.h::
+* boot_i386.S::
+* boot_mips.S::
+* kernel.c::
 * Other Multiboot2 kernels::
 @end menu
 
@@ -1587,13 +1592,23 @@ This is the source code in the file @file{multiboot2.h}:
 @end example
 
 
-@node boot.S
-@subsection boot.S
+@node boot_i386.S
+@subsection boot_i386.S
+
+In the file @file{boot_i386.S}:
+
+@example
+@include boot_i386.S.texi
+@end example
+
+
+@node boot_mips.S
+@subsection boot_mips.S
 
-In the file @file{boot.S}:
+In the file @file{boot_mips.S}:
 
 @example
-@include boot.S.texi
+@include boot_mips.S.texi
 @end example
 
 
-- 
2.25.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/3] multiboot2: Use .gitignore files
  2020-04-16 15:09 ` [PATCH 2/3] multiboot2: Use .gitignore files Hans Ulrich Niedermann
@ 2020-04-16 16:45   ` Hans Ulrich Niedermann
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Ulrich Niedermann @ 2020-04-16 16:45 UTC (permalink / raw)
  To: grub-devel; +Cc: Hans Ulrich Niedermann

Add /.gitignore file and remove the /.bzrignore file.

The /doc/.gitignore file is generated by gnulib-tool so we keep
that file in addition to the top-level /.gitignore file which
covers everything else in subdirectories as well.

Signed-off-by: Hans Ulrich Niedermann <hun@n-dimensional.de>
---
 .bzrignore     | 30 ------------------------------
 .gitignore     | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 doc/.gitignore |  2 ++
 3 files changed, 51 insertions(+), 30 deletions(-)
 delete mode 100644 .bzrignore
 create mode 100644 .gitignore
 create mode 100644 doc/.gitignore

diff --git a/.bzrignore b/.bzrignore
deleted file mode 100644
index fda459816..000000000
--- a/.bzrignore
+++ /dev/null
@@ -1,30 +0,0 @@
-gendocs.sh
-lib
-m4
-.deps
-Makefile
-autom4te.cache
-config.cache
-config.h
-config.log
-config.status
-stamp-h
-stamp-h1
-doc/Makefile
-doc/*.info*
-doc/.deps
-doc/gendocs_template
-doc/mdate-sh
-doc/Makefile.in
-doc/boot.S.texi
-doc/kernel
-doc/kernel.c.texi
-doc/multiboot.h.texi
-doc/texinfo.tex
-Makefile.in
-aclocal.m4
-config.h.in
-configure
-depcomp
-install-sh
-missing
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..01823be9c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,49 @@
+# Generated by "autogen.sh"
+/gendocs.sh
+/lib/
+/m4/
+
+/NEWS
+/README
+
+Makefile.in
+
+/aclocal.m4
+/autom4te.cache/
+/compile
+/config.h.in
+/configure
+/depcomp
+/doc/mdate-sh
+/doc/texinfo.tex
+/install-sh
+/INSTALL
+/missing
+
+# Generated by "configure"
+Makefile
+.deps/
+
+/config.h
+/config.log
+/config.status
+/stamp-h1
+
+# Generated by "make"
+/doc/*.c.texi
+/doc/*.h.texi
+/doc/*.S.texi
+/doc/multiboot.info*
+/doc/stamp-vti
+/doc/version.texi
+
+*.o
+
+/doc/kernel
+
+# Generated by "make web-manual"
+/doc/manual/
+/doc/multiboot.aux
+/doc/multiboot.cp
+/doc/multiboot.log
+/doc/multiboot.toc
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 000000000..847f66f4d
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,2 @@
+/gendocs_template
+/gendocs_template_min
-- 
2.25.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-16 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 15:09 [PATCH 1/3] multiboot2: Allow running autogen.sh Hans Ulrich Niedermann
2020-04-16 15:09 ` [PATCH 2/3] multiboot2: Use .gitignore files Hans Ulrich Niedermann
2020-04-16 16:45   ` [PATCH v2 " Hans Ulrich Niedermann
2020-04-16 15:09 ` [PATCH 3/3] multiboot2: Make example kernel build at least for i386 Hans Ulrich Niedermann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.