# Lab2: User Programs

{% hint style="warning" %} <mark style="color:red;">**Code Due: Thursday 04/23 11:59 pm**</mark>

<mark style="color:red;">**Design Doc Due: Sunday 04/26 11:59 pm**</mark>
{% endhint %}

Now that you've worked with Pintos and are becoming familiar with its infrastructure and thread package, **it's time to start working on the parts of the system that allow running user programs.**

* **The base code already supports loading and running user programs, but no I/O or interactivity is possible.** In this project, you will enable programs to interact with the OS via system calls.
* You will be working out of the `userprog/` directory for this assignment, but you will also be interacting with almost every other part of Pintos. We will describe the relevant parts below.

**You can build project 2 on top of your project 1 submission** (dogfooding your own kernel changes like a product). Or **you can start fresh**.

<mark style="color:red;">**No code from project 1 is required for this assignment.**</mark> The "alarm clock" functionality may be useful in projects 3 and 4, but it is not strictly required.

You might find it useful to go back and reread how to run the tests (see section [Testing](https://echostone.gitbook.io/pintos/getting-started/debug-and-test/testing)).

**Here are the sections in this chapter:**

{% content-ref url="lab2-user-programs/background" %}
[background](https://echostone.gitbook.io/pintos/project-description/lab2-user-programs/background)
{% endcontent-ref %}

{% content-ref url="lab2-user-programs/suggestions" %}
[suggestions](https://echostone.gitbook.io/pintos/project-description/lab2-user-programs/suggestions)
{% endcontent-ref %}

{% content-ref url="lab2-user-programs/your-tasks" %}
[your-tasks](https://echostone.gitbook.io/pintos/project-description/lab2-user-programs/your-tasks)
{% endcontent-ref %}

{% content-ref url="lab2-user-programs/faq" %}
[faq](https://echostone.gitbook.io/pintos/project-description/lab2-user-programs/faq)
{% endcontent-ref %}

{% content-ref url="lab2-user-programs/submission" %}
[submission](https://echostone.gitbook.io/pintos/project-description/lab2-user-programs/submission)
{% endcontent-ref %}


---

# 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://echostone.gitbook.io/pintos/project-description/lab2-user-programs.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.
