精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>嵌入式开发>>操作系统设计与实现>>翻译计划—《写你自己的操作系统》>>翻译计划:《写你自己的操作系统》(GRUB)

主题:翻译计划:《写你自己的操作系统》(GRUB)
发信人: wenbobo()
整理人: wenbobo(2002-12-31 10:49:44), 站内信件
版主注:
我现在打算翻译Write Your Own Operating System [FAQ],希望有兴趣的朋友帮助翻译,我觉得翻译这样的文章是个很好的锻炼,至少比盲目写程序要值得。希望大家支持。有意承担翻译任务者请给我发email。

本文发表于http://www.mega-tokyo.com/os/os-faq.html
作者为 Stuart 'Dark Fiber' George <[email protected]>
本文的译者为 wenbobo <[email protected]>
转载请勿删除以上版权宣示信息
 



GRUB

What is GRUB? 
什么是GRUB?

GRUB stands for GRand Unified Bootloader and is a GNU bootloader that can boot a variety of operating systems from Linux, Mach4, vSTA, DOS, NT 3.51, the *BSD variants and any generic OS you can add to it with its easy to use boot menu. 
GRUB就是GRand Unified Bootloader,它是一个GNU bootloader,可以引导多种操作系统,例如Linux,Mach4, vSTA, DOS, NT 3.51, 各种*BSD变种,并且你可以很方便的从它的启动菜单里天价任何一种普通的系统。

GRUB is a bootloader that takes away all the complexities out of trying to boot your os by doing it for you. GRUB can handle a variety of filesystems from MS-DOS FAT systems, Linux ext2fs (Second Extended File System), Amiga FFS (Fast File System) and three "generic" executable's types, ELF files, FreeBSD a.out files and "generic" executable's (any file with a valid multiboot header).
GRUB是一种把所有的复杂性都拿掉的,能够引导你的系统的bootloader。GRUB能够操作多种文件系统如DOS FAT系统,Linux ext2fs(第二个扩展文件系统),Amiga FFS(快速文件系统),并可识别三种“普通”格式的可执行文件,ELF文件,FreeBSD a.out格式以及“普通的”可执行文件(任何带有multiboot header的文件)

 

Where can I get GRUB from?
我可以从哪里得到GRUB呢?
Currently GRUB is at version 0.5.96 (as of writing) and the main GRUB homepages is 
当前的GRUB版本号是0.5.96(写此文的时候,但wenbobo翻译此文时已经有0.93版了^_*),GRUB的主页是
http://www.gnu.org/software/grub/
 

Grub and DJGPP A.OUT files produced by LD
Grub与DJGPP的LD输出的A.OUT文件

DJGPP's linke (LD) can produce AOUT files, one of the formats that GRUB nativly supports for loading of kernel files. 
DJGPP的连接器(LD)可输出AOUT文件,这是GRUB所直接支持的一种格式,可用来装载内核文件。

Unfortunatly for us the DJGPP AOUT is neither the FreeBSD A.OUT nor the NetBSD A.OUT format. 
不幸的是DJGPP AOUT既不是FreeBSD A.OUT也不是NetBSD A.OUT格式。

To get your DJGPP to output files that are correctly supported by GRUB, you need to either, alter the grub source code (not a good thing to do since its not official!), write a multiboot header into your coder (within first 4kb), or alter djgpp's LD linker to output desired formats, ELF, or Free/NetBSD A.OUT formats. 
为了让你的DJGPP输出GRUB能够正确支持的文件,你要么得修改grub源代码 (这么做可不是什么好方法因为不那么正式!),在你的代码里面写一个multiboot header(在开头的4k字节内),要么修改djgpp的LD连接器以输出所需的格式,ELF,或者Free/NetBSD A.OUT格式。 


Grub and NASM ELF files 
Grub与NASM ELF文件

ELF files that are produced by NASM "-f elf" are object / relocatable files, not pure flat executable files, and require further linking in order to produce an ELF executable file that can be loaded by grub.  
用“-f elf”参数的NASM输出的ELF文件是目标代码/重定位文件,并非纯粹的浮动可执行文件,需要做进一步的连接以得到能被grub装载的ELF可执行文件。
 

Grub and Watcom ELF files 
Grub与Watcom ELF文件

Watcom is another compiler that supports ELF files, but versions 10.6 and below produce broken ELF files that run at offset 0x00000000. 
Watcom是另一个支持ELF文件的编译器,但是版本10.6及以下的输出的是运行地址为0x00000000的错误的ELF文件。

Versions higher than 10.6 may work correctly, if anyone has 11.n and would like to verify true or false for me, please do so. 
高于10.6版本的也许可以正确工作,如果哪位有11.n版本的并打算为我验证一下真假,请试试吧。(wenbobo注:请打算用11.x版本的注意,不要删掉你的10.x了,因为11版编译器的输出提示好像有点问题,反正我用的都是乱码)



----
掬水月在手
弄花香满身

[关闭][返回]