# LAB4：进程管理

在lab2和lab3中，我们已经将物理内存纳入了掌控，并且实现了虚拟内存的机制，使得我们可以建立一些真正操作系统级别的抽象。在本章和下一章当中，我们要实现操作系统当中非常重要的一个部分：进程管理。我们主要分成了两个部分来实现，在本章中我们会实现内核进程的管理，在下一章再实现用户进程的管理。

内核进程和用户进程有什么区别呢？首先，内核进程运行于内核态，而用户进程一般处于用户态，只有在需要系统调用时才会进入内核态。其次，内核进程不需要很复杂的内存管理，共用整个内核内存空间。这是因为内核进程往往用来完成很多和操作系统有关的任务，操作系统应当信任内核进程；而用户进程由用户提供，为了避免恶意的用户影响操作系统以及其他进程的运行状态，需要对于地址空间进行隔离。

本次实验主要介绍ucore如何实现内核进程。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nankai.gitbook.io/ucore-os-on-risc-v64/lab4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
