想學習 Linux,裝個虛擬機,裝哪個發行版好?


建議學習《鳥哥的私房菜》,然後安裝一個發行版,如centos,redhat(rpm系列);也可以使用debian系列(如ubuntu,特點就是簡單,但是和redhat不太一樣,redhat系列的使用的特別多,不過現在ubuntu使用的人也很多,一般問題都可以找到相應答案的),就我個人看的話,這兩個系列入門都已經足夠了,但如果你想提高可以使用gentoo,archlinux,freebsd,這些都是使用滾動更新的方式,就是沒有版本的概念,你可以用一條命令將系統更新到最新的時間戳,他們的包管理機制都是使用ports,很好使用的,如果你想提升至更高檔次,就可以學習LFS,Linux from scratch,就是從一個內核源碼打造一個你自己的Linux發行版,這個可以讓你學習深入一些,如果你想更深入下去,你可以學習Linux下Shell腳本編程,perl腳本編程,Linux下C語言編程,最終你可以看下Linux v0.01源碼,這個只有10000行源碼,少量的彙編源碼,都是關於x86架構的。

一下是Linus寫的linux v0.01 release notes-linus:

1

2

3

4 Notes for linux release 0.01

5

6

7 0. Contents of this directory

8

9 linux-0.01.tar.Z - sources to the kernel

10 bash.Z - compressed bash binary if you want to test it

11 update.Z - compressed update binary

12 RELNOTES-0.01 - this file

13

14

15 1. Short intro

16

17

18 This is a free minix-like kernel for i386(+) based AT-machines. Full

19 source is included, and this source has been used to produce a running

20 kernel on two different machines. Currently there are no kernel

21 binaries for public viewing, as they have to be recompiled for different

22 machines. You need to compile it with gcc (I use 1.40, don"t know if

23 1.37.1 will handle all __asm__-directives), after having changed the

24 relevant configuration file(s).

25

26 As the version number (0.01) suggests this is not a mature product.

27 Currently only a subset of AT-hardware is supported (hard-disk, screen,

28 keyboard and serial lines), and some of the system calls are not yet

29 fully implemented (notably mount/umount aren"t even implemented). See

30 comments or readme"s in the code.

31

32 This version is also meant mostly for reading - ie if you are interested

33 in how the system looks like currently. It will compile and produce a

34 working kernel, and though I will help in any way I can to get it

35 working on your machine (mail me), it isn"t really supported. Changes

36 are frequent, and the first "production" version will probably differ

37 wildly from this pre-alpha-release.

38

39 Hardware needed for running linux:

40 - 386 AT

41 - VGA/EGA screen

42 - AT-type harddisk controller (IDE is fine)

43 - Finnish keyboard (oh, you can use a US keyboard, but not

44 without some practise :-)

45

46 The Finnish keyboard is hard-wired, and as I don"t have a US one I

47 cannot change it without major problems. See kernel/keyboard.s for

48 details. If anybody is willing to make an even partial port, I"d be

49 grateful. Shouldn"t be too hard, as it"s tabledriven (it"s assembler

50 though, so ...)

51

52 Although linux is a complete kernel, and uses no code from minix or

53 other sources, almost none of the support routines have yet been coded.

54 Thus you currently need minix to bootstrap the system. It might be

55 possible to use the free minix demo-disk to make a filesystem and run

56 linux without having minix, but I don"t know...

57

58

59 2. Copyrights etc

60

61

62 This kernel is (C) 1991 Linus Torvalds, but all or part of it may be

63 redistributed provided you do the following:

64

65 - Full source must be available (and free), if not with the

66 distribution then at least on asking for it.

67

68 - Copyright notices must be intact. (In fact, if you distribute

69 only parts of it you may have to add copyrights, as there aren"t

70 (C)"s in all files.) Small partial excerpts may be copied

71 without bothering with copyrights.

72

73 - You may not distibute this for a fee, not even "handling"

74 costs.

75

76 Mail me at "torvalds@kruuna.helsinki.fi" if you have any questions.

77

78 Sadly, a kernel by itself gets you nowhere. To get a working system you

79 need a shell, compilers, a library etc. These are separate parts and may

80 be under a stricter (or even looser) copyright. Most of the tools used

81 with linux are GNU software and are under the GNU copyleft. These tools

82 aren"t in the distribution - ask me (or GNU) for more info.

83

84

85 3. Short technical overview of the kernel.

86

87

88 The linux kernel has been made under minix, and it was my original idea

89 to make it binary compatible with minix. That was dropped, as the

90 differences got bigger, but the system still resembles minix a great

91 deal. Some of the key points are:

92

93 - Efficient use of the possibilities offered by the 386 chip.

94 Minix was written on a 8088, and later ported to other

95 machines - linux takes full advantage of the 386 (which is

96 nice if you /have/ a 386, but makes porting very difficult)

97

98 - No message passing, this is a more traditional approach to

99 unix. System calls are just that - calls. This might or might

100 not be faster, but it does mean we can dispense with some of

101 the problems with messages (message queues etc). Of course, we

102 also miss the nice features :-p.

103

104 - Multithreaded FS - a direct consequence of not using messages.

105 This makes the filesystem a bit (a lot) more complicated, but

106 much nicer. Coupled with a better scheduler, this means that

107 you can actually run several processes concurrently without

108 the performance hit induced by minix.

109

110 - Minimal task switching. This too is a consequence of not using

111 messages. We task switch only when we really want to switch

112 tasks - unlike minix which task-switches whatever you do. This

113 means we can more easily implement 387 support (indeed this is

114 already mostly implemented)

115

116 - Interrupts aren"t hidden. Some people (among them Tanenbaum)

117 think interrupts are ugly and should be hidden. Not so IMHO.

118 Due to practical reasons interrupts must be mainly handled by

119 machine code, which is a pity, but they are a part of the code

120 like everything else. Especially device drivers are mostly

121 interrupt routines - see kernel/hd.c etc.

122

123 - There is no distinction between kernel/fs/mm, and they are all

124 linked into the same heap of code. This has it"s good sides as

125 well as bad. The code isn"t as modular as the minix code, but

126 on the other hand some things are simpler. The different parts

127 of the kernel are under different sub-directories in the

128 source tree, but when running everything happens in the same

129 data/code space.

130

131 The guiding line when implementing linux was: get it working fast. I

132 wanted the kernel simple, yet powerful enough to run most unix software.

133 The file system I couldn"t do much about - it needed to be minix

134 compatible for practical reasons, and the minix filesystem was simple

135 enough as it was. The kernel and mm could be simplified, though:

136

137 - Just one data structure for tasks. "Real" unices have task

138 information in several places, I wanted everything in one

139 place.

140

141 - A very simple memory management algorithm, using both the

142 paging and segmentation capabilities of the i386. Currently

143 MM is just two files - memory.c and page.s, just a couple of

144 hundreds of lines of code.

145

146 These decisions seem to have worked out well - bugs were easy to spot,

147 and things work.

148

149

150 4. The "kernel proper"

151

152

153 All the routines handling tasks are in the subdirectory "kernel". These

154 include things like "fork" and "exit" as well as scheduling and minor

155 system calls like "getpid" etc. Here are also the handlers for most

156 exceptions and traps (not page faults, they are in mm), and all

157 low-level device drivers (get_hd_block, tty_write etc). Currently all

158 faults lead to a exit with error code 11 (Segmentation fault), and the

159 system seems to be relatively stable ("crashme" hasn"t - yet).

160

161

162 5. Memory management

163

164

165 This is the simplest of all parts, and should need only little changes.

166 It contains entry-points for some things that the rest of the kernel

167 needs, but mostly copes on it"s own, handling page faults as they

168 happen. Indeed, the rest of the kernel usually doesn"t actively allocate

169 pages, and just writes into user space, letting mm handle any possible

170 "page-not-present" errors.

171

172 Memory is dealt with in two completely different ways - by paging and

173 segmentation. First the 386 VM-space (4GB) is divided into a number of

174 segments (currently 64 segments of 64Mb each), the first of which is the

175 kernel memory segment, with the complete physical memory identity-mapped

176 into it. All kernel functions live within this area.

177

178 Tasks are then given one segment each, to use as they wish. The paging

179 mechanism sees to filling the segment with the appropriate pages,

180 keeping track of any duplicate copies (created at a "fork"), and making

181 copies on any write. The rest of the system doesn"t need to know about

182 all this.

183

184

185 6. The file system

186

187

188 As already mentioned, the linux FS is the same as in minix. This makes

189 crosscompiling from minix easy, and means you can mount a linux

190 partition from minix (or the other way around as soon as I implement

191 mount :-). This is only on the logical level though - the actual

192 routines are very different.

193

194 NOTE! Minix-1.6.16 seems to have a new FS, with minor

195 modifications to the 1.5.10 I"ve been using. Linux

196 won"t understand the new system.

197

198 The main difference is in the fact that minix has a single-threaded

199 file-system and linux hasn"t. Implementing a single-threaded FS is much

200 easier as you don"t need to worry about other processes allocating

201 buffer blocks etc while you do something else. It also means that you

202 lose some of the multiprocessing so important to unix.

203

204 There are a number of problems (deadlocks/raceconditions) that the linux

205 kernel needed to address due to multi-threading. One way to inhibit

206 race-conditions is to lock everything you need, but as this can lead to

207 unnecessary blocking I decided never to lock any data structures (unless

208 actually reading or writing to a physical device). This has the nice

209 property that dead-locks cannot happen.

210

211 Sadly it has the not so nice property that race-conditions can happen

212 almost everywhere. These are handled by double-checking allocations etc

213 (see fs/buffer.c and fs/inode.c). Not letting the kernel schedule a

214 task while it is in supervisor mode (standard unix practise), means that

215 all kernel/fs/mm actions are atomic (not counting interrupts, and we are

216 careful when writing those) if you don"t call "sleep", so that is one of

217 the things we can count on.

218

219

220 7. Apologies :-)

221

222

223 This isn"t yet the "mother of all operating systems", and anyone who

224 hoped for that will have to wait for the first real release (1.0), and

225 even then you might not want to change from minix. This is a source

226 release for those that are interested in seeing what linux looks like,

227 and it"s not really supported yet. Anyone with questions or suggestions

228 (even bug-reports if you decide to get it working on your system) is

229 encouraged to mail me.

230

231

232 8. Getting it working

233

234

235 Most hardware dependancies will have to be compiled into the system, and

236 there a number of defines in the file "include/linux/config.h" that you

237 have to change to get a personalized kernel. Also you must uncomment

238 the right "equ" in the file boot/boot.s, telling the bootup-routine what

239 kind of device your A-floppy is. After that a simple "make" should make

240 the file "Image", which you can copy to a floppy (cp Image /dev/PS0 is

241 what I use with a 1.44Mb floppy). That"s it.

242

243 Without any programs to run, though, the kernel cannot do anything. You

244 should find binaries for "update" and "bash" at the same place you found

245 this, which will have to be put into the "/bin" directory on the

246 specified root-device (specified in config.h). Bash must be found under

247 the name "/bin/sh", as that"s what the kernel currently executes. Happy

248 hacking.

249

250

251 Linus Torvalds "torvalds@kruuna.helsinki.fi"

252 Petersgatan 2 A 2

253 00140 Helsingfors 14

254 FINLAND

linux-0.01.tar.gz--&> linux-0.01.tar.gz (71.38 KB)

###linux-0.01.tar.gz.sgin###

-----BEGIN PGP SIGNATURE-----

Version: GnuPG v1.0.0 (GNU/Linux)

Comment: See http://www.kernel.org/signature.html for info

iD8DBQA54rf0yGugalF9Dw4RAqelAJ9lafFni4f/QyJ2IqDXzW2nz/ZIogCfRPtg

uYpWffOhkyByfhUt8Lcelec=

=KnLA

-----END PGP SIGNATURE-----


如果你有耐心的話,可以試試archlinux


既然lz說是學習linux,那麼就裝傻瓜式的ubuntu吧


看看手中的教程是用什麼發行版的就用什麼。

第一次用 Linux 參照教程來。

等熟悉了以後,選擇什麼樣的發行版就不是問題了。


對於初學者而言,CentOS+《鳥哥的私房菜》應該是最好的組合吧。


就自己折騰的經驗來說還是Linux Mint比較靠譜。依靠發行版Ubuntu開發,可以定期更新。


virtualbox加centos(伺服器方向),個人用就去搞ubuntu吧


做網頁,搞伺服器什麼的用CentOS吧,比較常用,

至於桌面用途的話,ubuntu比較簡單,基於ubuntu的國產linux deepin也不錯


先用個圖形界面的發行版過渡下,然後轉CentOS這類純命令行的吧


推薦閱讀:

TAG:操作系統 | Linux | 系統 | 虛擬機 | Linux軟體 |