MushOS
0.1
A UNIX-like OS prototype, written from scratch
Loading...
Searching...
No Matches
task.h
1
#ifndef MUSHOS_TASK_H
2
#define MUSHOS_TASK_H
3
4
#include "../../lib/base/generic.h"
5
6
#include "pages.h"
7
8
9
// This structure defines a 'task' - a process.
10
typedef
struct
task_struct
{
11
int
id;
// Process ID.
12
u_dword esp, ebp;
// Stack and base pointers.
13
u_dword eip;
// Instruction pointer.
14
page_folder
*page_directory;
// Page directory.
15
struct
task_struct
*next;
// The next task in a linked list.
16
}
task
;
17
18
// Initialises the tasking system.
19
void
initialise_tasking();
20
21
// Called by the timer hook, this changes the running process.
22
void
switch_task();
23
24
// Forks the current process, spawning a new one with a different
25
// memory space.
26
u_dword fork();
27
28
// Returns the pid of the current process.
29
int
getpid();
30
31
#endif
//MUSHOS_TASK_H
page_folder
Definition:
pages.h:30
task_struct
Definition:
task.h:10
core
kernel
task.h
Generated on Sun Jan 29 2023 13:48:02 for MushOS by
1.9.5