Department of Computer Science and Technology, Nanjing University, Programming assignments of Introduction to Computer System, 2024

Pre-Laboratory Reading

Latest News (please check at least once a day)


  • 2024/01/25
  • This handout is currently in the testing phase and will be considered as past handout material before the start of the Fall 2024 semester. If you are a student enrolled in the Fall 2024 ICS course, please do not use this handout as a substitute for the Fall 2024 ICS course PA lab handout. Submitting this experiment content will be considered as not submitted.

Read the handout offline

Handout pages of this lab are published through GitHub Pages, but the network may be unstable. You can clone this repositoryopen in new window to your local machine, and read the handouts offline through your browser.

However, as the handout content is updated, you will not be able to automatically access the latest version. You need to manually execute bash update.sh in the repository path to synchronize the latest version of the content to your local machine. Again, if you choose the offline reading method, then it is your responsibility to obtain the latest handout content.

How to Seek Help

Some quotes

::::> * We are all living beings, taught from a young age to get the most out of the least effort, often forgetting what we truly want.

I admit I am a perfectionist, but I believe everyone has a thirst for knowledge and a longing for truth in their hearts. The soul of "university" lies in transcending the mundane and timeless innocence and ideals. -- We are not here to please corporate graduates, but to seek the power to change the world. -- jyy

  • Education, beyond the memorization of knowledge, is essentially the training of abilities, the so-called training. And any training must overcome certain difficulties; otherwise, you are merely doing repetitive work, and your abilities will not improve. If you choose to retreat when encountering difficulties or let others overcome the difficulties you should overcome yourself, you are essentially giving up the opportunity for training, which is actually the most valuable part of professional education in university. -- etone
  • The idea that "as long as it doesn't affect my current survival, it's not a problem" is actually very selfish and short-sighted: Your lack of skills in your profession will eventually catch up to you and affect the long-term development of your career. More seriously, students who approach their profession with a passable attitude, their survival is at the expense of the reputation of Nanjing University's education -- if a significant proportion of our graduates are like this, it won't be long before not only those who muddle through to graduation find it hard to survive, but also those who truly work hard will see their prospects affected. -- etone

Syllabus

The fundamental way to understand the idea that "how programs run on a computer" is to build a complete computer system from scratch. The small projects (Programming Assignment, PA) of the "Fundamentals of Computer Systems" course at the Department of Computer Science and Technology, Nanjing University, will present a corresponding teaching subset of the x86/mips32/riscv32(64) architecture. Students will be guided to implement a simplified yet functionally complete x86/mips32/riscv32(64) emulator, NEMU (NJU EMUlator). Ultimately, students will run the game "仙剑奇侠传" on NEMU to explore the basic principles of "how programs run on a computer." NEMU is inspired by QEMUopen in new window and removes many parts that differ significantly from the course content. The PA includes a preparatory lab (setting up the lab environment) and five coherent parts:

  • Turing Machine and Simple Debugger
  • Von Neumann Computer System
  • Batch Processing System
  • Time-sharing Multitasking
  • Program Performance Optimization

Environment of the Programming Assignment

  • CPU Architecture: x64
  • Operating System: GNU/Linux
  • Compiler: GCC
  • Programming language: C Programming Language

How to Get Help

During your study and experiments, you will encounter numerous problems. In addition to referring to the textbook, you need to know how to access other reference materials.

However, before doing so, you need to adapt to searching for English materials. Unlike the problems encountered in previous programming courses, you will find it difficult to find relevant Chinese materials. Reviewing the hierarchy of computer science abstractions, the introduction to computer system is at a lower level than programming language course. This means that there are fewer people who understand system fundamentals compared to those who understand programming, and accordingly, there are fewer Chinese materials on system fundamentals.

How do you adapt to searching for English materials? The method is to try and persist in searching for English materials.

Search Engines, Encyclopedias and Q&A Websites

To find English materials, you should use the websites recommended in the table below:

Search EngineEncyclopediaQ&A Website
RecommendedHereopen in new window for a mirror of Google searchhttp://en.wikipedia.orghttp://stackoverflow.com
Not Recommendedhttp://www.baidu.comhttp://baike.baidu.comhttp://zhidao.baidu.com
http://bbs.csdn.net

Some explanations:

Official Manuals

The official manuals contain all the information about the objects you are searching for, and all questions about the objects can be found in the official manuals. Usually, the content of official manuals is very detailed, and it is unlikely that you can read through it all in a short time. Therefore, you need to know "how to use the table of contents to locate the issues you care about." If you are looking for some examples for quick reference, you should use a search engine.

Here are some manuals that may be used in this course:

GNU/Linux introductory tutorial

jyy has prepared some introductory tutorials on GNU/Linux for us. If you are using GNU/Linux for the first time, please read the following materials:

License Agreement

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Mainland China License. To view this license agreement, you can visit hereopen in new window, or write to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.