Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of NTFS and Kernel of Linux operating system

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about the example analysis of NTFS and kernel of Linux operating system, which may not be well understood by many people. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something from this article.

The traditional method of compiling kernel modules is tedious and time-consuming. This paper introduces a new method of compiling kernel modules quickly.

When you have installed the Linux system and started it, congratulations! If you also have WinNT/2000 installed on your hard drive, you have trouble trying to access another NTFS partition. Because the Linux system you are using does not have a compiled module that supports the NTFS file system. What shall I do? Maybe you'll run make menuconfig, recustomize all the modules you need, and then run make modeules;make modeules_install to install it. This is not only tedious and time-consuming, but also may lead to problems. Or because compiling the kernel is a bit tricky for you, and there are so many choices that you don't know what to do, you don't have a good way at all. This article provides you with a simple way to easily compile the modules you need to support NTFS systems (ntfs.o). Take this as an example, I hope it will be helpful for you to compile other modules.

The system I used at the time of writing this article is Red Hat Linux release 7.0 (Guinness) Kernel 2.2.16-22 on an i686. Starting with a newly installed system, let's compile a module that supports the NTFS file system we want.

First, find the .config file needed to compile the kernel

There are several configurations for compiling the kernel under the / usr/src/linux/configs directory. Select the configuration we want, copy it to the / usr/src/linux directory, and rename it .config.

Cp / usr/src/linux/configs/kernel-2.2.16-i686.config / usr/src/linux/.config

Second, modify the .config file, remove the unused modules, and add the modules you want.

Open .config, there are many XXXX=m entries, these are items to be compiled into modules, because we do not want to compile these modules, so we want to remove all XXXX=m entries. Then add the module we want and change # CONFIG_NTFS_FS is not set to CONFIG_NTFS_FS=m. Of course, you can do this with a variety of tools you are familiar with.

Third, compile the NTFS module

Run the command make modules under the / usr/src/linux directory to compile the NTFS module we want.

Fourth, install the NTFS module

The compiled ntfs.o is in the / usr/src/linux/fs/ntfs directory. Copy it to the correct directory manually.

Cp / usr/src/linux/fs/ntfs/ntfs.o / lib/modules/2.2.16-22/fs/

Note: do not run the command make modules_install, otherwise it will bring serious consequences, it will delete all modules in your system, only install the newly compiled module (ntfs.o).

5. Load NTFS module

Run the command depmod;modprobe ntfs to try to access your NTFS file system. I wish you success!

Some modules depend on your system kernel, so the methods provided in this article do not apply. Some modules are dependent on other modules. If you are not familiar with these dependencies, it is recommended that you add the module you want through make menuconfig after removing the unused module option in the second step.

After reading the above, do you have any further understanding of the NTFS and kernel sample analysis of the Linux operating system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report