From 805965979ac6cdd1ad117df0ccd3b98829af488e Mon Sep 17 00:00:00 2001 From: mo khan Date: Sat, 20 Mar 2021 14:04:16 -0600 Subject: add notes on chapter 3 --- doc/3.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/party.c | 1 + 2 files changed, 58 insertions(+) create mode 100644 doc/3.md diff --git a/doc/3.md b/doc/3.md new file mode 100644 index 0000000..2f1a471 --- /dev/null +++ b/doc/3.md @@ -0,0 +1,57 @@ +# Chapter 3 - Processes + +The process is the unit of work in a modern time-sharing system. +A system consists of a collection of processes: operating system processes +executing system code and user processes executing user code. + +Potentially, all these processes can execute concurrently, with the CPU +multiplexed among them. By switching the CPU between processes, the +operating system can make the computer more productive. + +A batch system executes `jobs`. +A time-shared system has `user programs` or `tasks`. + +All these activities are similar so we call them `processes`. + +## The Process + +A process is more than the program code, also known as the `text section`. +It also includes the current activity, represented by a value of the `program counter` +and the contents of the processor's registers. + +A process also includes the process `stack`, which contains temporary data (such +as function params, return addresses, and local variables) and a `data section` which +contains global variables. + +A process may also include a `heap`, which is memory that is dynamically allocated +during process run time. + +```plaintext + max |-------| + | Stack | + |-------| + | | | + | | | + | V | + | | + | | + | A | + | | | + | | | + |-------| + | heap | + |-------| + | data | + |-------| + | text | + 0 |-------| +``` + +A program is not a process. A program is a file containing instructions stored on +disk like an `executable file`. + +A process is an active entityt with a program counter specifying the next instruction +to execute and a set of associated resources. + +A program becomes a process when an executable file is loaded into memory. +Two processes may be associated diff --git a/src/party.c b/src/party.c index 92d7d30..65a0282 100644 --- a/src/party.c +++ b/src/party.c @@ -4,6 +4,7 @@ int party_init(void) { + // Use dmesg to view the log printk(KERN_INFO, "Start the Party!!!\n"); return 0; } -- cgit v1.2.3