巧用FreeBSD 5.3内核启动做了点手脚的麒麟2.1
[将非技术内容独立出去,文字无改动] 巧用FreeBSD 5.3内核启动做了点手脚的麒麟 2.1-01 上回书说到,麒麟开发组在我的分析发布之后不久,就删除了网站上的 2.0-14/21 的光盘镜像,取而代之的是发布了一个新版本 2.1-01 。 如上回我所提到的那样,麒麟 2.1-01
[将非技术内容独立出去,文字无改动]
巧用FreeBSD 5.3内核启动做了点手脚的麒麟2.1-01
上回书说到,麒麟开发组在我的分析发布之后不久,就删除了网站上的2.0-14/21的光盘镜像,取而代之的是发布了一个新版本2.1-01。
如上回我所提到的那样,麒麟2.1-01相对于以前版本(2.0-14/21)进行了特殊化处理。主要是做了两件事情,一个是用objcopy/strip去掉了符号信息,strip了,而且还有一些额外的小动作,这样“成功的”回避了我那篇相似性分析中所用的分析方法;再一个就是修改了引导程序,所以用直接引导内核的方式已经是不可以用FreeBSD内核启动麒麟了,给大家尝试新版本情况下FreeBSD内核同麒麟内核的兼容性带来了一些障碍。
我之前不理解这种换门的行为有什么意义,有一位网友点醒的好,这叫做“迅雷不及掩耳盗铃”--(形容掩耳盗铃速度之快,呵呵)。
也有些人对我的“换门说”产生了质疑,怀疑是不是麒麟2.1真的在结构上有重大改进才导致的无法启动。那么好吧,今天,我们就来证实麒麟2.1确实是换了一个门而已。
系统引导
系统引导,一般为多级,大多数情况下,从MBR接过引导权后,稍加处理后,会转交给一个比较高级的引导程序,一般由这个引导程序来负责启动内核。在Windows NT/2000中是NT Loader;Linux中可能是Grub;在FreeBSD中是Boot Loader。有很多的引导程序比较高级具有多系统的引导能力,有的还具有传递引导权给下一级引导程序的能力。Grub就是其中之一。
麒麟的引导过程
麒麟为了多系统引导和图形化界面,采用了Grub作为第一级引导程序。在选择了"Kylin"后,Grub将加载第二级引导程序,对于2.0-14/21来说使用的是FreeBSD的Boot Loader,而2.1-01开始,麒麟开发组调整了这个引导程序,虽然大体上还是和FreeBSD的Boot Loader相同,但是修改了一些东西,导致这个Boot Loader属于Kylin 2.1-01专用的Boot Loader,既无法启动FreeBSD,也无法启动Kylin 2.0-14/21。也就所谓的自家人不认自家门了。呵呵。
在这个过程中,Boot Loader相当于一个点火器或者钥匙,只有和内核配套,遵循加载内核的约定,才能够成功的将内核加载起来。但是这个引导程序对于运行中的系统安全性和稳定性影响甚微,所以,修改其引导程序的目的,大家可以发挥想象力了。
证明我所说的换门问题很简单,我们只要将门再换回来就行了。今天我们所做的,就是使用FreeBSD的Boot Loader来帮助加载FreeBSD 5.3的内核,最后成功的挂载各个系统模块,并引导图形界面成功。
需求:
1、一个FreeBSD 5.3的内核。我建议重新编译一个内核(和上回一样,要是上回编译了就不用再编译了),加上Linux兼容等可选模块,这样更贴近麒麟的做法。不过最低要求不需要加很多,只要加上Linux兼容的部分就行,我建议至少加上下面的选项:
options COMPAT_LINUX
options LINPROCFS
device sound
2、一个可以运行的麒麟操作系统,是2.1-01版本。
操作步骤:
1. 将新编译的内核随便起一个名,在这个例子中,我将其命名为freebsd_5.3_sl,并存在home目录中。
2. 在FreeBSD 5.3中做下列准备工作:
mkdir ~/boot
mkdir ~/boot/kernel
cp ~/freebsd_5.3_sl ~/boot/kernel/
cp /boot/loader ~/boot/
echo "load /boot/kernel/freebsd_5.3_sl" > ~/boot/loader.rc
echo "boot" >> ~/boot/loader.rc
cd ~
tar -czvf boot.tar.gz boot
3. 将boot.tar.gz传到Kylin的/root目录下,然后在Kylin中开一个shell,执行:
cd /
tar -zxvf /root/boot.tar.gz
这样,就把FreeBSD的Boot Loader和内核已经放好位置了,并且也已经写好了启动脚本。装好了钥匙也装好了门,一切就绪了。
4. 下面,来开始我们的引导之旅吧。:)reboot 重新引导麒麟操作系统。
5. 在GRUB的引导界面移动光标到Kylin上后按e (如果默认就在Kylin上,就直接按e)
6. 将光标移动到第二行,kernel那行,然后按e
7. 我们会看到如下的行。
修改/boot/booter mute为/boot/loader。呵呵,人家从2.0-18的loader换成了booter就是为了不让我们能够启动FreeBSD,今天我们就给它换回来。
8. 回到这个页面后按b,将引导boot loader
9. 好,现在系统开始真正引导了,但是大家会从随后的几个画面发现,麒麟从2.0-01开始,再也不显示Copyright信息了,不但连加州大学的版本信息不显示,连他自己的版本信息也不显示了。据传闻,这样是为了让界面更加干净。嗯,确实挺“干净”。呵呵。不过谁要是特意的想看Copyright,还是可以从dmesg来看到的。
10. 成功的启动了X Window,进入图形界面的登录窗口。
11. 输入口令登录后,开始加载Gnome各个组件
12. 成功的启动了完整的图形界面,大家可以从uname中看到FreeBSD 5.3-RELEASE。
(其实也可以cat /proc/version的,这回抓图的时候忘了,不好意思,呵呵。)
至此,我们完成了仅仅替换为FreeBSD 5.3的内核和引导内核用的引导程序,就做到了完整系统的启动。虽然还有一些警告信息,但是系统服务基本都是正常启动的。和上回的2.0-14/18一样,麒麟开发组新发布的2.1-01同FreeBSD的“兼容性”依旧很不错。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



