GRUB developper manual based on existing Internals section and

contributions by the various authors with active copyright assignment.

	* docs/Makefile.am (info_TEXINFOS): Add grub-dev.texi.
	* docs/font_char_metrics.png: New file.
	* docs/font_char_metrics.txt: Likewise.
	* docs/grub-dev.texi: Likewise.
	* docs/grub.texi (Internals): Move from here ...
	* docs/grub-dev.texi: ... here.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-04-03 15:30:28 +02:00
parent 2cccc747ac
commit caee5efd31
6 changed files with 1529 additions and 107 deletions

View file

@ -1,3 +1,15 @@
2011-04-02 Vladimir Serbinenko <phcoder@gmail.com>
GRUB developper manual based on existing Internals section and
contributions by the various authors with active copyright assignment.
* docs/Makefile.am (info_TEXINFOS): Add grub-dev.texi.
* docs/font_char_metrics.png: New file.
* docs/font_char_metrics.txt: Likewise.
* docs/grub-dev.texi: Likewise.
* docs/grub.texi (Internals): Move from here ...
* docs/grub-dev.texi: ... here.
2011-04-01 Colin Watson <cjwatson@ubuntu.com>
Store the loopback device as data on loopback grub_disk structures,

View file

@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = subdir-objects
# AM_MAKEINFOFLAGS = --no-split --no-validate
info_TEXINFOS = grub.texi
info_TEXINFOS = grub.texi grub-dev.texi
grub_TEXINFOS = fdl.texi

BIN
docs/font_char_metrics.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1 @@
Please fill this in.

1515
docs/grub-dev.texi Normal file

File diff suppressed because it is too large Load diff

View file

@ -100,7 +100,6 @@ This edition documents version @value{VERSION}.
* Obtaining and Building GRUB:: How to obtain and build GRUB
* Reporting bugs:: Where you should send a bug report
* Future:: Some future plans on GRUB
* Internals:: Hacking GRUB
* Copying This Manual:: Copying This Manual
* Index::
@end menu
@ -4374,111 +4373,6 @@ If you are interested in the development of GRUB 2, take a look at
@uref{http://www.gnu.org/software/grub/grub.html, the homepage}.
@node Internals
@appendix Hacking GRUB
@menu
* Getting the source code::
* Finding your way around::
@end menu
@node Getting the source code
@section Getting the source code
GRUB is maintained using the @uref{http://bazaar-vcs.org/, Bazaar revision
control system}. To fetch the primary development branch:
@example
bzr get http://bzr.savannah.gnu.org/r/grub/trunk/grub
@end example
The GRUB developers maintain several other branches with work in progress.
Of these, the most interesting is the experimental branch, which is a
staging area for new code which we expect to eventually merge into trunk but
which is not yet ready:
@example
bzr get http://bzr.savannah.gnu.org/r/grub/branches/experimental
@end example
Once you have used @kbd{bzr get} to fetch an initial copy of a branch, you
can use @kbd{bzr pull} to keep it up to date. If you have modified your
local version, you may need to resolve conflicts when pulling.
@node Finding your way around
@section Finding your way around
Here is a brief map of the GRUB code base.
GRUB uses Autoconf, but not (yet) Automake. The top-level build rules are
in @file{configure.ac}, @file{Makefile.in}, and @file{conf/*.rmk}. Each
@file{conf/*.rmk} file represents a particular target configuration, and is
processed into GNU Make rules by @file{genmk.rb} (which you only need to
look at if you are extending the build system). If you are adding a new
module which follows an existing pattern, such as a new command or a new
filesystem implementation, it is usually easiest to grep @file{conf/*.rmk}
for an existing example of that pattern to find out where it should be
added.
Low-level boot code, such as the MBR implementation on PC BIOS systems, is
in the @file{boot/} directory.
The GRUB kernel is in @file{kern/}. This contains core facilities such as
the device, disk, and file frameworks, environment variable handling, list
processing, and so on. The kernel should contain enough to get up to a
rescue prompt. Header files for kernel facilities, among others, are in
@file{include/}.
Terminal implementations are in @file{term/}.
Disk access code is spread across @file{disk/} (for accessing the disk
devices themselves), @file{partmap/} (for interpreting partition table
data), and @file{fs/} (for accessing filesystems). Note that, with the odd
specialised exception, GRUB only contains code to @emph{read} from
filesystems and tries to avoid containing any code to @emph{write} to
filesystems; this lets us confidently assure users that GRUB cannot be
responsible for filesystem corruption.
PCI and USB bus handling is in @file{bus/}.
Video handling code is in @file{video/}. The graphical menu system uses
this heavily, but is in a separate directory, @file{gfxmenu/}.
Most commands are implemented by files in @file{commands/}, with the
following exceptions:
@itemize
@item
A few core commands live in @file{kern/corecmd.c}.
@item
Commands related to normal mode live under @file{normal/}.
@item
Commands that load and boot kernels live under @file{loader/}.
@item
The @samp{loopback} command is really a disk device, and so lives in
@file{disk/loopback.c}.
@item
The @samp{gettext} command lives under @file{gettext/}.
@item
The @samp{loadfont} and @samp{lsfonts} commands live under @file{font/}.
@item
The @samp{serial}, @samp{terminfo}, and @samp{background_image} commands
live under @file{term/}.
@item
The @samp{efiemu_*} commands live under @file{efiemu/}.
@end itemize
There are a few other special-purpose exceptions; grep for them if they
matter to you.