下一页 上一页 目录

2. 安装 RTLINUX

编译 RTLinux 内核的第一步是下载预先打过补丁的内核 2.2.18 (仅限 x86) 2.2.18 (仅限 x86) 或 2.4.0-test1 (x86, PowerPC, Alpha) 到 /usr/src/ 并解压。同时,从 www.rtlinux.org 下载 RTLinux 内核 (版本 3.0) 的全新副本到 /usr/src/rtlinux/。(我们将使用 $ 符号表示命令提示符)。

  1. 现在,配置 Linux 内核
                    $ cd /usr/src/linux
                    $ make config
                            or
                    $ make menuconfig
                            or
                    $ make xconfig
    
  2. 要构建内核镜像,输入
                    $ make dep
                    $ make bzImage
                    $ make modules
                    $ make modules_install
                    $ cp arch/i386/boot/bzImage /boot/rtzImage
    
  3. 下一步是配置 LILO。在文件 /etc/lilo.conf 中输入以下行
                    image=/boot/rtzImage
                    label=rtl
                    read-only
                    root=/dev/hda1
    
    警告:将上面的 /dev/hda1 替换为你的根文件系统。找出它应该是哪个文件系统的最简单方法是查看你的 /etc/lilo.conf 中已有的 "root=" 条目。
  4. 现在,重启你的计算机并在 LILO 提示符下输入 'rtl' 加载 RTLinux 内核。然后 'cd' 到 /usr/src/rtlinux/ 并配置 RTLinux。
                    $ make config  
                            or
                    $ make menuconfig
                            or
                    $ make xconfig
    
  5. 最后,编译 RTLinux
                    $ make
                    $ make devices
                    $ make install
    

最后一步将创建目录

/usr/rtlinux-xx (xx 表示版本号)

其中包含 RTLinux 的默认安装目录,该目录是创建和编译用户程序所必需的(也就是说,它包含头文件、实用程序和文档)。它还会创建一个符号链接

/usr/rtlinux

它指向 /usr/rtlinux-xx。为了保持未来的兼容性,请确保你所有的 RTLinux 程序都使用 /usr/rtlinux 作为其默认路径。

注意:如果你更改了任何 Linux 内核选项,请不要忘记执行

                $ cd /usr/src/rtlinux
                $ make clean
                $ make
                $ make install


下一页 上一页 目录