When a friend's computer is missing certain files, the application cannot start normally with error code 0xc000012d. In fact, it can be solved by re-downloading the files and installing them. The application cannot start normally 0xc000012d: 1. First, the user needs to download ".netframework". 2. Then find the download address and download it to your computer. 3. Then double-click on the desktop to start running. 4. After the installation is completed, return to the wrong program location and open the program again.

Practical tips and methods to solve the black screen on Ubuntu startup Introduction: Ubuntu is a popular Linux operating system, but sometimes you may encounter a black screen problem during the startup process. This problem can be caused by a variety of reasons, such as graphics card driver issues, software conflicts, or system errors. This article will introduce some practical tips and methods to help solve the black screen problem at Ubuntu startup to ensure the stable operation of the system. 1. Update and reinstall the graphics card driver to enter recovery mode: press the Shift key during startup to enter

Reinstalling the system may not be a foolproof solution, but after reinstalling, I found that when the computer is turned on, it will display white text on a black background, and then give a prompt: rebootandselectproperbootdevice, what is going on? Such a prompt is usually caused by a boot error. In order to help everyone, the editor has brought you a solution. Computer use is becoming more and more popular, and computer failures are becoming more and more common. No, recently some users encountered a black screen when turning on the computer, and prompted Reboot and Select Proper Boot device, and the computer system could not start normally. What's going on? How to solve it? The user is confused. Next, the editor will follow

WPS is a very widely used office software, including documents, forms and PPT, and supports multi-terminal synchronization. If the prompt "The source application for this object cannot be launched" appears when editing wps, how to solve it? This problem may occur because you are trying to open a link or file, but its source application no longer exists or has been deleted. Here are some fixes: 1. Reinstall WPS software: Try reinstalling WPSOffice to fix the problem and make sure you are using the latest version. 2. Manually change the default program: Try to change the default program to WPS. You can right-click the file you want to open, select "Open with", and then

In the current smartphone market, processors can be said to be one of the focuses of competition for major mobile phone manufacturers. As the "brain" of a mobile phone, the performance of the processor directly affects the mobile phone's running speed, multi-tasking capabilities, and gaming experience. At present, the Kirin 8000 processor, as the equipment of Huawei's flagship mobile phone, has attracted much attention. So, what are the advantages and disadvantages of it compared with the Snapdragon processor? First of all, from a performance perspective, the Kirin 8000 processor is manufactured using the latest TSMC 5nm process. It has more advanced process technology and improved performance.

Kirin 8000 and Snapdragon processor performance analysis: detailed comparison of strengths and weaknesses. With the popularity of smartphones and their increasing functionality, processors, as the core components of mobile phones, have also attracted much attention. One of the most common and excellent processor brands currently on the market is Huawei's Kirin series and Qualcomm's Snapdragon series. This article will focus on the performance analysis of Kirin 8000 and Snapdragon processors, and explore the comparison of the strengths and weaknesses of the two in various aspects. First, let’s take a look at the Kirin 8000 processor. As Huawei’s latest flagship processor, Kirin 8000

To install the Linux kernel on Ubuntu22.04, you can follow the following steps: Update the system: First, make sure your Ubuntu system is the latest, execute the following command to update the system package: sudoaptupdatesudoaptupgrade Download the kernel file: Visit the official Linux kernel website () to download Required kernel version. Select a stable version and download the source code file (with .tar.gz or .tar.xz extension), for example: wget Unzip the file: Use the following command to unzip the downloaded kernel source code file: tar-xflinux-5.14.tar. xz install build dependencies: Install the tools and dependencies required to build the kernel. Execute

When wallpaperengine starts, there are 4 different options. Many users don't know which one to choose when starting wallpaperengine. Generally, when wallpaperengine starts, choose the first one: start 32-bit. Which one to choose when starting wallpaperengine? Answer: Start 32-bit. 1. Generally, when wallpaperengine starts, select the first one: start 32-bit. 2. When wallpaperengine starts, there are 4 different options: start 32-bit; start 64-bit. 3. Start 32-bit: This is a generally recommended option and suitable for most users. 4. Start 64-bit: If the system supports 64-bit, you can choose this option
