⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multiboot.texi

📁 i386的bootloader源码grub
💻 TEXI
📖 第 1 页 / 共 4 页
字号:
\input texinfo @c -*-texinfo-*-@c -*-texinfo-*-@c %**start of header@setfilename multiboot.info@settitle Multiboot Specification@c %**end of header@c Unify all our little indices for now.@syncodeindex fn cp@syncodeindex vr cp@syncodeindex ky cp@syncodeindex pg cp@syncodeindex tp cp@footnotestyle separate@paragraphindent 3@finalout@dircategory Kernel@direntry* Multiboot Specification: (multiboot).		Multiboot Specification.@end direntry@ifinfoCopyright @copyright{} 1995, 96 Bryan Ford <baford@@cs.utah.edu>Copyright @copyright{} 1995, 96 Erich Stefan Boleyn <erich@@uruk.org>Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, Inc.Permission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.@ignorePermission is granted to process this file through TeX and print theresults, provided the printed document carries a copying permissionnotice identical to this one except for the removal of this paragraph(this paragraph not being relevant to the printed manual).@end ignorePermission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided also thatthe entire resulting derived work is distributed under the terms of apermission notice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions.@end ifinfo@titlepage@sp 10@title The Multiboot Specification@author Yoshinori K. Okuji, Bryan Ford, Erich Stefan Boleyn, Kunihiro Ishiguro@page@vskip 0pt plus 1filllCopyright @copyright{} 1995, 96 Bryan Ford <baford@@cs.utah.edu>Copyright @copyright{} 1995, 96 Erich Stefan Boleyn <erich@@uruk.org>Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, Inc.Permission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.Permission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided also thatthe entire resulting derived work is distributed under the terms of apermission notice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions.@end titlepage@finalout@headings double@ifnottex@node Top@top Multiboot SpecificationThis file documents Multiboot Specification, the proposal for the bootsequence standard. This edition documents version 0.6.93.@end ifnottex@menu* Overview::                    * Terminology::                 * Specification::               * Examples::                    * History::                     * Index::                       @end menu@node Overview@chapter Introduction to Multiboot SpecificationThis chapter describes some rough information on the MultibootSpecification. Note that this is not a part of the specification itself.@menu* Motivation::                  * Architecture::                * Operating systems::           * Boot sources::                * Boot-time configuration::     * Convenience to operating systems::  * Boot modules::                @end menu@node Motivation@section The background of Multiboot SpecificationEvery operating system ever created tends to have its own boot loader.Installing a new operating system on a machine generally involvesinstalling a whole new set of boot mechanisms, each with completelydifferent install-time and boot-time user interfaces. Getting multipleoperating systems to coexist reliably on one machine through typical@dfn{chaining} mechanisms can be a nightmare. There is little or nochoice of boot loaders for a particular operating system --- if the onethat comes with the operating system doesn't do exactly what you want,or doesn't work on your machine, you're screwed.While we may not be able to fix this problem in existing commercialoperating systems, it shouldn't be too difficult for a few people in thefree operating system communities to put their heads together and solvethis problem for the popular free operating systems. That's what thisspecification aims for. Basically, it specifies an interface between aboot loader and a operating system, such that any complying boot loadershould be able to load any complying operating system. Thisspecification does @emph{not} specify how boot loaders should work ---only how they must interface with the operating system being loaded.@node Architecture@section The target architectureThis specification is primarily targeted at @sc{pc}, since they are themost common and have the largest variety of operating systems and bootloaders. However, to the extent that certain other architectures mayneed a boot specification and do not have one already, a variation ofthis specification, stripped of the x86-specific details, could beadopted for them as well.@node Operating systems@section The target operating systemsThis specification is targeted toward free 32-bit operating systemsthat can be fairly easily modified to support the specification withoutgoing through lots of bureaucratic rigmarole. The particular freeoperating systems that this specification is being primarily designedfor are Linux, FreeBSD, NetBSD, Mach, and VSTa. It is hoped that otheremerging free operating systems will adopt it from the start, and thusimmediately be able to take advantage of existing boot loaders. It wouldbe nice if commercial operating system vendors eventually adopted thisspecification as well, but that's probably a pipe dream.@node Boot sources@section Boot sourcesIt should be possible to write compliant boot loaders that load the OSimage from a variety of sources, including floppy disk, hard disk, andacross a network.Disk-based boot loaders may use a variety of techniques to find therelevant OS image and boot module data on disk, such as byinterpretation of specific file systems (e.g. the BSD/Mach boot loader),using precalculated @dfn{block lists} (e.g. LILO), loading from aspecial @dfn{boot partition} (e.g. OS/2), or even loading from withinanother operating system (e.g. the VSTa boot code, which loads fromDOS). Similarly, network-based boot loaders could use a variety ofnetwork hardware and protocols.It is hoped that boot loaders will be created that support multipleloading mechanisms, increasing their portability, robustness, anduser-friendliness.@node Boot-time configuration@section Configure an operating system at boot-timeIt is often necessary for one reason or another for the user to be ableto provide some configuration information to an operating systemdynamically at boot time. While this specification should not dictatehow this configuration information is obtained by the boot loader, itshould provide a standard means for the boot loader to pass suchinformation to the operating system.@node Convenience to operating systems@section How to make OS development easierOS images should be easy to generate. Ideally, an OS image should simplybe an ordinary 32-bit executable file in whatever file format theoperating system normally uses. It should be possible to @code{nm} ordisassemble OS images just like normal executables. Specialized toolsshould not be required to create OS images in a @emph{special} fileformat. If this means shifting some work from the operating system toa boot loader, that is probably appropriate, because all the memoryconsumed by the boot loader will typically be made available again afterthe boot process is created, whereas every bit of code in the OS imagetypically has to remain in memory forever. The operating system shouldnot have to worry about getting into 32-bit mode initially, because modeswitching code generally needs to be in the boot loader anyway in orderto load operating system data above the 1MB boundary, and forcing theoperating system to do this makes creation of OS images much moredifficult.Unfortunately, there is a horrendous variety of executable file formatseven among free Unix-like @sc{pc}-based operating systems --- generallya different format for each operating system. Most of the relevant freeoperating systems use some variant of a.out format, but some are movingto @sc{elf}. It is highly desirable for boot loaders not to have to beable to interpret all the different types of executable file formats inexistence in order to load the OS image --- otherwise the boot loadereffectively becomes operating system specific again.This specification adopts a compromise solution to thisproblem. Multiboot-compliant OS images always contain a magic@dfn{Multiboot header} (@pxref{OS image format}), which allows the bootloader to load the image without having to understand numerous a.outvariants or other executable formats. This magic header does not need tobe at the very beginning of the executable file, so kernel images canstill conform to the local a.out format variant in addition to beingMultiboot-compliant.@node Boot modules@section Boot modulesMany modern operating system kernels, such as those of VSTa and Mach, donot by themselves contain enough mechanism to get the system fullyoperational: they require the presence of additional software modules atboot time in order to access devices, mount file systems, etc. Whilethese additional modules could be embedded in the main OS image alongwith the kernel itself, and the resulting image be split apart manuallyby the operating system when it receives control, it is often moreflexible, more space-efficient, and more convenient to the operatingsystem and user if the boot loader can load these additional modulesindependently in the first place.Thus, this specification should provide a standard method for a bootloader to indicate to the operating system what auxiliary boot moduleswere loaded, and where they can be found. Boot loaders don't have tosupport multiple boot modules, but they are strongly encouraged to,because some operating systems will be unable to boot without them.@node Terminology@chapter The definitions of terms used through the specification@table @dfn@item mustWe use the term @dfn{must}, when any boot loader or OS image needs tofollow a rule --- otherwise, the boot loader or OS image is @emph{not}Multiboot-compliant.@item shouldWe use the term @dfn{should}, when any boot loader or OS image isrecommended to follow a rule, but it doesn't need to follow the rule.@item mayWe use the term @dfn{may}, when any boot loader or OS image is allowedto follow a rule.@item boot loaderWhatever program or set of programs loads the image of the finaloperating system to be run on the machine. The boot loader may itselfconsist of several stages, but that is an implementation detail notrelevant to this specification. Only the @emph{final} stage of the bootloader --- the stage that eventually transfers control to an operatingsystem --- must follow the rules specified in this document in orderto be @dfn{Multiboot-compliant}; earlier boot loader stages may bedesigned in whatever way is most convenient.@item OS imageThe initial binary image that a boot loader loads into memory andtransfers control to start an operating system. The OS image istypically an executable containing the operating system kernel.@item boot moduleOther auxiliary files that a boot loader loads into memory along withan OS image, but does not interpret in any way other than passing theirlocations to the operating system when it is invoked.@item Multiboot-compliantA boot loader or an OS image which follows the rules defined as@dfn{must} is Multiboot-compliant. When this specification specifies arule as @dfn{should} or @dfn{may}, a Multiboot-complaint boot loader/OSimage doesn't need to follow the rule.@item u8The type of unsigned 8-bit data.@item u16The type of unsigned 16-bit data. Because the target architecture islittle-endian, u16 is coded in little-endian.@item u32The type of unsigned 32-bit data. Because the target architecture islittle-endian, u32 is coded in little-endian.@item u64The type of unsigned 64-bit data. Because the target architecture islittle-endian, u64 is coded in little-endian.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -