PA0 is a guide to GNU/Linux development environment configuration. You are guided to install a GNU/Linux development environment. All PAs and Labs are done in this environment. If you are new to GNU/Linux, and you encounter some troubles during the configuration, which are not mentioned in this lecture note (such as "No such file or directory"), that is your fault. Go back to read this lecture note carefully. Remember, the machine is always right!

信息框说明

讲义中会出现一些信息框, 根据其颜色和左上角的图标可以得知信息的类别. 例如本信息框就是一些提示相关的内容. 其它类别主要还有

实验进度相关的提示
扩展阅读
选做思考题
选做编程题
实验必做内容
实验进度相关的必读信息
重要性超越实验的原则与方法
对, 你没有看错, 除了一些重要的信息之外, PA0的实验讲义都是英文!

随着科学技术的发展, 在国际学术交流中使用英语已经成为常态: 顶尖的论文无一不使用英文来书写, 在国际上公认的计算机领域经典书籍也是使用英文编著. 顶尖的论文没有中文翻译版; 如果需要获取信息, 也应该主动去阅读英文材料, 而不是等翻译版出版. "我是中国人, 我只看中文"这类观点已经不符合时代发展的潮流, 要站在时代的最前沿, 阅读英文材料的能力是不可或缺的.

阅读英文材料, 无非就是"不会的单词查字典, 不懂的句子反复读". 如今网上有各种词霸可解燃眉之急, 但英文阅读能力的提高贵在坚持. "刚开始觉得阅读英文效率低", 是所有中国人都无法避免的经历. 如果你发现身边的大神可以很轻松地阅读英文材料, 那是因为他们早就克服了这些困难. 引用陈道蓄老师的话: 坚持一年, 你就会发现有不同; 坚持两年, 你就会发现大有不同.

撇开这些高大上的话题不说, 阅读英文材料和你有什么关系呢? 有! 因为在PA中陪伴你的, 就是没有中文版的各种手册(例如i386手册), 当然还有man: 如果你不愿意阅读英文材料, 你是注定无法独立完成PA的.

作为过渡, 我们为大家准备了全英文的PA0. PA0的目的是配置实验环境, 同时熟悉GNU/Linux下的工作方式. 其中涉及的都是一些操作性的步骤, 你不必为了完成PA0而思考深奥的问题.

你需要独立完成PA0, 请你认真阅读讲义中的每一个字符, 并按照讲义中的内容进行操作: 当讲义提到要在互联网上搜索某个内容时, 你就去互联网上搜索这个内容. 如果遇到了错误, 请认真反复阅读讲义内容, 机器永远是对的. 如果你是第一次使用GNU/Linux, 你还需要查阅大量资料或教程来学习一些新工具的使用方法, 这需要花费大量的时间(例如你可能需要花费一个下午的时间, 仅仅是为了使用vim在文件中键入两行内容). 这就像阅读英文材料一样, 一开始你会觉得效率很低, 但随着时间的推移, 你对这些工具的使用会越来越熟练. 相反, 如果你通过"投机取巧"的方式来完成PA0, 你将会马上在PA1中遇到麻烦. 正如etone所说, 你在专业上的技不如人, 迟早有一天会找上来.

另外, PA0的讲义只负责给出操作过程, 并不负责解释这些操作相关的细节和原理. 如果你希望了解它们, 请在互联网上搜索相关内容.

We are going to install the Debian 10 distribution directly over your physical machine. If you already have one copy of GNU/Linux distribution, and you want to use your copy as the development environment, just use it! But if you encounter some troubles because of platform disparity, please search the Internet for trouble-shooting.

It is also OK to use virtual machines, such as VMWare or VirtualBox. If you decide to do this and you do not have a copy of GNU/Linux, please install Debian distribution in the virtual machine. Also, please search the Internet for trouble-shooting if you have any problems about virtual machines.

必须使用64位的GNU/Linux

如果你打算使用已有的GNU/Linux平台, 请确保它是64位版本. PA的某些特性会依赖于64位平台.

使用GNU/Linux真机的一些原因
  • 下学期的操作系统实验需要使用真机, 反正早晚都要都折腾, 还不如现在一次搞定.
  • 真机的稳定性会比虚拟机相对高一些(比如crash consistency之类的).
  • 真机的性能会比虚拟机相对高一些(不过不影响实验分数).

如果你坚持使用虚拟机, 貌似到时候会由于某些原因间接影响操作系统实验的分数.

如果你不必修读南京大学的拔尖班操作系统课程, 可以自由选择是否使用虚拟机.

Mac用户的不幸

与ICS同时开设的数字电路实验课程需要安装Vivado/Quartus工具来进行实验, 然而非常不幸的是, 这两款工具皆不提供Mac版本. 为了使用它们, 你必须安装Windows或者GNU/Linux操作系统. 那么, 还不如一石二鸟, 现在装个GNU/Linux真机, 就可以解决上述所有问题了.

如果你不必修读南京大学的课程, 可以忽略这个问题.

Getting Debian

You will get the newest stable version of Debian here. Click the link label with amd64 in the full CD sets category. Then scroll to the bottom of the page, click debian-10.?.?-amd64-xfce-CD-1.iso to download the image. The size of the image is about 650MB.

Preparation

If you are going to install Debian directly on the physical machine, we recommend you to install via USB Stick. Please do the following:

  • Reserve at least one partitions (20GB ~ 50GB) on the disk for Debian to install. For how to do this, please search the Internet. For example, if you use Windows, you can search for 压缩卷 Windows.
  • Burn the image into USB Stick. For how to do this, please search the Internet, too.

If you are going to install Debian in the virtual machine, please also search the Internet for details.

Installing Debian

Here we give a quick guide to installing Debian. If you have any question, please refer to the official installation guide.

  1. Graphics Install

  2. Select a language. Choose English.

    不要选择Chinese

    使用中文的系统环境会给一些命令行操作带来不便, 甚至会增加错误排查的难度.

  3. Select your location. Choose Other -> Asia -> China.

  4. Configure locales. Just leave the default setting (United States - en_US.UTF-8).

  5. Configure the keyboard. Just leave the default setting (American English).

  6. Configure the network. You can continue without network configuration.

    • Hostname: Just leave the default setting (debian).
    • Domain name: Just leave the default setting ().
  7. Set up users and passwords.

    • Root password: The root account is very important. If you forget the root password, you can not fully control the operating system.
    • Full name for the new user: Anything will be fine.
    • Username for your account: Anything will be fine, too. But pay attention to the restriction.
    • Choose a password for the new user: This password is different from the root's one, because they belong to different accounts.
  8. Configure the clock. Just wait.

  9. Partition disks. This step will perform disk partitioning.

    • Partitioning method: If you are installing Debian directly on the physical machine, choose Manual instead to select the new partition you prepared in the previous steps. Otherwise the existing data will be lost! If you are going to use virtual machine, then choose Guided - seperate /home partition. For more details, click help or search the Internet. After finishing configuration, select Finish partitioning and write changes to disk and click Continue.
    • Write the changes to disks?: Select Yes.
      请安装真机的同学再三检查分区配置

      一旦点击Yes, 操作将不可逆转.

  10. Install the base system. Just wait.

  11. Configure the package manager

    • Use a network mirror?: Select No.
  12. Select and install software. Just wait.

    • Configuring popularity-contest: Just select your favor.
    • Software selection: Just leave the default setting.
  13. Install the GRUB boot loader on a hard disk

    • Install the GRUB boot loader to the master boot record?: Choose Yes.
    • Device for boot loader installation: Select /dev/sda.
  14. Finish the installation. Click Continue.

results matching ""

    No results matching ""