User Mode Linux HOWTO
User Mode Linux Core Team
Mon Nov 18 14:16:16 EST 2002
This document describes the use and abuse of Jeff Dike's User Mode
Linux: a port of the Linux kernel as a normal Intel Linux process.
______________________________________________________________________
Table of Contents
1. Introduction
1.1 How is User Mode Linux Different?
1.2 Why Would I Want User Mode Linux?
2. Compiling the kernel and modules
2.1 Compiling the kernel
2.2 Compiling and installing kernel modules
2.3 Compiling and installing uml_utilities
3. Running UML and logging in
3.1 Running UML
3.2 Logging in
3.3 Examples
4. UML on 2G/2G hosts
4.1 Introduction
4.2 The problem
4.3 The solution
5. Setting up serial lines and consoles
5.1 Specifying the device
5.2 Specifying the channel
5.3 Examples
6. Setting up the network
6.1 General setup
6.2 Userspace daemons
6.3 Specifying ethernet addresses
6.4 UML interface setup
6.5 Multicast
6.6 TUN/TAP with the uml_net helper
6.7 TUN/TAP with a preconfigured tap device
6.8 Ethertap
6.9 The switch daemon
6.10 Slip
6.11 Slirp
6.12 pcap
6.13 Setting up the host yourself
7. Sharing Filesystems between Virtual Machines
7.1 A warning
7.2 Using layered block devices
7.3 Note!
7.4 Another warning
7.5 uml_moo : Merging a COW file with its backing file
8. Creating filesystems
8.1 Create the filesystem file
8.2 Assign the file to a UML device
8.3 Creating and mounting the filesystem
9. Host file access
9.1 Using hostfs
9.2 hostfs as the root filesystem
9.3 Building hostfs
10. The Management Console
10.1 version
10.2 halt and reboot
10.3 config
10.4 remove
10.5 sysrq
10.6 help
10.7 cad
10.8 stop
10.9 go
11. Kernel debugging
11.1 Starting the kernel under gdb
11.2 Examining sleeping processes
11.3 Running ddd on UML
11.4 Debugging modules
11.5 Attaching gdb to the kernel
11.6 Using alternate debuggers
12. Kernel debugging examples
12.1 The case of the hung fsck
12.2 Episode 2: The case of the hung fsck
13. What to do when UML doesn't work
13.1 Strange compilation errors when you build from source
13.2 (obsolete)
13.3 A variety of panics and hangs with /tmp on a reiserfs filesystem
13.4 The compile fails with errors about conflicting types for 'open', 'dup', and 'waitpid'
13.5 UML doesn't work when /tmp is an NFS filesystem
13.6 UML hangs on boot when compiled with gprof support
13.7 syslogd dies with a SIGTERM on startup
13.8 TUN/TAP networking doesn't work on a 2.4 host
13.9 You can network to the host but not to other machines on the net
13.10 I have no root and I want to scream
13.11 UML build conflict between ptrace.h and ucontext.h
13.12 The UML BogoMips is exactly half the host's BogoMips
13.13 When you run UML, it immediately segfaults
13.14 xterms appear, then immediately disappear
13.15 Any other panic, hang, or strange behavior
14. Diagnosing Problems
14.1 Case 1 : Normal kernel panics
14.2 Case 2 : Tracing thread panics
14.3 Case 3 : Tracing thread panics caused by other threads
14.4 Case 4 : Hangs
15. Thanks
15.1 Code and Documentation
15.2 Flushing out bugs
15.3 Buglets and clean-ups
15.4 Case Studies
15.5 Other contributions
______________________________________________________________________
11.. IInnttrroodduuccttiioonn
Welcome to User Mode Linux. It's going to be fun.
11..11.. HHooww iiss UUsseerr MMooddee LLiinnuuxx DDiiffffeerreenntt??
Normally, the Linux Kernel talks straight to your hardware (video
card, keyboard, hard drives, etc), and any programs which run ask the
kernel to operate the hardware, like so:
+-----------+-----------+----+
| Process 1 | Process 2 | ...|
+-----------+-----------+----+
| Linux Kernel |
+----------------------------+
| Hardware |
+----------------------------+
The User Mode Linux Kernel is different; instead of talking to the
hardware, it talks to a `real' Linux kernel (called the `host kernel'
from now on), like any other program. Programs can then run inside
User-Mode Linux as if they were running under a normal kernel, like
so:
+----------------+
| Process 2 | ...|
+-----------+----------------+
| Process 1 | User-Mode Linux|
+----------------------------+
| Linux Kernel |
+----------------------------+
| Hardware |
+----------------------------+
11..22.. WWhhyy WWoouulldd II WWaanntt UUsseerr MMooddee LLiinnuuxx??
1. If User Mode Linux crashes, your host kernel is still fine.
2. You can run a usermode kernel as a non-root user.
3. You can debug the User Mode Linux like any normal process.
4. You can run gprof (profiling) and gcov (coverage testing).
5. You can play with your kernel without breaking things.
6. You can use it as a sandbox for testing new apps.
7. You can try new development kernels safely.
8. You can run different distributions simultaneously.
9. It's extremely fun.
22.. CCoommppiilliinngg tthhee kkeerrnneell aanndd mmoodduulleess
22..11.. CCoommppiilliinngg tthhee kkeerrnneell
Compiling the user mode kernel is just like compiling any other
kernel. Let's go through the steps, using 2.4.0-prerelease (current
as of this writing) as an example:
1. Download the latest UML patch from
the download page <http://user-mode-linux.sourceforge.net/dl-
sf.html>
In this example, the file is uml-patch-2.4.0-prerelease.bz2.
2. Download the matching kernel from your favourite kernel mirror,
such as:
ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2
<ftp://ftp.ca.kernel.org/pub/kernel/v2.4/linux-2.4.0-prerelease.tar.bz2>
.
3. Make a directory and unpack the kernel into it.
host%
mkdir ~/uml
host%
cd ~/uml
host%
tar -xzvf linux-2.4.0-prerelease.tar.bz2
4. Apply the patch using
host%
cd ~/uml/linux
host%
bzcat uml-patch-2.4.0-prerelease.bz2 | patch -p1
5. Run your favorite config; `make xconfig ARCH=um' is the most
convenient. `make config ARCH=um' and 'make menuconfig ARCH=um'
will work as well. The defaults will give you a useful kernel. If
you want to change something, go ahead, it probably won't hurt
anything.
Note: If the host is configured with a 2G/2G address space split
rather than the usual 3G/1G split, then the packaged UML binaries
will not run. They will immediately segfault. See ``UML on 2G/2G
hosts'' for the scoop on running UML on your system.
6. Finish with `make linux ARCH=um': the result is a file called
`linux' in the top directory of your source tree.
Make sure that you don't build this kernel in /usr/src/linux. On some
distributions, /usr/include/asm is a link into this pool. The user-
mode build changes the other end of that link, and things that include
<asm/anything.h> stop compiling.
The sources are also available from cvs at the project's cvs page,
which has directions on getting the sources. You can also browse the
CVS pool from there.
If you get the CVS sources, you will have to check them out into an
empty directory. You will th
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共2000个文件
c:9355个
h:8958个
s:969个
linux kernel 2.6.22 tar.gz linux kernel 2.6.22 tar.gz linux kernel 2.6.22 tar.gz linux kernel 2.6.22 tar.gz linux kernel 2.6.22 tar.gz linux kernel 2.6.22 tar.gz
资源推荐
资源详情
资源评论
收起资源包目录
linux kernel 2.6.22 tar.gz (2000个子文件)
nls_cp949.c 853KB
advansys.c 713KB
nls_cp936.c 681KB
nls_cp950.c 579KB
nls_cp932.c 479KB
message.c 476KB
aic7xxx_old.c 360KB
patch_realtek.c 356KB
dgrs_firmware.c 351KB
tg3.c 348KB
init301.c 338KB
ipw2200.c 323KB
e1000_hw.c 313KB
ixj.c 312KB
nm256_coef.c 301KB
aic79xx_core.c 272KB
DAC960.c 259KB
ips.c 242KB
synclink.c 232KB
qeth_main.c 229KB
s2io.c 228KB
ipw2100.c 225KB
ppc-opc.c 221KB
airo.c 219KB
ipr.c 219KB
skgepnmi.c 213KB
ncr53c8xx.c 212KB
gdth.c 201KB
mptbase.c 199KB
FlashPoint.c 196KB
xfs_bmap.c 196KB
aic7xxx_core.c 195KB
53c7xx.c 191KB
smctr.c 187KB
sis_main.c 184KB
font_sun12x22.c 181KB
sched.c 181KB
osst.c 181KB
socket.c 175KB
perfmon.c 169KB
sm_statefuns.c 169KB
libata-core.c 169KB
cifssmb.c 167KB
de4x5.c 167KB
sbpcd.c 167KB
ide-tape.c 162KB
forcedeth.c 161KB
cs46xx.c 157KB
bnx2.c 157KB
claw.c 154KB
e1000_main.c 152KB
cyclades.c 151KB
llc_c_st.c 150KB
zfcp_fsf.c 150KB
BusLogic.c 149KB
synclinkmp.c 148KB
hdsp.c 147KB
skge.c 147KB
bttv-cards.c 146KB
md.c 144KB
dc395x.c 143KB
crisv10.c 143KB
ov511.c 141KB
sym_hipd.c 141KB
font_10x18.c 141KB
tcp_input.c 139KB
ieee80211.c 138KB
cassini.c 138KB
xfs_inode.c 138KB
wavelan_cs.c 133KB
u132-hcd.c 131KB
atmel.c 130KB
qla1280.c 127KB
bttv-driver.c 127KB
hdspm.c 125KB
bond_main.c 125KB
synclink_gt.c 124KB
stallion.c 124KB
istallion.c 123KB
trident_main.c 123KB
journal.c 123KB
trident.c 122KB
init.c 122KB
wavelan.c 122KB
st.c 122KB
hooks.c 121KB
tables.c 119KB
ibmcam.c 119KB
yss225.c 118KB
ftdi-elan.c 118KB
ucc_geth.c 118KB
raid5.c 117KB
floppy.c 117KB
slab.c 116KB
bcm43xx_main.c 116KB
softfloat.c 116KB
ac97_patch.c 115KB
synclink_cs.c 115KB
xfs_vnodeops.c 115KB
megaraid.c 115KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- yb_cherry2011-11-23谢谢你的内核源码,大部分符合,少部分不一样,应该是版本不匹配吧
- ngage11302012-12-01谢谢分享,不过和楼上的差不多,情况类似。也是部分不太一样。
- 天马行空_天马行空2019-07-07好资料值得学习
tpzy123456
- 粉丝: 1
- 资源: 29
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 《CKA/CKAD应试指南/从docker到kubernetes 完全攻略》学习笔记 第1章docker基础(1.1-1.4)
- 基于python实现的水下压缩空气储能互补系统建模仿真与经济效益分析+源代码+论文
- 华中科技大学-自然语言处理实验,Bi-LSTM+CRF的中文分词框架,并且利用基于深度学习的方法进行中文命名实体识别++源码报告
- 基于动态罚函数的铁路车流分配与径路优化模型python源码
- 鱼群算法求解组环问题python源码+文档说明
- 基于决策优化的多波束测深测线规划模型MATLAB代码
- 课程设计-基于python实现的多目标优化算法求解带时间窗的车辆路径规划问题+源代码+文档说明+界面截图+pptx
- 基于通信信号与通信系统的MATLAB仿真源码-课程设计
- 嵌入式-信号机制(概念,发送,定时,捕捉,SIGCHLD 信号实现回收子进程)
- c语言管理系统大一大二笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功